import{s as yt,o as Tt,n as wt}from"../chunks/scheduler.8c3d61f6.js";import{S as vt,i as Gt,g as o,s as i,r as g,A as Jt,h as r,f as n,c as a,j as x,u as f,x as m,k as I,y as s,a as l,v as h,d as _,t as b,w as M}from"../chunks/index.da70eac4.js";import{T as jt}from"../chunks/Tip.1d9b8c37.js";import{D as ne}from"../chunks/Docstring.6b390b9a.js";import{C as Oe}from"../chunks/CodeBlock.00a903b3.js";import{E as $t}from"../chunks/ExampleCodeBlock.db12be95.js";import{H as tt,E as xt}from"../chunks/EditOnGithub.1e64e623.js";function It(ie){let p,j='Make sure to check out the Schedulers <a href="../../using-diffusers/schedulers.md">guide</a> to learn how to explore the tradeoff between scheduler speed and quality, and see the <a href="../../using-diffusers/loading.md#reuse-a-pipeline">reuse components across pipelines</a> section to learn how to efficiently load the same components into multiple pipelines.';return{c(){p=o("p"),p.innerHTML=j},l(w){p=r(w,"P",{"data-svelte-h":!0}),m(p)!=="svelte-w7r39y"&&(p.innerHTML=j)},m(w,y){l(w,p,y)},p:wt,d(w){w&&n(p)}}}function kt(ie){let p,j="Examples:",w,y,T;return y=new Oe({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwT21uaUdlblBpcGVsaW5lJTBBJTBBcGlwZSUyMCUzRCUyME9tbmlHZW5QaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTIyU2hpdGFvJTJGT21uaUdlbi12MS1kaWZmdXNlcnMlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmJmbG9hdDE2KSUwQXBpcGUudG8oJTIyY3VkYSUyMiklMEFwcm9tcHQlMjAlM0QlMjAlMjJBJTIwY2F0JTIwaG9sZGluZyUyMGElMjBzaWduJTIwdGhhdCUyMHNheXMlMjBoZWxsbyUyMHdvcmxkJTIyJTBBJTIzJTIwRGVwZW5kaW5nJTIwb24lMjB0aGUlMjB2YXJpYW50JTIwYmVpbmclMjB1c2VkJTJDJTIwdGhlJTIwcGlwZWxpbmUlMjBjYWxsJTIwd2lsbCUyMHNsaWdodGx5JTIwdmFyeS4lMEElMjMlMjBSZWZlciUyMHRvJTIwdGhlJTIwcGlwZWxpbmUlMjBkb2N1bWVudGF0aW9uJTIwZm9yJTIwbW9yZSUyMGRldGFpbHMuJTBBaW1hZ2UlMjAlM0QlMjBwaXBlKHByb21wdCUyQyUyMG51bV9pbmZlcmVuY2Vfc3RlcHMlM0Q1MCUyQyUyMGd1aWRhbmNlX3NjYWxlJTNEMi41KS5pbWFnZXMlNUIwJTVEJTBBaW1hZ2Uuc2F2ZSglMjJ0MmkucG5nJTIyKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> OmniGenPipeline

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = OmniGenPipeline.from_pretrained(<span class="hljs-string">&quot;Shitao/OmniGen-v1-diffusers&quot;</span>, torch_dtype=torch.bfloat16)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;A cat holding a sign that says hello world&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Depending on the variant being used, the pipeline call will slightly vary.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Refer to the pipeline documentation for more details.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = pipe(prompt, num_inference_steps=<span class="hljs-number">50</span>, guidance_scale=<span class="hljs-number">2.5</span>).images[<span class="hljs-number">0</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>image.save(<span class="hljs-string">&quot;t2i.png&quot;</span>)`,wrap:!1}}),{c(){p=o("p"),p.textContent=j,w=i(),g(y.$$.fragment)},l(u){p=r(u,"P",{"data-svelte-h":!0}),m(p)!=="svelte-kvfsh7"&&(p.textContent=j),w=a(u),f(y.$$.fragment,u)},m(u,G){l(u,p,G),l(u,w,G),h(y,u,G),T=!0},p:wt,i(u){T||(_(y.$$.fragment,u),T=!0)},o(u){b(y.$$.fragment,u),T=!1},d(u){u&&(n(p),n(w)),M(y,u)}}}function Ut(ie){let p,j,w,y,T,u,G,nt='<a href="https://arxiv.org/pdf/2409.11340" rel="nofollow">OmniGen: Unified Image Generation</a> from BAAI, by Shitao Xiao, Yueze Wang, Junjie Zhou, Huaying Yuan, Xingrun Xing, Ruiran Yan, Chaofan Li, Shuting Wang, Tiejun Huang, Zheng Liu.',he,P,it="The abstract from the paper is:",_e,O,at=`<em>The emergence of Large Language Models (LLMs) has unified language
generation tasks and revolutionized human-machine interaction.
However, in the realm of image generation, a unified model capable of handling various tasks
within a single framework remains largely unexplored. In
this work, we introduce OmniGen, a new diffusion model
for unified image generation. OmniGen is characterized
by the following features: 1) Unification: OmniGen not
only demonstrates text-to-image generation capabilities but
also inherently supports various downstream tasks, such
as image editing, subject-driven generation, and visual conditional generation. 2) Simplicity: The architecture of
OmniGen is highly simplified, eliminating the need for additional plugins. Moreover, compared to existing diffusion
models, it is more user-friendly and can complete complex
tasks end-to-end through instructions without the need for
extra intermediate steps, greatly simplifying the image generation workflow. 3) Knowledge Transfer: Benefit from
learning in a unified format, OmniGen effectively transfers
knowledge across different tasks, manages unseen tasks and
domains, and exhibits novel capabilities. We also explore
the model’s reasoning capabilities and potential applications of the chain-of-thought mechanism.
This work represents the first attempt at a general-purpose image generation model,
and we will release our resources at https:
//github.com/VectorSpaceLab/OmniGen to foster future advancements.</em>`,be,k,Me,V,st='This pipeline was contributed by <a href="https://github.com/staoxiao" rel="nofollow">staoxiao</a>. The original codebase can be found <a href="https://github.com/VectorSpaceLab/OmniGen" rel="nofollow">here</a>. The original weights can be found under <a href="https://huggingface.co/Shitao/OmniGen-v1" rel="nofollow">hf.co/shitao</a>.',we,z,ye,E,lt='Use <a href="https://huggingface.co/docs/diffusers/main/en/tutorials/fast_diffusion#torchcompile" rel="nofollow"><code>torch.compile</code></a> to reduce the inference latency.',Te,L,ot="First, load the pipeline:",ve,Y,Ge,H,rt=`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.`,Je,R,je,S,pt=`OmniGen supports for 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 ‘use_input_image_size_as_output’ to keep the edited image the same size as the original image.`,$e,X,xe,A,Ie,d,F,Ve,ae,dt="The OmniGen pipeline for multimodal-to-image generation.",ze,se,ct='Reference: <a href="https://arxiv.org/pdf/2409.11340" rel="nofollow">https://arxiv.org/pdf/2409.11340</a>',Ee,v,N,Le,le,mt="Function invoked when calling the pipeline for generation.",Ye,U,He,oe,ut=`Returns: <a href="/docs/diffusers/pr_10148/en/api/pipelines/latent_diffusion#diffusers.ImagePipelineOutput">ImagePipelineOutput</a> or <code>tuple</code>:
If <code>return_dict</code> is <code>True</code>, <a href="/docs/diffusers/pr_10148/en/api/pipelines/latent_diffusion#diffusers.ImagePipelineOutput">ImagePipelineOutput</a> is returned, otherwise a <code>tuple</code> is returned
where the first element is a list with the generated images.`,Re,Z,D,Se,re,gt=`Disable sliced VAE decoding. If <code>enable_vae_slicing</code> was previously enabled, this method will go back to
computing decoding in one step.`,Xe,W,Q,Ae,pe,ft=`Disable tiled VAE decoding. If <code>enable_vae_tiling</code> was previously enabled, this method will go back to
computing decoding in one step.`,Fe,B,q,Ne,de,ht=`Enable sliced VAE decoding. When this option is enabled, the VAE will split the input tensor in slices to
compute decoding in several steps. This is useful to save some memory and allow larger batch sizes.`,De,C,K,Qe,ce,_t=`Enable tiled VAE decoding. When this option is enabled, the VAE will split the input tensor into tiles to
compute decoding and encoding in several steps. This is useful for saving a large amount of memory and to allow
processing larger images.`,qe,$,ee,Ke,me,bt="get the continues embedding of input images by VAE",et,ue,Mt="Returns: torch.Tensor",ke,te,Ue,fe,Ze;return T=new tt({props:{title:"OmniGen",local:"omnigen",headingTag:"h1"}}),k=new jt({props:{$$slots:{default:[It]},$$scope:{ctx:ie}}}),z=new tt({props:{title:"Inference",local:"inference",headingTag:"h2"}}),Y=new Oe({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwT21uaUdlblBpcGVsaW5lJTBBcGlwZSUyMCUzRCUyME9tbmlHZW5QaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIyU2hpdGFvJTJGT21uaUdlbi12MS1kaWZmdXNlcnMlMjIlMkMlMEElMjAlMjAlMjAlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmJmbG9hdDE2JTBBKSUwQXBpcGUudG8oJTIyY3VkYSUyMik=",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>)`,wrap:!1}}),R=new Oe({props:{code:"cHJvbXB0JTIwJTNEJTIwJTIyUmVhbGlzdGljJTIwcGhvdG8uJTIwQSUyMHlvdW5nJTIwd29tYW4lMjBzaXRzJTIwb24lMjBhJTIwc29mYSUyQyUyMGhvbGRpbmclMjBhJTIwYm9vayUyMGFuZCUyMGZhY2luZyUyMHRoZSUyMGNhbWVyYS4lMjBTaGUlMjB3ZWFycyUyMGRlbGljYXRlJTIwc2lsdmVyJTIwaG9vcCUyMGVhcnJpbmdzJTIwYWRvcm5lZCUyMHdpdGglMjB0aW55JTJDJTIwc3BhcmtsaW5nJTIwZGlhbW9uZHMlMjB0aGF0JTIwY2F0Y2glMjB0aGUlMjBsaWdodCUyQyUyMHdpdGglMjBoZXIlMjBsb25nJTIwY2hlc3RudXQlMjBoYWlyJTIwY2FzY2FkaW5nJTIwb3ZlciUyMGhlciUyMHNob3VsZGVycy4lMjBIZXIlMjBleWVzJTIwYXJlJTIwZm9jdXNlZCUyMGFuZCUyMGdlbnRsZSUyQyUyMGZyYW1lZCUyMGJ5JTIwbG9uZyUyQyUyMGRhcmslMjBsYXNoZXMuJTIwU2hlJTIwaXMlMjBkcmVzc2VkJTIwaW4lMjBhJTIwY296eSUyMGNyZWFtJTIwc3dlYXRlciUyQyUyMHdoaWNoJTIwY29tcGxlbWVudHMlMjBoZXIlMjB3YXJtJTJDJTIwaW52aXRpbmclMjBzbWlsZS4lMjBCZWhpbmQlMjBoZXIlMkMlMjB0aGVyZSUyMGlzJTIwYSUyMHRhYmxlJTIwd2l0aCUyMGElMjBjdXAlMjBvZiUyMHdhdGVyJTIwaW4lMjBhJTIwc2xlZWslMkMlMjBtaW5pbWFsaXN0JTIwYmx1ZSUyMG11Zy4lMjBUaGUlMjBiYWNrZ3JvdW5kJTIwaXMlMjBhJTIwc2VyZW5lJTIwaW5kb29yJTIwc2V0dGluZyUyMHdpdGglMjBzb2Z0JTIwbmF0dXJhbCUyMGxpZ2h0JTIwZmlsdGVyaW5nJTIwdGhyb3VnaCUyMGElMjB3aW5kb3clMkMlMjBhZG9ybmVkJTIwd2l0aCUyMHRhc3RlZnVsJTIwYXJ0JTIwYW5kJTIwZmxvd2VycyUyQyUyMGNyZWF0aW5nJTIwYSUyMGNvenklMjBhbmQlMjBwZWFjZWZ1bCUyMGFtYmlhbmNlLiUyMDRLJTJDJTIwSEQuJTIyJTBBaW1hZ2UlMjAlM0QlMjBwaXBlKCUwQSUyMCUyMCUyMCUyMHByb21wdCUzRHByb21wdCUyQyUwQSUyMCUyMCUyMCUyMGhlaWdodCUzRDEwMjQlMkMlMEElMjAlMjAlMjAlMjB3aWR0aCUzRDEwMjQlMkMlMEElMjAlMjAlMjAlMjBndWlkYW5jZV9zY2FsZSUzRDMlMkMlMEElMjAlMjAlMjAlMjBnZW5lcmF0b3IlM0R0b3JjaC5HZW5lcmF0b3IoZGV2aWNlJTNEJTIyY3B1JTIyKS5tYW51YWxfc2VlZCgxMTEpJTJDJTBBKS5pbWFnZXMlNUIwJTVEJTBBaW1hZ2U=",highlighted:`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`,wrap:!1}}),X=new Oe({props:{code:"cHJvbXB0JTNEJTIyJTNDaW1nJTNFJTNDJTdDaW1hZ2VfMSU3QyUzRSUzQyUyRmltZyUzRSUyMFJlbW92ZSUyMHRoZSUyMHdvbWFuJ3MlMjBlYXJyaW5ncy4lMjBSZXBsYWNlJTIwdGhlJTIwbXVnJTIwd2l0aCUyMGElMjBjbGVhciUyMGdsYXNzJTIwZmlsbGVkJTIwd2l0aCUyMHNwYXJrbGluZyUyMGljZWQlMjBjb2xhLiUyMiUwQWlucHV0X2ltYWdlcyUzRCU1QmxvYWRfaW1hZ2UoJTIyaHR0cHMlM0ElMkYlMkZyYXcuZ2l0aHVidXNlcmNvbnRlbnQuY29tJTJGVmVjdG9yU3BhY2VMYWIlMkZPbW5pR2VuJTJGbWFpbiUyRmltZ3MlMkZkb2NzX2ltZyUyRnQyaV93b21hbl93aXRoX2Jvb2sucG5nJTIyKSU1RCUwQWltYWdlJTIwJTNEJTIwcGlwZSglMEElMjAlMjAlMjAlMjBwcm9tcHQlM0Rwcm9tcHQlMkMlMjAlMEElMjAlMjAlMjAlMjBpbnB1dF9pbWFnZXMlM0RpbnB1dF9pbWFnZXMlMkMlMjAlMEElMjAlMjAlMjAlMjBndWlkYW5jZV9zY2FsZSUzRDIlMkMlMjAlMEElMjAlMjAlMjAlMjBpbWdfZ3VpZGFuY2Vfc2NhbGUlM0QxLjYlMkMlMEElMjAlMjAlMjAlMjB1c2VfaW5wdXRfaW1hZ2Vfc2l6ZV9hc19vdXRwdXQlM0RUcnVlJTJDJTBBJTIwJTIwJTIwJTIwZ2VuZXJhdG9yJTNEdG9yY2guR2VuZXJhdG9yKGRldmljZSUzRCUyMmNwdSUyMikubWFudWFsX3NlZWQoMjIyKSkuaW1hZ2VzJTVCMCU1RCUwQWltYWdl",highlighted:`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`,wrap:!1}}),A=new tt({props:{title:"OmniGenPipeline",local:"diffusers.OmniGenPipeline",headingTag:"h2"}}),F=new ne({props:{name:"class diffusers.OmniGenPipeline",anchor:"diffusers.OmniGenPipeline",parameters:[{name:"transformer",val:": OmniGenTransformer2DModel"},{name:"scheduler",val:": FlowMatchEulerDiscreteScheduler"},{name:"vae",val:": AutoencoderKL"},{name:"tokenizer",val:": LlamaTokenizer"}],parametersDescription:[{anchor:"diffusers.OmniGenPipeline.transformer",description:`<strong>transformer</strong> (<a href="/docs/diffusers/pr_10148/en/api/models/omnigen_transformer#diffusers.OmniGenTransformer2DModel">OmniGenTransformer2DModel</a>) &#x2014;
Autoregressive Transformer architecture for OmniGen.`,name:"transformer"},{anchor:"diffusers.OmniGenPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/pr_10148/en/api/schedulers/flow_match_euler_discrete#diffusers.FlowMatchEulerDiscreteScheduler">FlowMatchEulerDiscreteScheduler</a>) &#x2014;
A scheduler to be used in combination with <code>transformer</code> to denoise the encoded image latents.`,name:"scheduler"},{anchor:"diffusers.OmniGenPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/pr_10148/en/api/models/autoencoderkl#diffusers.AutoencoderKL">AutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.OmniGenPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>LlamaTokenizer</code>) &#x2014;
Text tokenizer of class.
<a href="https://huggingface.co/docs/transformers/main/model_doc/llama#transformers.LlamaTokenizer" rel="nofollow">LlamaTokenizer</a>.`,name:"tokenizer"}],source:"https://github.com/huggingface/diffusers/blob/vr_10148/src/diffusers/pipelines/omnigen/pipeline_omnigen.py#L123"}}),N=new ne({props:{name:"__call__",anchor:"diffusers.OmniGenPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]]"},{name:"input_images",val:": typing.Union[typing.List[str], typing.List[PIL.Image.Image], typing.List[typing.List[str]], typing.List[typing.List[PIL.Image.Image]], NoneType] = None"},{name:"height",val:": typing.Optional[int] = None"},{name:"width",val:": typing.Optional[int] = None"},{name:"num_inference_steps",val:": int = 50"},{name:"max_input_image_size",val:": int = 1024"},{name:"timesteps",val:": typing.List[int] = None"},{name:"guidance_scale",val:": float = 2.5"},{name:"img_guidance_scale",val:": float = 1.6"},{name:"use_kv_cache",val:": bool = True"},{name:"offload_kv_cache",val:": bool = True"},{name:"offload_transformer_block",val:": bool = False"},{name:"use_input_image_size_as_output",val:": bool = False"},{name:"num_images_per_prompt",val:": typing.Optional[int] = 1"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None"},{name:"latents",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"attention_kwargs",val:": typing.Optional[typing.Dict[str, typing.Any]] = None"},{name:"callback_on_step_end",val:": typing.Optional[typing.Callable[[int, int, typing.Dict], NoneType]] = None"},{name:"callback_on_step_end_tensor_inputs",val:": typing.List[str] = ['latents']"},{name:"max_sequence_length",val:": int = 120000"}],parametersDescription:[{anchor:"diffusers.OmniGenPipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to guide the image generation.
If the input includes images, need to add placeholders <code>&lt;img&gt;&lt;|image_i|&gt;&lt;/img&gt;</code> in the prompt to indicate the position of the i-th images.`,name:"prompt"},{anchor:"diffusers.OmniGenPipeline.__call__.input_images",description:`<strong>input_images</strong> (<code>List[str]</code> or <code>List[List[str]]</code>, <em>optional</em>) &#x2014;
The list of input images. We will replace the &#x201D;&lt;|image_i|&gt;&#x201D; in prompt with the i-th image in list.`,name:"input_images"},{anchor:"diffusers.OmniGenPipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size * self.vae_scale_factor) &#x2014;
The height in pixels of the generated image. This is set to 1024 by default for the best results.`,name:"height"},{anchor:"diffusers.OmniGenPipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size * self.vae_scale_factor) &#x2014;
The width in pixels of the generated image. This is set to 1024 by default for the best results.`,name:"width"},{anchor:"diffusers.OmniGenPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 50) &#x2014;
The number of denoising steps. More denoising steps usually lead to a higher quality image at the
expense of slower inference.`,name:"num_inference_steps"},{anchor:"diffusers.OmniGenPipeline.__call__.max_input_image_size",description:`<strong>max_input_image_size</strong> (<code>int</code>, <em>optional</em>, defaults to 1024) &#x2014;
the maximum size of input image, which will be used to crop the input image to the maximum size`,name:"max_input_image_size"},{anchor:"diffusers.OmniGenPipeline.__call__.timesteps",description:`<strong>timesteps</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Custom timesteps to use for the denoising process with schedulers which support a <code>timesteps</code> argument
in their <code>set_timesteps</code> method. If not defined, the default behavior when <code>num_inference_steps</code> is
passed will be used. Must be in descending order.`,name:"timesteps"},{anchor:"diffusers.OmniGenPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 2.5) &#x2014;
Guidance scale as defined in <a href="https://arxiv.org/abs/2207.12598" rel="nofollow">Classifier-Free Diffusion Guidance</a>.
<code>guidance_scale</code> is defined as <code>w</code> of equation 2. of <a href="https://arxiv.org/pdf/2205.11487.pdf" rel="nofollow">Imagen
Paper</a>. Guidance scale is enabled by setting <code>guidance_scale &gt; 1</code>. Higher guidance scale encourages to generate images that are closely linked to the text <code>prompt</code>,
usually at the expense of lower image quality.`,name:"guidance_scale"},{anchor:"diffusers.OmniGenPipeline.__call__.img_guidance_scale",description:`<strong>img_guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 1.6) &#x2014;
Defined as equation 3 in <a href="https://arxiv.org/pdf/2211.09800" rel="nofollow">Instrucpix2pix</a>.`,name:"img_guidance_scale"},{anchor:"diffusers.OmniGenPipeline.__call__.use_kv_cache",description:`<strong>use_kv_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to True) &#x2014;
enable kv cache to speed up the inference`,name:"use_kv_cache"},{anchor:"diffusers.OmniGenPipeline.__call__.offload_kv_cache",description:`<strong>offload_kv_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to True) &#x2014;
offload the cached key and value to cpu, which can save memory but slow down the generation silightly`,name:"offload_kv_cache"},{anchor:"diffusers.OmniGenPipeline.__call__.offload_transformer_block",description:`<strong>offload_transformer_block</strong> (<code>bool</code>, <em>optional</em>, defaults to False) &#x2014;
offload the transformer layers to cpu, which can save memory but slow down the generation`,name:"offload_transformer_block"},{anchor:"diffusers.OmniGenPipeline.__call__.use_input_image_size_as_output",description:`<strong>use_input_image_size_as_output</strong> (bool, defaults to False) &#x2014;
whether to use the input image size as the output image size, which can be used for single-image input, e.g., image editing task`,name:"use_input_image_size_as_output"},{anchor:"diffusers.OmniGenPipeline.__call__.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of images to generate per prompt.`,name:"num_images_per_prompt"},{anchor:"diffusers.OmniGenPipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code> or <code>List[torch.Generator]</code>, <em>optional</em>) &#x2014;
One or a list of <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow">torch generator(s)</a>
to make generation deterministic.`,name:"generator"},{anchor:"diffusers.OmniGenPipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated noisy latents, sampled from a Gaussian distribution, to be used as inputs for image
generation. Can be used to tweak the same generation with different prompts. If not provided, a latents
tensor will ge generated by sampling using the supplied random <code>generator</code>.`,name:"latents"},{anchor:"diffusers.OmniGenPipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pil&quot;</code>) &#x2014;
The output format of the generate image. Choose between
<a href="https://pillow.readthedocs.io/en/stable/" rel="nofollow">PIL</a>: <code>PIL.Image.Image</code> or <code>np.array</code>.`,name:"output_type"},{anchor:"diffusers.OmniGenPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <code>~pipelines.flux.FluxPipelineOutput</code> instead of a plain tuple.`,name:"return_dict"},{anchor:"diffusers.OmniGenPipeline.__call__.attention_kwargs",description:`<strong>attention_kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
A kwargs dictionary that if specified is passed along to the <code>AttentionProcessor</code> as defined under
<code>self.processor</code> in
<a href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention_processor.py" rel="nofollow">diffusers.models.attention_processor</a>.`,name:"attention_kwargs"},{anchor:"diffusers.OmniGenPipeline.__call__.callback_on_step_end",description:`<strong>callback_on_step_end</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
A function that calls at the end of each denoising steps during the inference. The function is called
with the following arguments: <code>callback_on_step_end(self: DiffusionPipeline, step: int, timestep: int, callback_kwargs: Dict)</code>. <code>callback_kwargs</code> will include a list of all tensors as specified by
<code>callback_on_step_end_tensor_inputs</code>.`,name:"callback_on_step_end"},{anchor:"diffusers.OmniGenPipeline.__call__.callback_on_step_end_tensor_inputs",description:`<strong>callback_on_step_end_tensor_inputs</strong> (<code>List</code>, <em>optional</em>) &#x2014;
The list of tensor inputs for the <code>callback_on_step_end</code> function. The tensors specified in the list
will be passed as <code>callback_kwargs</code> argument. You will only be able to include variables listed in the
<code>._callback_tensor_inputs</code> attribute of your pipeline class.`,name:"callback_on_step_end_tensor_inputs"},{anchor:"diffusers.OmniGenPipeline.__call__.max_sequence_length",description:"<strong>max_sequence_length</strong> (<code>int</code> defaults to 512) &#x2014; Maximum sequence length to use with the <code>prompt</code>.",name:"max_sequence_length"}],source:"https://github.com/huggingface/diffusers/blob/vr_10148/src/diffusers/pipelines/omnigen/pipeline_omnigen.py#L339"}}),U=new $t({props:{anchor:"diffusers.OmniGenPipeline.__call__.example",$$slots:{default:[kt]},$$scope:{ctx:ie}}}),D=new ne({props:{name:"disable_vae_slicing",anchor:"diffusers.OmniGenPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/vr_10148/src/diffusers/pipelines/omnigen/pipeline_omnigen.py#L262"}}),Q=new ne({props:{name:"disable_vae_tiling",anchor:"diffusers.OmniGenPipeline.disable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/vr_10148/src/diffusers/pipelines/omnigen/pipeline_omnigen.py#L277"}}),q=new ne({props:{name:"enable_vae_slicing",anchor:"diffusers.OmniGenPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/vr_10148/src/diffusers/pipelines/omnigen/pipeline_omnigen.py#L255"}}),K=new ne({props:{name:"enable_vae_tiling",anchor:"diffusers.OmniGenPipeline.enable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/vr_10148/src/diffusers/pipelines/omnigen/pipeline_omnigen.py#L269"}}),ee=new ne({props:{name:"encod_input_iamges",anchor:"diffusers.OmniGenPipeline.encod_input_iamges",parameters:[{name:"input_pixel_values",val:": typing.List[torch.Tensor]"},{name:"device",val:": typing.Optional[torch.device] = None"},{name:"dtype",val:": typing.Optional[torch.dtype] = None"}],parametersDescription:[{anchor:"diffusers.OmniGenPipeline.encod_input_iamges.input_pixel_values",description:"<strong>input_pixel_values</strong> &#x2014; normlized pixel of input images",name:"input_pixel_values"},{anchor:"diffusers.OmniGenPipeline.encod_input_iamges.device",description:"<strong>device</strong> &#x2014;",name:"device"}],source:"https://github.com/huggingface/diffusers/blob/vr_10148/src/diffusers/pipelines/omnigen/pipeline_omnigen.py#L177"}}),te=new xt({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/pipelines/omnigen.md"}}),{c(){p=o("meta"),j=i(),w=o("p"),y=i(),g(T.$$.fragment),u=i(),G=o("p"),G.innerHTML=nt,he=i(),P=o("p"),P.textContent=it,_e=i(),O=o("p"),O.innerHTML=at,be=i(),g(k.$$.fragment),Me=i(),V=o("p"),V.innerHTML=st,we=i(),g(z.$$.fragment),ye=i(),E=o("p"),E.innerHTML=lt,Te=i(),L=o("p"),L.textContent=ot,ve=i(),g(Y.$$.fragment),Ge=i(),H=o("p"),H.innerHTML=rt,Je=i(),g(R.$$.fragment),je=i(),S=o("p"),S.innerHTML=pt,$e=i(),g(X.$$.fragment),xe=i(),g(A.$$.fragment),Ie=i(),d=o("div"),g(F.$$.fragment),Ve=i(),ae=o("p"),ae.textContent=dt,ze=i(),se=o("p"),se.innerHTML=ct,Ee=i(),v=o("div"),g(N.$$.fragment),Le=i(),le=o("p"),le.textContent=mt,Ye=i(),g(U.$$.fragment),He=i(),oe=o("p"),oe.innerHTML=ut,Re=i(),Z=o("div"),g(D.$$.fragment),Se=i(),re=o("p"),re.innerHTML=gt,Xe=i(),W=o("div"),g(Q.$$.fragment),Ae=i(),pe=o("p"),pe.innerHTML=ft,Fe=i(),B=o("div"),g(q.$$.fragment),Ne=i(),de=o("p"),de.textContent=ht,De=i(),C=o("div"),g(K.$$.fragment),Qe=i(),ce=o("p"),ce.textContent=_t,qe=i(),$=o("div"),g(ee.$$.fragment),Ke=i(),me=o("p"),me.textContent=bt,et=i(),ue=o("p"),ue.textContent=Mt,ke=i(),g(te.$$.fragment),Ue=i(),fe=o("p"),this.h()},l(e){const t=Jt("svelte-u9bgzb",document.head);p=r(t,"META",{name:!0,content:!0}),t.forEach(n),j=a(e),w=r(e,"P",{}),x(w).forEach(n),y=a(e),f(T.$$.fragment,e),u=a(e),G=r(e,"P",{"data-svelte-h":!0}),m(G)!=="svelte-1842wmz"&&(G.innerHTML=nt),he=a(e),P=r(e,"P",{"data-svelte-h":!0}),m(P)!=="svelte-1cwsb16"&&(P.textContent=it),_e=a(e),O=r(e,"P",{"data-svelte-h":!0}),m(O)!=="svelte-rsyogj"&&(O.innerHTML=at),be=a(e),f(k.$$.fragment,e),Me=a(e),V=r(e,"P",{"data-svelte-h":!0}),m(V)!=="svelte-1yp0gqw"&&(V.innerHTML=st),we=a(e),f(z.$$.fragment,e),ye=a(e),E=r(e,"P",{"data-svelte-h":!0}),m(E)!=="svelte-iekg51"&&(E.innerHTML=lt),Te=a(e),L=r(e,"P",{"data-svelte-h":!0}),m(L)!=="svelte-jub7f1"&&(L.textContent=ot),ve=a(e),f(Y.$$.fragment,e),Ge=a(e),H=r(e,"P",{"data-svelte-h":!0}),m(H)!=="svelte-1a87kfl"&&(H.innerHTML=rt),Je=a(e),f(R.$$.fragment,e),je=a(e),S=r(e,"P",{"data-svelte-h":!0}),m(S)!=="svelte-nyhece"&&(S.innerHTML=pt),$e=a(e),f(X.$$.fragment,e),xe=a(e),f(A.$$.fragment,e),Ie=a(e),d=r(e,"DIV",{class:!0});var c=x(d);f(F.$$.fragment,c),Ve=a(c),ae=r(c,"P",{"data-svelte-h":!0}),m(ae)!=="svelte-mbik9p"&&(ae.textContent=dt),ze=a(c),se=r(c,"P",{"data-svelte-h":!0}),m(se)!=="svelte-86snvu"&&(se.innerHTML=ct),Ee=a(c),v=r(c,"DIV",{class:!0});var J=x(v);f(N.$$.fragment,J),Le=a(J),le=r(J,"P",{"data-svelte-h":!0}),m(le)!=="svelte-v78lg8"&&(le.textContent=mt),Ye=a(J),f(U.$$.fragment,J),He=a(J),oe=r(J,"P",{"data-svelte-h":!0}),m(oe)!=="svelte-1i995z0"&&(oe.innerHTML=ut),J.forEach(n),Re=a(c),Z=r(c,"DIV",{class:!0});var We=x(Z);f(D.$$.fragment,We),Se=a(We),re=r(We,"P",{"data-svelte-h":!0}),m(re)!=="svelte-1s3c06i"&&(re.innerHTML=gt),We.forEach(n),Xe=a(c),W=r(c,"DIV",{class:!0});var Be=x(W);f(Q.$$.fragment,Be),Ae=a(Be),pe=r(Be,"P",{"data-svelte-h":!0}),m(pe)!=="svelte-pkn4ui"&&(pe.innerHTML=ft),Be.forEach(n),Fe=a(c),B=r(c,"DIV",{class:!0});var Ce=x(B);f(q.$$.fragment,Ce),Ne=a(Ce),de=r(Ce,"P",{"data-svelte-h":!0}),m(de)!=="svelte-14bnrb6"&&(de.textContent=ht),Ce.forEach(n),De=a(c),C=r(c,"DIV",{class:!0});var Pe=x(C);f(K.$$.fragment,Pe),Qe=a(Pe),ce=r(Pe,"P",{"data-svelte-h":!0}),m(ce)!=="svelte-1xwrf7t"&&(ce.textContent=_t),Pe.forEach(n),qe=a(c),$=r(c,"DIV",{class:!0});var ge=x($);f(ee.$$.fragment,ge),Ke=a(ge),me=r(ge,"P",{"data-svelte-h":!0}),m(me)!=="svelte-gzhrwm"&&(me.textContent=bt),et=a(ge),ue=r(ge,"P",{"data-svelte-h":!0}),m(ue)!=="svelte-1c3z8g4"&&(ue.textContent=Mt),ge.forEach(n),c.forEach(n),ke=a(e),f(te.$$.fragment,e),Ue=a(e),fe=r(e,"P",{}),x(fe).forEach(n),this.h()},h(){I(p,"name","hf:doc:metadata"),I(p,"content",Zt),I(v,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(d,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,t){s(document.head,p),l(e,j,t),l(e,w,t),l(e,y,t),h(T,e,t),l(e,u,t),l(e,G,t),l(e,he,t),l(e,P,t),l(e,_e,t),l(e,O,t),l(e,be,t),h(k,e,t),l(e,Me,t),l(e,V,t),l(e,we,t),h(z,e,t),l(e,ye,t),l(e,E,t),l(e,Te,t),l(e,L,t),l(e,ve,t),h(Y,e,t),l(e,Ge,t),l(e,H,t),l(e,Je,t),h(R,e,t),l(e,je,t),l(e,S,t),l(e,$e,t),h(X,e,t),l(e,xe,t),h(A,e,t),l(e,Ie,t),l(e,d,t),h(F,d,null),s(d,Ve),s(d,ae),s(d,ze),s(d,se),s(d,Ee),s(d,v),h(N,v,null),s(v,Le),s(v,le),s(v,Ye),h(U,v,null),s(v,He),s(v,oe),s(d,Re),s(d,Z),h(D,Z,null),s(Z,Se),s(Z,re),s(d,Xe),s(d,W),h(Q,W,null),s(W,Ae),s(W,pe),s(d,Fe),s(d,B),h(q,B,null),s(B,Ne),s(B,de),s(d,De),s(d,C),h(K,C,null),s(C,Qe),s(C,ce),s(d,qe),s(d,$),h(ee,$,null),s($,Ke),s($,me),s($,et),s($,ue),l(e,ke,t),h(te,e,t),l(e,Ue,t),l(e,fe,t),Ze=!0},p(e,[t]){const c={};t&2&&(c.$$scope={dirty:t,ctx:e}),k.$set(c);const J={};t&2&&(J.$$scope={dirty:t,ctx:e}),U.$set(J)},i(e){Ze||(_(T.$$.fragment,e),_(k.$$.fragment,e),_(z.$$.fragment,e),_(Y.$$.fragment,e),_(R.$$.fragment,e),_(X.$$.fragment,e),_(A.$$.fragment,e),_(F.$$.fragment,e),_(N.$$.fragment,e),_(U.$$.fragment,e),_(D.$$.fragment,e),_(Q.$$.fragment,e),_(q.$$.fragment,e),_(K.$$.fragment,e),_(ee.$$.fragment,e),_(te.$$.fragment,e),Ze=!0)},o(e){b(T.$$.fragment,e),b(k.$$.fragment,e),b(z.$$.fragment,e),b(Y.$$.fragment,e),b(R.$$.fragment,e),b(X.$$.fragment,e),b(A.$$.fragment,e),b(F.$$.fragment,e),b(N.$$.fragment,e),b(U.$$.fragment,e),b(D.$$.fragment,e),b(Q.$$.fragment,e),b(q.$$.fragment,e),b(K.$$.fragment,e),b(ee.$$.fragment,e),b(te.$$.fragment,e),Ze=!1},d(e){e&&(n(j),n(w),n(y),n(u),n(G),n(he),n(P),n(_e),n(O),n(be),n(Me),n(V),n(we),n(ye),n(E),n(Te),n(L),n(ve),n(Ge),n(H),n(Je),n(je),n(S),n($e),n(xe),n(Ie),n(d),n(ke),n(Ue),n(fe)),n(p),M(T,e),M(k,e),M(z,e),M(Y,e),M(R,e),M(X,e),M(A,e),M(F),M(N),M(U),M(D),M(Q),M(q),M(K),M(ee),M(te,e)}}}const Zt='{"title":"OmniGen","local":"omnigen","sections":[{"title":"Inference","local":"inference","sections":[],"depth":2},{"title":"OmniGenPipeline","local":"diffusers.OmniGenPipeline","sections":[],"depth":2}],"depth":1}';function Wt(ie){return Tt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Lt extends vt{constructor(p){super(),Gt(this,p,Wt,Ut,yt,{})}}export{Lt as component};
