import{s as Wt,o as Bt,n as Lt}from"../chunks/scheduler.182ea377.js";import{S as Gt,i as Qt,g as o,s as n,r as m,A as Yt,h as s,f as r,c as i,j as $,u as g,x as p,k as P,y as t,a as x,v as _,d as h,t as b,w as v}from"../chunks/index.abf12888.js";import{T as $t}from"../chunks/Tip.230e2334.js";import{D as k}from"../chunks/Docstring.93f6f462.js";import{H as Pt}from"../chunks/Heading.16916d63.js";function Jt(K){let a,L="This is an experimental pipeline and is likely to change in the future.";return{c(){a=o("p"),a.textContent=L},l(c){a=s(c,"P",{"data-svelte-h":!0}),p(a)!=="svelte-5fv3pw"&&(a.textContent=L)},m(c,S){x(c,a,S)},p:Lt,d(c){c&&r(a)}}}function Zt(K){let a,L="This API is 🧪 experimental.";return{c(){a=o("p"),a.textContent=L},l(c){a=s(c,"P",{"data-svelte-h":!0}),p(a)!=="svelte-89q1io"&&(a.textContent=L)},m(c,S){x(c,a,S)},p:Lt,d(c){c&&r(a)}}}function en(K){let a,L="This API is 🧪 experimental.";return{c(){a=o("p"),a.textContent=L},l(c){a=s(c,"P",{"data-svelte-h":!0}),p(a)!=="svelte-89q1io"&&(a.textContent=L)},m(c,S){x(c,a,S)},p:Lt,d(c){c&&r(a)}}}function tn(K){let a,L,c,S,q,Te,F,wt='<a href="https://github.com/crowsonkb/k-diffusion" rel="nofollow">k-diffusion</a> is a popular library created by <a href="https://github.com/crowsonkb/" rel="nofollow">Katherine Crowson</a>. We provide <code>StableDiffusionKDiffusionPipeline</code> and <code>StableDiffusionXLKDiffusionPipeline</code> that allow you to run Stable DIffusion with samplers from k-diffusion.',Ke,U,kt='Note that most the samplers from k-diffusion are implemented in Diffusers and we recommend using existing schedulers. You can find a mapping between k-diffusion samplers and schedulers in Diffusers <a href="https://huggingface.co/docs/diffusers/api/schedulers/overview" rel="nofollow">here</a>',ye,O,Ie,u,R,Fe,re,St="Pipeline for text-to-image generation using Stable Diffusion.",Ue,ae,Ct=`This model inherits from <a href="/docs/diffusers/main/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.)`,Oe,fe,Tt="The pipeline also inherits the following loading methods:",Re,le,Kt='<li><a href="/docs/diffusers/main/en/api/loaders/textual_inversion#diffusers.loaders.TextualInversionLoaderMixin.load_textual_inversion">load_textual_inversion()</a> for loading textual inversion embeddings</li> <li><a href="/docs/diffusers/main/en/api/loaders/lora#diffusers.loaders.LoraLoaderMixin.load_lora_weights">load_lora_weights()</a> for loading LoRA weights</li> <li><a href="/docs/diffusers/main/en/api/loaders/lora#diffusers.loaders.LoraLoaderMixin.save_lora_weights">save_lora_weights()</a> for saving LoRA weights</li>',We,y,Be,I,W,Ge,de,yt="Encodes the prompt into text encoder hidden states.",Me,B,Xe,f,G,Qe,pe,It="Pipeline for text-to-image generation using Stable Diffusion XL and k-diffusion.",Ye,ce,Mt=`This model inherits from <a href="/docs/diffusers/main/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.)`,Je,ue,Xt="The pipeline also inherits the following loading methods:",Ze,me,zt='<li><a href="/docs/diffusers/main/en/api/loaders/textual_inversion#diffusers.loaders.TextualInversionLoaderMixin.load_textual_inversion">load_textual_inversion()</a> for loading textual inversion embeddings</li> <li><a href="/docs/diffusers/main/en/api/loaders/single_file#diffusers.loaders.FromSingleFileMixin.from_single_file">from_single_file()</a> for loading <code>.ckpt</code> files</li> <li><a href="/docs/diffusers/main/en/api/loaders/lora#diffusers.loaders.StableDiffusionXLLoraLoaderMixin.load_lora_weights">load_lora_weights()</a> for loading LoRA weights</li> <li><code>save_lora_weights()</code> for saving LoRA weights</li> <li><a href="/docs/diffusers/main/en/api/loaders/ip_adapter#diffusers.loaders.IPAdapterMixin.load_ip_adapter">load_ip_adapter()</a> for loading IP Adapters</li>',et,M,Q,tt,ge,At="Disables the FreeU mechanism if enabled.",nt,X,Y,it,_e,Et=`Disable sliced VAE decoding. If <code>enable_vae_slicing</code> was previously enabled, this method will go back to
computing decoding in one step.`,ot,z,J,st,he,Nt=`Disable tiled VAE decoding. If <code>enable_vae_tiling</code> was previously enabled, this method will go back to
computing decoding in one step.`,rt,w,Z,at,be,Vt='Enables the FreeU mechanism as in <a href="https://arxiv.org/abs/2309.11497" rel="nofollow">https://arxiv.org/abs/2309.11497</a>.',ft,ve,Ht="The suffixes after the scaling factors represent the stages where they are being applied.",lt,xe,jt=`Please refer to the <a href="https://github.com/ChenyangSi/FreeU" rel="nofollow">official repository</a> for combinations of the values
that are known to work well for different pipelines such as Stable Diffusion v1, v2, and Stable Diffusion XL.`,dt,A,ee,pt,De,qt=`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.`,ct,E,te,ut,$e,Ft=`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.`,mt,N,ne,gt,Pe,Ut="Encodes the prompt into text encoder hidden states.",_t,C,ie,ht,Le,Ot=`Enables fused QKV projections. For self-attention modules, all projection matrices (i.e., query,
key, value) are fused. For cross-attention modules, key and value projection matrices are fused.`,bt,V,vt,T,oe,xt,we,Rt="Disable QKV projection fusion if enabled.",Dt,H,ze,Ce,Ae;return q=new Pt({props:{title:"K-Diffusion",local:"k-diffusion",headingTag:"h1"}}),O=new Pt({props:{title:"StableDiffusionKDiffusionPipeline",local:"diffusers.StableDiffusionKDiffusionPipeline",headingTag:"h2"}}),R=new k({props:{name:"class diffusers.StableDiffusionKDiffusionPipeline",anchor:"diffusers.StableDiffusionKDiffusionPipeline",parameters:[{name:"vae",val:""},{name:"text_encoder",val:""},{name:"tokenizer",val:""},{name:"unet",val:""},{name:"scheduler",val:""},{name:"safety_checker",val:""},{name:"feature_extractor",val:""},{name:"requires_safety_checker",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.StableDiffusionKDiffusionPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/main/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.StableDiffusionKDiffusionPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>CLIPTextModel</code>) &#x2014;
Frozen text-encoder. Stable Diffusion uses the text portion of
<a href="https://huggingface.co/docs/transformers/model_doc/clip#transformers.CLIPTextModel" rel="nofollow">CLIP</a>, specifically
the <a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a> variant.`,name:"text_encoder"},{anchor:"diffusers.StableDiffusionKDiffusionPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>) &#x2014;
Tokenizer of class
<a href="https://huggingface.co/docs/transformers/v4.21.0/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>.`,name:"tokenizer"},{anchor:"diffusers.StableDiffusionKDiffusionPipeline.unet",description:'<strong>unet</strong> (<a href="/docs/diffusers/main/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014; Conditional U-Net architecture to denoise the encoded image latents.',name:"unet"},{anchor:"diffusers.StableDiffusionKDiffusionPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/main/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents. Can be one of
<a href="/docs/diffusers/main/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/main/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/main/en/api/schedulers/pndm#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"},{anchor:"diffusers.StableDiffusionKDiffusionPipeline.safety_checker",description:`<strong>safety_checker</strong> (<code>StableDiffusionSafetyChecker</code>) &#x2014;
Classification module that estimates whether generated images could be considered offensive or harmful.
Please, refer to the <a href="https://huggingface.co/runwayml/stable-diffusion-v1-5" rel="nofollow">model card</a> for details.`,name:"safety_checker"},{anchor:"diffusers.StableDiffusionKDiffusionPipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<code>CLIPImageProcessor</code>) &#x2014;
Model that extracts features from generated images to be used as inputs for the <code>safety_checker</code>.`,name:"feature_extractor"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion_k_diffusion/pipeline_stable_diffusion_k_diffusion.py#L50"}}),y=new $t({props:{warning:!0,$$slots:{default:[Jt]},$$scope:{ctx:K}}}),W=new k({props:{name:"encode_prompt",anchor:"diffusers.StableDiffusionKDiffusionPipeline.encode_prompt",parameters:[{name:"prompt",val:""},{name:"device",val:""},{name:"num_images_per_prompt",val:""},{name:"do_classifier_free_guidance",val:""},{name:"negative_prompt",val:" = None"},{name:"prompt_embeds",val:": Optional = None"},{name:"negative_prompt_embeds",val:": Optional = None"},{name:"lora_scale",val:": Optional = None"},{name:"clip_skip",val:": Optional = None"}],parametersDescription:[{anchor:"diffusers.StableDiffusionKDiffusionPipeline.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.StableDiffusionKDiffusionPipeline.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.StableDiffusionKDiffusionPipeline.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.StableDiffusionKDiffusionPipeline.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.StableDiffusionKDiffusionPipeline.encode_prompt.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.FloatTensor</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.StableDiffusionKDiffusionPipeline.encode_prompt.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.FloatTensor</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.StableDiffusionKDiffusionPipeline.encode_prompt.lora_scale",description:`<strong>lora_scale</strong> (<code>float</code>, <em>optional</em>) &#x2014;
A LoRA scale that will be applied to all LoRA layers of the text encoder if LoRA layers are loaded.`,name:"lora_scale"},{anchor:"diffusers.StableDiffusionKDiffusionPipeline.encode_prompt.clip_skip",description:`<strong>clip_skip</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Number of layers to be skipped from CLIP while computing the prompt embeddings. A value of 1 means that
the output of the pre-final layer will be used for computing the prompt embeddings.`,name:"clip_skip"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion_k_diffusion/pipeline_stable_diffusion_k_diffusion.py#L181"}}),B=new Pt({props:{title:"StableDiffusionXLKDiffusionPipeline",local:"diffusers.StableDiffusionXLKDiffusionPipeline",headingTag:"h2"}}),G=new k({props:{name:"class diffusers.StableDiffusionXLKDiffusionPipeline",anchor:"diffusers.StableDiffusionXLKDiffusionPipeline",parameters:[{name:"vae",val:": AutoencoderKL"},{name:"text_encoder",val:": CLIPTextModel"},{name:"text_encoder_2",val:": CLIPTextModelWithProjection"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"tokenizer_2",val:": CLIPTokenizer"},{name:"unet",val:": UNet2DConditionModel"},{name:"scheduler",val:": KarrasDiffusionSchedulers"},{name:"force_zeros_for_empty_prompt",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.StableDiffusionXLKDiffusionPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/main/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.StableDiffusionXLKDiffusionPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>CLIPTextModel</code>) &#x2014;
Frozen text-encoder. Stable Diffusion XL uses the text portion of
<a href="https://huggingface.co/docs/transformers/model_doc/clip#transformers.CLIPTextModel" rel="nofollow">CLIP</a>, specifically
the <a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a> variant.`,name:"text_encoder"},{anchor:"diffusers.StableDiffusionXLKDiffusionPipeline.text_encoder_2",description:`<strong>text_encoder_2</strong> (<code> CLIPTextModelWithProjection</code>) &#x2014;
Second frozen text-encoder. Stable Diffusion XL uses the text and pool portion of
<a href="https://huggingface.co/docs/transformers/model_doc/clip#transformers.CLIPTextModelWithProjection" rel="nofollow">CLIP</a>,
specifically the
<a href="https://huggingface.co/laion/CLIP-ViT-bigG-14-laion2B-39B-b160k" rel="nofollow">laion/CLIP-ViT-bigG-14-laion2B-39B-b160k</a>
variant.`,name:"text_encoder_2"},{anchor:"diffusers.StableDiffusionXLKDiffusionPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>) &#x2014;
Tokenizer of class
<a href="https://huggingface.co/docs/transformers/v4.21.0/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>.`,name:"tokenizer"},{anchor:"diffusers.StableDiffusionXLKDiffusionPipeline.tokenizer_2",description:`<strong>tokenizer_2</strong> (<code>CLIPTokenizer</code>) &#x2014;
Second Tokenizer of class
<a href="https://huggingface.co/docs/transformers/v4.21.0/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>.`,name:"tokenizer_2"},{anchor:"diffusers.StableDiffusionXLKDiffusionPipeline.unet",description:'<strong>unet</strong> (<a href="/docs/diffusers/main/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014; Conditional U-Net architecture to denoise the encoded image latents.',name:"unet"},{anchor:"diffusers.StableDiffusionXLKDiffusionPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/main/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents. Can be one of
<a href="/docs/diffusers/main/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/main/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/main/en/api/schedulers/pndm#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"},{anchor:"diffusers.StableDiffusionXLKDiffusionPipeline.force_zeros_for_empty_prompt",description:`<strong>force_zeros_for_empty_prompt</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>&quot;True&quot;</code>) &#x2014;
Whether the negative prompt embeddings shall be forced to always be set to 0. Also see the config of
<code>stabilityai/stable-diffusion-xl-base-1-0</code>.`,name:"force_zeros_for_empty_prompt"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion_k_diffusion/pipeline_stable_diffusion_xl_k_diffusion.py#L92"}}),Q=new k({props:{name:"disable_freeu",anchor:"diffusers.StableDiffusionXLKDiffusionPipeline.disable_freeu",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion_k_diffusion/pipeline_stable_diffusion_xl_k_diffusion.py#L609"}}),Y=new k({props:{name:"disable_vae_slicing",anchor:"diffusers.StableDiffusionXLKDiffusionPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion_k_diffusion/pipeline_stable_diffusion_xl_k_diffusion.py#L208"}}),J=new k({props:{name:"disable_vae_tiling",anchor:"diffusers.StableDiffusionXLKDiffusionPipeline.disable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion_k_diffusion/pipeline_stable_diffusion_xl_k_diffusion.py#L225"}}),Z=new k({props:{name:"enable_freeu",anchor:"diffusers.StableDiffusionXLKDiffusionPipeline.enable_freeu",parameters:[{name:"s1",val:": float"},{name:"s2",val:": float"},{name:"b1",val:": float"},{name:"b2",val:": float"}],parametersDescription:[{anchor:"diffusers.StableDiffusionXLKDiffusionPipeline.enable_freeu.s1",description:`<strong>s1</strong> (<code>float</code>) &#x2014;
Scaling factor for stage 1 to attenuate the contributions of the skip features. This is done to
mitigate &#x201C;oversmoothing effect&#x201D; in the enhanced denoising process.`,name:"s1"},{anchor:"diffusers.StableDiffusionXLKDiffusionPipeline.enable_freeu.s2",description:`<strong>s2</strong> (<code>float</code>) &#x2014;
Scaling factor for stage 2 to attenuate the contributions of the skip features. This is done to
mitigate &#x201C;oversmoothing effect&#x201D; in the enhanced denoising process.`,name:"s2"},{anchor:"diffusers.StableDiffusionXLKDiffusionPipeline.enable_freeu.b1",description:"<strong>b1</strong> (<code>float</code>) &#x2014; Scaling factor for stage 1 to amplify the contributions of backbone features.",name:"b1"},{anchor:"diffusers.StableDiffusionXLKDiffusionPipeline.enable_freeu.b2",description:"<strong>b2</strong> (<code>float</code>) &#x2014; Scaling factor for stage 2 to amplify the contributions of backbone features.",name:"b2"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion_k_diffusion/pipeline_stable_diffusion_xl_k_diffusion.py#L586"}}),ee=new k({props:{name:"enable_vae_slicing",anchor:"diffusers.StableDiffusionXLKDiffusionPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion_k_diffusion/pipeline_stable_diffusion_xl_k_diffusion.py#L200"}}),te=new k({props:{name:"enable_vae_tiling",anchor:"diffusers.StableDiffusionXLKDiffusionPipeline.enable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion_k_diffusion/pipeline_stable_diffusion_xl_k_diffusion.py#L216"}}),ne=new k({props:{name:"encode_prompt",anchor:"diffusers.StableDiffusionXLKDiffusionPipeline.encode_prompt",parameters:[{name:"prompt",val:": str"},{name:"prompt_2",val:": Optional = None"},{name:"device",val:": Optional = None"},{name:"num_images_per_prompt",val:": int = 1"},{name:"do_classifier_free_guidance",val:": bool = True"},{name:"negative_prompt",val:": Optional = None"},{name:"negative_prompt_2",val:": Optional = None"},{name:"prompt_embeds",val:": Optional = None"},{name:"negative_prompt_embeds",val:": Optional = None"},{name:"pooled_prompt_embeds",val:": Optional = None"},{name:"negative_pooled_prompt_embeds",val:": Optional = None"},{name:"lora_scale",val:": Optional = None"},{name:"clip_skip",val:": Optional = None"}],parametersDescription:[{anchor:"diffusers.StableDiffusionXLKDiffusionPipeline.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.StableDiffusionXLKDiffusionPipeline.encode_prompt.prompt_2",description:`<strong>prompt_2</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to be sent to the <code>tokenizer_2</code> and <code>text_encoder_2</code>. If not defined, <code>prompt</code> is
used in both text-encoders
device &#x2014; (<code>torch.device</code>):
torch device`,name:"prompt_2"},{anchor:"diffusers.StableDiffusionXLKDiffusionPipeline.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.StableDiffusionXLKDiffusionPipeline.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.StableDiffusionXLKDiffusionPipeline.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.StableDiffusionXLKDiffusionPipeline.encode_prompt.negative_prompt_2",description:`<strong>negative_prompt_2</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the image generation to be sent to <code>tokenizer_2</code> and
<code>text_encoder_2</code>. If not defined, <code>negative_prompt</code> is used in both text-encoders`,name:"negative_prompt_2"},{anchor:"diffusers.StableDiffusionXLKDiffusionPipeline.encode_prompt.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.FloatTensor</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.StableDiffusionXLKDiffusionPipeline.encode_prompt.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.FloatTensor</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.StableDiffusionXLKDiffusionPipeline.encode_prompt.pooled_prompt_embeds",description:`<strong>pooled_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated pooled text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting.
If not provided, pooled text embeddings will be generated from <code>prompt</code> input argument.`,name:"pooled_prompt_embeds"},{anchor:"diffusers.StableDiffusionXLKDiffusionPipeline.encode_prompt.negative_pooled_prompt_embeds",description:`<strong>negative_pooled_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative pooled text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt
weighting. If not provided, pooled negative_prompt_embeds will be generated from <code>negative_prompt</code>
input argument.`,name:"negative_pooled_prompt_embeds"},{anchor:"diffusers.StableDiffusionXLKDiffusionPipeline.encode_prompt.lora_scale",description:`<strong>lora_scale</strong> (<code>float</code>, <em>optional</em>) &#x2014;
A lora scale that will be applied to all LoRA layers of the text encoder if LoRA layers are loaded.`,name:"lora_scale"},{anchor:"diffusers.StableDiffusionXLKDiffusionPipeline.encode_prompt.clip_skip",description:`<strong>clip_skip</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Number of layers to be skipped from CLIP while computing the prompt embeddings. A value of 1 means that
the output of the pre-final layer will be used for computing the prompt embeddings.`,name:"clip_skip"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion_k_diffusion/pipeline_stable_diffusion_xl_k_diffusion.py#L233"}}),ie=new k({props:{name:"fuse_qkv_projections",anchor:"diffusers.StableDiffusionXLKDiffusionPipeline.fuse_qkv_projections",parameters:[{name:"unet",val:": bool = True"},{name:"vae",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.StableDiffusionXLKDiffusionPipeline.fuse_qkv_projections.unet",description:"<strong>unet</strong> (<code>bool</code>, defaults to <code>True</code>) &#x2014; To apply fusion on the UNet.",name:"unet"},{anchor:"diffusers.StableDiffusionXLKDiffusionPipeline.fuse_qkv_projections.vae",description:"<strong>vae</strong> (<code>bool</code>, defaults to <code>True</code>) &#x2014; To apply fusion on the VAE.",name:"vae"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion_k_diffusion/pipeline_stable_diffusion_xl_k_diffusion.py#L614"}}),V=new $t({props:{warning:!0,$$slots:{default:[Zt]},$$scope:{ctx:K}}}),oe=new k({props:{name:"unfuse_qkv_projections",anchor:"diffusers.StableDiffusionXLKDiffusionPipeline.unfuse_qkv_projections",parameters:[{name:"unet",val:": bool = True"},{name:"vae",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.StableDiffusionXLKDiffusionPipeline.unfuse_qkv_projections.unet",description:"<strong>unet</strong> (<code>bool</code>, defaults to <code>True</code>) &#x2014; To apply fusion on the UNet.",name:"unet"},{anchor:"diffusers.StableDiffusionXLKDiffusionPipeline.unfuse_qkv_projections.vae",description:"<strong>vae</strong> (<code>bool</code>, defaults to <code>True</code>) &#x2014; To apply fusion on the VAE.",name:"vae"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion_k_diffusion/pipeline_stable_diffusion_xl_k_diffusion.py#L645"}}),H=new $t({props:{warning:!0,$$slots:{default:[en]},$$scope:{ctx:K}}}),{c(){a=o("meta"),L=n(),c=o("p"),S=n(),m(q.$$.fragment),Te=n(),F=o("p"),F.innerHTML=wt,Ke=n(),U=o("p"),U.innerHTML=kt,ye=n(),m(O.$$.fragment),Ie=n(),u=o("div"),m(R.$$.fragment),Fe=n(),re=o("p"),re.textContent=St,Ue=n(),ae=o("p"),ae.innerHTML=Ct,Oe=n(),fe=o("p"),fe.textContent=Tt,Re=n(),le=o("ul"),le.innerHTML=Kt,We=n(),m(y.$$.fragment),Be=n(),I=o("div"),m(W.$$.fragment),Ge=n(),de=o("p"),de.textContent=yt,Me=n(),m(B.$$.fragment),Xe=n(),f=o("div"),m(G.$$.fragment),Qe=n(),pe=o("p"),pe.textContent=It,Ye=n(),ce=o("p"),ce.innerHTML=Mt,Je=n(),ue=o("p"),ue.textContent=Xt,Ze=n(),me=o("ul"),me.innerHTML=zt,et=n(),M=o("div"),m(Q.$$.fragment),tt=n(),ge=o("p"),ge.textContent=At,nt=n(),X=o("div"),m(Y.$$.fragment),it=n(),_e=o("p"),_e.innerHTML=Et,ot=n(),z=o("div"),m(J.$$.fragment),st=n(),he=o("p"),he.innerHTML=Nt,rt=n(),w=o("div"),m(Z.$$.fragment),at=n(),be=o("p"),be.innerHTML=Vt,ft=n(),ve=o("p"),ve.textContent=Ht,lt=n(),xe=o("p"),xe.innerHTML=jt,dt=n(),A=o("div"),m(ee.$$.fragment),pt=n(),De=o("p"),De.textContent=qt,ct=n(),E=o("div"),m(te.$$.fragment),ut=n(),$e=o("p"),$e.textContent=Ft,mt=n(),N=o("div"),m(ne.$$.fragment),gt=n(),Pe=o("p"),Pe.textContent=Ut,_t=n(),C=o("div"),m(ie.$$.fragment),ht=n(),Le=o("p"),Le.textContent=Ot,bt=n(),m(V.$$.fragment),vt=n(),T=o("div"),m(oe.$$.fragment),xt=n(),we=o("p"),we.textContent=Rt,Dt=n(),m(H.$$.fragment),ze=n(),Ce=o("p"),this.h()},l(e){const d=Yt("svelte-u9bgzb",document.head);a=s(d,"META",{name:!0,content:!0}),d.forEach(r),L=i(e),c=s(e,"P",{}),$(c).forEach(r),S=i(e),g(q.$$.fragment,e),Te=i(e),F=s(e,"P",{"data-svelte-h":!0}),p(F)!=="svelte-9bprpz"&&(F.innerHTML=wt),Ke=i(e),U=s(e,"P",{"data-svelte-h":!0}),p(U)!=="svelte-kxbfc9"&&(U.innerHTML=kt),ye=i(e),g(O.$$.fragment,e),Ie=i(e),u=s(e,"DIV",{class:!0});var D=$(u);g(R.$$.fragment,D),Fe=i(D),re=s(D,"P",{"data-svelte-h":!0}),p(re)!=="svelte-35p306"&&(re.textContent=St),Ue=i(D),ae=s(D,"P",{"data-svelte-h":!0}),p(ae)!=="svelte-wu1jmh"&&(ae.innerHTML=Ct),Oe=i(D),fe=s(D,"P",{"data-svelte-h":!0}),p(fe)!=="svelte-14s6m4u"&&(fe.textContent=Tt),Re=i(D),le=s(D,"UL",{"data-svelte-h":!0}),p(le)!=="svelte-ks5x56"&&(le.innerHTML=Kt),We=i(D),g(y.$$.fragment,D),Be=i(D),I=s(D,"DIV",{class:!0});var se=$(I);g(W.$$.fragment,se),Ge=i(se),de=s(se,"P",{"data-svelte-h":!0}),p(de)!=="svelte-16q0ax1"&&(de.textContent=yt),se.forEach(r),D.forEach(r),Me=i(e),g(B.$$.fragment,e),Xe=i(e),f=s(e,"DIV",{class:!0});var l=$(f);g(G.$$.fragment,l),Qe=i(l),pe=s(l,"P",{"data-svelte-h":!0}),p(pe)!=="svelte-3dg7oo"&&(pe.textContent=It),Ye=i(l),ce=s(l,"P",{"data-svelte-h":!0}),p(ce)!=="svelte-wu1jmh"&&(ce.innerHTML=Mt),Je=i(l),ue=s(l,"P",{"data-svelte-h":!0}),p(ue)!=="svelte-14s6m4u"&&(ue.textContent=Xt),Ze=i(l),me=s(l,"UL",{"data-svelte-h":!0}),p(me)!=="svelte-1ir2i9c"&&(me.innerHTML=zt),et=i(l),M=s(l,"DIV",{class:!0});var Ee=$(M);g(Q.$$.fragment,Ee),tt=i(Ee),ge=s(Ee,"P",{"data-svelte-h":!0}),p(ge)!=="svelte-psupw6"&&(ge.textContent=At),Ee.forEach(r),nt=i(l),X=s(l,"DIV",{class:!0});var Ne=$(X);g(Y.$$.fragment,Ne),it=i(Ne),_e=s(Ne,"P",{"data-svelte-h":!0}),p(_e)!=="svelte-1s3c06i"&&(_e.innerHTML=Et),Ne.forEach(r),ot=i(l),z=s(l,"DIV",{class:!0});var Ve=$(z);g(J.$$.fragment,Ve),st=i(Ve),he=s(Ve,"P",{"data-svelte-h":!0}),p(he)!=="svelte-pkn4ui"&&(he.innerHTML=Nt),Ve.forEach(r),rt=i(l),w=s(l,"DIV",{class:!0});var j=$(w);g(Z.$$.fragment,j),at=i(j),be=s(j,"P",{"data-svelte-h":!0}),p(be)!=="svelte-1f3tmq1"&&(be.innerHTML=Vt),ft=i(j),ve=s(j,"P",{"data-svelte-h":!0}),p(ve)!=="svelte-xjijlp"&&(ve.textContent=Ht),lt=i(j),xe=s(j,"P",{"data-svelte-h":!0}),p(xe)!=="svelte-hy0nzs"&&(xe.innerHTML=jt),j.forEach(r),dt=i(l),A=s(l,"DIV",{class:!0});var He=$(A);g(ee.$$.fragment,He),pt=i(He),De=s(He,"P",{"data-svelte-h":!0}),p(De)!=="svelte-14bnrb6"&&(De.textContent=qt),He.forEach(r),ct=i(l),E=s(l,"DIV",{class:!0});var je=$(E);g(te.$$.fragment,je),ut=i(je),$e=s(je,"P",{"data-svelte-h":!0}),p($e)!=="svelte-1xwrf7t"&&($e.textContent=Ft),je.forEach(r),mt=i(l),N=s(l,"DIV",{class:!0});var qe=$(N);g(ne.$$.fragment,qe),gt=i(qe),Pe=s(qe,"P",{"data-svelte-h":!0}),p(Pe)!=="svelte-16q0ax1"&&(Pe.textContent=Ut),qe.forEach(r),_t=i(l),C=s(l,"DIV",{class:!0});var ke=$(C);g(ie.$$.fragment,ke),ht=i(ke),Le=s(ke,"P",{"data-svelte-h":!0}),p(Le)!=="svelte-le0q9u"&&(Le.textContent=Ot),bt=i(ke),g(V.$$.fragment,ke),ke.forEach(r),vt=i(l),T=s(l,"DIV",{class:!0});var Se=$(T);g(oe.$$.fragment,Se),xt=i(Se),we=s(Se,"P",{"data-svelte-h":!0}),p(we)!=="svelte-fohozp"&&(we.textContent=Rt),Dt=i(Se),g(H.$$.fragment,Se),Se.forEach(r),l.forEach(r),ze=i(e),Ce=s(e,"P",{}),$(Ce).forEach(r),this.h()},h(){P(a,"name","hf:doc:metadata"),P(a,"content",nn),P(I,"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(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),P(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),P(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),P(w,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),P(A,"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(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),P(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),P(T,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),P(f,"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,d){t(document.head,a),x(e,L,d),x(e,c,d),x(e,S,d),_(q,e,d),x(e,Te,d),x(e,F,d),x(e,Ke,d),x(e,U,d),x(e,ye,d),_(O,e,d),x(e,Ie,d),x(e,u,d),_(R,u,null),t(u,Fe),t(u,re),t(u,Ue),t(u,ae),t(u,Oe),t(u,fe),t(u,Re),t(u,le),t(u,We),_(y,u,null),t(u,Be),t(u,I),_(W,I,null),t(I,Ge),t(I,de),x(e,Me,d),_(B,e,d),x(e,Xe,d),x(e,f,d),_(G,f,null),t(f,Qe),t(f,pe),t(f,Ye),t(f,ce),t(f,Je),t(f,ue),t(f,Ze),t(f,me),t(f,et),t(f,M),_(Q,M,null),t(M,tt),t(M,ge),t(f,nt),t(f,X),_(Y,X,null),t(X,it),t(X,_e),t(f,ot),t(f,z),_(J,z,null),t(z,st),t(z,he),t(f,rt),t(f,w),_(Z,w,null),t(w,at),t(w,be),t(w,ft),t(w,ve),t(w,lt),t(w,xe),t(f,dt),t(f,A),_(ee,A,null),t(A,pt),t(A,De),t(f,ct),t(f,E),_(te,E,null),t(E,ut),t(E,$e),t(f,mt),t(f,N),_(ne,N,null),t(N,gt),t(N,Pe),t(f,_t),t(f,C),_(ie,C,null),t(C,ht),t(C,Le),t(C,bt),_(V,C,null),t(f,vt),t(f,T),_(oe,T,null),t(T,xt),t(T,we),t(T,Dt),_(H,T,null),x(e,ze,d),x(e,Ce,d),Ae=!0},p(e,[d]){const D={};d&2&&(D.$$scope={dirty:d,ctx:e}),y.$set(D);const se={};d&2&&(se.$$scope={dirty:d,ctx:e}),V.$set(se);const l={};d&2&&(l.$$scope={dirty:d,ctx:e}),H.$set(l)},i(e){Ae||(h(q.$$.fragment,e),h(O.$$.fragment,e),h(R.$$.fragment,e),h(y.$$.fragment,e),h(W.$$.fragment,e),h(B.$$.fragment,e),h(G.$$.fragment,e),h(Q.$$.fragment,e),h(Y.$$.fragment,e),h(J.$$.fragment,e),h(Z.$$.fragment,e),h(ee.$$.fragment,e),h(te.$$.fragment,e),h(ne.$$.fragment,e),h(ie.$$.fragment,e),h(V.$$.fragment,e),h(oe.$$.fragment,e),h(H.$$.fragment,e),Ae=!0)},o(e){b(q.$$.fragment,e),b(O.$$.fragment,e),b(R.$$.fragment,e),b(y.$$.fragment,e),b(W.$$.fragment,e),b(B.$$.fragment,e),b(G.$$.fragment,e),b(Q.$$.fragment,e),b(Y.$$.fragment,e),b(J.$$.fragment,e),b(Z.$$.fragment,e),b(ee.$$.fragment,e),b(te.$$.fragment,e),b(ne.$$.fragment,e),b(ie.$$.fragment,e),b(V.$$.fragment,e),b(oe.$$.fragment,e),b(H.$$.fragment,e),Ae=!1},d(e){e&&(r(L),r(c),r(S),r(Te),r(F),r(Ke),r(U),r(ye),r(Ie),r(u),r(Me),r(Xe),r(f),r(ze),r(Ce)),r(a),v(q,e),v(O,e),v(R),v(y),v(W),v(B,e),v(G),v(Q),v(Y),v(J),v(Z),v(ee),v(te),v(ne),v(ie),v(V),v(oe),v(H)}}}const nn='{"title":"K-Diffusion","local":"k-diffusion","sections":[{"title":"StableDiffusionKDiffusionPipeline","local":"diffusers.StableDiffusionKDiffusionPipeline","sections":[],"depth":2},{"title":"StableDiffusionXLKDiffusionPipeline","local":"diffusers.StableDiffusionXLKDiffusionPipeline","sections":[],"depth":2}],"depth":1}';function on(K){return Bt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class dn extends Gt{constructor(a){super(),Qt(this,a,on,tn,Wt,{})}}export{dn as component};
