import{s as rl,n as ul,o as gl}from"../chunks/scheduler.53228c21.js";import{S as Tl,i as wl,e as i,s,c,h as hl,a as p,d as t,b as n,f as yl,g as o,j as m,k as u,l as Ul,m as a,n as M,t as d,o as J,p as y}from"../chunks/index.100fac89.js";import{C as bl}from"../chunks/CopyLLMTxtMenu.9360b11d.js";import{C as G}from"../chunks/CodeBlock.d30a6509.js";import{H as te,E as jl}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.c9001d7a.js";function Gl($e){let r,ne,ae,ie,Z,pe,f,me,W,Le="OmniGen is an image generation model. Unlike existing text-to-image models, OmniGen is a single model designed to handle a variety of tasks (e.g., text-to-image, image editing, controllable generation). It has the following features:",ce,I,qe="<li>Minimalist model architecture, consisting of only a VAE and a transformer module, for joint modeling of text and images.</li> <li>Support for multimodal inputs. It can process any text-image mixed data as instructions for image generation, rather than relying solely on text.</li>",oe,B,Ae=`For more information, please refer to the <a href="https://huggingface.co/papers/2409.11340" rel="nofollow">paper</a>.
This guide will walk you through using OmniGen for various tasks and use cases.`,Me,V,de,X,Oe='Model weights may be stored in separate subfolders on the Hub or locally, in which case, you should use the <a href="/docs/diffusers/main/en/api/pipelines/overview#diffusers.DiffusionPipeline.from_pretrained">from_pretrained()</a> method.',Je,R,ye,_,re,v,De=`For text-to-image, pass a text prompt. By default, OmniGen generates a 1024x1024 image.
You can try setting the <code>height</code> and <code>width</code> parameters to generate images with different size.`,ue,C,ge,g,Pe='<img src="https://raw.githubusercontent.com/VectorSpaceLab/OmniGen/main/imgs/docs_img/t2i_woman_with_book.png" alt="generated image"/>',Te,Y,we,k,Ke=`OmniGen supports multimodal inputs.
When the input includes an image, you need to add a placeholder <code>&lt;img&gt;&lt;|image_1|&gt;&lt;/img&gt;</code> in the text prompt to represent the image.
It is recommended to enable <code>use_input_image_size_as_output</code> to keep the edited image the same size as the original image.`,he,N,Ue,T,el='<div class="flex-1"><img class="rounded-xl" src="https://raw.githubusercontent.com/VectorSpaceLab/OmniGen/main/imgs/docs_img/t2i_woman_with_book.png"/> <figcaption class="mt-2 text-center text-sm text-gray-500">original image</figcaption></div> <div class="flex-1"><img class="rounded-xl" src="https://raw.githubusercontent.com/VectorSpaceLab/OmniGen/main/imgs/docs_img/edit.png"/> <figcaption class="mt-2 text-center text-sm text-gray-500">edited image</figcaption></div>',be,x,ll="OmniGen has some interesting features, such as visual reasoning, as shown in the example below.",je,z,Ge,w,tl='<img src="https://raw.githubusercontent.com/VectorSpaceLab/OmniGen/main/imgs/docs_img/reasoning.png" alt="generated image"/>',Ze,S,fe,H,al="OmniGen can handle several classic computer vision tasks. As shown below, OmniGen can detect human skeletons in input images, which can be used as control conditions to generate new images.",We,E,Ie,h,sl='<div class="flex-1"><img class="rounded-xl" src="https://raw.githubusercontent.com/VectorSpaceLab/OmniGen/main/imgs/docs_img/edit.png"/> <figcaption class="mt-2 text-center text-sm text-gray-500">original image</figcaption></div> <div class="flex-1"><img class="rounded-xl" src="https://raw.githubusercontent.com/VectorSpaceLab/OmniGen/main/imgs/docs_img/skeletal.png"/> <figcaption class="mt-2 text-center text-sm text-gray-500">detected skeleton</figcaption></div> <div class="flex-1"><img class="rounded-xl" src="https://raw.githubusercontent.com/VectorSpaceLab/OmniGen/main/imgs/docs_img/skeletal2img.png"/> <figcaption class="mt-2 text-center text-sm text-gray-500">skeleton to image</figcaption></div>',Be,Q,nl="OmniGen can also directly use relevant information from input images to generate new images.",Ve,F,Xe,U,il='<div class="flex-1"><img class="rounded-xl" src="https://raw.githubusercontent.com/VectorSpaceLab/OmniGen/main/imgs/docs_img/same_pose.png"/> <figcaption class="mt-2 text-center text-sm text-gray-500">generated image</figcaption></div>',Re,$,_e,L,pl=`OmniGen can generate multiple images based on the people and objects in the input image and supports inputting multiple images simultaneously.
Additionally, OmniGen can extract desired objects from an image containing multiple objects based on instructions.`,ve,q,Ce,b,ml='<div class="flex-1"><img class="rounded-xl" src="https://raw.githubusercontent.com/VectorSpaceLab/OmniGen/main/imgs/docs_img/3.png"/> <figcaption class="mt-2 text-center text-sm text-gray-500">input_image_1</figcaption></div> <div class="flex-1"><img class="rounded-xl" src="https://raw.githubusercontent.com/VectorSpaceLab/OmniGen/main/imgs/docs_img/4.png"/> <figcaption class="mt-2 text-center text-sm text-gray-500">input_image_2</figcaption></div> <div class="flex-1"><img class="rounded-xl" src="https://raw.githubusercontent.com/VectorSpaceLab/OmniGen/main/imgs/docs_img/id2.png"/> <figcaption class="mt-2 text-center text-sm text-gray-500">generated image</figcaption></div>',Ye,A,ke,j,cl='<div class="flex-1"><img class="rounded-xl" src="https://raw.githubusercontent.com/VectorSpaceLab/OmniGen/main/imgs/docs_img/emma.jpeg"/> <figcaption class="mt-2 text-center text-sm text-gray-500">person image</figcaption></div> <div class="flex-1"><img class="rounded-xl" src="https://raw.githubusercontent.com/VectorSpaceLab/OmniGen/main/imgs/docs_img/dress.jpg"/> <figcaption class="mt-2 text-center text-sm text-gray-500">clothe image</figcaption></div> <div class="flex-1"><img class="rounded-xl" src="https://raw.githubusercontent.com/VectorSpaceLab/OmniGen/main/imgs/docs_img/tryon.png"/> <figcaption class="mt-2 text-center text-sm text-gray-500">generated image</figcaption></div>',Ne,O,xe,D,ol=`For text-to-image task, OmniGen requires minimal memory and time costs (9GB memory and 31s for a 1024x1024 image on A800 GPU).
However, when using input images, the computational cost increases.`,ze,P,Ml="Here are some guidelines to help you reduce computational costs when using multiple images. The experiments are conducted on an A800 GPU with two input images.",Se,K,dl=`Like other pipelines, you can reduce memory usage by offloading the model: <code>pipe.enable_model_cpu_offload()</code> or <code>pipe.enable_sequential_cpu_offload() </code>.
In OmniGen, you can also decrease computational overhead by reducing the <code>max_input_image_size</code>.
The memory consumption for different image sizes is shown in the table below:`,He,ee,Jl="<thead><tr><th>Method</th> <th>Memory Usage</th></tr></thead> <tbody><tr><td>max_input_image_size=1024</td> <td>40GB</td></tr> <tr><td>max_input_image_size=512</td> <td>17GB</td></tr> <tr><td>max_input_image_size=256</td> <td>14GB</td></tr></tbody>",Ee,le,Qe,se,Fe;return Z=new bl({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),f=new te({props:{title:"OmniGen",local:"omnigen",headingTag:"h1"}}),V=new te({props:{title:"Load model checkpoints",local:"load-model-checkpoints",headingTag:"h2"}}),R=new G({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwT21uaUdlblBpcGVsaW5lJTBBJTBBcGlwZSUyMCUzRCUyME9tbmlHZW5QaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTIyU2hpdGFvJTJGT21uaUdlbi12MS1kaWZmdXNlcnMlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmJmbG9hdDE2KQ==",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> OmniGenPipeline

pipe = OmniGenPipeline.from_pretrained(<span class="hljs-string">&quot;Shitao/OmniGen-v1-diffusers&quot;</span>, torch_dtype=torch.bfloat16)`,wrap:!1}}),_=new te({props:{title:"Text-to-image",local:"text-to-image",headingTag:"h2"}}),C=new G({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwT21uaUdlblBpcGVsaW5lJTBBJTBBcGlwZSUyMCUzRCUyME9tbmlHZW5QaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIyU2hpdGFvJTJGT21uaUdlbi12MS1kaWZmdXNlcnMlMjIlMkMlMEElMjAlMjAlMjAlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmJmbG9hdDE2JTBBKSUwQXBpcGUudG8oJTIyY3VkYSUyMiklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJSZWFsaXN0aWMlMjBwaG90by4lMjBBJTIweW91bmclMjB3b21hbiUyMHNpdHMlMjBvbiUyMGElMjBzb2ZhJTJDJTIwaG9sZGluZy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sJTIwYW1iaWFuY2UuJTIwNEslMkMlMjBIRC4lMjIlMEFpbWFnZSUyMCUzRCUyMHBpcGUoJTBBJTIwJTIwJTIwJTIwcHJvbXB0JTNEcHJvbXB0JTJDJTBBJTIwJTIwJTIwJTIwaGVpZ2h0JTNEMTAyNCUyQyUwQSUyMCUyMCUyMCUyMHdpZHRoJTNEMTAyNCUyQyUwQSUyMCUyMCUyMCUyMGd1aWRhbmNlX3NjYWxlJTNEMyUyQyUwQSUyMCUyMCUyMCUyMGdlbmVyYXRvciUzRHRvcmNoLkdlbmVyYXRvcihkZXZpY2UlM0QlMjJjcHUlMjIpLm1hbnVhbF9zZWVkKDExMSklMkMlMEEpLmltYWdlcyU1QjAlNUQlMEFpbWFnZS5zYXZlKCUyMm91dHB1dC5wbmclMjIp",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> OmniGenPipeline

pipe = OmniGenPipeline.from_pretrained(
    <span class="hljs-string">&quot;Shitao/OmniGen-v1-diffusers&quot;</span>,
    torch_dtype=torch.bfloat16
)
pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)

prompt = <span class="hljs-string">&quot;Realistic photo. A young woman sits on a sofa, holding a book and facing the camera. She wears delicate silver hoop earrings adorned with tiny, sparkling diamonds that catch the light, with her long chestnut hair cascading over her shoulders. Her eyes are focused and gentle, framed by long, dark lashes. She is dressed in a cozy cream sweater, which complements her warm, inviting smile. Behind her, there is a table with a cup of water in a sleek, minimalist blue mug. The background is a serene indoor setting with soft natural light filtering through a window, adorned with tasteful art and flowers, creating a cozy and peaceful ambiance. 4K, HD.&quot;</span>
image = pipe(
    prompt=prompt,
    height=<span class="hljs-number">1024</span>,
    width=<span class="hljs-number">1024</span>,
    guidance_scale=<span class="hljs-number">3</span>,
    generator=torch.Generator(device=<span class="hljs-string">&quot;cpu&quot;</span>).manual_seed(<span class="hljs-number">111</span>),
).images[<span class="hljs-number">0</span>]
image.save(<span class="hljs-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DJTIwJTBBJTIwJTIwJTIwJTIwZ3VpZGFuY2Vfc2NhbGUlM0QyJTJDJTIwJTBBJTIwJTIwJTIwJTIwaW1nX2d1aWRhbmNlX3NjYWxlJTNEMS42JTJDJTBBJTIwJTIwJTIwJTIwdXNlX2lucHV0X2ltYWdlX3NpemVfYXNfb3V0cHV0JTNEVHJ1ZSUyQyUwQSUyMCUyMCUyMCUyMGdlbmVyYXRvciUzRHRvcmNoLkdlbmVyYXRvcihkZXZpY2UlM0QlMjJjcHUlMjIpLm1hbnVhbF9zZWVkKDIyMiklMEEpLmltYWdlcyU1QjAlNUQlMEFpbWFnZS5zYXZlKCUyMm91dHB1dC5wbmclMjIp",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> OmniGenPipeline
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image 

pipe = OmniGenPipeline.from_pretrained(
    <span class="hljs-string">&quot;Shitao/OmniGen-v1-diffusers&quot;</span>,
    torch_dtype=torch.bfloat16
)
pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)

prompt=<span class="hljs-string">&quot;&lt;img&gt;&lt;|image_1|&gt;&lt;/img&gt; Remove the woman&#x27;s earrings. Replace the mug with a clear glass filled with sparkling iced cola.&quot;</span>
input_images=[load_image(<span class="hljs-string">&quot;https://raw.githubusercontent.com/VectorSpaceLab/OmniGen/main/imgs/docs_img/t2i_woman_with_book.png&quot;</span>)]
image = pipe(
    prompt=prompt, 
    input_images=input_images, 
    guidance_scale=<span class="hljs-number">2</span>, 
    img_guidance_scale=<span class="hljs-number">1.6</span>,
    use_input_image_size_as_output=<span class="hljs-literal">True</span>,
    generator=torch.Generator(device=<span class="hljs-string">&quot;cpu&quot;</span>).manual_seed(<span class="hljs-number">222</span>)
).images[<span class="hljs-number">0</span>]
image.save(<span class="hljs-string">&quot;output.png&quot;</span>)`,wrap:!1}}),z=new G({props:{code:"cHJvbXB0JTNEJTIySWYlMjB0aGUlMjB3b21hbiUyMGlzJTIwdGhpcnN0eSUyQyUyMHdoYXQlMjBzaG91bGQlMjBzaGUlMjB0YWtlJTNGJTIwRmluZCUyMGl0JTIwaW4lMjB0aGUlMjBpbWFnZSUyMGFuZCUyMGhpZ2hsaWdodCUyMGl0JTIwaW4lMjBibHVlLiUyMCUzQ2ltZyUzRSUzQyU3Q2ltYWdlXzElN0MlM0UlM0MlMkZpbWclM0UlMjIlMEFpbnB1dF9pbWFnZXMlM0QlNUJsb2FkX2ltYWdlKCUyMmh0dHBzJTNBJTJGJTJGcmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSUyRlZlY3RvclNwYWNlTGFiJTJGT21uaUdlbiUyRm1haW4lMkZpbWdzJTJGZG9jc19pbWclMkZlZGl0LnBuZyUyMiklNUQlMEFpbWFnZSUyMCUzRCUyMHBpcGUoJTBBJTIwJTIwJTIwJTIwcHJvbXB0JTNEcHJvbXB0JTJDJTIwJTBBJTIwJTIwJTIwJTIwaW5wdXRfaW1hZ2VzJTNEaW5wdXRfaW1hZ2VzJTJDJTIwJTBBJTIwJTIwJTIwJTIwZ3VpZGFuY2Vfc2NhbGUlM0QyJTJDJTIwJTBBJTIwJTIwJTIwJTIwaW1nX2d1aWRhbmNlX3NjYWxlJTNEMS42JTJDJTBBJTIwJTIwJTIwJTIwdXNlX2lucHV0X2ltYWdlX3NpemVfYXNfb3V0cHV0JTNEVHJ1ZSUyQyUwQSUyMCUyMCUyMCUyMGdlbmVyYXRvciUzRHRvcmNoLkdlbmVyYXRvcihkZXZpY2UlM0QlMjJjcHUlMjIpLm1hbnVhbF9zZWVkKDApJTBBKS5pbWFnZXMlNUIwJTVEJTBBaW1hZ2Uuc2F2ZSglMjJvdXRwdXQucG5nJTIyKQ==",highlighted:`prompt=<span class="hljs-string">&quot;If the woman is thirsty, what should she take? Find it in the image and highlight it in blue. &lt;img&gt;&lt;|image_1|&gt;&lt;/img&gt;&quot;</span>
input_images=[load_image(<span class="hljs-string">&quot;https://raw.githubusercontent.com/VectorSpaceLab/OmniGen/main/imgs/docs_img/edit.png&quot;</span>)]
image = pipe(
    prompt=prompt, 
    input_images=input_images, 
    guidance_scale=<span class="hljs-number">2</span>, 
    img_guidance_scale=<span class="hljs-number">1.6</span>,
    use_input_image_size_as_output=<span class="hljs-literal">True</span>,
    generator=torch.Generator(device=<span class="hljs-string">&quot;cpu&quot;</span>).manual_seed(<span class="hljs-number">0</span>)
).images[<span class="hljs-number">0</span>]
image.save(<span class="hljs-string">&quot;output.png&quot;</span>)`,wrap:!1}}),S=new te({props:{title:"Controllable generation",local:"controllable-generation",headingTag:"h2"}}),E=new G({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwT21uaUdlblBpcGVsaW5lJTBBZnJvbSUyMGRpZmZ1c2Vycy51dGlscyUyMGltcG9ydCUyMGxvYWRfaW1hZ2UlMjAlMEElMEFwaXBlJTIwJTNEJTIwT21uaUdlblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJTaGl0YW8lMkZPbW5pR2VuLXYxLWRpZmZ1c2VycyUyMiUyQyUwQSUyMCUyMCUyMCUyMHRvcmNoX2R0eXBlJTNEdG9yY2guYmZsb2F0MTYlMEEpJTBBcGlwZS50byglMjJjdWRhJTIyKSUwQSUwQXByb21wdCUzRCUyMkRldGVjdCUyMHRoZSUyMHNrZWxldG9uJTIwb2YlMjBodW1hbiUyMGluJTIwdGhpcyUyMGltYWdlJTNBJTIwJTNDaW1nJTNFJTNDJTdDaW1hZ2VfMSU3QyUzRSUzQyUyRmltZyUzRSUyMiUwQWlucHV0X2ltYWdlcyUzRCU1QmxvYWRfaW1hZ2UoJTIyaHR0cHMlM0ElMkYlMkZyYXcuZ2l0aHVidXNlcmNvbnRlbnQuY29tJTJGVmVjdG9yU3BhY2VMYWIlMkZPbW5pR2VuJTJGbWFpbiUyRmltZ3MlMkZkb2N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CUyMGFjcm9zcyUyMGhpcyUyMGNoZWVrcy4lMjBUaGUlMjBsaWJyYXJ5JTIwaXMlMjBxdWlldCUyQyUyMHdpdGglMjByb3dzJTIwb2YlMjBzaGVsdmVzJTIwZmlsbGVkJTIwd2l0aCUyMGJvb2tzJTIwc3RyZXRjaGluZyUyMG91dCUyMGJlaGluZCUyMGhpbS4lMjIlMEFpbnB1dF9pbWFnZXMlM0QlNUJsb2FkX2ltYWdlKCUyMmh0dHBzJTNBJTJGJTJGcmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSUyRlZlY3RvclNwYWNlTGFiJTJGT21uaUdlbiUyRm1haW4lMkZpbWdzJTJGZG9jc19pbWclMkZza2VsZXRhbC5wbmclMjIpJTVEJTBBaW1hZ2UyJTIwJTNEJTIwcGlwZSglMEElMjAlMjAlMjAlMjBwcm9tcHQlM0Rwcm9tcHQlMkMlMjAlMEElMjAlMjAlMjAlMjBpbnB1dF9pbWFnZXMlM0RpbnB1dF9pbWFnZXMlMkMlMjAlMEElMjAlMjAlMjAlMjBndWlkYW5jZV9zY2FsZSUzRDIlMkMlMjAlMEElMjAlMjAlMjAlMjBpbWdfZ3VpZGFuY2Vfc2NhbGUlM0QxLjYlMkMlMEElMjAlMjAlMjAlMjB1c2VfaW5wdXRfaW1hZ2Vfc2l6ZV9hc19vdXRwdXQlM0RUcnVlJTJDJTBBJTIwJTIwJTIwJTIwZ2VuZXJhdG9yJTNEdG9yY2guR2VuZXJhdG9yKGRldmljZSUzRCUyMmNwdSUyMikubWFudWFsX3NlZWQoMzMzKSUwQSkuaW1hZ2VzJTVCMCU1RCUwQWltYWdlMi5zYXZlKCUyMmltYWdlMi5wbmclMjIp",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> OmniGenPipeline
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image 

pipe = OmniGenPipeline.from_pretrained(
    <span class="hljs-string">&quot;Shitao/OmniGen-v1-diffusers&quot;</span>,
    torch_dtype=torch.bfloat16
)
pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)

prompt=<span class="hljs-string">&quot;Detect the skeleton of human in this image: &lt;img&gt;&lt;|image_1|&gt;&lt;/img&gt;&quot;</span>
input_images=[load_image(<span class="hljs-string">&quot;https://raw.githubusercontent.com/VectorSpaceLab/OmniGen/main/imgs/docs_img/edit.png&quot;</span>)]
image1 = pipe(
    prompt=prompt, 
    input_images=input_images, 
    guidance_scale=<span class="hljs-number">2</span>, 
    img_guidance_scale=<span class="hljs-number">1.6</span>,
    use_input_image_size_as_output=<span class="hljs-literal">True</span>,
    generator=torch.Generator(device=<span class="hljs-string">&quot;cpu&quot;</span>).manual_seed(<span class="hljs-number">333</span>)
).images[<span class="hljs-number">0</span>]
image1.save(<span class="hljs-string">&quot;image1.png&quot;</span>)

prompt=<span class="hljs-string">&quot;Generate a new photo using the following picture and text as conditions: &lt;img&gt;&lt;|image_1|&gt;&lt;/img&gt;\\n A young boy is sitting on a sofa in the library, holding a book. His hair is neatly combed, and a faint smile plays on his lips, with a few freckles scattered across his cheeks. The library is quiet, with rows of shelves filled with books stretching out behind him.&quot;</span>
input_images=[load_image(<span class="hljs-string">&quot;https://raw.githubusercontent.com/VectorSpaceLab/OmniGen/main/imgs/docs_img/skeletal.png&quot;</span>)]
image2 = pipe(
    prompt=prompt, 
    input_images=input_images, 
    guidance_scale=<span class="hljs-number">2</span>, 
    img_guidance_scale=<span class="hljs-number">1.6</span>,
    use_input_image_size_as_output=<span class="hljs-literal">True</span>,
    generator=torch.Generator(device=<span class="hljs-string">&quot;cpu&quot;</span>).manual_seed(<span class="hljs-number">333</span>)
).images[<span class="hljs-number">0</span>]
image2.save(<span class="hljs-string">&quot;image2.png&quot;</span>)`,wrap:!1}}),F=new G({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwT21uaUdlblBpcGVsaW5lJTB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c2VyY29udGVudC5jb20lMkZWZWN0b3JTcGFjZUxhYiUyRk9tbmlHZW4lMkZtYWluJTJGaW1ncyUyRmRvY3NfaW1nJTJGZWRpdC5wbmclMjIpJTVEJTBBaW1hZ2UlMjAlM0QlMjBwaXBlKCUwQSUyMCUyMCUyMCUyMHByb21wdCUzRHByb21wdCUyQyUyMCUwQSUyMCUyMCUyMCUyMGlucHV0X2ltYWdlcyUzRGlucHV0X2ltYWdlcyUyQyUyMCUwQSUyMCUyMCUyMCUyMGd1aWRhbmNlX3NjYWxlJTNEMiUyQyUyMCUwQSUyMCUyMCUyMCUyMGltZ19ndWlkYW5jZV9zY2FsZSUzRDEuNiUyQyUwQSUyMCUyMCUyMCUyMHVzZV9pbnB1dF9pbWFnZV9zaXplX2FzX291dHB1dCUzRFRydWUlMkMlMEElMjAlMjAlMjAlMjBnZW5lcmF0b3IlM0R0b3JjaC5HZW5lcmF0b3IoZGV2aWNlJTNEJTIyY3B1JTIyKS5tYW51YWxfc2VlZCgwKSUwQSkuaW1hZ2VzJTVCMCU1RCUwQWltYWdlLnNhdmUoJTIyb3V0cHV0LnBuZyUyMik=",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> OmniGenPipeline
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image 

pipe = OmniGenPipeline.from_pretrained(
    <span class="hljs-string">&quot;Shitao/OmniGen-v1-diffusers&quot;</span>,
    torch_dtype=torch.bfloat16
)
pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)

prompt=<span class="hljs-string">&quot;Following the pose of this image &lt;img&gt;&lt;|image_1|&gt;&lt;/img&gt;, generate a new photo: A young boy is sitting on a sofa in the library, holding a book. His hair is neatly combed, and a faint smile plays on his lips, with a few freckles scattered across his cheeks. The library is quiet, with rows of shelves filled with books stretching out behind him.&quot;</span>
input_images=[load_image(<span class="hljs-string">&quot;https://raw.githubusercontent.com/VectorSpaceLab/OmniGen/main/imgs/docs_img/edit.png&quot;</span>)]
image = pipe(
    prompt=prompt, 
    input_images=input_images, 
    guidance_scale=<span class="hljs-number">2</span>, 
    img_guidance_scale=<span class="hljs-number">1.6</span>,
    use_input_image_size_as_output=<span class="hljs-literal">True</span>,
    generator=torch.Generator(device=<span class="hljs-string">&quot;cpu&quot;</span>).manual_seed(<span class="hljs-number">0</span>)
).images[<span class="hljs-number">0</span>]
image.save(<span class="hljs-string">&quot;output.png&quot;</span>)`,wrap:!1}}),$=new te({props:{title:"ID and object preserving",local:"id-and-object-preserving",headingTag:"h2"}}),q=new G({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwT21uaUdlblBpcGVsaW5lJTBBZnJvbSUyMGRpZmZ1c2Vycy51dGlscyUyMGltcG9ydCUyMGxvYWRfaW1hZ2UlMjAlMEElMEFwaXBlJTIwJTNEJTIwT21uaUdlblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJTaGl0YW8lMkZPbW5pR2VuLXYxLWRpZmZ1c2VycyUyMiUyQyUwQSUyMCUyMCUyMCUyMHRvcmNoX2R0eXBlJTNEdG9yY2guYmZsb2F0MTYlMEEpJTBBcGlwZS50byglMjJjdWRhJTIyKSUwQSUwQXByb21wdCUzRCUyMkElMjBtYW4lMjBhbmQlMjBhJTIwd29tYW4lMjBhcmUlMjBzaXR0aW5nJTIwYXQlMjBhJTIwY2xhc3Nyb29tJTIwZGVzay4lMjBUaGUlMjBtYW4lMjBpcyUyMHRoZSUyMG1hbiUyMHdpdGglMjB5ZWxsb3clMjBoYWlyJTIwaW4lMjAlM0NpbWclM0UlM0MlN0NpbWFnZV8xJTdDJTNFJTNDJTJGaW1nJTNFLiUyMFRoZSUyMHdvbWFuJTIwaXMlMjB0aGUlMjB3b21hbiUyMG9uJTIwdGhlJTIwbGVmdCUyMG9mJTIwJTNDaW1nJTNFJTNDJTdDaW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-keyword">import</span> OmniGenPipeline
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image 

pipe = OmniGenPipeline.from_pretrained(
    <span class="hljs-string">&quot;Shitao/OmniGen-v1-diffusers&quot;</span>,
    torch_dtype=torch.bfloat16
)
pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)

prompt=<span class="hljs-string">&quot;A man and a woman are sitting at a classroom desk. The man is the man with yellow hair in &lt;img&gt;&lt;|image_1|&gt;&lt;/img&gt;. The woman is the woman on the left of &lt;img&gt;&lt;|image_2|&gt;&lt;/img&gt;&quot;</span>
input_image_1 = load_image(<span class="hljs-string">&quot;https://raw.githubusercontent.com/VectorSpaceLab/OmniGen/main/imgs/docs_img/3.png&quot;</span>)
input_image_2 = load_image(<span class="hljs-string">&quot;https://raw.githubusercontent.com/VectorSpaceLab/OmniGen/main/imgs/docs_img/4.png&quot;</span>)
input_images=[input_image_1, input_image_2]
image = pipe(
    prompt=prompt, 
    input_images=input_images, 
    height=<span class="hljs-number">1024</span>,
    width=<span class="hljs-number">1024</span>,
    guidance_scale=<span class="hljs-number">2.5</span>, 
    img_guidance_scale=<span class="hljs-number">1.6</span>,
    generator=torch.Generator(device=<span class="hljs-string">&quot;cpu&quot;</span>).manual_seed(<span class="hljs-number">666</span>)
).images[<span class="hljs-number">0</span>]
image.save(<span class="hljs-string">&quot;output.png&quot;</span>)`,wrap:!1}}),A=new G({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwT21uaUdlblBpcGVsaW5lJTBBZnJvbSUyMGRpZmZ1c2Vycy51dGlscyUyMGltcG9ydCUyMGxvYWRfaW1hZ2UlMjAlMEElMEFwaXBlJTIwJTNEJTIwT21uaUdlblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJTaGl0YW8lMkZPbW5pR2VuLXYxLWRpZmZ1c2VycyUyMiUyQyUwQSUyMCUyM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bWFnZSUyMCUzRCUyMHBpcGUoJTBBJTIwJTIwJTIwJTIwcHJvbXB0JTNEcHJvbXB0JTJDJTIwJTBBJTIwJTIwJTIwJTIwaW5wdXRfaW1hZ2VzJTNEaW5wdXRfaW1hZ2VzJTJDJTIwJTBBJTIwJTIwJTIwJTIwaGVpZ2h0JTNEMTAyNCUyQyUwQSUyMCUyMCUyMCUyMHdpZHRoJTNEMTAyNCUyQyUwQSUyMCUyMCUyMCUyMGd1aWRhbmNlX3NjYWxlJTNEMi41JTJDJTIwJTBBJTIwJTIwJTIwJTIwaW1nX2d1aWRhbmNlX3NjYWxlJTNEMS42JTJDJTBBJTIwJTIwJTIwJTIwZ2VuZXJhdG9yJTNEdG9yY2guR2VuZXJhdG9yKGRldmljZSUzRCUyMmNwdSUyMikubWFudWFsX3NlZWQoNjY2KSUwQSkuaW1hZ2VzJTVCMCU1RCUwQWltYWdlLnNhdmUoJTIyb3V0cHV0LnBuZyUyMik=",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> OmniGenPipeline
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image 

pipe = OmniGenPipeline.from_pretrained(
    <span class="hljs-string">&quot;Shitao/OmniGen-v1-diffusers&quot;</span>,
    torch_dtype=torch.bfloat16
)
pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)

prompt=<span class="hljs-string">&quot;A woman is walking down the street, wearing a white long-sleeve blouse with lace details on the sleeves, paired with a blue pleated skirt. The woman is &lt;img&gt;&lt;|image_1|&gt;&lt;/img&gt;. The long-sleeve blouse and a pleated skirt are &lt;img&gt;&lt;|image_2|&gt;&lt;/img&gt;.&quot;</span>
input_image_1 = load_image(<span class="hljs-string">&quot;https://raw.githubusercontent.com/VectorSpaceLab/OmniGen/main/imgs/docs_img/emma.jpeg&quot;</span>)
input_image_2 = load_image(<span class="hljs-string">&quot;https://raw.githubusercontent.com/VectorSpaceLab/OmniGen/main/imgs/docs_img/dress.jpg&quot;</span>)
input_images=[input_image_1, input_image_2]
image = pipe(
    prompt=prompt, 
    input_images=input_images, 
    height=<span class="hljs-number">1024</span>,
    width=<span class="hljs-number">1024</span>,
    guidance_scale=<span class="hljs-number">2.5</span>, 
    img_guidance_scale=<span class="hljs-number">1.6</span>,
    generator=torch.Generator(device=<span class="hljs-string">&quot;cpu&quot;</span>).manual_seed(<span class="hljs-number">666</span>)
).images[<span class="hljs-number">0</span>]
image.save(<span class="hljs-string">&quot;output.png&quot;</span>)`,wrap:!1}}),O=new te({props:{title:"Optimization when using multiple images",local:"optimization-when-using-multiple-images",headingTag:"h2"}}),le=new jl({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/using-diffusers/omnigen.md"}}),{c(){r=i("meta"),ne=s(),ae=i("p"),ie=s(),c(Z.$$.fragment),pe=s(),c(f.$$.fragment),me=s(),W=i("p"),W.textContent=Le,ce=s(),I=i("ul"),I.innerHTML=qe,oe=s(),B=i("p"),B.innerHTML=Ae,Me=s(),c(V.$$.fragment),de=s(),X=i("p"),X.innerHTML=Oe,Je=s(),c(R.$$.fragment),ye=s(),c(_.$$.fragment),re=s(),v=i("p"),v.innerHTML=De,ue=s(),c(C.$$.fragment),ge=s(),g=i("div"),g.innerHTML=Pe,Te=s(),c(Y.$$.fragment),we=s(),k=i("p"),k.innerHTML=Ke,he=s(),c(N.$$.fragment),Ue=s(),T=i("div"),T.innerHTML=el,be=s(),x=i("p"),x.textContent=ll,je=s(),c(z.$$.fragment),Ge=s(),w=i("div"),w.innerHTML=tl,Ze=s(),c(S.$$.fragment),fe=s(),H=i("p"),H.textContent=al,We=s(),c(E.$$.fragment),Ie=s(),h=i("div"),h.innerHTML=sl,Be=s(),Q=i("p"),Q.textContent=nl,Ve=s(),c(F.$$.fragment),Xe=s(),U=i("div"),U.innerHTML=il,Re=s(),c($.$$.fragment),_e=s(),L=i("p"),L.textContent=pl,ve=s(),c(q.$$.fragment),Ce=s(),b=i("div"),b.innerHTML=ml,Ye=s(),c(A.$$.fragment),ke=s(),j=i("div"),j.innerHTML=cl,Ne=s(),c(O.$$.fragment),xe=s(),D=i("p"),D.textContent=ol,ze=s(),P=i("p"),P.textContent=Ml,Se=s(),K=i("p"),K.innerHTML=dl,He=s(),ee=i("table"),ee.innerHTML=Jl,Ee=s(),c(le.$$.fragment),Qe=s(),se=i("p"),this.h()},l(e){const l=hl("svelte-u9bgzb",document.head);r=p(l,"META",{name:!0,content:!0}),l.forEach(t),ne=n(e),ae=p(e,"P",{}),yl(ae).forEach(t),ie=n(e),o(Z.$$.fragment,e),pe=n(e),o(f.$$.fragment,e),me=n(e),W=p(e,"P",{"data-svelte-h":!0}),m(W)!=="svelte-wv02ap"&&(W.textContent=Le),ce=n(e),I=p(e,"UL",{"data-svelte-h":!0}),m(I)!=="svelte-1e1t33d"&&(I.innerHTML=qe),oe=n(e),B=p(e,"P",{"data-svelte-h":!0}),m(B)!=="svelte-1frdgki"&&(B.innerHTML=Ae),Me=n(e),o(V.$$.fragment,e),de=n(e),X=p(e,"P",{"data-svelte-h":!0}),m(X)!=="svelte-1ia8sef"&&(X.innerHTML=Oe),Je=n(e),o(R.$$.fragment,e),ye=n(e),o(_.$$.fragment,e),re=n(e),v=p(e,"P",{"data-svelte-h":!0}),m(v)!=="svelte-1a87kfl"&&(v.innerHTML=De),ue=n(e),o(C.$$.fragment,e),ge=n(e),g=p(e,"DIV",{class:!0,"data-svelte-h":!0}),m(g)!=="svelte-uf526e"&&(g.innerHTML=Pe),Te=n(e),o(Y.$$.fragment,e),we=n(e),k=p(e,"P",{"data-svelte-h":!0}),m(k)!=="svelte-53bqqd"&&(k.innerHTML=Ke),he=n(e),o(N.$$.fragment,e),Ue=n(e),T=p(e,"DIV",{class:!0,"data-svelte-h":!0}),m(T)!=="svelte-ptjo10"&&(T.innerHTML=el),be=n(e),x=p(e,"P",{"data-svelte-h":!0}),m(x)!=="svelte-1n0on1x"&&(x.textContent=ll),je=n(e),o(z.$$.fragment,e),Ge=n(e),w=p(e,"DIV",{class:!0,"data-svelte-h":!0}),m(w)!=="svelte-yas3w7"&&(w.innerHTML=tl),Ze=n(e),o(S.$$.fragment,e),fe=n(e),H=p(e,"P",{"data-svelte-h":!0}),m(H)!=="svelte-gken8m"&&(H.textContent=al),We=n(e),o(E.$$.fragment,e),Ie=n(e),h=p(e,"DIV",{class:!0,"data-svelte-h":!0}),m(h)!=="svelte-n9fk6r"&&(h.innerHTML=sl),Be=n(e),Q=p(e,"P",{"data-svelte-h":!0}),m(Q)!=="svelte-1xps456"&&(Q.textContent=nl),Ve=n(e),o(F.$$.fragment,e),Xe=n(e),U=p(e,"DIV",{class:!0,"data-svelte-h":!0}),m(U)!=="svelte-17vyas4"&&(U.innerHTML=il),Re=n(e),o($.$$.fragment,e),_e=n(e),L=p(e,"P",{"data-svelte-h":!0}),m(L)!=="svelte-18p79vw"&&(L.textContent=pl),ve=n(e),o(q.$$.fragment,e),Ce=n(e),b=p(e,"DIV",{class:!0,"data-svelte-h":!0}),m(b)!=="svelte-q7ysaf"&&(b.innerHTML=ml),Ye=n(e),o(A.$$.fragment,e),ke=n(e),j=p(e,"DIV",{class:!0,"data-svelte-h":!0}),m(j)!=="svelte-164h1l6"&&(j.innerHTML=cl),Ne=n(e),o(O.$$.fragment,e),xe=n(e),D=p(e,"P",{"data-svelte-h":!0}),m(D)!=="svelte-1y946ts"&&(D.textContent=ol),ze=n(e),P=p(e,"P",{"data-svelte-h":!0}),m(P)!=="svelte-13qz3jx"&&(P.textContent=Ml),Se=n(e),K=p(e,"P",{"data-svelte-h":!0}),m(K)!=="svelte-1twry1x"&&(K.innerHTML=dl),He=n(e),ee=p(e,"TABLE",{"data-svelte-h":!0}),m(ee)!=="svelte-1qb6le7"&&(ee.innerHTML=Jl),Ee=n(e),o(le.$$.fragment,e),Qe=n(e),se=p(e,"P",{}),yl(se).forEach(t),this.h()},h(){u(r,"name","hf:doc:metadata"),u(r,"content",Zl),u(g,"class","flex justify-center"),u(T,"class","flex flex-row gap-4"),u(w,"class","flex justify-center"),u(h,"class","flex flex-row gap-4"),u(U,"class","flex flex-row gap-4"),u(b,"class","flex flex-row gap-4"),u(j,"class","flex flex-row gap-4")},m(e,l){Ul(document.head,r),a(e,ne,l),a(e,ae,l),a(e,ie,l),M(Z,e,l),a(e,pe,l),M(f,e,l),a(e,me,l),a(e,W,l),a(e,ce,l),a(e,I,l),a(e,oe,l),a(e,B,l),a(e,Me,l),M(V,e,l),a(e,de,l),a(e,X,l),a(e,Je,l),M(R,e,l),a(e,ye,l),M(_,e,l),a(e,re,l),a(e,v,l),a(e,ue,l),M(C,e,l),a(e,ge,l),a(e,g,l),a(e,Te,l),M(Y,e,l),a(e,we,l),a(e,k,l),a(e,he,l),M(N,e,l),a(e,Ue,l),a(e,T,l),a(e,be,l),a(e,x,l),a(e,je,l),M(z,e,l),a(e,Ge,l),a(e,w,l),a(e,Ze,l),M(S,e,l),a(e,fe,l),a(e,H,l),a(e,We,l),M(E,e,l),a(e,Ie,l),a(e,h,l),a(e,Be,l),a(e,Q,l),a(e,Ve,l),M(F,e,l),a(e,Xe,l),a(e,U,l),a(e,Re,l),M($,e,l),a(e,_e,l),a(e,L,l),a(e,ve,l),M(q,e,l),a(e,Ce,l),a(e,b,l),a(e,Ye,l),M(A,e,l),a(e,ke,l),a(e,j,l),a(e,Ne,l),M(O,e,l),a(e,xe,l),a(e,D,l),a(e,ze,l),a(e,P,l),a(e,Se,l),a(e,K,l),a(e,He,l),a(e,ee,l),a(e,Ee,l),M(le,e,l),a(e,Qe,l),a(e,se,l),Fe=!0},p:ul,i(e){Fe||(d(Z.$$.fragment,e),d(f.$$.fragment,e),d(V.$$.fragment,e),d(R.$$.fragment,e),d(_.$$.fragment,e),d(C.$$.fragment,e),d(Y.$$.fragment,e),d(N.$$.fragment,e),d(z.$$.fragment,e),d(S.$$.fragment,e),d(E.$$.fragment,e),d(F.$$.fragment,e),d($.$$.fragment,e),d(q.$$.fragment,e),d(A.$$.fragment,e),d(O.$$.fragment,e),d(le.$$.fragment,e),Fe=!0)},o(e){J(Z.$$.fragment,e),J(f.$$.fragment,e),J(V.$$.fragment,e),J(R.$$.fragment,e),J(_.$$.fragment,e),J(C.$$.fragment,e),J(Y.$$.fragment,e),J(N.$$.fragment,e),J(z.$$.fragment,e),J(S.$$.fragment,e),J(E.$$.fragment,e),J(F.$$.fragment,e),J($.$$.fragment,e),J(q.$$.fragment,e),J(A.$$.fragment,e),J(O.$$.fragment,e),J(le.$$.fragment,e),Fe=!1},d(e){e&&(t(ne),t(ae),t(ie),t(pe),t(me),t(W),t(ce),t(I),t(oe),t(B),t(Me),t(de),t(X),t(Je),t(ye),t(re),t(v),t(ue),t(ge),t(g),t(Te),t(we),t(k),t(he),t(Ue),t(T),t(be),t(x),t(je),t(Ge),t(w),t(Ze),t(fe),t(H),t(We),t(Ie),t(h),t(Be),t(Q),t(Ve),t(Xe),t(U),t(Re),t(_e),t(L),t(ve),t(Ce),t(b),t(Ye),t(ke),t(j),t(Ne),t(xe),t(D),t(ze),t(P),t(Se),t(K),t(He),t(ee),t(Ee),t(Qe),t(se)),t(r),y(Z,e),y(f,e),y(V,e),y(R,e),y(_,e),y(C,e),y(Y,e),y(N,e),y(z,e),y(S,e),y(E,e),y(F,e),y($,e),y(q,e),y(A,e),y(O,e),y(le,e)}}}const Zl='{"title":"OmniGen","local":"omnigen","sections":[{"title":"Load model checkpoints","local":"load-model-checkpoints","sections":[],"depth":2},{"title":"Text-to-image","local":"text-to-image","sections":[],"depth":2},{"title":"Image edit","local":"image-edit","sections":[],"depth":2},{"title":"Controllable generation","local":"controllable-generation","sections":[],"depth":2},{"title":"ID and object preserving","local":"id-and-object-preserving","sections":[],"depth":2},{"title":"Optimization when using multiple images","local":"optimization-when-using-multiple-images","sections":[],"depth":2}],"depth":1}';function fl($e){return gl(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Rl extends Tl{constructor(r){super(),wl(this,r,fl,Gl,rl,{})}}export{Rl as component};
