Buckets:
| import{s as Fe,o as Be,n as We}from"../chunks/scheduler.8c3d61f6.js";import{S as Oe,i as Xe,g as l,s as i,r as f,A as Se,h as p,f as n,c as a,j as M,u as _,x as T,k as P,y as t,a as c,v as h,d as b,t as v,w as x}from"../chunks/index.da70eac4.js";import{T as Re}from"../chunks/Tip.1d9b8c37.js";import{D as O}from"../chunks/Docstring.6b390b9a.js";import{C as Ye}from"../chunks/CodeBlock.00a903b3.js";import{E as Qe}from"../chunks/ExampleCodeBlock.db12be95.js";import{H as Je,E as Ke}from"../chunks/EditOnGithub.1e64e623.js";function et(X){let s,$='Make sure to check out the Schedulers <a href="../../using-diffusers/schedulers">guide</a> to learn how to explore the tradeoff between scheduler speed and quality, and see the <a href="../../using-diffusers/loading#reuse-a-pipeline">reuse components across pipelines</a> section to learn how to efficiently load the same components into multiple pipelines.';return{c(){s=l("p"),s.innerHTML=$},l(g){s=p(g,"P",{"data-svelte-h":!0}),T(s)!=="svelte-1qn15hi"&&(s.innerHTML=$)},m(g,u){c(g,s,u)},p:We,d(g){g&&n(s)}}}function tt(X){let s,$="Examples:",g,u,y;return u=new Ye({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwTHVtaW5hMlRleHQySW1nUGlwZWxpbmUlMEElMEFwaXBlJTIwJTNEJTIwTHVtaW5hMlRleHQySW1nUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUyMkFscGhhLVZMTE0lMkZMdW1pbmEtSW1hZ2UtMi4wJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5iZmxvYXQxNiklMEElMjMlMjBFbmFibGUlMjBtZW1vcnklMjBvcHRpbWl6YXRpb25zLiUwQXBpcGUuZW5hYmxlX21vZGVsX2NwdV9vZmZsb2FkKCklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJVcHBlciUyMGJvZHklMjBvZiUyMGElMjB5b3VuZyUyMHdvbWFuJTIwaW4lMjBhJTIwVmljdG9yaWFuLWVyYSUyMG91dGZpdCUyMHdpdGglMjBicmFzcyUyMGdvZ2dsZXMlMjBhbmQlMjBsZWF0aGVyJTIwc3RyYXBzLiUyMEJhY2tncm91bmQlMjBzaG93cyUyMGFuJTIwaW5kdXN0cmlhbCUyMHJldm9sdXRpb24lMjBjaXR5c2NhcGUlMjB3aXRoJTIwc21va3klMjBza2llcyUyMGFuZCUyMHRhbGwlMkMlMjBtZXRhbCUyMHN0cnVjdHVyZXMlMjIlMEFpbWFnZSUyMCUzRCUyMHBpcGUocHJvbXB0KS5pbWFnZXMlNUIwJTVE",highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">import</span> torch | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> Lumina2Text2ImgPipeline | |
| <span class="hljs-meta">>>> </span>pipe = Lumina2Text2ImgPipeline.from_pretrained(<span class="hljs-string">"Alpha-VLLM/Lumina-Image-2.0"</span>, torch_dtype=torch.bfloat16) | |
| <span class="hljs-meta">>>> </span><span class="hljs-comment"># Enable memory optimizations.</span> | |
| <span class="hljs-meta">>>> </span>pipe.enable_model_cpu_offload() | |
| <span class="hljs-meta">>>> </span>prompt = <span class="hljs-string">"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"</span> | |
| <span class="hljs-meta">>>> </span>image = pipe(prompt).images[<span class="hljs-number">0</span>]`,wrap:!1}}),{c(){s=l("p"),s.textContent=$,g=i(),f(u.$$.fragment)},l(m){s=p(m,"P",{"data-svelte-h":!0}),T(s)!=="svelte-kvfsh7"&&(s.textContent=$),g=a(m),_(u.$$.fragment,m)},m(m,w){c(m,s,w),c(m,g,w),h(u,m,w),y=!0},p:We,i(m){y||(b(u.$$.fragment,m),y=!0)},o(m){v(u.$$.fragment,m),y=!1},d(m){m&&(n(s),n(g)),x(u,m)}}}function nt(X){let s,$,g,u,y,m,w,je='<a href="https://huggingface.co/Alpha-VLLM/Lumina-Image-2.0" rel="nofollow">Lumina Image 2.0: A Unified and Efficient Image Generative Model</a> is a 2 billion parameter flow-based diffusion transformer capable of generating diverse images from text descriptions.',ie,G,Ue="The abstract from the paper is:",ae,D,Ve="<em>We introduce Lumina-Image 2.0, an advanced text-to-image model that surpasses previous state-of-the-art methods across multiple benchmarks, while also shedding light on its potential to evolve into a generalist vision intelligence model. Lumina-Image 2.0 exhibits three key properties: (1) Unification – it adopts a unified architecture that treats text and image tokens as a joint sequence, enabling natural cross-modal interactions and facilitating task expansion. Besides, since high-quality captioners can provide semantically better-aligned text-image training pairs, we introduce a unified captioning system, UniCaptioner, which generates comprehensive and precise captions for the model. This not only accelerates model convergence but also enhances prompt adherence, variable-length prompt handling, and task generalization via prompt templates. (2) Efficiency – to improve the efficiency of the unified architecture, we develop a set of optimization techniques that improve semantic learning and fine-grained texture generation during training while incorporating inference-time acceleration strategies without compromising image quality. (3) Transparency – we open-source all training details, code, and models to ensure full reproducibility, aiming to bridge the gap between well-resourced closed-source research teams and independent developers.</em>",se,k,re,H,le,r,A,he,S,qe="Pipeline for text-to-image generation using Lumina-T2I.",be,R,Ge=`This model inherits from <a href="/docs/diffusers/pr_10727/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.)`,ve,L,N,xe,Y,De="Function invoked when calling the pipeline for generation.",Te,C,ye,E,z,we,Q,He=`Disable sliced VAE decoding. If <code>enable_vae_slicing</code> was previously enabled, this method will go back to | |
| computing decoding in one step.`,$e,j,Z,Le,K,Ae=`Disable tiled VAE decoding. If <code>enable_vae_tiling</code> was previously enabled, this method will go back to | |
| computing decoding in one step.`,Ie,U,J,Me,ee,Ne=`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.`,Pe,V,W,ke,te,ze=`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.`,Ce,q,F,Ee,ne,Ze="Encodes the prompt into text encoder hidden states.",pe,B,de,oe,me;return y=new Je({props:{title:"Lumina2",local:"lumina2",headingTag:"h1"}}),k=new Re({props:{$$slots:{default:[et]},$$scope:{ctx:X}}}),H=new Je({props:{title:"Lumina2Text2ImgPipeline",local:"diffusers.Lumina2Text2ImgPipeline",headingTag:"h2"}}),A=new O({props:{name:"class diffusers.Lumina2Text2ImgPipeline",anchor:"diffusers.Lumina2Text2ImgPipeline",parameters:[{name:"transformer",val:": Lumina2Transformer2DModel"},{name:"scheduler",val:": FlowMatchEulerDiscreteScheduler"},{name:"vae",val:": AutoencoderKL"},{name:"text_encoder",val:": AutoModel"},{name:"tokenizer",val:": AutoTokenizer"}],parametersDescription:[{anchor:"diffusers.Lumina2Text2ImgPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/pr_10727/en/api/models/autoencoderkl#diffusers.AutoencoderKL">AutoencoderKL</a>) — | |
| Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.Lumina2Text2ImgPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>AutoModel</code>) — | |
| 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.Lumina2Text2ImgPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>AutoModel</code>) — | |
| Tokenizer of class | |
| <a href="https://huggingface.co/docs/transformers/model_doc/t5#transformers.AutoModel" rel="nofollow">AutoModel</a>.`,name:"tokenizer"},{anchor:"diffusers.Lumina2Text2ImgPipeline.transformer",description:`<strong>transformer</strong> (<a href="/docs/diffusers/pr_10727/en/api/models/transformer2d#diffusers.Transformer2DModel">Transformer2DModel</a>) — | |
| A text conditioned <code>Transformer2DModel</code> to denoise the encoded image latents.`,name:"transformer"},{anchor:"diffusers.Lumina2Text2ImgPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/pr_10727/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a>) — | |
| 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_10727/src/diffusers/pipelines/lumina2/pipeline_lumina2.py#L143"}}),N=new O({props:{name:"__call__",anchor:"diffusers.Lumina2Text2ImgPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]] = None"},{name:"width",val:": typing.Optional[int] = None"},{name:"height",val:": typing.Optional[int] = None"},{name:"num_inference_steps",val:": int = 30"},{name:"guidance_scale",val:": float = 4.0"},{name:"negative_prompt",val:": typing.Union[str, typing.List[str]] = None"},{name:"sigmas",val:": typing.List[float] = None"},{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.Tensor] = None"},{name:"prompt_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"prompt_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"negative_prompt_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{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:"system_prompt",val:": typing.Optional[str] = None"},{name:"cfg_trunc_ratio",val:": float = 1.0"},{name:"cfg_normalization",val:": bool = True"},{name:"use_mask_in_transformer",val:": bool = True"},{name:"max_sequence_length",val:": int = 256"}],parametersDescription:[{anchor:"diffusers.Lumina2Text2ImgPipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) — | |
| 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.Lumina2Text2ImgPipeline.__call__.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) — | |
| 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.Lumina2Text2ImgPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 30) — | |
| 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.Lumina2Text2ImgPipeline.__call__.sigmas",description:`<strong>sigmas</strong> (<code>List[float]</code>, <em>optional</em>) — | |
| 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.Lumina2Text2ImgPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 4.0) — | |
| 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 > 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.Lumina2Text2ImgPipeline.__call__.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) — | |
| The number of images to generate per prompt.`,name:"num_images_per_prompt"},{anchor:"diffusers.Lumina2Text2ImgPipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size) — | |
| The height in pixels of the generated image.`,name:"height"},{anchor:"diffusers.Lumina2Text2ImgPipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size) — | |
| The width in pixels of the generated image.`,name:"width"},{anchor:"diffusers.Lumina2Text2ImgPipeline.__call__.eta",description:`<strong>eta</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) — | |
| Corresponds to parameter eta (η) 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_10727/en/api/schedulers/ddim#diffusers.DDIMScheduler">schedulers.DDIMScheduler</a>, will be ignored for others.`,name:"eta"},{anchor:"diffusers.Lumina2Text2ImgPipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code> or <code>List[torch.Generator]</code>, <em>optional</em>) — | |
| 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.Lumina2Text2ImgPipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.Tensor</code>, <em>optional</em>) — | |
| 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.Lumina2Text2ImgPipeline.__call__.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.Tensor</code>, <em>optional</em>) — | |
| 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.Lumina2Text2ImgPipeline.__call__.prompt_attention_mask",description:"<strong>prompt_attention_mask</strong> (<code>torch.Tensor</code>, <em>optional</em>) — Pre-generated attention mask for text embeddings.",name:"prompt_attention_mask"},{anchor:"diffusers.Lumina2Text2ImgPipeline.__call__.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.Tensor</code>, <em>optional</em>) — | |
| Pre-generated negative text embeddings. For Lumina-T2I this negative prompt should be "". If not | |
| provided, negative_prompt_embeds will be generated from <code>negative_prompt</code> input argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.Lumina2Text2ImgPipeline.__call__.negative_prompt_attention_mask",description:`<strong>negative_prompt_attention_mask</strong> (<code>torch.Tensor</code>, <em>optional</em>) — | |
| Pre-generated attention mask for negative text embeddings.`,name:"negative_prompt_attention_mask"},{anchor:"diffusers.Lumina2Text2ImgPipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>"pil"</code>) — | |
| 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.Lumina2Text2ImgPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) — | |
| Whether or not to return a <code>~pipelines.stable_diffusion.IFPipelineOutput</code> instead of a plain tuple.`,name:"return_dict"},{anchor:"diffusers.Lumina2Text2ImgPipeline.__call__.callback_on_step_end",description:`<strong>callback_on_step_end</strong> (<code>Callable</code>, <em>optional</em>) — | |
| 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.Lumina2Text2ImgPipeline.__call__.callback_on_step_end_tensor_inputs",description:`<strong>callback_on_step_end_tensor_inputs</strong> (<code>List</code>, <em>optional</em>) — | |
| 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.Lumina2Text2ImgPipeline.__call__.system_prompt",description:`<strong>system_prompt</strong> (<code>str</code>, <em>optional</em>) — | |
| The system prompt to use for the image generation.`,name:"system_prompt"},{anchor:"diffusers.Lumina2Text2ImgPipeline.__call__.cfg_trunc_ratio",description:`<strong>cfg_trunc_ratio</strong> (<code>float</code>, <em>optional</em>, defaults to <code>1.0</code>) — | |
| The ratio of the timestep interval to apply normalization-based guidance scale.`,name:"cfg_trunc_ratio"},{anchor:"diffusers.Lumina2Text2ImgPipeline.__call__.cfg_normalization",description:`<strong>cfg_normalization</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) — | |
| Whether to apply normalization-based guidance scale.`,name:"cfg_normalization"},{anchor:"diffusers.Lumina2Text2ImgPipeline.__call__.use_mask_in_transformer",description:`<strong>use_mask_in_transformer</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) — | |
| Whether to use attention mask in <code>Lumina2Transformer2DModel</code>. Set <code>False</code> for performance gain.`,name:"use_mask_in_transformer"},{anchor:"diffusers.Lumina2Text2ImgPipeline.__call__.max_sequence_length",description:`<strong>max_sequence_length</strong> (<code>int</code>, defaults to <code>256</code>) — | |
| Maximum sequence length to use with the <code>prompt</code>.`,name:"max_sequence_length"}],source:"https://github.com/huggingface/diffusers/blob/vr_10727/src/diffusers/pipelines/lumina2/pipeline_lumina2.py#L503",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>If <code>return_dict</code> is <code>True</code>, <a | |
| href="/docs/diffusers/pr_10727/en/api/pipelines/unclip#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_10727/en/api/pipelines/unclip#diffusers.ImagePipelineOutput" | |
| >ImagePipelineOutput</a> or <code>tuple</code></p> | |
| `}}),C=new Qe({props:{anchor:"diffusers.Lumina2Text2ImgPipeline.__call__.example",$$slots:{default:[tt]},$$scope:{ctx:X}}}),z=new O({props:{name:"disable_vae_slicing",anchor:"diffusers.Lumina2Text2ImgPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/vr_10727/src/diffusers/pipelines/lumina2/pipeline_lumina2.py#L445"}}),Z=new O({props:{name:"disable_vae_tiling",anchor:"diffusers.Lumina2Text2ImgPipeline.disable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/vr_10727/src/diffusers/pipelines/lumina2/pipeline_lumina2.py#L460"}}),J=new O({props:{name:"enable_vae_slicing",anchor:"diffusers.Lumina2Text2ImgPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/vr_10727/src/diffusers/pipelines/lumina2/pipeline_lumina2.py#L438"}}),W=new O({props:{name:"enable_vae_tiling",anchor:"diffusers.Lumina2Text2ImgPipeline.enable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/vr_10727/src/diffusers/pipelines/lumina2/pipeline_lumina2.py#L452"}}),F=new O({props:{name:"encode_prompt",anchor:"diffusers.Lumina2Text2ImgPipeline.encode_prompt",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]]"},{name:"do_classifier_free_guidance",val:": bool = True"},{name:"negative_prompt",val:": typing.Union[str, typing.List[str]] = None"},{name:"num_images_per_prompt",val:": int = 1"},{name:"device",val:": typing.Optional[torch.device] = None"},{name:"prompt_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"prompt_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"negative_prompt_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"system_prompt",val:": typing.Optional[str] = None"},{name:"max_sequence_length",val:": int = 256"}],parametersDescription:[{anchor:"diffusers.Lumina2Text2ImgPipeline.encode_prompt.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) — | |
| prompt to be encoded`,name:"prompt"},{anchor:"diffusers.Lumina2Text2ImgPipeline.encode_prompt.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) — | |
| 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 "".`,name:"negative_prompt"},{anchor:"diffusers.Lumina2Text2ImgPipeline.encode_prompt.do_classifier_free_guidance",description:`<strong>do_classifier_free_guidance</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) — | |
| whether to use classifier free guidance or not`,name:"do_classifier_free_guidance"},{anchor:"diffusers.Lumina2Text2ImgPipeline.encode_prompt.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) — | |
| number of images that should be generated per prompt`,name:"num_images_per_prompt"},{anchor:"diffusers.Lumina2Text2ImgPipeline.encode_prompt.device",description:`<strong>device</strong> — (<code>torch.device</code>, <em>optional</em>): | |
| torch device to place the resulting embeddings on`,name:"device"},{anchor:"diffusers.Lumina2Text2ImgPipeline.encode_prompt.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.Tensor</code>, <em>optional</em>) — | |
| 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.Lumina2Text2ImgPipeline.encode_prompt.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.Tensor</code>, <em>optional</em>) — | |
| Pre-generated negative text embeddings. For Lumina-T2I, it’s should be the embeddings of the "" string.`,name:"negative_prompt_embeds"},{anchor:"diffusers.Lumina2Text2ImgPipeline.encode_prompt.max_sequence_length",description:`<strong>max_sequence_length</strong> (<code>int</code>, defaults to <code>256</code>) — | |
| Maximum sequence length to use for the prompt.`,name:"max_sequence_length"}],source:"https://github.com/huggingface/diffusers/blob/vr_10727/src/diffusers/pipelines/lumina2/pipeline_lumina2.py#L247"}}),B=new Ke({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/pipelines/lumina2.md"}}),{c(){s=l("meta"),$=i(),g=l("p"),u=i(),f(y.$$.fragment),m=i(),w=l("p"),w.innerHTML=je,ie=i(),G=l("p"),G.textContent=Ue,ae=i(),D=l("p"),D.innerHTML=Ve,se=i(),f(k.$$.fragment),re=i(),f(H.$$.fragment),le=i(),r=l("div"),f(A.$$.fragment),he=i(),S=l("p"),S.textContent=qe,be=i(),R=l("p"),R.innerHTML=Ge,ve=i(),L=l("div"),f(N.$$.fragment),xe=i(),Y=l("p"),Y.textContent=De,Te=i(),f(C.$$.fragment),ye=i(),E=l("div"),f(z.$$.fragment),we=i(),Q=l("p"),Q.innerHTML=He,$e=i(),j=l("div"),f(Z.$$.fragment),Le=i(),K=l("p"),K.innerHTML=Ae,Ie=i(),U=l("div"),f(J.$$.fragment),Me=i(),ee=l("p"),ee.textContent=Ne,Pe=i(),V=l("div"),f(W.$$.fragment),ke=i(),te=l("p"),te.textContent=ze,Ce=i(),q=l("div"),f(F.$$.fragment),Ee=i(),ne=l("p"),ne.textContent=Ze,pe=i(),f(B.$$.fragment),de=i(),oe=l("p"),this.h()},l(e){const o=Se("svelte-u9bgzb",document.head);s=p(o,"META",{name:!0,content:!0}),o.forEach(n),$=a(e),g=p(e,"P",{}),M(g).forEach(n),u=a(e),_(y.$$.fragment,e),m=a(e),w=p(e,"P",{"data-svelte-h":!0}),T(w)!=="svelte-1yt6rrf"&&(w.innerHTML=je),ie=a(e),G=p(e,"P",{"data-svelte-h":!0}),T(G)!=="svelte-1cwsb16"&&(G.textContent=Ue),ae=a(e),D=p(e,"P",{"data-svelte-h":!0}),T(D)!=="svelte-14hqiub"&&(D.innerHTML=Ve),se=a(e),_(k.$$.fragment,e),re=a(e),_(H.$$.fragment,e),le=a(e),r=p(e,"DIV",{class:!0});var d=M(r);_(A.$$.fragment,d),he=a(d),S=p(d,"P",{"data-svelte-h":!0}),T(S)!=="svelte-1ennvvi"&&(S.textContent=qe),be=a(d),R=p(d,"P",{"data-svelte-h":!0}),T(R)!=="svelte-1ipmcmq"&&(R.innerHTML=Ge),ve=a(d),L=p(d,"DIV",{class:!0});var I=M(L);_(N.$$.fragment,I),xe=a(I),Y=p(I,"P",{"data-svelte-h":!0}),T(Y)!=="svelte-v78lg8"&&(Y.textContent=De),Te=a(I),_(C.$$.fragment,I),I.forEach(n),ye=a(d),E=p(d,"DIV",{class:!0});var ce=M(E);_(z.$$.fragment,ce),we=a(ce),Q=p(ce,"P",{"data-svelte-h":!0}),T(Q)!=="svelte-1s3c06i"&&(Q.innerHTML=He),ce.forEach(n),$e=a(d),j=p(d,"DIV",{class:!0});var ge=M(j);_(Z.$$.fragment,ge),Le=a(ge),K=p(ge,"P",{"data-svelte-h":!0}),T(K)!=="svelte-pkn4ui"&&(K.innerHTML=Ae),ge.forEach(n),Ie=a(d),U=p(d,"DIV",{class:!0});var ue=M(U);_(J.$$.fragment,ue),Me=a(ue),ee=p(ue,"P",{"data-svelte-h":!0}),T(ee)!=="svelte-14bnrb6"&&(ee.textContent=Ne),ue.forEach(n),Pe=a(d),V=p(d,"DIV",{class:!0});var fe=M(V);_(W.$$.fragment,fe),ke=a(fe),te=p(fe,"P",{"data-svelte-h":!0}),T(te)!=="svelte-1xwrf7t"&&(te.textContent=ze),fe.forEach(n),Ce=a(d),q=p(d,"DIV",{class:!0});var _e=M(q);_(F.$$.fragment,_e),Ee=a(_e),ne=p(_e,"P",{"data-svelte-h":!0}),T(ne)!=="svelte-16q0ax1"&&(ne.textContent=Ze),_e.forEach(n),d.forEach(n),pe=a(e),_(B.$$.fragment,e),de=a(e),oe=p(e,"P",{}),M(oe).forEach(n),this.h()},h(){P(s,"name","hf:doc:metadata"),P(s,"content",ot),P(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),P(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),P(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),P(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),P(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),P(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),P(r,"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,o){t(document.head,s),c(e,$,o),c(e,g,o),c(e,u,o),h(y,e,o),c(e,m,o),c(e,w,o),c(e,ie,o),c(e,G,o),c(e,ae,o),c(e,D,o),c(e,se,o),h(k,e,o),c(e,re,o),h(H,e,o),c(e,le,o),c(e,r,o),h(A,r,null),t(r,he),t(r,S),t(r,be),t(r,R),t(r,ve),t(r,L),h(N,L,null),t(L,xe),t(L,Y),t(L,Te),h(C,L,null),t(r,ye),t(r,E),h(z,E,null),t(E,we),t(E,Q),t(r,$e),t(r,j),h(Z,j,null),t(j,Le),t(j,K),t(r,Ie),t(r,U),h(J,U,null),t(U,Me),t(U,ee),t(r,Pe),t(r,V),h(W,V,null),t(V,ke),t(V,te),t(r,Ce),t(r,q),h(F,q,null),t(q,Ee),t(q,ne),c(e,pe,o),h(B,e,o),c(e,de,o),c(e,oe,o),me=!0},p(e,[o]){const d={};o&2&&(d.$$scope={dirty:o,ctx:e}),k.$set(d);const I={};o&2&&(I.$$scope={dirty:o,ctx:e}),C.$set(I)},i(e){me||(b(y.$$.fragment,e),b(k.$$.fragment,e),b(H.$$.fragment,e),b(A.$$.fragment,e),b(N.$$.fragment,e),b(C.$$.fragment,e),b(z.$$.fragment,e),b(Z.$$.fragment,e),b(J.$$.fragment,e),b(W.$$.fragment,e),b(F.$$.fragment,e),b(B.$$.fragment,e),me=!0)},o(e){v(y.$$.fragment,e),v(k.$$.fragment,e),v(H.$$.fragment,e),v(A.$$.fragment,e),v(N.$$.fragment,e),v(C.$$.fragment,e),v(z.$$.fragment,e),v(Z.$$.fragment,e),v(J.$$.fragment,e),v(W.$$.fragment,e),v(F.$$.fragment,e),v(B.$$.fragment,e),me=!1},d(e){e&&(n($),n(g),n(u),n(m),n(w),n(ie),n(G),n(ae),n(D),n(se),n(re),n(le),n(r),n(pe),n(de),n(oe)),n(s),x(y,e),x(k,e),x(H,e),x(A),x(N),x(C),x(z),x(Z),x(J),x(W),x(F),x(B,e)}}}const ot='{"title":"Lumina2","local":"lumina2","sections":[{"title":"Lumina2Text2ImgPipeline","local":"diffusers.Lumina2Text2ImgPipeline","sections":[],"depth":2}],"depth":1}';function it(X){return Be(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ct extends Oe{constructor(s){super(),Xe(this,s,it,nt,Fe,{})}}export{ct as component}; | |
Xet Storage Details
- Size:
- 29.8 kB
- Xet hash:
- 6ad9ff61182b64bb072d27f3ec3860dba059914fbbe1a721cb2d5dd109b118d4
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.