import{s as Ie,o as Ue,n as ze}from"../chunks/scheduler.182ea377.js";import{S as Le,i as Be,g as s,s as i,r as y,A as Ee,h as r,f as n,c as a,j as R,u as x,x as u,k as F,y as c,a as o,v as D,d as w,t as H,w as P}from"../chunks/index.abf12888.js";import{D as he}from"../chunks/Docstring.b0ac41bc.js";import{C as Oe}from"../chunks/CodeBlock.57fe6e13.js";import{E as Ne}from"../chunks/ExampleCodeBlock.cf625607.js";import{H as Je,E as Se}from"../chunks/EditOnGithub.9b8e78e4.js";function je(X){let p,k="Examples:",h,_,f;return _=new Oe({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwSHVueXVhbkRpVFBpcGVsaW5lJTBBJTBBcGlwZSUyMCUzRCUyMEh1bnl1YW5EaVRQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTIyVGVuY2VudC1IdW55dWFuJTJGSHVueXVhbkRpVCUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiklMEFwaXBlLnRvKCUyMmN1ZGElMjIpJTBBJTBBJTIzJTIwWW91JTIwbWF5JTIwYWxzbyUyMHVzZSUyMEVuZ2xpc2glMjBwcm9tcHQlMjBhcyUyMEh1bnl1YW5EaVQlMjBzdXBwb3J0cyUyMGJvdGglMjBFbmdsaXNoJTIwYW5kJTIwQ2hpbmVzZSUwQSUyMyUyMHByb21wdCUyMCUzRCUyMCUyMkFuJTIwYXN0cm9uYXV0JTIwcmlkaW5nJTIwYSUyMGhvcnNlJTIyJTBBcHJvbXB0JTIwJTNEJTIwJTIyJUU0JUI4JTgwJUU0JUI4JUFBJUU1JUFFJTg3JUU4JTg4JUFBJUU1JTkxJTk4JUU1JTlDJUE4JUU5JUFBJTkxJUU5JUE5JUFDJTIyJTBBaW1hZ2UlMjAlM0QlMjBwaXBlKHByb21wdCkuaW1hZ2VzJTVCMCU1RA==",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> HunyuanDiTPipeline

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = HunyuanDiTPipeline.from_pretrained(<span class="hljs-string">&quot;Tencent-Hunyuan/HunyuanDiT&quot;</span>, torch_dtype=torch.float16)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># You may also use English prompt as HunyuanDiT supports both English and Chinese</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># prompt = &quot;An astronaut riding a horse&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;一个宇航员在骑马&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = pipe(prompt).images[<span class="hljs-number">0</span>]`,wrap:!1}}),{c(){p=s("p"),p.textContent=k,h=i(),y(_.$$.fragment)},l(d){p=r(d,"P",{"data-svelte-h":!0}),u(p)!=="svelte-kvfsh7"&&(p.textContent=k),h=a(d),x(_.$$.fragment,d)},m(d,g){o(d,p,g),o(d,h,g),D(_,d,g),f=!0},p:ze,i(d){f||(w(_.$$.fragment,d),f=!0)},o(d){H(_.$$.fragment,d),f=!1},d(d){d&&(n(p),n(h)),P(_,d)}}}function qe(X){let p,k,h,_,f,d,g,Te='<img src="https://github.com/gnobitab/diffusers-hunyuan/assets/1157982/39b99036-c3cb-4f16-bb1a-40ec25eda573" alt="chinese elements understanding"/>',Y,$,ve='<a href="https://arxiv.org/abs/2405.08748" rel="nofollow">Hunyuan-DiT : A Powerful Multi-Resolution Diffusion Transformer with Fine-Grained Chinese Understanding</a>] from Tencent Hunyuan.',Z,C,be="The abstract from the paper is:",Q,M,ye="<em>We present Hunyuan-DiT, a text-to-image diffusion transformer with fine-grained understanding of both English and Chinese. To construct Hunyuan-DiT, we carefully design the transformer structure, text encoder, and positional encoding. We also build from scratch a whole data pipeline to update and evaluate data for iterative model optimization. For fine-grained language understanding, we train a Multimodal Large Language Model to refine the captions of the images. Finally, Hunyuan-DiT can perform multi-turn multimodal dialogue with users, generating and refining images according to the context. Through our holistic human evaluation protocol with more than 50 professional human evaluators, Hunyuan-DiT sets a new state-of-the-art in Chinese-to-image generation compared with other open-source models.</em>",K,J,xe='You can find the original codebase at <a href="https://github.com/Tencent/HunyuanDiT" rel="nofollow">Tencent/HunyuanDiT</a> and all the available checkpoints at <a href="https://huggingface.co/Tencent-Hunyuan/HunyuanDiT" rel="nofollow">Tencent-Hunyuan</a>.',ee,I,De="<strong>Highlights</strong>: HunyuanDiT supports Chinese/English-to-image, multi-resolution generation.",te,U,we="HunyuanDiT has the following components:",ne,z,He="<li>It uses a diffusion transformer as the backbone</li> <li>It combines two text encoders, a bilingual CLIP and a multilingual T5 encoder</li>",oe,L,ie,l,B,pe,S,Pe="Pipeline for English/Chinese-to-image generation using HunyuanDiT.",le,j,ke=`This model inherits from <a href="/docs/diffusers/v0.28.0/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.)`,ce,q,$e=`HunyuanDiT uses two text encoders: <a href="https://huggingface.co/google/mt5-base" rel="nofollow">mT5</a> and [bilingual CLIP](fine-tuned by
ourselves)`,me,T,E,ue,V,Ce="The call function to the pipeline for generation with HunyuanDiT.",_e,v,fe,b,O,ge,A,Me="Encodes the prompt into text encoder hidden states.",ae,N,se,G,re;return f=new Je({props:{title:"Hunyuan-DiT",local:"hunyuan-dit",headingTag:"h1"}}),L=new Je({props:{title:"HunyuanDiTPipeline",local:"diffusers.HunyuanDiTPipeline",headingTag:"h2"}}),B=new he({props:{name:"class diffusers.HunyuanDiTPipeline",anchor:"diffusers.HunyuanDiTPipeline",parameters:[{name:"vae",val:": AutoencoderKL"},{name:"text_encoder",val:": BertModel"},{name:"tokenizer",val:": BertTokenizer"},{name:"transformer",val:": HunyuanDiT2DModel"},{name:"scheduler",val:": DDPMScheduler"},{name:"safety_checker",val:": StableDiffusionSafetyChecker"},{name:"feature_extractor",val:": CLIPImageProcessor"},{name:"requires_safety_checker",val:": bool = True"},{name:"text_encoder_2",val:" = <class 'transformers.models.t5.modeling_t5.T5EncoderModel'>"},{name:"tokenizer_2",val:" = <class 'transformers.models.t5.tokenization_t5.T5Tokenizer'>"}],parametersDescription:[{anchor:"diffusers.HunyuanDiTPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/v0.28.0/en/api/models/autoencoderkl#diffusers.AutoencoderKL">AutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations. We use
<code>sdxl-vae-fp16-fix</code>.`,name:"vae"},{anchor:"diffusers.HunyuanDiTPipeline.text_encoder",description:`<strong>text_encoder</strong> (Optional[<code>~transformers.BertModel</code>, <code>~transformers.CLIPTextModel</code>]) &#x2014;
Frozen text-encoder (<a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a>).
HunyuanDiT uses a fine-tuned [bilingual CLIP].`,name:"text_encoder"},{anchor:"diffusers.HunyuanDiTPipeline.tokenizer",description:`<strong>tokenizer</strong> (Optional[<code>~transformers.BertTokenizer</code>, <code>~transformers.CLIPTokenizer</code>]) &#x2014;
A <code>BertTokenizer</code> or <code>CLIPTokenizer</code> to tokenize text.`,name:"tokenizer"},{anchor:"diffusers.HunyuanDiTPipeline.transformer",description:`<strong>transformer</strong> (<a href="/docs/diffusers/v0.28.0/en/api/models/hunyuan_transformer_2d#diffusers.HunyuanDiT2DModel">HunyuanDiT2DModel</a>) &#x2014;
The HunyuanDiT model designed by Tencent Hunyuan.`,name:"transformer"},{anchor:"diffusers.HunyuanDiTPipeline.text_encoder_2",description:`<strong>text_encoder_2</strong> (<code>T5EncoderModel</code>) &#x2014;
The mT5 embedder. Specifically, it is &#x2018;t5-v1_1-xxl&#x2019;.`,name:"text_encoder_2"},{anchor:"diffusers.HunyuanDiTPipeline.tokenizer_2",description:`<strong>tokenizer_2</strong> (<code>MT5Tokenizer</code>) &#x2014;
The tokenizer for the mT5 embedder.`,name:"tokenizer_2"},{anchor:"diffusers.HunyuanDiTPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/v0.28.0/en/api/schedulers/ddpm#diffusers.DDPMScheduler">DDPMScheduler</a>) &#x2014;
A scheduler to be used in combination with HunyuanDiT to denoise the encoded image latents.`,name:"scheduler"}],source:"https://github.com/huggingface/diffusers/blob/v0.28.0/src/diffusers/pipelines/hunyuandit/pipeline_hunyuandit.py#L139"}}),E=new he({props:{name:"__call__",anchor:"diffusers.HunyuanDiTPipeline.__call__",parameters:[{name:"prompt",val:": Union = None"},{name:"height",val:": Optional = None"},{name:"width",val:": Optional = None"},{name:"num_inference_steps",val:": Optional = 50"},{name:"guidance_scale",val:": Optional = 5.0"},{name:"negative_prompt",val:": Union = None"},{name:"num_images_per_prompt",val:": Optional = 1"},{name:"eta",val:": Optional = 0.0"},{name:"generator",val:": Union = None"},{name:"latents",val:": Optional = None"},{name:"prompt_embeds",val:": Optional = None"},{name:"prompt_embeds_2",val:": Optional = None"},{name:"negative_prompt_embeds",val:": Optional = None"},{name:"negative_prompt_embeds_2",val:": Optional = None"},{name:"prompt_attention_mask",val:": Optional = None"},{name:"prompt_attention_mask_2",val:": Optional = None"},{name:"negative_prompt_attention_mask",val:": Optional = None"},{name:"negative_prompt_attention_mask_2",val:": Optional = None"},{name:"output_type",val:": Optional = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"callback_on_step_end",val:": Union = None"},{name:"callback_on_step_end_tensor_inputs",val:": List = ['latents']"},{name:"guidance_rescale",val:": float = 0.0"},{name:"original_size",val:": Optional = (1024, 1024)"},{name:"target_size",val:": Optional = None"},{name:"crops_coords_top_left",val:": Tuple = (0, 0)"},{name:"use_resolution_binning",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.HunyuanDiTPipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to guide image generation. If not defined, you need to pass <code>prompt_embeds</code>.`,name:"prompt"},{anchor:"diffusers.HunyuanDiTPipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>) &#x2014;
The height in pixels of the generated image.`,name:"height"},{anchor:"diffusers.HunyuanDiTPipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>) &#x2014;
The width in pixels of the generated image.`,name:"width"},{anchor:"diffusers.HunyuanDiTPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 50) &#x2014;
The number of denoising steps. More denoising steps usually lead to a higher quality image at the
expense of slower inference. This parameter is modulated by <code>strength</code>.`,name:"num_inference_steps"},{anchor:"diffusers.HunyuanDiTPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 7.5) &#x2014;
A higher guidance scale value encourages the model to generate images closely linked to the text
<code>prompt</code> at the expense of lower image quality. Guidance scale is enabled when <code>guidance_scale &gt; 1</code>.`,name:"guidance_scale"},{anchor:"diffusers.HunyuanDiTPipeline.__call__.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to guide what to not include in image generation. If not defined, you need to
pass <code>negative_prompt_embeds</code> instead. Ignored when not using guidance (<code>guidance_scale &lt; 1</code>).`,name:"negative_prompt"},{anchor:"diffusers.HunyuanDiTPipeline.__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.HunyuanDiTPipeline.__call__.eta",description:`<strong>eta</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Corresponds to parameter eta (&#x3B7;) from the <a href="https://arxiv.org/abs/2010.02502" rel="nofollow">DDIM</a> paper. Only applies
to the <a href="/docs/diffusers/v0.28.0/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, and is ignored in other schedulers.`,name:"eta"},{anchor:"diffusers.HunyuanDiTPipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code> or <code>List[torch.Generator]</code>, <em>optional</em>) &#x2014;
A <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow"><code>torch.Generator</code></a> to make
generation deterministic.`,name:"generator"},{anchor:"diffusers.HunyuanDiTPipeline.__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 (prompt weighting). If not
provided, text embeddings are generated from the <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.HunyuanDiTPipeline.__call__.prompt_embeds_2",description:`<strong>prompt_embeds_2</strong> (<code>torch.Tensor</code>, <em>optional</em>) &#x2014;
Pre-generated text embeddings. Can be used to easily tweak text inputs (prompt weighting). If not
provided, text embeddings are generated from the <code>prompt</code> input argument.`,name:"prompt_embeds_2"},{anchor:"diffusers.HunyuanDiTPipeline.__call__.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.Tensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative text embeddings. Can be used to easily tweak text inputs (prompt weighting). If
not provided, <code>negative_prompt_embeds</code> are generated from the <code>negative_prompt</code> input argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.HunyuanDiTPipeline.__call__.negative_prompt_embeds_2",description:`<strong>negative_prompt_embeds_2</strong> (<code>torch.Tensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative text embeddings. Can be used to easily tweak text inputs (prompt weighting). If
not provided, <code>negative_prompt_embeds</code> are generated from the <code>negative_prompt</code> input argument.`,name:"negative_prompt_embeds_2"},{anchor:"diffusers.HunyuanDiTPipeline.__call__.prompt_attention_mask",description:`<strong>prompt_attention_mask</strong> (<code>torch.Tensor</code>, <em>optional</em>) &#x2014;
Attention mask for the prompt. Required when <code>prompt_embeds</code> is passed directly.`,name:"prompt_attention_mask"},{anchor:"diffusers.HunyuanDiTPipeline.__call__.prompt_attention_mask_2",description:`<strong>prompt_attention_mask_2</strong> (<code>torch.Tensor</code>, <em>optional</em>) &#x2014;
Attention mask for the prompt. Required when <code>prompt_embeds_2</code> is passed directly.`,name:"prompt_attention_mask_2"},{anchor:"diffusers.HunyuanDiTPipeline.__call__.negative_prompt_attention_mask",description:`<strong>negative_prompt_attention_mask</strong> (<code>torch.Tensor</code>, <em>optional</em>) &#x2014;
Attention mask for the negative prompt. Required when <code>negative_prompt_embeds</code> is passed directly.`,name:"negative_prompt_attention_mask"},{anchor:"diffusers.HunyuanDiTPipeline.__call__.negative_prompt_attention_mask_2",description:`<strong>negative_prompt_attention_mask_2</strong> (<code>torch.Tensor</code>, <em>optional</em>) &#x2014;
Attention mask for the negative prompt. Required when <code>negative_prompt_embeds_2</code> is passed directly.`,name:"negative_prompt_attention_mask_2"},{anchor:"diffusers.HunyuanDiTPipeline.__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 generated image. Choose between <code>PIL.Image</code> or <code>np.array</code>.`,name:"output_type"},{anchor:"diffusers.HunyuanDiTPipeline.__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 <a href="/docs/diffusers/v0.28.0/en/api/pipelines/stable_diffusion/depth2img#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput">StableDiffusionPipelineOutput</a> instead of a
plain tuple.`,name:"return_dict"},{anchor:"diffusers.HunyuanDiTPipeline.__call__.callback_on_step_end",description:`<strong>callback_on_step_end</strong> (<code>Callable[[int, int, Dict], None]</code>, <code>PipelineCallback</code>, <code>MultiPipelineCallbacks</code>, <em>optional</em>) &#x2014;
A callback function or a list of callback functions to be called at the end of each denoising step.`,name:"callback_on_step_end"},{anchor:"diffusers.HunyuanDiTPipeline.__call__.callback_on_step_end_tensor_inputs",description:`<strong>callback_on_step_end_tensor_inputs</strong> (<code>List[str]</code>, <em>optional</em>) &#x2014;
A list of tensor inputs that should be passed to the callback function. If not defined, all tensor
inputs will be passed.`,name:"callback_on_step_end_tensor_inputs"},{anchor:"diffusers.HunyuanDiTPipeline.__call__.guidance_rescale",description:`<strong>guidance_rescale</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Rescale the noise_cfg according to <code>guidance_rescale</code>. Based on findings of <a href="https://arxiv.org/pdf/2305.08891.pdf" rel="nofollow">Common Diffusion Noise
Schedules and Sample Steps are Flawed</a>. See Section 3.4`,name:"guidance_rescale"},{anchor:"diffusers.HunyuanDiTPipeline.__call__.original_size",description:`<strong>original_size</strong> (<code>Tuple[int, int]</code>, <em>optional</em>, defaults to <code>(1024, 1024)</code>) &#x2014;
The original size of the image. Used to calculate the time ids.`,name:"original_size"},{anchor:"diffusers.HunyuanDiTPipeline.__call__.target_size",description:`<strong>target_size</strong> (<code>Tuple[int, int]</code>, <em>optional</em>) &#x2014;
The target size of the image. Used to calculate the time ids.`,name:"target_size"},{anchor:"diffusers.HunyuanDiTPipeline.__call__.crops_coords_top_left",description:`<strong>crops_coords_top_left</strong> (<code>Tuple[int, int]</code>, <em>optional</em>, defaults to <code>(0, 0)</code>) &#x2014;
The top left coordinates of the crop. Used to calculate the time ids.`,name:"crops_coords_top_left"},{anchor:"diffusers.HunyuanDiTPipeline.__call__.use_resolution_binning",description:`<strong>use_resolution_binning</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to use resolution binning or not. If <code>True</code>, the input resolution will be mapped to the closest
standard resolution. Supported resolutions are 1024x1024, 1280x1280, 1024x768, 1152x864, 1280x960,
768x1024, 864x1152, 960x1280, 1280x768, and 768x1280. It is recommended to set this to <code>True</code>.`,name:"use_resolution_binning"}],source:"https://github.com/huggingface/diffusers/blob/v0.28.0/src/diffusers/pipelines/hunyuandit/pipeline_hunyuandit.py#L543",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>If <code>return_dict</code> is <code>True</code>, <a
  href="/docs/diffusers/v0.28.0/en/api/pipelines/stable_diffusion/depth2img#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> is returned,
otherwise a <code>tuple</code> is returned where the first element is a list with the generated images and the
second element is a list of <code>bool</code>s indicating whether the corresponding generated image contains
“not-safe-for-work” (nsfw) content.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/diffusers/v0.28.0/en/api/pipelines/stable_diffusion/depth2img#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),v=new Ne({props:{anchor:"diffusers.HunyuanDiTPipeline.__call__.example",$$slots:{default:[je]},$$scope:{ctx:X}}}),O=new he({props:{name:"encode_prompt",anchor:"diffusers.HunyuanDiTPipeline.encode_prompt",parameters:[{name:"prompt",val:": str"},{name:"device",val:": device"},{name:"dtype",val:": dtype"},{name:"num_images_per_prompt",val:": int = 1"},{name:"do_classifier_free_guidance",val:": bool = True"},{name:"negative_prompt",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:"max_sequence_length",val:": Optional = None"},{name:"text_encoder_index",val:": int = 0"}],parametersDescription:[{anchor:"diffusers.HunyuanDiTPipeline.encode_prompt.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
prompt to be encoded
device &#x2014; (<code>torch.device</code>):
torch device`,name:"prompt"},{anchor:"diffusers.HunyuanDiTPipeline.encode_prompt.dtype",description:`<strong>dtype</strong> (<code>torch.dtype</code>) &#x2014;
torch dtype`,name:"dtype"},{anchor:"diffusers.HunyuanDiTPipeline.encode_prompt.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>) &#x2014;
number of images that should be generated per prompt`,name:"num_images_per_prompt"},{anchor:"diffusers.HunyuanDiTPipeline.encode_prompt.do_classifier_free_guidance",description:`<strong>do_classifier_free_guidance</strong> (<code>bool</code>) &#x2014;
whether to use classifier free guidance or not`,name:"do_classifier_free_guidance"},{anchor:"diffusers.HunyuanDiTPipeline.encode_prompt.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.HunyuanDiTPipeline.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.HunyuanDiTPipeline.encode_prompt.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.Tensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt
weighting. If not provided, negative_prompt_embeds will be generated from <code>negative_prompt</code> input
argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.HunyuanDiTPipeline.encode_prompt.prompt_attention_mask",description:`<strong>prompt_attention_mask</strong> (<code>torch.Tensor</code>, <em>optional</em>) &#x2014;
Attention mask for the prompt. Required when <code>prompt_embeds</code> is passed directly.`,name:"prompt_attention_mask"},{anchor:"diffusers.HunyuanDiTPipeline.encode_prompt.negative_prompt_attention_mask",description:`<strong>negative_prompt_attention_mask</strong> (<code>torch.Tensor</code>, <em>optional</em>) &#x2014;
Attention mask for the negative prompt. Required when <code>negative_prompt_embeds</code> is passed directly.`,name:"negative_prompt_attention_mask"},{anchor:"diffusers.HunyuanDiTPipeline.encode_prompt.max_sequence_length",description:"<strong>max_sequence_length</strong> (<code>int</code>, <em>optional</em>) &#x2014; maximum sequence length to use for the prompt.",name:"max_sequence_length"},{anchor:"diffusers.HunyuanDiTPipeline.encode_prompt.text_encoder_index",description:`<strong>text_encoder_index</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Index of the text encoder to use. <code>0</code> for clip and <code>1</code> for T5.`,name:"text_encoder_index"}],source:"https://github.com/huggingface/diffusers/blob/v0.28.0/src/diffusers/pipelines/hunyuandit/pipeline_hunyuandit.py#L234"}}),N=new Se({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/pipelines/hunyuandit.md"}}),{c(){p=s("meta"),k=i(),h=s("p"),_=i(),y(f.$$.fragment),d=i(),g=s("p"),g.innerHTML=Te,Y=i(),$=s("p"),$.innerHTML=ve,Z=i(),C=s("p"),C.textContent=be,Q=i(),M=s("p"),M.innerHTML=ye,K=i(),J=s("p"),J.innerHTML=xe,ee=i(),I=s("p"),I.innerHTML=De,te=i(),U=s("p"),U.textContent=we,ne=i(),z=s("ul"),z.innerHTML=He,oe=i(),y(L.$$.fragment),ie=i(),l=s("div"),y(B.$$.fragment),pe=i(),S=s("p"),S.textContent=Pe,le=i(),j=s("p"),j.innerHTML=ke,ce=i(),q=s("p"),q.innerHTML=$e,me=i(),T=s("div"),y(E.$$.fragment),ue=i(),V=s("p"),V.textContent=Ce,_e=i(),y(v.$$.fragment),fe=i(),b=s("div"),y(O.$$.fragment),ge=i(),A=s("p"),A.textContent=Me,ae=i(),y(N.$$.fragment),se=i(),G=s("p"),this.h()},l(e){const t=Ee("svelte-u9bgzb",document.head);p=r(t,"META",{name:!0,content:!0}),t.forEach(n),k=a(e),h=r(e,"P",{}),R(h).forEach(n),_=a(e),x(f.$$.fragment,e),d=a(e),g=r(e,"P",{"data-svelte-h":!0}),u(g)!=="svelte-2bc00t"&&(g.innerHTML=Te),Y=a(e),$=r(e,"P",{"data-svelte-h":!0}),u($)!=="svelte-13ajqzh"&&($.innerHTML=ve),Z=a(e),C=r(e,"P",{"data-svelte-h":!0}),u(C)!=="svelte-1cwsb16"&&(C.textContent=be),Q=a(e),M=r(e,"P",{"data-svelte-h":!0}),u(M)!=="svelte-pnixkh"&&(M.innerHTML=ye),K=a(e),J=r(e,"P",{"data-svelte-h":!0}),u(J)!=="svelte-14jgagb"&&(J.innerHTML=xe),ee=a(e),I=r(e,"P",{"data-svelte-h":!0}),u(I)!=="svelte-4ilgcj"&&(I.innerHTML=De),te=a(e),U=r(e,"P",{"data-svelte-h":!0}),u(U)!=="svelte-csifv3"&&(U.textContent=we),ne=a(e),z=r(e,"UL",{"data-svelte-h":!0}),u(z)!=="svelte-1jg2mmd"&&(z.innerHTML=He),oe=a(e),x(L.$$.fragment,e),ie=a(e),l=r(e,"DIV",{class:!0});var m=R(l);x(B.$$.fragment,m),pe=a(m),S=r(m,"P",{"data-svelte-h":!0}),u(S)!=="svelte-ue2deu"&&(S.textContent=Pe),le=a(m),j=r(m,"P",{"data-svelte-h":!0}),u(j)!=="svelte-lghmy4"&&(j.innerHTML=ke),ce=a(m),q=r(m,"P",{"data-svelte-h":!0}),u(q)!=="svelte-18ud7q1"&&(q.innerHTML=$e),me=a(m),T=r(m,"DIV",{class:!0});var W=R(T);x(E.$$.fragment,W),ue=a(W),V=r(W,"P",{"data-svelte-h":!0}),u(V)!=="svelte-1jqbgbl"&&(V.textContent=Ce),_e=a(W),x(v.$$.fragment,W),W.forEach(n),fe=a(m),b=r(m,"DIV",{class:!0});var de=R(b);x(O.$$.fragment,de),ge=a(de),A=r(de,"P",{"data-svelte-h":!0}),u(A)!=="svelte-16q0ax1"&&(A.textContent=Me),de.forEach(n),m.forEach(n),ae=a(e),x(N.$$.fragment,e),se=a(e),G=r(e,"P",{}),R(G).forEach(n),this.h()},h(){F(p,"name","hf:doc:metadata"),F(p,"content",Ve),F(T,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),F(b,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),F(l,"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){c(document.head,p),o(e,k,t),o(e,h,t),o(e,_,t),D(f,e,t),o(e,d,t),o(e,g,t),o(e,Y,t),o(e,$,t),o(e,Z,t),o(e,C,t),o(e,Q,t),o(e,M,t),o(e,K,t),o(e,J,t),o(e,ee,t),o(e,I,t),o(e,te,t),o(e,U,t),o(e,ne,t),o(e,z,t),o(e,oe,t),D(L,e,t),o(e,ie,t),o(e,l,t),D(B,l,null),c(l,pe),c(l,S),c(l,le),c(l,j),c(l,ce),c(l,q),c(l,me),c(l,T),D(E,T,null),c(T,ue),c(T,V),c(T,_e),D(v,T,null),c(l,fe),c(l,b),D(O,b,null),c(b,ge),c(b,A),o(e,ae,t),D(N,e,t),o(e,se,t),o(e,G,t),re=!0},p(e,[t]){const m={};t&2&&(m.$$scope={dirty:t,ctx:e}),v.$set(m)},i(e){re||(w(f.$$.fragment,e),w(L.$$.fragment,e),w(B.$$.fragment,e),w(E.$$.fragment,e),w(v.$$.fragment,e),w(O.$$.fragment,e),w(N.$$.fragment,e),re=!0)},o(e){H(f.$$.fragment,e),H(L.$$.fragment,e),H(B.$$.fragment,e),H(E.$$.fragment,e),H(v.$$.fragment,e),H(O.$$.fragment,e),H(N.$$.fragment,e),re=!1},d(e){e&&(n(k),n(h),n(_),n(d),n(g),n(Y),n($),n(Z),n(C),n(Q),n(M),n(K),n(J),n(ee),n(I),n(te),n(U),n(ne),n(z),n(oe),n(ie),n(l),n(ae),n(se),n(G)),n(p),P(f,e),P(L,e),P(B),P(E),P(v),P(O),P(N,e)}}}const Ve='{"title":"Hunyuan-DiT","local":"hunyuan-dit","sections":[{"title":"HunyuanDiTPipeline","local":"diffusers.HunyuanDiTPipeline","sections":[],"depth":2}],"depth":1}';function Ae(X){return Ue(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ze extends Le{constructor(p){super(),Be(this,p,Ae,qe,Ie,{})}}export{Ze as component};
