import{s as Wt,o as Bt,n as Lt}from"../chunks/scheduler.182ea377.js";import{S as Gt,i as Qt,g as i,s as o,r as m,A as Yt,h as s,f as r,c as n,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=i("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=i("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 eo(K){let a,L="This API is 🧪 experimental.";return{c(){a=i("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 to(K){let a,L,c,S,j,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/v0.26.1/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/v0.26.1/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/v0.26.1/en/api/loaders/lora#diffusers.loaders.LoraLoaderMixin.load_lora_weights">load_lora_weights()</a> for loading LoRA weights</li> <li><a href="/docs/diffusers/v0.26.1/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/v0.26.1/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/v0.26.1/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/v0.26.1/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/v0.26.1/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/v0.26.1/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.",ot,X,Y,nt,_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.`,it,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,qt=`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,jt=`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,oe,gt,Pe,Ut="Encodes the prompt into text encoder hidden states.",_t,C,ne,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,ie,xt,we,Rt="Disable QKV projection fusion if enabled.",Dt,H,ze,Ce,Ae;return j=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/v0.26.1/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/v0.26.1/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/v0.26.1/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/v0.26.1/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/v0.26.1/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/v0.26.1/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/v0.26.1/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/v0.26.1/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/v0.26.1/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/v0.26.1/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/v0.26.1/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/v0.26.1/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/v0.26.1/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/v0.26.1/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/v0.26.1/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/v0.26.1/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/v0.26.1/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/v0.26.1/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/v0.26.1/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/v0.26.1/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/v0.26.1/src/diffusers/pipelines/stable_diffusion_k_diffusion/pipeline_stable_diffusion_xl_k_diffusion.py#L216"}}),oe=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/v0.26.1/src/diffusers/pipelines/stable_diffusion_k_diffusion/pipeline_stable_diffusion_xl_k_diffusion.py#L233"}}),ne=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/v0.26.1/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}}}),ie=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/v0.26.1/src/diffusers/pipelines/stable_diffusion_k_diffusion/pipeline_stable_diffusion_xl_k_diffusion.py#L645"}}),H=new $t({props:{warning:!0,$$slots:{default:[eo]},$$scope:{ctx:K}}}),{c(){a=i("meta"),L=o(),c=i("p"),S=o(),m(j.$$.fragment),Te=o(),F=i("p"),F.innerHTML=wt,Ke=o(),U=i("p"),U.innerHTML=kt,ye=o(),m(O.$$.fragment),Ie=o(),u=i("div"),m(R.$$.fragment),Fe=o(),re=i("p"),re.textContent=St,Ue=o(),ae=i("p"),ae.innerHTML=Ct,Oe=o(),fe=i("p"),fe.textContent=Tt,Re=o(),le=i("ul"),le.innerHTML=Kt,We=o(),m(y.$$.fragment),Be=o(),I=i("div"),m(W.$$.fragment),Ge=o(),de=i("p"),de.textContent=yt,Me=o(),m(B.$$.fragment),Xe=o(),f=i("div"),m(G.$$.fragment),Qe=o(),pe=i("p"),pe.textContent=It,Ye=o(),ce=i("p"),ce.innerHTML=Mt,Je=o(),ue=i("p"),ue.textContent=Xt,Ze=o(),me=i("ul"),me.innerHTML=zt,et=o(),M=i("div"),m(Q.$$.fragment),tt=o(),ge=i("p"),ge.textContent=At,ot=o(),X=i("div"),m(Y.$$.fragment),nt=o(),_e=i("p"),_e.innerHTML=Et,it=o(),z=i("div"),m(J.$$.fragment),st=o(),he=i("p"),he.innerHTML=Nt,rt=o(),w=i("div"),m(Z.$$.fragment),at=o(),be=i("p"),be.innerHTML=Vt,ft=o(),ve=i("p"),ve.textContent=Ht,lt=o(),xe=i("p"),xe.innerHTML=qt,dt=o(),A=i("div"),m(ee.$$.fragment),pt=o(),De=i("p"),De.textContent=jt,ct=o(),E=i("div"),m(te.$$.fragment),ut=o(),$e=i("p"),$e.textContent=Ft,mt=o(),N=i("div"),m(oe.$$.fragment),gt=o(),Pe=i("p"),Pe.textContent=Ut,_t=o(),C=i("div"),m(ne.$$.fragment),ht=o(),Le=i("p"),Le.textContent=Ot,bt=o(),m(V.$$.fragment),vt=o(),T=i("div"),m(ie.$$.fragment),xt=o(),we=i("p"),we.textContent=Rt,Dt=o(),m(H.$$.fragment),ze=o(),Ce=i("p"),this.h()},l(e){const d=Yt("svelte-u9bgzb",document.head);a=s(d,"META",{name:!0,content:!0}),d.forEach(r),L=n(e),c=s(e,"P",{}),$(c).forEach(r),S=n(e),g(j.$$.fragment,e),Te=n(e),F=s(e,"P",{"data-svelte-h":!0}),p(F)!=="svelte-9bprpz"&&(F.innerHTML=wt),Ke=n(e),U=s(e,"P",{"data-svelte-h":!0}),p(U)!=="svelte-kxbfc9"&&(U.innerHTML=kt),ye=n(e),g(O.$$.fragment,e),Ie=n(e),u=s(e,"DIV",{class:!0});var D=$(u);g(R.$$.fragment,D),Fe=n(D),re=s(D,"P",{"data-svelte-h":!0}),p(re)!=="svelte-35p306"&&(re.textContent=St),Ue=n(D),ae=s(D,"P",{"data-svelte-h":!0}),p(ae)!=="svelte-185dgu5"&&(ae.innerHTML=Ct),Oe=n(D),fe=s(D,"P",{"data-svelte-h":!0}),p(fe)!=="svelte-14s6m4u"&&(fe.textContent=Tt),Re=n(D),le=s(D,"UL",{"data-svelte-h":!0}),p(le)!=="svelte-1n1qh2q"&&(le.innerHTML=Kt),We=n(D),g(y.$$.fragment,D),Be=n(D),I=s(D,"DIV",{class:!0});var se=$(I);g(W.$$.fragment,se),Ge=n(se),de=s(se,"P",{"data-svelte-h":!0}),p(de)!=="svelte-16q0ax1"&&(de.textContent=yt),se.forEach(r),D.forEach(r),Me=n(e),g(B.$$.fragment,e),Xe=n(e),f=s(e,"DIV",{class:!0});var l=$(f);g(G.$$.fragment,l),Qe=n(l),pe=s(l,"P",{"data-svelte-h":!0}),p(pe)!=="svelte-3dg7oo"&&(pe.textContent=It),Ye=n(l),ce=s(l,"P",{"data-svelte-h":!0}),p(ce)!=="svelte-185dgu5"&&(ce.innerHTML=Mt),Je=n(l),ue=s(l,"P",{"data-svelte-h":!0}),p(ue)!=="svelte-14s6m4u"&&(ue.textContent=Xt),Ze=n(l),me=s(l,"UL",{"data-svelte-h":!0}),p(me)!=="svelte-cte2vi"&&(me.innerHTML=zt),et=n(l),M=s(l,"DIV",{class:!0});var Ee=$(M);g(Q.$$.fragment,Ee),tt=n(Ee),ge=s(Ee,"P",{"data-svelte-h":!0}),p(ge)!=="svelte-psupw6"&&(ge.textContent=At),Ee.forEach(r),ot=n(l),X=s(l,"DIV",{class:!0});var Ne=$(X);g(Y.$$.fragment,Ne),nt=n(Ne),_e=s(Ne,"P",{"data-svelte-h":!0}),p(_e)!=="svelte-1s3c06i"&&(_e.innerHTML=Et),Ne.forEach(r),it=n(l),z=s(l,"DIV",{class:!0});var Ve=$(z);g(J.$$.fragment,Ve),st=n(Ve),he=s(Ve,"P",{"data-svelte-h":!0}),p(he)!=="svelte-pkn4ui"&&(he.innerHTML=Nt),Ve.forEach(r),rt=n(l),w=s(l,"DIV",{class:!0});var q=$(w);g(Z.$$.fragment,q),at=n(q),be=s(q,"P",{"data-svelte-h":!0}),p(be)!=="svelte-1f3tmq1"&&(be.innerHTML=Vt),ft=n(q),ve=s(q,"P",{"data-svelte-h":!0}),p(ve)!=="svelte-xjijlp"&&(ve.textContent=Ht),lt=n(q),xe=s(q,"P",{"data-svelte-h":!0}),p(xe)!=="svelte-hy0nzs"&&(xe.innerHTML=qt),q.forEach(r),dt=n(l),A=s(l,"DIV",{class:!0});var He=$(A);g(ee.$$.fragment,He),pt=n(He),De=s(He,"P",{"data-svelte-h":!0}),p(De)!=="svelte-14bnrb6"&&(De.textContent=jt),He.forEach(r),ct=n(l),E=s(l,"DIV",{class:!0});var qe=$(E);g(te.$$.fragment,qe),ut=n(qe),$e=s(qe,"P",{"data-svelte-h":!0}),p($e)!=="svelte-1xwrf7t"&&($e.textContent=Ft),qe.forEach(r),mt=n(l),N=s(l,"DIV",{class:!0});var je=$(N);g(oe.$$.fragment,je),gt=n(je),Pe=s(je,"P",{"data-svelte-h":!0}),p(Pe)!=="svelte-16q0ax1"&&(Pe.textContent=Ut),je.forEach(r),_t=n(l),C=s(l,"DIV",{class:!0});var ke=$(C);g(ne.$$.fragment,ke),ht=n(ke),Le=s(ke,"P",{"data-svelte-h":!0}),p(Le)!=="svelte-le0q9u"&&(Le.textContent=Ot),bt=n(ke),g(V.$$.fragment,ke),ke.forEach(r),vt=n(l),T=s(l,"DIV",{class:!0});var Se=$(T);g(ie.$$.fragment,Se),xt=n(Se),we=s(Se,"P",{"data-svelte-h":!0}),p(we)!=="svelte-fohozp"&&(we.textContent=Rt),Dt=n(Se),g(H.$$.fragment,Se),Se.forEach(r),l.forEach(r),ze=n(e),Ce=s(e,"P",{}),$(Ce).forEach(r),this.h()},h(){P(a,"name","hf:doc:metadata"),P(a,"content",oo),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),_(j,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,ot),t(f,X),_(Y,X,null),t(X,nt),t(X,_e),t(f,it),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),_(oe,N,null),t(N,gt),t(N,Pe),t(f,_t),t(f,C),_(ne,C,null),t(C,ht),t(C,Le),t(C,bt),_(V,C,null),t(f,vt),t(f,T),_(ie,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(j.$$.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(oe.$$.fragment,e),h(ne.$$.fragment,e),h(V.$$.fragment,e),h(ie.$$.fragment,e),h(H.$$.fragment,e),Ae=!0)},o(e){b(j.$$.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(oe.$$.fragment,e),b(ne.$$.fragment,e),b(V.$$.fragment,e),b(ie.$$.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(j,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(oe),v(ne),v(V),v(ie),v(H)}}}const oo='{"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 no(K){return Bt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class lo extends Gt{constructor(a){super(),Qt(this,a,no,to,Wt,{})}}export{lo as component};
