import{s as Jl,n as yl,o as rl}from"../chunks/scheduler.8c3d61f6.js";import{S as ul,i as Tl,g as i,s,r as c,A as gl,h as p,f as t,c as n,j as dl,u as o,x as m,k as u,y as wl,a,v as M,d,t as J,w as y}from"../chunks/index.da70eac4.js";import{C as G}from"../chunks/CodeBlock.a9c4becf.js";import{H as le,E as hl}from"../chunks/getInferenceSnippets.39110341.js";function Ul(Qe){let r,se,te,ne,Z,ie,f,Fe="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:",pe,W,$e="<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>",me,I,Le=`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.`,ce,B,oe,V,qe='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.',Me,X,de,R,Je,_,Ae=`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.`,ye,v,re,T,Oe='<img src="https://raw.githubusercontent.com/VectorSpaceLab/OmniGen/main/imgs/docs_img/t2i_woman_with_book.png" alt="generated image"/>',ue,Y,Te,C,De=`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.`,ge,k,we,g,Pe='<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>',he,N,Ke="OmniGen has some interesting features, such as visual reasoning, as shown in the example below.",Ue,x,be,w,el='<img src="https://raw.githubusercontent.com/VectorSpaceLab/OmniGen/main/imgs/docs_img/reasoning.png" alt="generated image"/>',je,z,Ge,S,ll="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.",Ze,H,fe,h,tl='<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>',We,E,al="OmniGen can also directly use relevant information from input images to generate new images.",Ie,Q,Be,U,sl='<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>',Ve,F,Xe,$,nl=`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.`,Re,L,_e,b,il='<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>',ve,q,Ye,j,pl='<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>',Ce,A,ke,O,ml=`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.`,Ne,D,cl="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.",xe,P,ol=`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:`,ze,K,Ml="<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>",Se,ee,He,ae,Ee;return Z=new le({props:{title:"OmniGen",local:"omnigen",headingTag:"h1"}}),B=new le({props:{title:"Load model checkpoints",local:"load-model-checkpoints",headingTag:"h2"}}),X=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}}),R=new le({props:{title:"Text-to-image",local:"text-to-image",headingTag:"h2"}}),v=new G({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwT21uaUdlblBpcGVsaW5lJTBBJTBBcGlwZSUyMCUzRCUyME9tbmlHZW5QaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIyU2hpdGFvJTJGT21uaUdlbi12MS1kaWZmdXNlcnMlMjIlMkMlMEElMjAlMjAlMjAlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmJmbG9hdDE2JTBBKSUwQXBpcGUudG8oJTIyY3VkYSUyMiklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJSZWFsaXN0aWMlMjBwaG90by4lMjBBJTIweW91bmclMjB3b21hbiUyMHNpdHMlMjBvbiUyMGElMjBzb2ZhJTJDJTIwaG9sZGluZyUyMGElMjBib29rJTIwYW5kJTIwZmFjaW5nJTIwdGhlJTIwY2FtZXJhLiUyMFNoZSUyMHdlYXJzJTIwZGVsaWNhdGUlMjBzaWx2ZXIlMjBob29w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B0JTJDJTBBJTIwJTIwJTIwJTIwaGVpZ2h0JTNEMTAyNCUyQyUwQSUyMCUyMCUyMCUyMHdpZHRoJTNEMTAyNCUyQyUwQSUyMCUyMCUyMCUyMGd1aWRhbmNlX3NjYWxlJTNEMyUyQyUwQSUyMCUyMCUyMCUyMGdlbmVyYXRvciUzRHRvcmNoLkdlbmVyYXRvcihkZXZpY2UlM0QlMjJjcHUlMjIpLm1hbnVhbF9zZWVkKDExMSklMkMlMEEpLmltYWdlcyU1QjAlNUQlMEFpbWFnZS5zYXZlKCUyMm91dHB1dC5wbmclMjIp",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-string">&quot;output.png&quot;</span>)`,wrap:!1}}),Y=new le({props:{title:"Image edit",local:"image-edit",headingTag:"h2"}}),k=new G({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTI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EMS42JTJDJTBBJTIwJTIwJTIwJTIwdXNlX2lucHV0X2ltYWdlX3NpemVfYXNfb3V0cHV0JTNEVHJ1ZSUyQyUwQSUyMCUyMCUyMCUyMGdlbmVyYXRvciUzRHRvcmNoLkdlbmVyYXRvcihkZXZpY2UlM0QlMjJjcHUlMjIpLm1hbnVhbF9zZWVkKDIyMiklMEEpLmltYWdlcyU1QjAlNUQlMEFpbWFnZS5zYXZlKCUyMm91dHB1dC5wbmclMjIp",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}}),x=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}}),z=new le({props:{title:"Controllable generation",local:"controllable-generation",headingTag:"h2"}}),H=new G({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwT21uaUdlblBpcGVsaW5lJTBBZnJvbSUyMGRpZmZ1c2Vycy51dGlscyUyMGltcG9ydCUyMGxvYWRfaW1hZ2UlMjAlMEElMEFwaXBlJTIwJTNEJTIwT21uaUdlblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJTaGl0YW8lMkZPbW5pR2VuLXYxLWRpZmZ1c2VycyUyMiUyQyUwQSUyMCUyMCUyMCUyMHRvcmNoX2R0eXBlJTNEdG9yY2guYmZsb2F0MTYlMEEpJTBBcGlwZS50byglMjJjdWRhJTIyKSUwQSUwQXByb21wdCUzRCUyMkRldGVjdCUyMHRoZSUyMHNrZWxldG9uJTIwb2YlMjBodW1hbiUyMGluJTIwdGhpcyUyMGltYWdlJTNBJTIwJTNDaW1nJTNFJTNDJTdDaW1hZ2VfMSU3QyUzRSUzQyUyRmltZyUzRSUyMiUwQWlucHV0X2ltYWdlcyUzRCU1QmxvYWRfaW1hZ2UoJTIyaHR0cHMlM0ElMkYlMkZyYXcuZ2l0aHVidXNlcmNvbnRlbnQuY29tJTJGVmVjdG9yU3BhY2VMYWIlMkZPbW5pR2VuJTJGbWFpbiUyRmltZ3MlMkZkb2NzX2ltZyUyRmVkaXQucG5nJTIyKSU1RCUwQWltYWdlMSUyMCUzRCUyMHBpcGUoJTBBJTIwJTIwJTIwJTIwcHJvbXB0JTNEcHJvbXB0JTJDJTI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GVsdmVzJTIwZmlsbGVkJTIwd2l0aCUyMGJvb2tzJTIwc3RyZXRjaGluZyUyMG91dCUyMGJlaGluZCUyMGhpbS4lMjIlMEFpbnB1dF9pbWFnZXMlM0QlNUJsb2FkX2ltYWdlKCUyMmh0dHBzJTNBJTJGJTJGcmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSUyRlZlY3RvclNwYWNlTGFiJTJGT21uaUdlbiUyRm1haW4lMkZpbWdzJTJGZG9jc19pbWclMkZza2VsZXRhbC5wbmclMjIpJTVEJTBBaW1hZ2UyJTIwJTNEJTIwcGlwZSglMEElMjAlMjAlMjAlMjBwcm9tcHQlM0Rwcm9tcHQlMkMlMjAlMEElMjAlMjAlMjAlMjBpbnB1dF9pbWFnZXMlM0RpbnB1dF9pbWFnZXMlMkMlMjAlMEElMjAlMjAlMjAlMjBndWlkYW5jZV9zY2FsZSUzRDIlMkMlMjAlMEElMjAlMjAlMjAlMjBpbWdfZ3VpZGFuY2Vfc2NhbGUlM0QxLjYlMkMlMEElMjAlMjAlMjAlMjB1c2VfaW5wdXRfaW1hZ2Vfc2l6ZV9hc19vdXRwdXQlM0RUcnVlJTJDJTBBJTIwJTIwJTIwJTIwZ2VuZXJhdG9yJTNEdG9yY2guR2VuZXJhdG9yKGRldmljZSUzRCUyMmNwdSUyMikubWFudWFsX3NlZWQoMzMzKSUwQSkuaW1hZ2VzJTVCMCU1RCUwQWltYWdlMi5zYXZlKCUyMmltYWdlMi5wbmclMjIp",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}}),Q=new G({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwT21uaUdlblBpcGVsaW5lJTBBZnJvbSUyMGRpZmZ1c2Vycy51dGlscyUyMGltcG9ydCUyMGxvYWRfaW1hZ2UlMjAlMEElMEFwaXBlJTIwJTNEJTIwT21uaUdlblBpcGVsaW5l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EJTBBaW1hZ2UlMjAlM0QlMjBwaXBlKCUwQSUyMCUyMCUyMCUyMHByb21wdCUzRHByb21wdCUyQyUyMCUwQSUyMCUyMCUyMCUyMGlucHV0X2ltYWdlcyUzRGlucHV0X2ltYWdlcyUyQyUyMCUwQSUyMCUyMCUyMCUyMGd1aWRhbmNlX3NjYWxlJTNEMiUyQyUyMCUwQSUyMCUyMCUyMCUyMGltZ19ndWlkYW5jZV9zY2FsZSUzRDEuNiUyQyUwQSUyMCUyMCUyMCUyMHVzZV9pbnB1dF9pbWFnZV9zaXplX2FzX291dHB1dCUzRFRydWUlMkMlMEElMjAlMjAlMjAlMjBnZW5lcmF0b3IlM0R0b3JjaC5HZW5lcmF0b3IoZGV2aWNlJTNEJTIyY3B1JTIyKS5tYW51YWxfc2VlZCgwKSUwQSkuaW1hZ2VzJTVCMCU1RCUwQWltYWdlLnNhdmUoJTIyb3V0cHV0LnBuZyUyMik=",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}}),F=new le({props:{title:"ID and object preserving",local:"id-and-object-preserving",headingTag:"h2"}}),L=new G({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwT21uaUdlblBpcGVsaW5lJTBBZnJvbSUyMGRpZmZ1c2Vycy51dGlscyUyMGltcG9ydCUyMGxvYWRfaW1hZ2UlMjAlMEElMEFwaXBlJTIwJTNEJTIwT21uaUdlblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJTaGl0YW8lMkZPbW5pR2VuLXYxLWRpZmZ1c2VycyUyMiUyQyUwQSUyMCUyMCUyMCUyMHRvcmNoX2R0eXBlJTNEdG9yY2guYmZsb2F0MTYlMEEpJTBBcGlwZS50byglMjJjdWRhJTIyKSUwQSUwQXByb21wdCUzRCUyMkElMjBtYW4lMjBhbmQlMjBhJTIwd29tYW4lMjBhcmUlMjBzaXR0aW5nJTIwYXQlMjBhJTIwY2xhc3Nyb29tJTIwZGVzay4lMjBUaGUlMjBtYW4lMjBpcyUyMHRoZSUyMG1hbiUyMHdpdGglMjB5ZWxsb3clMjBoYWlyJTIwaW4lMjAlM0NpbWclM0UlM0MlN0NpbWFnZV8xJTdDJTNFJTNDJTJGaW1nJTNFLiUyMFRoZSUyMHdvbWFuJTIwaXMlMjB0aGUlMjB3b21hbiUyMG9uJTIwdGhlJTIwbGVmdCUyMG9mJTIwJTNDaW1nJTNFJTNDJTdDaW1hZ2VfMiU3QyUzRSUzQyUyRmltZyUzRSUyMiUwQWlucHV0X2ltYWdlXzElMjAlM0QlMjBsb2FkX2ltYWdlKCUyMmh0dHBzJTNBJTJGJTJGcmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSUyRlZlY3RvclNwYWNlTGFiJTJGT21uaUdlbiUyRm1haW4lMkZpbWdzJTJGZG9jc19pbWclMkYzLnBuZyUyMiklMEFpbnB1dF9pbWFnZV8yJTIwJTNEJTIwbG9hZF9pbWFnZSglMjJodHRwcyUzQSUyRiUyRnJhdy5naXRodWJ1c2VyY29udGVudC5jb20lMkZWZWN0b3JTcGFjZUxhYiUyRk9tbmlHZW4lMkZtYWluJTJGaW1ncyUyRmRvY3NfaW1nJTJGNC5wbmclMjIpJTBBaW5wdXRfaW1hZ2VzJTNEJTVCaW5wdXRfaW1hZ2VfMSUyQyUyMGlucHV0X2ltYWdlXzIlNUQlMEFpbWFnZSUyMCUzRCUyMHBpcGUoJTBBJTIwJTIwJTIwJTIwcHJvbXB0JTNEcHJvbXB0JTJDJTIwJTBBJTIwJTIwJTIwJTIwaW5wdXRfaW1hZ2VzJTNEaW5wdXRfaW1hZ2VzJTJDJTIwJTBBJTIwJTIwJTIwJTIwaGVpZ2h0JTNEMTAyNCUyQyUwQSUyMCUyMCUyMCUyMHdpZHRoJTNEMTAyNCUyQyUwQSUyMCUyMCUyMCUyMGd1aWRhbmNlX3NjYWxlJTNEMi41JTJDJTIwJTBBJTIwJTIwJTIwJTIwaW1nX2d1aWRhbmNlX3NjYWxlJTNEMS42JTJDJTBBJTIwJTIwJTIwJTIwZ2VuZXJhdG9yJTNEdG9yY2guR2VuZXJhdG9yKGRldmljZSUzRCUyMmNwdSUyMikubWFudWFsX3NlZWQoNjY2KSUwQSkuaW1hZ2VzJTVCMCU1RCUwQWltYWdlLnNhdmUoJTIyb3V0cHV0LnBuZyUyMik=",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 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}}),q=new G({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwT21uaUdlblBpcGVsaW5lJTBBZnJvbSUyMGRpZmZ1c2Vycy51dGlscyUyMGltcG9ydCUyMGxvYWRfaW1hZ2UlMjAlMEElMEFwaXBlJTIwJTNEJTIwT21uaUdlblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJTaGl0YW8lMkZPbW5pR2VuLXYxLWRpZmZ1c2VycyUyMiUyQyUwQSUyMCUyMCUyMCUyMHRvcmNoX2R0eXBlJTNEdG9yY2guYmZsb2F0MTYlMEEpJTBBcGlwZS50byglMjJjdWRhJTIyKSUwQSUwQXByb21wdCUzRCUyMkElMjB3b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2VzJTNEaW5wdXRfaW1hZ2VzJTJDJTIwJTBBJTIwJTIwJTIwJTIwaGVpZ2h0JTNEMTAyNCUyQyUwQSUyMCUyMCUyMCUyMHdpZHRoJTNEMTAyNCUyQyUwQSUyMCUyMCUyMCUyMGd1aWRhbmNlX3NjYWxlJTNEMi41JTJDJTIwJTBBJTIwJTIwJTIwJTIwaW1nX2d1aWRhbmNlX3NjYWxlJTNEMS42JTJDJTBBJTIwJTIwJTIwJTIwZ2VuZXJhdG9yJTNEdG9yY2guR2VuZXJhdG9yKGRldmljZSUzRCUyMmNwdSUyMikubWFudWFsX3NlZWQoNjY2KSUwQSkuaW1hZ2VzJTVCMCU1RCUwQWltYWdlLnNhdmUoJTIyb3V0cHV0LnBuZyUyMik=",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}}),A=new le({props:{title:"Optimization when using multiple images",local:"optimization-when-using-multiple-images",headingTag:"h2"}}),ee=new hl({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/using-diffusers/omnigen.md"}}),{c(){r=i("meta"),se=s(),te=i("p"),ne=s(),c(Z.$$.fragment),ie=s(),f=i("p"),f.textContent=Fe,pe=s(),W=i("ul"),W.innerHTML=$e,me=s(),I=i("p"),I.innerHTML=Le,ce=s(),c(B.$$.fragment),oe=s(),V=i("p"),V.innerHTML=qe,Me=s(),c(X.$$.fragment),de=s(),c(R.$$.fragment),Je=s(),_=i("p"),_.innerHTML=Ae,ye=s(),c(v.$$.fragment),re=s(),T=i("div"),T.innerHTML=Oe,ue=s(),c(Y.$$.fragment),Te=s(),C=i("p"),C.innerHTML=De,ge=s(),c(k.$$.fragment),we=s(),g=i("div"),g.innerHTML=Pe,he=s(),N=i("p"),N.textContent=Ke,Ue=s(),c(x.$$.fragment),be=s(),w=i("div"),w.innerHTML=el,je=s(),c(z.$$.fragment),Ge=s(),S=i("p"),S.textContent=ll,Ze=s(),c(H.$$.fragment),fe=s(),h=i("div"),h.innerHTML=tl,We=s(),E=i("p"),E.textContent=al,Ie=s(),c(Q.$$.fragment),Be=s(),U=i("div"),U.innerHTML=sl,Ve=s(),c(F.$$.fragment),Xe=s(),$=i("p"),$.textContent=nl,Re=s(),c(L.$$.fragment),_e=s(),b=i("div"),b.innerHTML=il,ve=s(),c(q.$$.fragment),Ye=s(),j=i("div"),j.innerHTML=pl,Ce=s(),c(A.$$.fragment),ke=s(),O=i("p"),O.textContent=ml,Ne=s(),D=i("p"),D.textContent=cl,xe=s(),P=i("p"),P.innerHTML=ol,ze=s(),K=i("table"),K.innerHTML=Ml,Se=s(),c(ee.$$.fragment),He=s(),ae=i("p"),this.h()},l(e){const l=gl("svelte-u9bgzb",document.head);r=p(l,"META",{name:!0,content:!0}),l.forEach(t),se=n(e),te=p(e,"P",{}),dl(te).forEach(t),ne=n(e),o(Z.$$.fragment,e),ie=n(e),f=p(e,"P",{"data-svelte-h":!0}),m(f)!=="svelte-wv02ap"&&(f.textContent=Fe),pe=n(e),W=p(e,"UL",{"data-svelte-h":!0}),m(W)!=="svelte-1e1t33d"&&(W.innerHTML=$e),me=n(e),I=p(e,"P",{"data-svelte-h":!0}),m(I)!=="svelte-1frdgki"&&(I.innerHTML=Le),ce=n(e),o(B.$$.fragment,e),oe=n(e),V=p(e,"P",{"data-svelte-h":!0}),m(V)!=="svelte-1ia8sef"&&(V.innerHTML=qe),Me=n(e),o(X.$$.fragment,e),de=n(e),o(R.$$.fragment,e),Je=n(e),_=p(e,"P",{"data-svelte-h":!0}),m(_)!=="svelte-1a87kfl"&&(_.innerHTML=Ae),ye=n(e),o(v.$$.fragment,e),re=n(e),T=p(e,"DIV",{class:!0,"data-svelte-h":!0}),m(T)!=="svelte-uf526e"&&(T.innerHTML=Oe),ue=n(e),o(Y.$$.fragment,e),Te=n(e),C=p(e,"P",{"data-svelte-h":!0}),m(C)!=="svelte-53bqqd"&&(C.innerHTML=De),ge=n(e),o(k.$$.fragment,e),we=n(e),g=p(e,"DIV",{class:!0,"data-svelte-h":!0}),m(g)!=="svelte-ptjo10"&&(g.innerHTML=Pe),he=n(e),N=p(e,"P",{"data-svelte-h":!0}),m(N)!=="svelte-1n0on1x"&&(N.textContent=Ke),Ue=n(e),o(x.$$.fragment,e),be=n(e),w=p(e,"DIV",{class:!0,"data-svelte-h":!0}),m(w)!=="svelte-yas3w7"&&(w.innerHTML=el),je=n(e),o(z.$$.fragment,e),Ge=n(e),S=p(e,"P",{"data-svelte-h":!0}),m(S)!=="svelte-gken8m"&&(S.textContent=ll),Ze=n(e),o(H.$$.fragment,e),fe=n(e),h=p(e,"DIV",{class:!0,"data-svelte-h":!0}),m(h)!=="svelte-n9fk6r"&&(h.innerHTML=tl),We=n(e),E=p(e,"P",{"data-svelte-h":!0}),m(E)!=="svelte-1xps456"&&(E.textContent=al),Ie=n(e),o(Q.$$.fragment,e),Be=n(e),U=p(e,"DIV",{class:!0,"data-svelte-h":!0}),m(U)!=="svelte-17vyas4"&&(U.innerHTML=sl),Ve=n(e),o(F.$$.fragment,e),Xe=n(e),$=p(e,"P",{"data-svelte-h":!0}),m($)!=="svelte-18p79vw"&&($.textContent=nl),Re=n(e),o(L.$$.fragment,e),_e=n(e),b=p(e,"DIV",{class:!0,"data-svelte-h":!0}),m(b)!=="svelte-q7ysaf"&&(b.innerHTML=il),ve=n(e),o(q.$$.fragment,e),Ye=n(e),j=p(e,"DIV",{class:!0,"data-svelte-h":!0}),m(j)!=="svelte-164h1l6"&&(j.innerHTML=pl),Ce=n(e),o(A.$$.fragment,e),ke=n(e),O=p(e,"P",{"data-svelte-h":!0}),m(O)!=="svelte-1y946ts"&&(O.textContent=ml),Ne=n(e),D=p(e,"P",{"data-svelte-h":!0}),m(D)!=="svelte-13qz3jx"&&(D.textContent=cl),xe=n(e),P=p(e,"P",{"data-svelte-h":!0}),m(P)!=="svelte-1twry1x"&&(P.innerHTML=ol),ze=n(e),K=p(e,"TABLE",{"data-svelte-h":!0}),m(K)!=="svelte-1qb6le7"&&(K.innerHTML=Ml),Se=n(e),o(ee.$$.fragment,e),He=n(e),ae=p(e,"P",{}),dl(ae).forEach(t),this.h()},h(){u(r,"name","hf:doc:metadata"),u(r,"content",bl),u(T,"class","flex justify-center"),u(g,"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){wl(document.head,r),a(e,se,l),a(e,te,l),a(e,ne,l),M(Z,e,l),a(e,ie,l),a(e,f,l),a(e,pe,l),a(e,W,l),a(e,me,l),a(e,I,l),a(e,ce,l),M(B,e,l),a(e,oe,l),a(e,V,l),a(e,Me,l),M(X,e,l),a(e,de,l),M(R,e,l),a(e,Je,l),a(e,_,l),a(e,ye,l),M(v,e,l),a(e,re,l),a(e,T,l),a(e,ue,l),M(Y,e,l),a(e,Te,l),a(e,C,l),a(e,ge,l),M(k,e,l),a(e,we,l),a(e,g,l),a(e,he,l),a(e,N,l),a(e,Ue,l),M(x,e,l),a(e,be,l),a(e,w,l),a(e,je,l),M(z,e,l),a(e,Ge,l),a(e,S,l),a(e,Ze,l),M(H,e,l),a(e,fe,l),a(e,h,l),a(e,We,l),a(e,E,l),a(e,Ie,l),M(Q,e,l),a(e,Be,l),a(e,U,l),a(e,Ve,l),M(F,e,l),a(e,Xe,l),a(e,$,l),a(e,Re,l),M(L,e,l),a(e,_e,l),a(e,b,l),a(e,ve,l),M(q,e,l),a(e,Ye,l),a(e,j,l),a(e,Ce,l),M(A,e,l),a(e,ke,l),a(e,O,l),a(e,Ne,l),a(e,D,l),a(e,xe,l),a(e,P,l),a(e,ze,l),a(e,K,l),a(e,Se,l),M(ee,e,l),a(e,He,l),a(e,ae,l),Ee=!0},p:yl,i(e){Ee||(d(Z.$$.fragment,e),d(B.$$.fragment,e),d(X.$$.fragment,e),d(R.$$.fragment,e),d(v.$$.fragment,e),d(Y.$$.fragment,e),d(k.$$.fragment,e),d(x.$$.fragment,e),d(z.$$.fragment,e),d(H.$$.fragment,e),d(Q.$$.fragment,e),d(F.$$.fragment,e),d(L.$$.fragment,e),d(q.$$.fragment,e),d(A.$$.fragment,e),d(ee.$$.fragment,e),Ee=!0)},o(e){J(Z.$$.fragment,e),J(B.$$.fragment,e),J(X.$$.fragment,e),J(R.$$.fragment,e),J(v.$$.fragment,e),J(Y.$$.fragment,e),J(k.$$.fragment,e),J(x.$$.fragment,e),J(z.$$.fragment,e),J(H.$$.fragment,e),J(Q.$$.fragment,e),J(F.$$.fragment,e),J(L.$$.fragment,e),J(q.$$.fragment,e),J(A.$$.fragment,e),J(ee.$$.fragment,e),Ee=!1},d(e){e&&(t(se),t(te),t(ne),t(ie),t(f),t(pe),t(W),t(me),t(I),t(ce),t(oe),t(V),t(Me),t(de),t(Je),t(_),t(ye),t(re),t(T),t(ue),t(Te),t(C),t(ge),t(we),t(g),t(he),t(N),t(Ue),t(be),t(w),t(je),t(Ge),t(S),t(Ze),t(fe),t(h),t(We),t(E),t(Ie),t(Be),t(U),t(Ve),t(Xe),t($),t(Re),t(_e),t(b),t(ve),t(Ye),t(j),t(Ce),t(ke),t(O),t(Ne),t(D),t(xe),t(P),t(ze),t(K),t(Se),t(He),t(ae)),t(r),y(Z,e),y(B,e),y(X,e),y(R,e),y(v,e),y(Y,e),y(k,e),y(x,e),y(z,e),y(H,e),y(Q,e),y(F,e),y(L,e),y(q,e),y(A,e),y(ee,e)}}}const bl='{"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 jl(Qe){return rl(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Il extends ul{constructor(r){super(),Tl(this,r,jl,Ul,Jl,{})}}export{Il as component};
