import{s as Tt,o as Lt,n as wt}from"../chunks/scheduler.8c3d61f6.js";import{S as yt,i as Mt,g as s,s as o,r as h,A as It,h as r,f as n,c as a,j as me,u as _,x as m,k as pe,y as f,a as i,v as b,d as x,t as v,w}from"../chunks/index.da70eac4.js";import{T as $t}from"../chunks/Tip.1d9b8c37.js";import{D as ze}from"../chunks/Docstring.6b390b9a.js";import{C as Be}from"../chunks/CodeBlock.00a903b3.js";import{E as Pt}from"../chunks/ExampleCodeBlock.db12be95.js";import{H as Qe,E as kt}from"../chunks/EditOnGithub.1e64e623.js";function Jt(ie){let l,y='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(){l=s("p"),l.innerHTML=y},l(d){l=r(d,"P",{"data-svelte-h":!0}),m(l)!=="svelte-w7r39y"&&(l.innerHTML=y)},m(d,u){i(d,l,u)},p:wt,d(d){d&&n(l)}}}function Ut(ie){let l,y="Examples:",d,u,T;return u=new Be({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwTHVtaW5hVGV4dDJJbWdQaXBlbGluZSUwQSUwQXBpcGUlMjAlM0QlMjBMdW1pbmFUZXh0MkltZ1BpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJBbHBoYS1WTExNJTJGTHVtaW5hLU5leHQtU0ZULWRpZmZ1c2VycyUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guYmZsb2F0MTYlMEEpLmN1ZGEoKSUwQSUyMyUyMEVuYWJsZSUyMG1lbW9yeSUyMG9wdGltaXphdGlvbnMuJTBBcGlwZS5lbmFibGVfbW9kZWxfY3B1X29mZmxvYWQoKSUwQSUwQXByb21wdCUyMCUzRCUyMCUyMlVwcGVyJTIwYm9keSUyMG9mJTIwYSUyMHlvdW5nJTIwd29tYW4lMjBpbiUyMGElMjBWaWN0b3JpYW4tZXJhJTIwb3V0Zml0JTIwd2l0aCUyMGJyYXNzJTIwZ29nZ2xlcyUyMGFuZCUyMGxlYXRoZXIlMjBzdHJhcHMuJTIwQmFja2dyb3VuZCUyMHNob3dzJTIwYW4lMjBpbmR1c3RyaWFsJTIwcmV2b2x1dGlvbiUyMGNpdHlzY2FwZSUyMHdpdGglMjBzbW9reSUyMHNraWVzJTIwYW5kJTIwdGFsbCUyQyUyMG1ldGFsJTIwc3RydWN0dXJlcyUyMiUwQWltYWdlJTIwJTNEJTIwcGlwZShwcm9tcHQpLmltYWdlcyU1QjAlNUQ=",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> LuminaText2ImgPipeline

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = LuminaText2ImgPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;Alpha-VLLM/Lumina-Next-SFT-diffusers&quot;</span>, torch_dtype=torch.bfloat16
<span class="hljs-meta">... </span>).cuda()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Enable memory optimizations.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.enable_model_cpu_offload()

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;Upper body of a young woman in a Victorian-era outfit with brass goggles and leather straps. Background shows an industrial revolution cityscape with smoky skies and tall, metal structures&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = pipe(prompt).images[<span class="hljs-number">0</span>]`,wrap:!1}}),{c(){l=s("p"),l.textContent=y,d=o(),h(u.$$.fragment)},l(p){l=r(p,"P",{"data-svelte-h":!0}),m(l)!=="svelte-kvfsh7"&&(l.textContent=y),d=a(p),_(u.$$.fragment,p)},m(p,L){i(p,l,L),i(p,d,L),b(u,p,L),T=!0},p:wt,i(p){T||(x(u.$$.fragment,p),T=!0)},o(p){v(u.$$.fragment,p),T=!1},d(p){p&&(n(l),n(d)),w(u,p)}}}function Ct(ie){let l,y,d,u,T,p,L,Oe='<img src="https://github.com/Alpha-VLLM/Lumina-T2X/assets/54879512/9f52eabb-07dc-4881-8257-6d8a5f2a0a5a" alt="concepts"/>',de,J,Ke='<a href="https://github.com/Alpha-VLLM/Lumina-T2X/blob/main/assets/lumina-next.pdf" rel="nofollow">Lumina-Next : Making Lumina-T2X Stronger and Faster with Next-DiT</a> from Alpha-VLLM, OpenGVLab, Shanghai AI Laboratory.',ce,U,et="The abstract from the paper is:",ue,C,tt='<em>Lumina-T2X is a nascent family of Flow-based Large Diffusion Transformers (Flag-DiT) that establishes a unified framework for transforming noise into various modalities, such as images and videos, conditioned on text instructions. Despite its promising capabilities, Lumina-T2X still encounters challenges including training instability, slow inference, and extrapolation artifacts. In this paper, we present Lumina-Next, an improved version of Lumina-T2X, showcasing stronger generation performance with increased training and inference efficiency. We begin with a comprehensive analysis of the Flag-DiT architecture and identify several suboptimal components, which we address by introducing the Next-DiT architecture with 3D RoPE and sandwich normalizations. To enable better resolution extrapolation, we thoroughly compare different context extrapolation methods applied to text-to-image generation with 3D RoPE, and propose Frequency- and Time-Aware Scaled RoPE tailored for diffusion transformers. Additionally, we introduce a sigmoid time discretization schedule to reduce sampling steps in solving the Flow ODE and the Context Drop method to merge redundant visual tokens for faster network evaluation, effectively boosting the overall sampling speed. Thanks to these improvements, Lumina-Next not only improves the quality and efficiency of basic text-to-image generation but also demonstrates superior resolution extrapolation capabilities and multilingual generation using decoder-based LLMs as the text encoder, all in a zero-shot manner. To further validate Lumina-Next as a versatile generative framework, we instantiate it on diverse tasks including visual recognition, multi-view, audio, music, and point cloud generation, showcasing strong performance across these domains. By releasing all codes and model weights at <a href="https://github.com/Alpha-VLLM/Lumina-T2X" rel="nofollow">https://github.com/Alpha-VLLM/Lumina-T2X</a>, we aim to advance the development of next-generation generative AI capable of universal modeling.</em>',fe,j,nt="<strong>Highlights</strong>: Lumina-Next is a next-generation Diffusion Transformer that significantly enhances text-to-image generation, multilingual generation, and multitask performance by introducing the Next-DiT architecture, 3D RoPE, and frequency- and time-aware RoPE, among other improvements.",ge,W,it="Lumina-Next has the following components:",he,G,ot="<li>It improves sampling efficiency with fewer and faster Steps.</li> <li>It uses a Next-DiT as a transformer backbone with Sandwichnorm 3D RoPE, and Grouped-Query Attention.</li> <li>It uses a Frequency- and Time-Aware Scaled RoPE.</li>",_e,be,xe,H,at='<a href="https://arxiv.org/abs/2405.05945" rel="nofollow">Lumina-T2X: Transforming Text into Any Modality, Resolution, and Duration via Flow-based Large Diffusion Transformers</a> from Alpha-VLLM, OpenGVLab, Shanghai AI Laboratory.',ve,V,st="The abstract from the paper is:",we,N,rt="<em>Sora unveils the potential of scaling Diffusion Transformer for generating photorealistic images and videos at arbitrary resolutions, aspect ratios, and durations, yet it still lacks sufficient implementation details. In this technical report, we introduce the Lumina-T2X family - a series of Flow-based Large Diffusion Transformers (Flag-DiT) equipped with zero-initialized attention, as a unified framework designed to transform noise into images, videos, multi-view 3D objects, and audio clips conditioned on text instructions. By tokenizing the latent spatial-temporal space and incorporating learnable placeholders such as [nextline] and [nextframe] tokens, Lumina-T2X seamlessly unifies the representations of different modalities across various spatial-temporal resolutions. This unified approach enables training within a single framework for different modalities and allows for flexible generation of multimodal data at any resolution, aspect ratio, and length during inference. Advanced techniques like RoPE, RMSNorm, and flow matching enhance the stability, flexibility, and scalability of Flag-DiT, enabling models of Lumina-T2X to scale up to 7 billion parameters and extend the context window to 128K tokens. This is particularly beneficial for creating ultra-high-definition images with our Lumina-T2I model and long 720p videos with our Lumina-T2V model. Remarkably, Lumina-T2I, powered by a 5-billion-parameter Flag-DiT, requires only 35% of the training computational costs of a 600-million-parameter naive DiT. Our further comprehensive analysis underscores Lumina-T2X’s preliminary capability in resolution extrapolation, high-resolution editing, generating consistent 3D views, and synthesizing videos with seamless transitions. We expect that the open-sourcing of Lumina-T2X will further foster creativity, transparency, and diversity in the generative AI community.</em>",Te,X,lt='You can find the original codebase at <a href="https://github.com/Alpha-VLLM/Lumina-T2X" rel="nofollow">Alpha-VLLM</a> and all the available checkpoints at <a href="https://huggingface.co/collections/Alpha-VLLM/lumina-family-66423205bedb81171fd0644b" rel="nofollow">Alpha-VLLM Lumina Family</a>.',Le,Z,mt="<strong>Highlights</strong>: Lumina-T2X supports Any Modality, Resolution, and Duration.",ye,D,pt="Lumina-T2X has the following components:",Me,B,dt="<li>It uses a Flow-based Large Diffusion Transformer as the backbone</li> <li>It supports different any modalities with one backbone and corresponding encoder, decoder.</li>",Ie,A,ct='This pipeline was contributed by <a href="https://github.com/PommesPeter" rel="nofollow">PommesPeter</a>. The original codebase can be found <a href="https://github.com/Alpha-VLLM/Lumina-T2X" rel="nofollow">here</a>. The original weights can be found under <a href="https://huggingface.co/Alpha-VLLM" rel="nofollow">hf.co/Alpha-VLLM</a>.',$e,$,Pe,S,ke,R,ut='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.',Je,F,ft="First, load the pipeline:",Ue,q,Ce,E,gt="Then change the memory layout of the pipelines <code>transformer</code> and <code>vae</code> components to <code>torch.channels-last</code>:",je,Y,We,z,ht="Finally, compile the components and run inference:",Ge,Q,He,O,Ve,c,K,Ae,oe,_t="Pipeline for text-to-image generation using Lumina-T2I.",Se,ae,bt=`This model inherits from <a href="/docs/diffusers/v0.30.3/en/api/pipelines/overview#diffusers.DiffusionPipeline">DiffusionPipeline</a>. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`,Re,M,ee,Fe,se,xt="Function invoked when calling the pipeline for generation.",qe,P,Ee,k,te,Ye,re,vt="Encodes the prompt into text encoder hidden states.",Ne,ne,Xe,le,Ze;return T=new Qe({props:{title:"Lumina-T2X",local:"lumina-t2x",headingTag:"h1"}}),$=new $t({props:{$$slots:{default:[Jt]},$$scope:{ctx:ie}}}),S=new Qe({props:{title:"Inference (Text-to-Image)",local:"inference-text-to-image",headingTag:"h3"}}),q=new Be({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEx1bWluYVRleHQySW1nUGlwZWxpbmUlMEFpbXBvcnQlMjB0b3JjaCUwQSUwQXBpcGVsaW5lJTIwJTNEJTIwTHVtaW5hVGV4dDJJbWdQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTBBJTA5JTIyQWxwaGEtVkxMTSUyRkx1bWluYS1OZXh0LVNGVC1kaWZmdXNlcnMlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmJmbG9hdDE2JTBBKS50byglMjJjdWRhJTIyKQ==",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> LuminaText2ImgPipeline
<span class="hljs-keyword">import</span> torch

pipeline = LuminaText2ImgPipeline.from_pretrained(
	<span class="hljs-string">&quot;Alpha-VLLM/Lumina-Next-SFT-diffusers&quot;</span>, torch_dtype=torch.bfloat16
).to(<span class="hljs-string">&quot;cuda&quot;</span>)`,wrap:!1}}),Y=new Be({props:{code:"cGlwZWxpbmUudHJhbnNmb3JtZXIudG8obWVtb3J5X2Zvcm1hdCUzRHRvcmNoLmNoYW5uZWxzX2xhc3QpJTBBcGlwZWxpbmUudmFlLnRvKG1lbW9yeV9mb3JtYXQlM0R0b3JjaC5jaGFubmVsc19sYXN0KQ==",highlighted:`pipeline.transformer.to(memory_format=torch.channels_last)
pipeline.vae.to(memory_format=torch.channels_last)`,wrap:!1}}),Q=new Be({props:{code:"cGlwZWxpbmUudHJhbnNmb3JtZXIlMjAlM0QlMjB0b3JjaC5jb21waWxlKHBpcGVsaW5lLnRyYW5zZm9ybWVyJTJDJTIwbW9kZSUzRCUyMm1heC1hdXRvdHVuZSUyMiUyQyUyMGZ1bGxncmFwaCUzRFRydWUpJTBBcGlwZWxpbmUudmFlLmRlY29kZSUyMCUzRCUyMHRvcmNoLmNvbXBpbGUocGlwZWxpbmUudmFlLmRlY29kZSUyQyUyMG1vZGUlM0QlMjJtYXgtYXV0b3R1bmUlMjIlMkMlMjBmdWxsZ3JhcGglM0RUcnVlKSUwQSUwQWltYWdlJTIwJTNEJTIwcGlwZWxpbmUocHJvbXB0JTNEJTIyVXBwZXIlMjBib2R5JTIwb2YlMjBhJTIweW91bmclMjB3b21hbiUyMGluJTIwYSUyMFZpY3Rvcmlhbi1lcmElMjBvdXRmaXQlMjB3aXRoJTIwYnJhc3MlMjBnb2dnbGVzJTIwYW5kJTIwbGVhdGhlciUyMHN0cmFwcy4lMjBCYWNrZ3JvdW5kJTIwc2hvd3MlMjBhbiUyMGluZHVzdHJpYWwlMjByZXZvbHV0aW9uJTIwY2l0eXNjYXBlJTIwd2l0aCUyMHNtb2t5JTIwc2tpZXMlMjBhbmQlMjB0YWxsJTJDJTIwbWV0YWwlMjBzdHJ1Y3R1cmVzJTIyKS5pbWFnZXMlNUIwJTVE",highlighted:`pipeline.transformer = torch.<span class="hljs-built_in">compile</span>(pipeline.transformer, mode=<span class="hljs-string">&quot;max-autotune&quot;</span>, fullgraph=<span class="hljs-literal">True</span>)
pipeline.vae.decode = torch.<span class="hljs-built_in">compile</span>(pipeline.vae.decode, mode=<span class="hljs-string">&quot;max-autotune&quot;</span>, fullgraph=<span class="hljs-literal">True</span>)

image = pipeline(prompt=<span class="hljs-string">&quot;Upper body of a young woman in a Victorian-era outfit with brass goggles and leather straps. Background shows an industrial revolution cityscape with smoky skies and tall, metal structures&quot;</span>).images[<span class="hljs-number">0</span>]`,wrap:!1}}),O=new Qe({props:{title:"LuminaText2ImgPipeline",local:"diffusers.LuminaText2ImgPipeline",headingTag:"h2"}}),K=new ze({props:{name:"class diffusers.LuminaText2ImgPipeline",anchor:"diffusers.LuminaText2ImgPipeline",parameters:[{name:"transformer",val:": LuminaNextDiT2DModel"},{name:"scheduler",val:": FlowMatchEulerDiscreteScheduler"},{name:"vae",val:": AutoencoderKL"},{name:"text_encoder",val:": AutoModel"},{name:"tokenizer",val:": AutoTokenizer"}],parametersDescription:[{anchor:"diffusers.LuminaText2ImgPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/v0.30.3/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.LuminaText2ImgPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>AutoModel</code>) &#x2014;
Frozen text-encoder. Lumina-T2I uses
<a href="https://huggingface.co/docs/transformers/model_doc/t5#transformers.AutoModel" rel="nofollow">T5</a>, specifically the
<a href="https://huggingface.co/Alpha-VLLM/tree/main/t5-v1_1-xxl" rel="nofollow">t5-v1_1-xxl</a> variant.`,name:"text_encoder"},{anchor:"diffusers.LuminaText2ImgPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>AutoModel</code>) &#x2014;
Tokenizer of class
<a href="https://huggingface.co/docs/transformers/model_doc/t5#transformers.AutoModel" rel="nofollow">AutoModel</a>.`,name:"tokenizer"},{anchor:"diffusers.LuminaText2ImgPipeline.transformer",description:`<strong>transformer</strong> (<a href="/docs/diffusers/v0.30.3/en/api/models/transformer2d#diffusers.Transformer2DModel">Transformer2DModel</a>) &#x2014;
A text conditioned <code>Transformer2DModel</code> to denoise the encoded image latents.`,name:"transformer"},{anchor:"diffusers.LuminaText2ImgPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/v0.30.3/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a>) &#x2014;
A scheduler to be used in combination with <code>transformer</code> to denoise the encoded image latents.`,name:"scheduler"}],source:"https://github.com/huggingface/diffusers/blob/v0.30.3/src/diffusers/pipelines/lumina/pipeline_lumina.py#L127"}}),ee=new ze({props:{name:"__call__",anchor:"diffusers.LuminaText2ImgPipeline.__call__",parameters:[{name:"prompt",val:": Union = None"},{name:"width",val:": Optional = None"},{name:"height",val:": Optional = None"},{name:"num_inference_steps",val:": int = 30"},{name:"timesteps",val:": List = None"},{name:"guidance_scale",val:": float = 4.0"},{name:"negative_prompt",val:": Union = None"},{name:"sigmas",val:": List = None"},{name:"num_images_per_prompt",val:": Optional = 1"},{name:"generator",val:": Union = None"},{name:"latents",val:": Optional = None"},{name:"prompt_embeds",val:": Optional = None"},{name:"negative_prompt_embeds",val:": Optional = None"},{name:"prompt_attention_mask",val:": Optional = None"},{name:"negative_prompt_attention_mask",val:": Optional = None"},{name:"output_type",val:": Optional = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"clean_caption",val:": bool = True"},{name:"max_sequence_length",val:": int = 256"},{name:"scaling_watershed",val:": Optional = 1.0"},{name:"proportional_attn",val:": Optional = True"}],parametersDescription:[{anchor:"diffusers.LuminaText2ImgPipeline.__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 not defined, one has to pass <code>prompt_embeds</code>.
instead.`,name:"prompt"},{anchor:"diffusers.LuminaText2ImgPipeline.__call__.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the image generation. If not defined, one has to pass
<code>negative_prompt_embeds</code> instead. Ignored when not using guidance (i.e., ignored if <code>guidance_scale</code> is
less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.LuminaText2ImgPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 30) &#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.LuminaText2ImgPipeline.__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.LuminaText2ImgPipeline.__call__.sigmas",description:`<strong>sigmas</strong> (<code>List[float]</code>, <em>optional</em>) &#x2014;
Custom sigmas to use for the denoising process with schedulers which support a <code>sigmas</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.`,name:"sigmas"},{anchor:"diffusers.LuminaText2ImgPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 4.0) &#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.LuminaText2ImgPipeline.__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.LuminaText2ImgPipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size) &#x2014;
The height in pixels of the generated image.`,name:"height"},{anchor:"diffusers.LuminaText2ImgPipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size) &#x2014;
The width in pixels of the generated image.`,name:"width"},{anchor:"diffusers.LuminaText2ImgPipeline.__call__.eta",description:`<strong>eta</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Corresponds to parameter eta (&#x3B7;) in the DDIM paper: <a href="https://arxiv.org/abs/2010.02502" rel="nofollow">https://arxiv.org/abs/2010.02502</a>. Only applies to
<a href="/docs/diffusers/v0.30.3/en/api/schedulers/ddim#diffusers.DDIMScheduler">schedulers.DDIMScheduler</a>, will be ignored for others.`,name:"eta"},{anchor:"diffusers.LuminaText2ImgPipeline.__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.LuminaText2ImgPipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.Tensor</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.LuminaText2ImgPipeline.__call__.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.Tensor</code>, <em>optional</em>) &#x2014;
Pre-generated text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting. If not
provided, text embeddings will be generated from <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.LuminaText2ImgPipeline.__call__.prompt_attention_mask",description:"<strong>prompt_attention_mask</strong> (<code>torch.Tensor</code>, <em>optional</em>) &#x2014; Pre-generated attention mask for text embeddings.",name:"prompt_attention_mask"},{anchor:"diffusers.LuminaText2ImgPipeline.__call__.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.Tensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative text embeddings. For Lumina-T2I this negative prompt should be &quot;&quot;. If not
provided, negative_prompt_embeds will be generated from <code>negative_prompt</code> input argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.LuminaText2ImgPipeline.__call__.negative_prompt_attention_mask",description:`<strong>negative_prompt_attention_mask</strong> (<code>torch.Tensor</code>, <em>optional</em>) &#x2014;
Pre-generated attention mask for negative text embeddings.`,name:"negative_prompt_attention_mask"},{anchor:"diffusers.LuminaText2ImgPipeline.__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.LuminaText2ImgPipeline.__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.stable_diffusion.IFPipelineOutput</code> instead of a plain tuple.`,name:"return_dict"},{anchor:"diffusers.LuminaText2ImgPipeline.__call__.clean_caption",description:`<strong>clean_caption</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to clean the caption before creating embeddings. Requires <code>beautifulsoup4</code> and <code>ftfy</code> to
be installed. If the dependencies are not installed, the embeddings will be created from the raw
prompt.`,name:"clean_caption"},{anchor:"diffusers.LuminaText2ImgPipeline.__call__.max_sequence_length",description:`<strong>max_sequence_length</strong> (<code>int</code> defaults to 120) &#x2014;
Maximum sequence length to use with the <code>prompt</code>.`,name:"max_sequence_length"},{anchor:"diffusers.LuminaText2ImgPipeline.__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.LuminaText2ImgPipeline.__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"}],source:"https://github.com/huggingface/diffusers/blob/v0.30.3/src/diffusers/pipelines/lumina/pipeline_lumina.py#L612",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>If <code>return_dict</code> is <code>True</code>, <a
  href="/docs/diffusers/v0.30.3/en/api/pipelines/consistency_models#diffusers.ImagePipelineOutput"
>ImagePipelineOutput</a> is returned, otherwise a <code>tuple</code> is
returned where the first element is a list with the generated images</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/diffusers/v0.30.3/en/api/pipelines/consistency_models#diffusers.ImagePipelineOutput"
>ImagePipelineOutput</a> or <code>tuple</code></p>
`}}),P=new Pt({props:{anchor:"diffusers.LuminaText2ImgPipeline.__call__.example",$$slots:{default:[Ut]},$$scope:{ctx:ie}}}),te=new ze({props:{name:"encode_prompt",anchor:"diffusers.LuminaText2ImgPipeline.encode_prompt",parameters:[{name:"prompt",val:": Union"},{name:"do_classifier_free_guidance",val:": bool = True"},{name:"negative_prompt",val:": Union = None"},{name:"num_images_per_prompt",val:": int = 1"},{name:"device",val:": Optional = None"},{name:"prompt_embeds",val:": Optional = None"},{name:"negative_prompt_embeds",val:": Optional = None"},{name:"prompt_attention_mask",val:": Optional = None"},{name:"negative_prompt_attention_mask",val:": Optional = None"},{name:"clean_caption",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.LuminaText2ImgPipeline.encode_prompt.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
prompt to be encoded`,name:"prompt"},{anchor:"diffusers.LuminaText2ImgPipeline.encode_prompt.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt not to guide the image generation. If not defined, one has to pass <code>negative_prompt_embeds</code>
instead. Ignored when not using guidance (i.e., ignored if <code>guidance_scale</code> is less than <code>1</code>). For
Lumina-T2I, this should be &quot;&quot;.`,name:"negative_prompt"},{anchor:"diffusers.LuminaText2ImgPipeline.encode_prompt.do_classifier_free_guidance",description:`<strong>do_classifier_free_guidance</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
whether to use classifier free guidance or not`,name:"do_classifier_free_guidance"},{anchor:"diffusers.LuminaText2ImgPipeline.encode_prompt.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
number of images that should be generated per prompt
device &#x2014; (<code>torch.device</code>, <em>optional</em>):
torch device to place the resulting embeddings on`,name:"num_images_per_prompt"},{anchor:"diffusers.LuminaText2ImgPipeline.encode_prompt.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.Tensor</code>, <em>optional</em>) &#x2014;
Pre-generated text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting. If not
provided, text embeddings will be generated from <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.LuminaText2ImgPipeline.encode_prompt.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.Tensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative text embeddings. For Lumina-T2I, it&#x2019;s should be the embeddings of the &quot;&quot; string.`,name:"negative_prompt_embeds"},{anchor:"diffusers.LuminaText2ImgPipeline.encode_prompt.clean_caption",description:`<strong>clean_caption</strong> (<code>bool</code>, defaults to <code>False</code>) &#x2014;
If <code>True</code>, the function will preprocess and clean the provided caption before encoding.`,name:"clean_caption"},{anchor:"diffusers.LuminaText2ImgPipeline.encode_prompt.max_sequence_length",description:"<strong>max_sequence_length</strong> (<code>int</code>, defaults to 256) &#x2014; Maximum sequence length to use for the prompt.",name:"max_sequence_length"}],source:"https://github.com/huggingface/diffusers/blob/v0.30.3/src/diffusers/pipelines/lumina/pipeline_lumina.py#L252"}}),ne=new kt({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/pipelines/lumina.md"}}),{c(){l=s("meta"),y=o(),d=s("p"),u=o(),h(T.$$.fragment),p=o(),L=s("p"),L.innerHTML=Oe,de=o(),J=s("p"),J.innerHTML=Ke,ce=o(),U=s("p"),U.textContent=et,ue=o(),C=s("p"),C.innerHTML=tt,fe=o(),j=s("p"),j.innerHTML=nt,ge=o(),W=s("p"),W.textContent=it,he=o(),G=s("ul"),G.innerHTML=ot,_e=o(),be=s("hr"),xe=o(),H=s("p"),H.innerHTML=at,ve=o(),V=s("p"),V.textContent=st,we=o(),N=s("p"),N.innerHTML=rt,Te=o(),X=s("p"),X.innerHTML=lt,Le=o(),Z=s("p"),Z.innerHTML=mt,ye=o(),D=s("p"),D.textContent=pt,Me=o(),B=s("ul"),B.innerHTML=dt,Ie=o(),A=s("p"),A.innerHTML=ct,$e=o(),h($.$$.fragment),Pe=o(),h(S.$$.fragment),ke=o(),R=s("p"),R.innerHTML=ut,Je=o(),F=s("p"),F.textContent=ft,Ue=o(),h(q.$$.fragment),Ce=o(),E=s("p"),E.innerHTML=gt,je=o(),h(Y.$$.fragment),We=o(),z=s("p"),z.textContent=ht,Ge=o(),h(Q.$$.fragment),He=o(),h(O.$$.fragment),Ve=o(),c=s("div"),h(K.$$.fragment),Ae=o(),oe=s("p"),oe.textContent=_t,Se=o(),ae=s("p"),ae.innerHTML=bt,Re=o(),M=s("div"),h(ee.$$.fragment),Fe=o(),se=s("p"),se.textContent=xt,qe=o(),h(P.$$.fragment),Ee=o(),k=s("div"),h(te.$$.fragment),Ye=o(),re=s("p"),re.textContent=vt,Ne=o(),h(ne.$$.fragment),Xe=o(),le=s("p"),this.h()},l(e){const t=It("svelte-u9bgzb",document.head);l=r(t,"META",{name:!0,content:!0}),t.forEach(n),y=a(e),d=r(e,"P",{}),me(d).forEach(n),u=a(e),_(T.$$.fragment,e),p=a(e),L=r(e,"P",{"data-svelte-h":!0}),m(L)!=="svelte-z320hd"&&(L.innerHTML=Oe),de=a(e),J=r(e,"P",{"data-svelte-h":!0}),m(J)!=="svelte-15xt6tn"&&(J.innerHTML=Ke),ce=a(e),U=r(e,"P",{"data-svelte-h":!0}),m(U)!=="svelte-1cwsb16"&&(U.textContent=et),ue=a(e),C=r(e,"P",{"data-svelte-h":!0}),m(C)!=="svelte-zv9btz"&&(C.innerHTML=tt),fe=a(e),j=r(e,"P",{"data-svelte-h":!0}),m(j)!=="svelte-1mx7f6l"&&(j.innerHTML=nt),ge=a(e),W=r(e,"P",{"data-svelte-h":!0}),m(W)!=="svelte-1vdt8mw"&&(W.textContent=it),he=a(e),G=r(e,"UL",{"data-svelte-h":!0}),m(G)!=="svelte-iwyd0p"&&(G.innerHTML=ot),_e=a(e),be=r(e,"HR",{}),xe=a(e),H=r(e,"P",{"data-svelte-h":!0}),m(H)!=="svelte-1sewgiu"&&(H.innerHTML=at),ve=a(e),V=r(e,"P",{"data-svelte-h":!0}),m(V)!=="svelte-1cwsb16"&&(V.textContent=st),we=a(e),N=r(e,"P",{"data-svelte-h":!0}),m(N)!=="svelte-1n6lvl2"&&(N.innerHTML=rt),Te=a(e),X=r(e,"P",{"data-svelte-h":!0}),m(X)!=="svelte-1d4lw4f"&&(X.innerHTML=lt),Le=a(e),Z=r(e,"P",{"data-svelte-h":!0}),m(Z)!=="svelte-xfq9w9"&&(Z.innerHTML=mt),ye=a(e),D=r(e,"P",{"data-svelte-h":!0}),m(D)!=="svelte-1imnafj"&&(D.textContent=pt),Me=a(e),B=r(e,"UL",{"data-svelte-h":!0}),m(B)!=="svelte-1cqh1e9"&&(B.innerHTML=dt),Ie=a(e),A=r(e,"P",{"data-svelte-h":!0}),m(A)!=="svelte-14qpphk"&&(A.innerHTML=ct),$e=a(e),_($.$$.fragment,e),Pe=a(e),_(S.$$.fragment,e),ke=a(e),R=r(e,"P",{"data-svelte-h":!0}),m(R)!=="svelte-iekg51"&&(R.innerHTML=ut),Je=a(e),F=r(e,"P",{"data-svelte-h":!0}),m(F)!=="svelte-jub7f1"&&(F.textContent=ft),Ue=a(e),_(q.$$.fragment,e),Ce=a(e),E=r(e,"P",{"data-svelte-h":!0}),m(E)!=="svelte-4294wb"&&(E.innerHTML=gt),je=a(e),_(Y.$$.fragment,e),We=a(e),z=r(e,"P",{"data-svelte-h":!0}),m(z)!=="svelte-9i4prs"&&(z.textContent=ht),Ge=a(e),_(Q.$$.fragment,e),He=a(e),_(O.$$.fragment,e),Ve=a(e),c=r(e,"DIV",{class:!0});var g=me(c);_(K.$$.fragment,g),Ae=a(g),oe=r(g,"P",{"data-svelte-h":!0}),m(oe)!=="svelte-1ennvvi"&&(oe.textContent=_t),Se=a(g),ae=r(g,"P",{"data-svelte-h":!0}),m(ae)!=="svelte-1hljmsw"&&(ae.innerHTML=bt),Re=a(g),M=r(g,"DIV",{class:!0});var I=me(M);_(ee.$$.fragment,I),Fe=a(I),se=r(I,"P",{"data-svelte-h":!0}),m(se)!=="svelte-v78lg8"&&(se.textContent=xt),qe=a(I),_(P.$$.fragment,I),I.forEach(n),Ee=a(g),k=r(g,"DIV",{class:!0});var De=me(k);_(te.$$.fragment,De),Ye=a(De),re=r(De,"P",{"data-svelte-h":!0}),m(re)!=="svelte-16q0ax1"&&(re.textContent=vt),De.forEach(n),g.forEach(n),Ne=a(e),_(ne.$$.fragment,e),Xe=a(e),le=r(e,"P",{}),me(le).forEach(n),this.h()},h(){pe(l,"name","hf:doc:metadata"),pe(l,"content",jt),pe(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),pe(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),pe(c,"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){f(document.head,l),i(e,y,t),i(e,d,t),i(e,u,t),b(T,e,t),i(e,p,t),i(e,L,t),i(e,de,t),i(e,J,t),i(e,ce,t),i(e,U,t),i(e,ue,t),i(e,C,t),i(e,fe,t),i(e,j,t),i(e,ge,t),i(e,W,t),i(e,he,t),i(e,G,t),i(e,_e,t),i(e,be,t),i(e,xe,t),i(e,H,t),i(e,ve,t),i(e,V,t),i(e,we,t),i(e,N,t),i(e,Te,t),i(e,X,t),i(e,Le,t),i(e,Z,t),i(e,ye,t),i(e,D,t),i(e,Me,t),i(e,B,t),i(e,Ie,t),i(e,A,t),i(e,$e,t),b($,e,t),i(e,Pe,t),b(S,e,t),i(e,ke,t),i(e,R,t),i(e,Je,t),i(e,F,t),i(e,Ue,t),b(q,e,t),i(e,Ce,t),i(e,E,t),i(e,je,t),b(Y,e,t),i(e,We,t),i(e,z,t),i(e,Ge,t),b(Q,e,t),i(e,He,t),b(O,e,t),i(e,Ve,t),i(e,c,t),b(K,c,null),f(c,Ae),f(c,oe),f(c,Se),f(c,ae),f(c,Re),f(c,M),b(ee,M,null),f(M,Fe),f(M,se),f(M,qe),b(P,M,null),f(c,Ee),f(c,k),b(te,k,null),f(k,Ye),f(k,re),i(e,Ne,t),b(ne,e,t),i(e,Xe,t),i(e,le,t),Ze=!0},p(e,[t]){const g={};t&2&&(g.$$scope={dirty:t,ctx:e}),$.$set(g);const I={};t&2&&(I.$$scope={dirty:t,ctx:e}),P.$set(I)},i(e){Ze||(x(T.$$.fragment,e),x($.$$.fragment,e),x(S.$$.fragment,e),x(q.$$.fragment,e),x(Y.$$.fragment,e),x(Q.$$.fragment,e),x(O.$$.fragment,e),x(K.$$.fragment,e),x(ee.$$.fragment,e),x(P.$$.fragment,e),x(te.$$.fragment,e),x(ne.$$.fragment,e),Ze=!0)},o(e){v(T.$$.fragment,e),v($.$$.fragment,e),v(S.$$.fragment,e),v(q.$$.fragment,e),v(Y.$$.fragment,e),v(Q.$$.fragment,e),v(O.$$.fragment,e),v(K.$$.fragment,e),v(ee.$$.fragment,e),v(P.$$.fragment,e),v(te.$$.fragment,e),v(ne.$$.fragment,e),Ze=!1},d(e){e&&(n(y),n(d),n(u),n(p),n(L),n(de),n(J),n(ce),n(U),n(ue),n(C),n(fe),n(j),n(ge),n(W),n(he),n(G),n(_e),n(be),n(xe),n(H),n(ve),n(V),n(we),n(N),n(Te),n(X),n(Le),n(Z),n(ye),n(D),n(Me),n(B),n(Ie),n(A),n($e),n(Pe),n(ke),n(R),n(Je),n(F),n(Ue),n(Ce),n(E),n(je),n(We),n(z),n(Ge),n(He),n(Ve),n(c),n(Ne),n(Xe),n(le)),n(l),w(T,e),w($,e),w(S,e),w(q,e),w(Y,e),w(Q,e),w(O,e),w(K),w(ee),w(P),w(te),w(ne,e)}}}const jt='{"title":"Lumina-T2X","local":"lumina-t2x","sections":[{"title":"Inference (Text-to-Image)","local":"inference-text-to-image","sections":[],"depth":3},{"title":"LuminaText2ImgPipeline","local":"diffusers.LuminaText2ImgPipeline","sections":[],"depth":2}],"depth":1}';function Wt(ie){return Lt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Bt extends yt{constructor(l){super(),Mt(this,l,Wt,Ct,Tt,{})}}export{Bt as component};
