import{s as xt,o as vt,n as bt}from"../chunks/scheduler.8c3d61f6.js";import{S as wt,i as Tt,g as s,s as o,r as h,A as yt,h as r,f as n,c as a,j as le,u as _,x as p,k as pe,y as f,a as i,v as b,d as x,t as v,w}from"../chunks/index.589a98e8.js";import{T as Lt}from"../chunks/Tip.42aa8582.js";import{D as Ee}from"../chunks/Docstring.27406313.js";import{C as Xe}from"../chunks/CodeBlock.36627b28.js";import{E as Mt}from"../chunks/ExampleCodeBlock.3dc467a7.js";import{H as Ye,E as It}from"../chunks/EditOnGithub.e5a8d9cb.js";function $t(ne){let l,L='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=L},l(d){l=r(d,"P",{"data-svelte-h":!0}),p(l)!=="svelte-w7r39y"&&(l.innerHTML=L)},m(d,u){i(d,l,u)},p:bt,d(d){d&&n(l)}}}function kt(ne){let l,L="Examples:",d,u,T;return u=new Xe({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=L,d=o(),h(u.$$.fragment)},l(m){l=r(m,"P",{"data-svelte-h":!0}),p(l)!=="svelte-kvfsh7"&&(l.textContent=L),d=a(m),_(u.$$.fragment,m)},m(m,y){i(m,l,y),i(m,d,y),b(u,m,y),T=!0},p:bt,i(m){T||(x(u.$$.fragment,m),T=!0)},o(m){v(u.$$.fragment,m),T=!1},d(m){m&&(n(l),n(d)),w(u,m)}}}function Pt(ne){let l,L,d,u,T,m,y,ze='<img src="https://github.com/Alpha-VLLM/Lumina-T2X/assets/54879512/9f52eabb-07dc-4881-8257-6d8a5f2a0a5a" alt="concepts"/>',me,J,Qe='<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.',de,U,Oe="The abstract from the paper is:",ce,C,Ke='<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>',ue,j,et="<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.",fe,W,tt="Lumina-Next has the following components:",ge,G,nt="<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>",he,_e,be,H,it='<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.',xe,V,ot="The abstract from the paper is:",ve,N,at="<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>",we,Z,st='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>.',Te,X,rt="<strong>Highlights</strong>: Lumina-T2X supports Any Modality, Resolution, and Duration.",ye,D,lt="Lumina-T2X has the following components:",Le,B,pt="<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>",Me,$,Ie,S,$e,R,mt='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.',ke,A,dt="First, load the pipeline:",Pe,F,Je,q,ct="Then change the memory layout of the pipelines <code>transformer</code> and <code>vae</code> components to <code>torch.channels-last</code>:",Ue,E,Ce,Y,ut="Finally, compile the components and run inference:",je,z,We,Q,Ge,c,O,De,ie,ft="Pipeline for text-to-image generation using Lumina-T2I.",Be,oe,gt=`This model inherits from <a href="/docs/diffusers/pr_8408/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.)`,Se,M,K,Re,ae,ht="Function invoked when calling the pipeline for generation.",Ae,k,Fe,P,ee,qe,se,_t="Encodes the prompt into text encoder hidden states.",He,te,Ve,re,Ne;return T=new Ye({props:{title:"Lumina-T2X",local:"lumina-t2x",headingTag:"h1"}}),$=new Lt({props:{$$slots:{default:[$t]},$$scope:{ctx:ne}}}),S=new Ye({props:{title:"Inference (Text-to-Image)",local:"inference-text-to-image",headingTag:"h3"}}),F=new Xe({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEx1bWluYVRleHQySW1nUGlwZWxpbmUlMEFpbXBvcnQlMjB0b3JjaCUyMCUwQSUwQXBpcGVsaW5lJTIwJTNEJTIwTHVtaW5hVGV4dDJJbWdQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTBBJTA5JTIyQWxwaGEtVkxMTSUyRkx1bWluYS1OZXh0LVNGVC1kaWZmdXNlcnMlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmJmbG9hdDE2JTBBKS50byglMjJjdWRhJTIyKQ==",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}}),E=new Xe({props:{code:"cGlwZWxpbmUudHJhbnNmb3JtZXIudG8obWVtb3J5X2Zvcm1hdCUzRHRvcmNoLmNoYW5uZWxzX2xhc3QpJTBBcGlwZWxpbmUudmFlLnRvKG1lbW9yeV9mb3JtYXQlM0R0b3JjaC5jaGFubmVsc19sYXN0KQ==",highlighted:`pipeline.transformer.to(memory_format=torch.channels_last)
pipeline.vae.to(memory_format=torch.channels_last)`,wrap:!1}}),z=new Xe({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}}),Q=new Ye({props:{title:"LuminaText2ImgPipeline",local:"diffusers.LuminaText2ImgPipeline",headingTag:"h2"}}),O=new Ee({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/pr_8408/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/pr_8408/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/pr_8408/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/vr_8408/src/diffusers/pipelines/lumina/pipeline_lumina.py#L127"}}),K=new Ee({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/pr_8408/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/vr_8408/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/pr_8408/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</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/diffusers/pr_8408/en/api/pipelines/latent_diffusion#diffusers.ImagePipelineOutput"
>ImagePipelineOutput</a> or <code>tuple</code></p>
`}}),k=new Mt({props:{anchor:"diffusers.LuminaText2ImgPipeline.__call__.example",$$slots:{default:[kt]},$$scope:{ctx:ne}}}),ee=new Ee({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/vr_8408/src/diffusers/pipelines/lumina/pipeline_lumina.py#L252"}}),te=new It({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/pipelines/lumina.md"}}),{c(){l=s("meta"),L=o(),d=s("p"),u=o(),h(T.$$.fragment),m=o(),y=s("p"),y.innerHTML=ze,me=o(),J=s("p"),J.innerHTML=Qe,de=o(),U=s("p"),U.textContent=Oe,ce=o(),C=s("p"),C.innerHTML=Ke,ue=o(),j=s("p"),j.innerHTML=et,fe=o(),W=s("p"),W.textContent=tt,ge=o(),G=s("ul"),G.innerHTML=nt,he=o(),_e=s("hr"),be=o(),H=s("p"),H.innerHTML=it,xe=o(),V=s("p"),V.textContent=ot,ve=o(),N=s("p"),N.innerHTML=at,we=o(),Z=s("p"),Z.innerHTML=st,Te=o(),X=s("p"),X.innerHTML=rt,ye=o(),D=s("p"),D.textContent=lt,Le=o(),B=s("ul"),B.innerHTML=pt,Me=o(),h($.$$.fragment),Ie=o(),h(S.$$.fragment),$e=o(),R=s("p"),R.innerHTML=mt,ke=o(),A=s("p"),A.textContent=dt,Pe=o(),h(F.$$.fragment),Je=o(),q=s("p"),q.innerHTML=ct,Ue=o(),h(E.$$.fragment),Ce=o(),Y=s("p"),Y.textContent=ut,je=o(),h(z.$$.fragment),We=o(),h(Q.$$.fragment),Ge=o(),c=s("div"),h(O.$$.fragment),De=o(),ie=s("p"),ie.textContent=ft,Be=o(),oe=s("p"),oe.innerHTML=gt,Se=o(),M=s("div"),h(K.$$.fragment),Re=o(),ae=s("p"),ae.textContent=ht,Ae=o(),h(k.$$.fragment),Fe=o(),P=s("div"),h(ee.$$.fragment),qe=o(),se=s("p"),se.textContent=_t,He=o(),h(te.$$.fragment),Ve=o(),re=s("p"),this.h()},l(e){const t=yt("svelte-u9bgzb",document.head);l=r(t,"META",{name:!0,content:!0}),t.forEach(n),L=a(e),d=r(e,"P",{}),le(d).forEach(n),u=a(e),_(T.$$.fragment,e),m=a(e),y=r(e,"P",{"data-svelte-h":!0}),p(y)!=="svelte-z320hd"&&(y.innerHTML=ze),me=a(e),J=r(e,"P",{"data-svelte-h":!0}),p(J)!=="svelte-15xt6tn"&&(J.innerHTML=Qe),de=a(e),U=r(e,"P",{"data-svelte-h":!0}),p(U)!=="svelte-1cwsb16"&&(U.textContent=Oe),ce=a(e),C=r(e,"P",{"data-svelte-h":!0}),p(C)!=="svelte-zv9btz"&&(C.innerHTML=Ke),ue=a(e),j=r(e,"P",{"data-svelte-h":!0}),p(j)!=="svelte-1mx7f6l"&&(j.innerHTML=et),fe=a(e),W=r(e,"P",{"data-svelte-h":!0}),p(W)!=="svelte-1vdt8mw"&&(W.textContent=tt),ge=a(e),G=r(e,"UL",{"data-svelte-h":!0}),p(G)!=="svelte-iwyd0p"&&(G.innerHTML=nt),he=a(e),_e=r(e,"HR",{}),be=a(e),H=r(e,"P",{"data-svelte-h":!0}),p(H)!=="svelte-1sewgiu"&&(H.innerHTML=it),xe=a(e),V=r(e,"P",{"data-svelte-h":!0}),p(V)!=="svelte-1cwsb16"&&(V.textContent=ot),ve=a(e),N=r(e,"P",{"data-svelte-h":!0}),p(N)!=="svelte-1n6lvl2"&&(N.innerHTML=at),we=a(e),Z=r(e,"P",{"data-svelte-h":!0}),p(Z)!=="svelte-1d4lw4f"&&(Z.innerHTML=st),Te=a(e),X=r(e,"P",{"data-svelte-h":!0}),p(X)!=="svelte-xfq9w9"&&(X.innerHTML=rt),ye=a(e),D=r(e,"P",{"data-svelte-h":!0}),p(D)!=="svelte-1imnafj"&&(D.textContent=lt),Le=a(e),B=r(e,"UL",{"data-svelte-h":!0}),p(B)!=="svelte-1cqh1e9"&&(B.innerHTML=pt),Me=a(e),_($.$$.fragment,e),Ie=a(e),_(S.$$.fragment,e),$e=a(e),R=r(e,"P",{"data-svelte-h":!0}),p(R)!=="svelte-iekg51"&&(R.innerHTML=mt),ke=a(e),A=r(e,"P",{"data-svelte-h":!0}),p(A)!=="svelte-jub7f1"&&(A.textContent=dt),Pe=a(e),_(F.$$.fragment,e),Je=a(e),q=r(e,"P",{"data-svelte-h":!0}),p(q)!=="svelte-4294wb"&&(q.innerHTML=ct),Ue=a(e),_(E.$$.fragment,e),Ce=a(e),Y=r(e,"P",{"data-svelte-h":!0}),p(Y)!=="svelte-9i4prs"&&(Y.textContent=ut),je=a(e),_(z.$$.fragment,e),We=a(e),_(Q.$$.fragment,e),Ge=a(e),c=r(e,"DIV",{class:!0});var g=le(c);_(O.$$.fragment,g),De=a(g),ie=r(g,"P",{"data-svelte-h":!0}),p(ie)!=="svelte-1ennvvi"&&(ie.textContent=ft),Be=a(g),oe=r(g,"P",{"data-svelte-h":!0}),p(oe)!=="svelte-1kau6sn"&&(oe.innerHTML=gt),Se=a(g),M=r(g,"DIV",{class:!0});var I=le(M);_(K.$$.fragment,I),Re=a(I),ae=r(I,"P",{"data-svelte-h":!0}),p(ae)!=="svelte-v78lg8"&&(ae.textContent=ht),Ae=a(I),_(k.$$.fragment,I),I.forEach(n),Fe=a(g),P=r(g,"DIV",{class:!0});var Ze=le(P);_(ee.$$.fragment,Ze),qe=a(Ze),se=r(Ze,"P",{"data-svelte-h":!0}),p(se)!=="svelte-16q0ax1"&&(se.textContent=_t),Ze.forEach(n),g.forEach(n),He=a(e),_(te.$$.fragment,e),Ve=a(e),re=r(e,"P",{}),le(re).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(P,"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,L,t),i(e,d,t),i(e,u,t),b(T,e,t),i(e,m,t),i(e,y,t),i(e,me,t),i(e,J,t),i(e,de,t),i(e,U,t),i(e,ce,t),i(e,C,t),i(e,ue,t),i(e,j,t),i(e,fe,t),i(e,W,t),i(e,ge,t),i(e,G,t),i(e,he,t),i(e,_e,t),i(e,be,t),i(e,H,t),i(e,xe,t),i(e,V,t),i(e,ve,t),i(e,N,t),i(e,we,t),i(e,Z,t),i(e,Te,t),i(e,X,t),i(e,ye,t),i(e,D,t),i(e,Le,t),i(e,B,t),i(e,Me,t),b($,e,t),i(e,Ie,t),b(S,e,t),i(e,$e,t),i(e,R,t),i(e,ke,t),i(e,A,t),i(e,Pe,t),b(F,e,t),i(e,Je,t),i(e,q,t),i(e,Ue,t),b(E,e,t),i(e,Ce,t),i(e,Y,t),i(e,je,t),b(z,e,t),i(e,We,t),b(Q,e,t),i(e,Ge,t),i(e,c,t),b(O,c,null),f(c,De),f(c,ie),f(c,Be),f(c,oe),f(c,Se),f(c,M),b(K,M,null),f(M,Re),f(M,ae),f(M,Ae),b(k,M,null),f(c,Fe),f(c,P),b(ee,P,null),f(P,qe),f(P,se),i(e,He,t),b(te,e,t),i(e,Ve,t),i(e,re,t),Ne=!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}),k.$set(I)},i(e){Ne||(x(T.$$.fragment,e),x($.$$.fragment,e),x(S.$$.fragment,e),x(F.$$.fragment,e),x(E.$$.fragment,e),x(z.$$.fragment,e),x(Q.$$.fragment,e),x(O.$$.fragment,e),x(K.$$.fragment,e),x(k.$$.fragment,e),x(ee.$$.fragment,e),x(te.$$.fragment,e),Ne=!0)},o(e){v(T.$$.fragment,e),v($.$$.fragment,e),v(S.$$.fragment,e),v(F.$$.fragment,e),v(E.$$.fragment,e),v(z.$$.fragment,e),v(Q.$$.fragment,e),v(O.$$.fragment,e),v(K.$$.fragment,e),v(k.$$.fragment,e),v(ee.$$.fragment,e),v(te.$$.fragment,e),Ne=!1},d(e){e&&(n(L),n(d),n(u),n(m),n(y),n(me),n(J),n(de),n(U),n(ce),n(C),n(ue),n(j),n(fe),n(W),n(ge),n(G),n(he),n(_e),n(be),n(H),n(xe),n(V),n(ve),n(N),n(we),n(Z),n(Te),n(X),n(ye),n(D),n(Le),n(B),n(Me),n(Ie),n($e),n(R),n(ke),n(A),n(Pe),n(Je),n(q),n(Ue),n(Ce),n(Y),n(je),n(We),n(Ge),n(c),n(He),n(Ve),n(re)),n(l),w(T,e),w($,e),w(S,e),w(F,e),w(E,e),w(z,e),w(Q,e),w(O),w(K),w(k),w(ee),w(te,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 Ut(ne){return vt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Zt extends wt{constructor(l){super(),Tt(this,l,Ut,Pt,xt,{})}}export{Zt as component};
