import{s as nr,o as sr,n as Pe}from"../chunks/scheduler.182ea377.js";import{S as dr,i as ir,g as n,s as o,r as _,A as lr,h as s,f as i,c as r,j as M,u as h,x as u,k as T,y as t,a as b,v as g,d as x,t as L,w as v}from"../chunks/index.abf12888.js";import{T as Dt}from"../chunks/Tip.230e2334.js";import{D as C}from"../chunks/Docstring.b0ac41bc.js";import{C as ko}from"../chunks/CodeBlock.57fe6e13.js";import{E as Co}from"../chunks/ExampleCodeBlock.cf625607.js";import{H as Do,E as cr}from"../chunks/EditOnGithub.9b8e78e4.js";function fr(D){let a,$='To learn more about how to load LoRA weights, see the <a href="../../using-diffusers/loading_adapters#lora">LoRA</a> loading guide.';return{c(){a=n("p"),a.innerHTML=$},l(l){a=s(l,"P",{"data-svelte-h":!0}),u(a)!=="svelte-1fw6lx1"&&(a.innerHTML=$)},m(l,c){b(l,a,c)},p:Pe,d(l){l&&i(a)}}}function pr(D){let a,$="This is an experimental API.";return{c(){a=n("p"),a.textContent=$},l(l){a=s(l,"P",{"data-svelte-h":!0}),u(a)!=="svelte-8w79b9"&&(a.textContent=$)},m(l,c){b(l,a,c)},p:Pe,d(l){l&&i(a)}}}function mr(D){let a,$="Example:",l,c,w;return c=new ko({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERpZmZ1c2lvblBpcGVsaW5lJTBBaW1wb3J0JTIwdG9yY2glMEElMEFwaXBlbGluZSUyMCUzRCUyMERpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJzdGFiaWxpdHlhaSUyRnN0YWJsZS1kaWZmdXNpb24teGwtYmFzZS0xLjAlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMEEpLnRvKCUyMmN1ZGElMjIpJTBBcGlwZWxpbmUubG9hZF9sb3JhX3dlaWdodHMoJTIybmVyaWpzJTJGcGl4ZWwtYXJ0LXhsJTIyJTJDJTIwd2VpZ2h0X25hbWUlM0QlMjJwaXhlbC1hcnQteGwuc2FmZXRlbnNvcnMlMjIlMkMlMjBhZGFwdGVyX25hbWUlM0QlMjJwaXhlbCUyMiklMEFwaXBlbGluZS5mdXNlX2xvcmEobG9yYV9zY2FsZSUzRDAuNyk=",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline
<span class="hljs-keyword">import</span> torch

pipeline = DiffusionPipeline.from_pretrained(
    <span class="hljs-string">&quot;stabilityai/stable-diffusion-xl-base-1.0&quot;</span>, torch_dtype=torch.float16
).to(<span class="hljs-string">&quot;cuda&quot;</span>)
pipeline.load_lora_weights(<span class="hljs-string">&quot;nerijs/pixel-art-xl&quot;</span>, weight_name=<span class="hljs-string">&quot;pixel-art-xl.safetensors&quot;</span>, adapter_name=<span class="hljs-string">&quot;pixel&quot;</span>)
pipeline.fuse_lora(lora_scale=<span class="hljs-number">0.7</span>)`,wrap:!1}}),{c(){a=n("p"),a.textContent=$,l=o(),_(c.$$.fragment)},l(d){a=s(d,"P",{"data-svelte-h":!0}),u(a)!=="svelte-11lpom8"&&(a.textContent=$),l=r(d),h(c.$$.fragment,d)},m(d,y){b(d,a,y),b(d,l,y),g(c,d,y),w=!0},p:Pe,i(d){w||(x(c.$$.fragment,d),w=!0)},o(d){L(c.$$.fragment,d),w=!1},d(d){d&&(i(a),i(l)),v(c,d)}}}function ur(D){let a,$="Example:",l,c,w;return c=new ko({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERpZmZ1c2lvblBpcGVsaW5lJTBBJTBBcGlwZWxpbmUlMjAlM0QlMjBEaWZmdXNpb25QaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIyc3RhYmlsaXR5YWklMkZzdGFibGUtZGlmZnVzaW9uLXhsLWJhc2UtMS4wJTIyJTJDJTBBKS50byglMjJjdWRhJTIyKSUwQXBpcGVsaW5lLmxvYWRfbG9yYV93ZWlnaHRzKCUyMkNpcm9OMjAyMiUyRnRveS1mYWNlJTIyJTJDJTIwd2VpZ2h0X25hbWUlM0QlMjJ0b3lfZmFjZV9zZHhsLnNhZmV0ZW5zb3JzJTIyJTJDJTIwYWRhcHRlcl9uYW1lJTNEJTIydG95JTIyKSUwQXBpcGVsaW5lLmdldF9hY3RpdmVfYWRhcHRlcnMoKQ==",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline

pipeline = DiffusionPipeline.from_pretrained(
    <span class="hljs-string">&quot;stabilityai/stable-diffusion-xl-base-1.0&quot;</span>,
).to(<span class="hljs-string">&quot;cuda&quot;</span>)
pipeline.load_lora_weights(<span class="hljs-string">&quot;CiroN2022/toy-face&quot;</span>, weight_name=<span class="hljs-string">&quot;toy_face_sdxl.safetensors&quot;</span>, adapter_name=<span class="hljs-string">&quot;toy&quot;</span>)
pipeline.get_active_adapters()`,wrap:!1}}),{c(){a=n("p"),a.textContent=$,l=o(),_(c.$$.fragment)},l(d){a=s(d,"P",{"data-svelte-h":!0}),u(a)!=="svelte-11lpom8"&&(a.textContent=$),l=r(d),h(c.$$.fragment,d)},m(d,y){b(d,a,y),b(d,l,y),g(c,d,y),w=!0},p:Pe,i(d){w||(x(c.$$.fragment,d),w=!0)},o(d){L(c.$$.fragment,d),w=!1},d(d){d&&(i(a),i(l)),v(c,d)}}}function _r(D){let a,$="We support loading A1111 formatted LoRA checkpoints in a limited capacity.",l,c,w="This function is experimental and might change in the future.";return{c(){a=n("p"),a.textContent=$,l=o(),c=n("p"),c.textContent=w},l(d){a=s(d,"P",{"data-svelte-h":!0}),u(a)!=="svelte-15l1sdn"&&(a.textContent=$),l=r(d),c=s(d,"P",{"data-svelte-h":!0}),u(c)!=="svelte-3fufvn"&&(c.textContent=w)},m(d,y){b(d,a,y),b(d,l,y),b(d,c,y)},p:Pe,d(d){d&&(i(a),i(l),i(c))}}}function hr(D){let a,$="This is an experimental API.";return{c(){a=n("p"),a.textContent=$},l(l){a=s(l,"P",{"data-svelte-h":!0}),u(a)!=="svelte-8w79b9"&&(a.textContent=$)},m(l,c){b(l,a,c)},p:Pe,d(l){l&&i(a)}}}function gr(D){let a,$="Examples:",l,c,w;return c=new ko({props:{code:"JTIzJTIwQXNzdW1pbmclMjAlNjBwaXBlbGluZSU2MCUyMGlzJTIwYWxyZWFkeSUyMGxvYWRlZCUyMHdpdGglMjB0aGUlMjBMb1JBJTIwcGFyYW1ldGVycy4lMEFwaXBlbGluZS51bmxvYWRfbG9yYV93ZWlnaHRzKCklMEEuLi4=",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Assuming `pipeline` is already loaded with the LoRA parameters.</span>\n<span class="hljs-meta">&gt;&gt;&gt; </span>pipeline.unload_lora_weights()\n<span class="hljs-meta">&gt;&gt;&gt; </span>...',wrap:!1}}),{c(){a=n("p"),a.textContent=$,l=o(),_(c.$$.fragment)},l(d){a=s(d,"P",{"data-svelte-h":!0}),u(a)!=="svelte-kvfsh7"&&(a.textContent=$),l=r(d),h(c.$$.fragment,d)},m(d,y){b(d,a,y),b(d,l,y),g(c,d,y),w=!0},p:Pe,i(d){w||(x(c.$$.fragment,d),w=!0)},o(d){L(c.$$.fragment,d),w=!1},d(d){d&&(i(a),i(l)),v(c,d)}}}function xr(D){let a,$,l,c,w,d,y,Ao="LoRA is a fast and lightweight training method that inserts and trains a significantly smaller number of parameters instead of all the model parameters. This produces a smaller file (~100 MBs) and makes it easier to quickly train a model to learn a new concept. LoRA weights are typically loaded into the UNet, text encoder or both. There are two classes for loading LoRA weights:",pt,ne,Ro='<li><code>LoraLoaderMixin</code> provides functions for loading and unloading, fusing and unfusing, enabling and disabling, and more functions for managing LoRA weights. This class can be used with any model.</li> <li><code>StableDiffusionXLLoraLoaderMixin</code> is a <a href="../../api/pipelines/stable_diffusion/stable_diffusion_xl">Stable Diffusion (SDXL)</a> version of the <code>LoraLoaderMixin</code> class for loading and saving LoRA weights. It can only be used with the SDXL model.</li>',mt,j,ut,se,_t,f,de,kt,Se,Po=`Load LoRA layers into <a href="/docs/diffusers/v0.28.0/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a> and
<a href="https://huggingface.co/docs/transformers/model_doc/clip#transformers.CLIPTextModel" rel="nofollow"><code>CLIPTextModel</code></a>.`,At,Ie,ie,Rt,Z,le,Pt,Ue,So="Disables the LoRA layers for the text encoder.",St,X,ce,It,Ne,Io="Enables the LoRA layers for the text encoder.",Ut,P,fe,Nt,Ee,Uo="Fuses the LoRA parameters into the original parameters of the corresponding blocks.",Et,G,Ht,z,Jt,N,pe,Wt,He,No="Gets the list of the current active adapters.",jt,V,Zt,q,me,Xt,Je,Eo="Gets the current list of all available adapters in the pipeline.",Gt,B,ue,zt,We,Ho="This will load the LoRA layers specified in <code>state_dict</code> into <code>text_encoder</code>",Vt,F,_e,qt,je,Jo="This will load the LoRA layers specified in <code>state_dict</code> into <code>transformer</code>.",Bt,Y,he,Ft,Ze,Wo="This will load the LoRA layers specified in <code>state_dict</code> into <code>unet</code>.",Yt,k,ge,Ot,Xe,jo=`Load LoRA weights specified in <code>pretrained_model_name_or_path_or_dict</code> into <code>self.unet</code> and
<code>self.text_encoder</code>.`,Qt,Ge,Zo="All kwargs are forwarded to <code>self.lora_state_dict</code>.",Kt,ze,Xo='See <a href="/docs/diffusers/v0.28.0/en/api/loaders/lora#diffusers.loaders.LoraLoaderMixin.lora_state_dict">lora_state_dict()</a> for more details on how the state dict is loaded.',eo,Ve,Go=`See <a href="/docs/diffusers/v0.28.0/en/api/loaders/lora#diffusers.loaders.LoraLoaderMixin.load_lora_into_unet">load_lora_into_unet()</a> for more details on how the state dict is loaded into
<code>self.unet</code>.`,to,qe,zo=`See <a href="/docs/diffusers/v0.28.0/en/api/loaders/lora#diffusers.loaders.LoraLoaderMixin.load_lora_into_text_encoder">load_lora_into_text_encoder()</a> for more details on how the state dict is loaded
into <code>self.text_encoder</code>.`,oo,E,xe,ro,Be,Vo="Return state dict for lora weights and the network alphas.",ao,O,no,Q,Le,so,Fe,qo="Save the LoRA parameters corresponding to the UNet and text encoder.",io,K,ve,lo,Ye,Bo="Sets the adapter layers for the text encoder.",co,ee,be,fo,Oe,Fo=`Moves the LoRAs listed in <code>adapter_names</code> to a target device. Useful for offloading the LoRA to the CPU in case
you want to load multiple adapters and free some GPU memory.`,po,H,$e,mo,Qe,Yo=`Reverses the effect of
<a href="https://huggingface.co/docs/diffusers/main/en/api/loaders#diffusers.loaders.LoraLoaderMixin.fuse_lora" rel="nofollow"><code>pipe.fuse_lora()</code></a>.`,uo,te,_o,J,we,ho,Ke,Oo="Unloads the LoRA parameters.",go,oe,ht,ye,gt,R,Me,xo,et,Qo="This class overrides <code>LoraLoaderMixin</code> with LoRA loading/saving code that’s specific to SDXL",Lo,A,Te,vo,tt,Ko=`Load LoRA weights specified in <code>pretrained_model_name_or_path_or_dict</code> into <code>self.unet</code> and
<code>self.text_encoder</code>.`,bo,ot,er="All kwargs are forwarded to <code>self.lora_state_dict</code>.",$o,rt,tr='See <a href="/docs/diffusers/v0.28.0/en/api/loaders/lora#diffusers.loaders.LoraLoaderMixin.lora_state_dict">lora_state_dict()</a> for more details on how the state dict is loaded.',wo,at,or=`See <a href="/docs/diffusers/v0.28.0/en/api/loaders/lora#diffusers.loaders.LoraLoaderMixin.load_lora_into_unet">load_lora_into_unet()</a> for more details on how the state dict is loaded into
<code>self.unet</code>.`,yo,nt,rr=`See <a href="/docs/diffusers/v0.28.0/en/api/loaders/lora#diffusers.loaders.LoraLoaderMixin.load_lora_into_text_encoder">load_lora_into_text_encoder()</a> for more details on how the state dict is loaded
into <code>self.text_encoder</code>.`,Mo,re,Ce,To,st,ar="Save the LoRA parameters corresponding to the UNet and text encoder.",xt,De,Lt,ct,vt;return w=new Do({props:{title:"LoRA",local:"lora",headingTag:"h1"}}),j=new Dt({props:{$$slots:{default:[fr]},$$scope:{ctx:D}}}),se=new Do({props:{title:"LoraLoaderMixin",local:"diffusers.loaders.LoraLoaderMixin",headingTag:"h2"}}),de=new C({props:{name:"class diffusers.loaders.LoraLoaderMixin",anchor:"diffusers.loaders.LoraLoaderMixin",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.28.0/src/diffusers/loaders/lora.py#L71"}}),ie=new C({props:{name:"delete_adapters",anchor:"diffusers.loaders.LoraLoaderMixin.delete_adapters",parameters:[{name:"adapter_names",val:": Union"}],parametersDescription:[{anchor:"diffusers.loaders.LoraLoaderMixin.delete_adapters.Deletes",description:`<strong>Deletes</strong> the LoRA layers of <code>adapter_name</code> for the unet and text-encoder(s). &#x2014;
adapter_names (<code>Union[List[str], str]</code>):
The names of the adapter to delete. Can be a single string or a list of strings`,name:"Deletes"}],source:"https://github.com/huggingface/diffusers/blob/v0.28.0/src/diffusers/loaders/lora.py#L1172"}}),le=new C({props:{name:"disable_lora_for_text_encoder",anchor:"diffusers.loaders.LoraLoaderMixin.disable_lora_for_text_encoder",parameters:[{name:"text_encoder",val:": Optional = None"}],parametersDescription:[{anchor:"diffusers.loaders.LoraLoaderMixin.disable_lora_for_text_encoder.text_encoder",description:`<strong>text_encoder</strong> (<code>torch.nn.Module</code>, <em>optional</em>) &#x2014;
The text encoder module to disable the LoRA layers for. If <code>None</code>, it will try to get the
<code>text_encoder</code> attribute.`,name:"text_encoder"}],source:"https://github.com/huggingface/diffusers/blob/v0.28.0/src/diffusers/loaders/lora.py#L1036"}}),ce=new C({props:{name:"enable_lora_for_text_encoder",anchor:"diffusers.loaders.LoraLoaderMixin.enable_lora_for_text_encoder",parameters:[{name:"text_encoder",val:": Optional = None"}],parametersDescription:[{anchor:"diffusers.loaders.LoraLoaderMixin.enable_lora_for_text_encoder.text_encoder",description:`<strong>text_encoder</strong> (<code>torch.nn.Module</code>, <em>optional</em>) &#x2014;
The text encoder module to enable the LoRA layers for. If <code>None</code>, it will try to get the <code>text_encoder</code>
attribute.`,name:"text_encoder"}],source:"https://github.com/huggingface/diffusers/blob/v0.28.0/src/diffusers/loaders/lora.py#L1053"}}),fe=new C({props:{name:"fuse_lora",anchor:"diffusers.loaders.LoraLoaderMixin.fuse_lora",parameters:[{name:"fuse_unet",val:": bool = True"},{name:"fuse_text_encoder",val:": bool = True"},{name:"lora_scale",val:": float = 1.0"},{name:"safe_fusing",val:": bool = False"},{name:"adapter_names",val:": Optional = None"}],parametersDescription:[{anchor:"diffusers.loaders.LoraLoaderMixin.fuse_lora.fuse_unet",description:"<strong>fuse_unet</strong> (<code>bool</code>, defaults to <code>True</code>) &#x2014; Whether to fuse the UNet LoRA parameters.",name:"fuse_unet"},{anchor:"diffusers.loaders.LoraLoaderMixin.fuse_lora.fuse_text_encoder",description:`<strong>fuse_text_encoder</strong> (<code>bool</code>, defaults to <code>True</code>) &#x2014;
Whether to fuse the text encoder LoRA parameters. If the text encoder wasn&#x2019;t monkey-patched with the
LoRA parameters then it won&#x2019;t have any effect.`,name:"fuse_text_encoder"},{anchor:"diffusers.loaders.LoraLoaderMixin.fuse_lora.lora_scale",description:`<strong>lora_scale</strong> (<code>float</code>, defaults to 1.0) &#x2014;
Controls how much to influence the outputs with the LoRA parameters.`,name:"lora_scale"},{anchor:"diffusers.loaders.LoraLoaderMixin.fuse_lora.safe_fusing",description:`<strong>safe_fusing</strong> (<code>bool</code>, defaults to <code>False</code>) &#x2014;
Whether to check fused weights for NaN values before fusing and if values are NaN not fusing them.`,name:"safe_fusing"},{anchor:"diffusers.loaders.LoraLoaderMixin.fuse_lora.adapter_names",description:`<strong>adapter_names</strong> (<code>List[str]</code>, <em>optional</em>) &#x2014;
Adapter names to be used for fusing. If nothing is passed, all active adapters will be fused.`,name:"adapter_names"}],source:"https://github.com/huggingface/diffusers/blob/v0.28.0/src/diffusers/loaders/lora.py#L869"}}),G=new Dt({props:{warning:!0,$$slots:{default:[pr]},$$scope:{ctx:D}}}),z=new Co({props:{anchor:"diffusers.loaders.LoraLoaderMixin.fuse_lora.example",$$slots:{default:[mr]},$$scope:{ctx:D}}}),pe=new C({props:{name:"get_active_adapters",anchor:"diffusers.loaders.LoraLoaderMixin.get_active_adapters",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.28.0/src/diffusers/loaders/lora.py#L1196"}}),V=new Co({props:{anchor:"diffusers.loaders.LoraLoaderMixin.get_active_adapters.example",$$slots:{default:[ur]},$$scope:{ctx:D}}}),me=new C({props:{name:"get_list_adapters",anchor:"diffusers.loaders.LoraLoaderMixin.get_list_adapters",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.28.0/src/diffusers/loaders/lora.py#L1228"}}),ue=new C({props:{name:"load_lora_into_text_encoder",anchor:"diffusers.loaders.LoraLoaderMixin.load_lora_into_text_encoder",parameters:[{name:"state_dict",val:""},{name:"network_alphas",val:""},{name:"text_encoder",val:""},{name:"prefix",val:" = None"},{name:"lora_scale",val:" = 1.0"},{name:"low_cpu_mem_usage",val:" = None"},{name:"adapter_name",val:" = None"},{name:"_pipeline",val:" = None"}],parametersDescription:[{anchor:"diffusers.loaders.LoraLoaderMixin.load_lora_into_text_encoder.state_dict",description:`<strong>state_dict</strong> (<code>dict</code>) &#x2014;
A standard state dict containing the lora layer parameters. The key should be prefixed with an
additional <code>text_encoder</code> to distinguish between unet lora layers.`,name:"state_dict"},{anchor:"diffusers.loaders.LoraLoaderMixin.load_lora_into_text_encoder.network_alphas",description:`<strong>network_alphas</strong> (<code>Dict[str, float]</code>) &#x2014;
See <code>LoRALinearLayer</code> for more details.`,name:"network_alphas"},{anchor:"diffusers.loaders.LoraLoaderMixin.load_lora_into_text_encoder.text_encoder",description:`<strong>text_encoder</strong> (<code>CLIPTextModel</code>) &#x2014;
The text encoder model to load the LoRA layers into.`,name:"text_encoder"},{anchor:"diffusers.loaders.LoraLoaderMixin.load_lora_into_text_encoder.prefix",description:`<strong>prefix</strong> (<code>str</code>) &#x2014;
Expected prefix of the <code>text_encoder</code> in the <code>state_dict</code>.`,name:"prefix"},{anchor:"diffusers.loaders.LoraLoaderMixin.load_lora_into_text_encoder.lora_scale",description:`<strong>lora_scale</strong> (<code>float</code>) &#x2014;
How much to scale the output of the lora linear layer before it is added with the output of the regular
lora layer.`,name:"lora_scale"},{anchor:"diffusers.loaders.LoraLoaderMixin.load_lora_into_text_encoder.low_cpu_mem_usage",description:`<strong>low_cpu_mem_usage</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code> if torch version &gt;= 1.9.0 else <code>False</code>) &#x2014;
Speed up model loading only loading the pretrained weights and not initializing the weights. This also
tries to not use more than 1x model size in CPU memory (including peak memory) while loading the model.
Only supported for PyTorch &gt;= 1.9.0. If you are using an older version of PyTorch, setting this
argument to <code>True</code> will raise an error.`,name:"low_cpu_mem_usage"},{anchor:"diffusers.loaders.LoraLoaderMixin.load_lora_into_text_encoder.adapter_name",description:`<strong>adapter_name</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Adapter name to be used for referencing the loaded adapter model. If not specified, it will use
<code>default_{i}</code> where i is the total number of adapters being loaded.`,name:"adapter_name"}],source:"https://github.com/huggingface/diffusers/blob/v0.28.0/src/diffusers/loaders/lora.py#L502"}}),_e=new C({props:{name:"load_lora_into_transformer",anchor:"diffusers.loaders.LoraLoaderMixin.load_lora_into_transformer",parameters:[{name:"state_dict",val:""},{name:"network_alphas",val:""},{name:"transformer",val:""},{name:"low_cpu_mem_usage",val:" = None"},{name:"adapter_name",val:" = None"},{name:"_pipeline",val:" = None"}],parametersDescription:[{anchor:"diffusers.loaders.LoraLoaderMixin.load_lora_into_transformer.state_dict",description:`<strong>state_dict</strong> (<code>dict</code>) &#x2014;
A standard state dict containing the lora layer parameters. The keys can either be indexed directly
into the unet or prefixed with an additional <code>unet</code> which can be used to distinguish between text
encoder lora layers.`,name:"state_dict"},{anchor:"diffusers.loaders.LoraLoaderMixin.load_lora_into_transformer.network_alphas",description:`<strong>network_alphas</strong> (<code>Dict[str, float]</code>) &#x2014;
See <code>LoRALinearLayer</code> for more details.`,name:"network_alphas"},{anchor:"diffusers.loaders.LoraLoaderMixin.load_lora_into_transformer.unet",description:`<strong>unet</strong> (<code>UNet2DConditionModel</code>) &#x2014;
The UNet model to load the LoRA layers into.`,name:"unet"},{anchor:"diffusers.loaders.LoraLoaderMixin.load_lora_into_transformer.low_cpu_mem_usage",description:`<strong>low_cpu_mem_usage</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code> if torch version &gt;= 1.9.0 else <code>False</code>) &#x2014;
Speed up model loading only loading the pretrained weights and not initializing the weights. This also
tries to not use more than 1x model size in CPU memory (including peak memory) while loading the model.
Only supported for PyTorch &gt;= 1.9.0. If you are using an older version of PyTorch, setting this
argument to <code>True</code> will raise an error.`,name:"low_cpu_mem_usage"},{anchor:"diffusers.loaders.LoraLoaderMixin.load_lora_into_transformer.adapter_name",description:`<strong>adapter_name</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Adapter name to be used for referencing the loaded adapter model. If not specified, it will use
<code>default_{i}</code> where i is the total number of adapters being loaded.`,name:"adapter_name"}],source:"https://github.com/huggingface/diffusers/blob/v0.28.0/src/diffusers/loaders/lora.py#L627"}}),he=new C({props:{name:"load_lora_into_unet",anchor:"diffusers.loaders.LoraLoaderMixin.load_lora_into_unet",parameters:[{name:"state_dict",val:""},{name:"network_alphas",val:""},{name:"unet",val:""},{name:"low_cpu_mem_usage",val:" = None"},{name:"adapter_name",val:" = None"},{name:"_pipeline",val:" = None"}],parametersDescription:[{anchor:"diffusers.loaders.LoraLoaderMixin.load_lora_into_unet.state_dict",description:`<strong>state_dict</strong> (<code>dict</code>) &#x2014;
A standard state dict containing the lora layer parameters. The keys can either be indexed directly
into the unet or prefixed with an additional <code>unet</code> which can be used to distinguish between text
encoder lora layers.`,name:"state_dict"},{anchor:"diffusers.loaders.LoraLoaderMixin.load_lora_into_unet.network_alphas",description:`<strong>network_alphas</strong> (<code>Dict[str, float]</code>) &#x2014;
See <code>LoRALinearLayer</code> for more details.`,name:"network_alphas"},{anchor:"diffusers.loaders.LoraLoaderMixin.load_lora_into_unet.unet",description:`<strong>unet</strong> (<code>UNet2DConditionModel</code>) &#x2014;
The UNet model to load the LoRA layers into.`,name:"unet"},{anchor:"diffusers.loaders.LoraLoaderMixin.load_lora_into_unet.low_cpu_mem_usage",description:`<strong>low_cpu_mem_usage</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code> if torch version &gt;= 1.9.0 else <code>False</code>) &#x2014;
Speed up model loading only loading the pretrained weights and not initializing the weights. This also
tries to not use more than 1x model size in CPU memory (including peak memory) while loading the model.
Only supported for PyTorch &gt;= 1.9.0. If you are using an older version of PyTorch, setting this
argument to <code>True</code> will raise an error.`,name:"low_cpu_mem_usage"},{anchor:"diffusers.loaders.LoraLoaderMixin.load_lora_into_unet.adapter_name",description:`<strong>adapter_name</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Adapter name to be used for referencing the loaded adapter model. If not specified, it will use
<code>default_{i}</code> where i is the total number of adapters being loaded.`,name:"adapter_name"}],source:"https://github.com/huggingface/diffusers/blob/v0.28.0/src/diffusers/loaders/lora.py#L385"}}),ge=new C({props:{name:"load_lora_weights",anchor:"diffusers.loaders.LoraLoaderMixin.load_lora_weights",parameters:[{name:"pretrained_model_name_or_path_or_dict",val:": Union"},{name:"adapter_name",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.loaders.LoraLoaderMixin.load_lora_weights.pretrained_model_name_or_path_or_dict",description:`<strong>pretrained_model_name_or_path_or_dict</strong> (<code>str</code> or <code>os.PathLike</code> or <code>dict</code>) &#x2014;
See <a href="/docs/diffusers/v0.28.0/en/api/loaders/lora#diffusers.loaders.LoraLoaderMixin.lora_state_dict">lora_state_dict()</a>.`,name:"pretrained_model_name_or_path_or_dict"},{anchor:"diffusers.loaders.LoraLoaderMixin.load_lora_weights.kwargs",description:`<strong>kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
See <a href="/docs/diffusers/v0.28.0/en/api/loaders/lora#diffusers.loaders.LoraLoaderMixin.lora_state_dict">lora_state_dict()</a>.`,name:"kwargs"},{anchor:"diffusers.loaders.LoraLoaderMixin.load_lora_weights.adapter_name",description:`<strong>adapter_name</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Adapter name to be used for referencing the loaded adapter model. If not specified, it will use
<code>default_{i}</code> where i is the total number of adapters being loaded.`,name:"adapter_name"}],source:"https://github.com/huggingface/diffusers/blob/v0.28.0/src/diffusers/loaders/lora.py#L82"}}),xe=new C({props:{name:"lora_state_dict",anchor:"diffusers.loaders.LoraLoaderMixin.lora_state_dict",parameters:[{name:"pretrained_model_name_or_path_or_dict",val:": Union"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.loaders.LoraLoaderMixin.lora_state_dict.pretrained_model_name_or_path_or_dict",description:`<strong>pretrained_model_name_or_path_or_dict</strong> (<code>str</code> or <code>os.PathLike</code> or <code>dict</code>) &#x2014;
Can be either:</p>
<ul>
<li>A string, the <em>model id</em> (for example <code>google/ddpm-celebahq-256</code>) of a pretrained model hosted on
the Hub.</li>
<li>A path to a <em>directory</em> (for example <code>./my_model_directory</code>) containing the model weights saved
with <a href="/docs/diffusers/v0.28.0/en/api/models/overview#diffusers.ModelMixin.save_pretrained">ModelMixin.save_pretrained()</a>.</li>
<li>A <a href="https://pytorch.org/tutorials/beginner/saving_loading_models.html#what-is-a-state-dict" rel="nofollow">torch state
dict</a>.</li>
</ul>`,name:"pretrained_model_name_or_path_or_dict"},{anchor:"diffusers.loaders.LoraLoaderMixin.lora_state_dict.cache_dir",description:`<strong>cache_dir</strong> (<code>Union[str, os.PathLike]</code>, <em>optional</em>) &#x2014;
Path to a directory where a downloaded pretrained model configuration is cached if the standard cache
is not used.`,name:"cache_dir"},{anchor:"diffusers.loaders.LoraLoaderMixin.lora_state_dict.force_download",description:`<strong>force_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to force the (re-)download of the model weights and configuration files, overriding the
cached versions if they exist.
resume_download &#x2014;
Deprecated and ignored. All downloads are now resumed by default when possible. Will be removed in v1
of Diffusers.`,name:"force_download"},{anchor:"diffusers.loaders.LoraLoaderMixin.lora_state_dict.proxies",description:`<strong>proxies</strong> (<code>Dict[str, str]</code>, <em>optional</em>) &#x2014;
A dictionary of proxy servers to use by protocol or endpoint, for example, <code>{&apos;http&apos;: &apos;foo.bar:3128&apos;, &apos;http://hostname&apos;: &apos;foo.bar:4012&apos;}</code>. The proxies are used on each request.`,name:"proxies"},{anchor:"diffusers.loaders.LoraLoaderMixin.lora_state_dict.local_files_only",description:`<strong>local_files_only</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to only load local model weights and configuration files or not. If set to <code>True</code>, the model
won&#x2019;t be downloaded from the Hub.`,name:"local_files_only"},{anchor:"diffusers.loaders.LoraLoaderMixin.lora_state_dict.token",description:`<strong>token</strong> (<code>str</code> or <em>bool</em>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. If <code>True</code>, the token generated from
<code>diffusers-cli login</code> (stored in <code>~/.huggingface</code>) is used.`,name:"token"},{anchor:"diffusers.loaders.LoraLoaderMixin.lora_state_dict.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;main&quot;</code>) &#x2014;
The specific model version to use. It can be a branch name, a tag name, a commit id, or any identifier
allowed by Git.`,name:"revision"},{anchor:"diffusers.loaders.LoraLoaderMixin.lora_state_dict.subfolder",description:`<strong>subfolder</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&quot;</code>) &#x2014;
The subfolder location of a model file within a larger model repository on the Hub or locally.`,name:"subfolder"},{anchor:"diffusers.loaders.LoraLoaderMixin.lora_state_dict.low_cpu_mem_usage",description:`<strong>low_cpu_mem_usage</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code> if torch version &gt;= 1.9.0 else <code>False</code>) &#x2014;
Speed up model loading only loading the pretrained weights and not initializing the weights. This also
tries to not use more than 1x model size in CPU memory (including peak memory) while loading the model.
Only supported for PyTorch &gt;= 1.9.0. If you are using an older version of PyTorch, setting this
argument to <code>True</code> will raise an error.`,name:"low_cpu_mem_usage"},{anchor:"diffusers.loaders.LoraLoaderMixin.lora_state_dict.mirror",description:`<strong>mirror</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Mirror source to resolve accessibility issues if you&#x2019;re downloading a model in China. We do not
guarantee the timeliness or safety of the source, and you should refer to the mirror site for more
information.`,name:"mirror"}],source:"https://github.com/huggingface/diffusers/blob/v0.28.0/src/diffusers/loaders/lora.py#L144"}}),O=new Dt({props:{warning:!0,$$slots:{default:[_r]},$$scope:{ctx:D}}}),Le=new C({props:{name:"save_lora_weights",anchor:"diffusers.loaders.LoraLoaderMixin.save_lora_weights",parameters:[{name:"save_directory",val:": Union"},{name:"unet_lora_layers",val:": Dict = None"},{name:"text_encoder_lora_layers",val:": Dict = None"},{name:"transformer_lora_layers",val:": Dict = None"},{name:"is_main_process",val:": bool = True"},{name:"weight_name",val:": str = None"},{name:"save_function",val:": Callable = None"},{name:"safe_serialization",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.loaders.LoraLoaderMixin.save_lora_weights.save_directory",description:`<strong>save_directory</strong> (<code>str</code> or <code>os.PathLike</code>) &#x2014;
Directory to save LoRA parameters to. Will be created if it doesn&#x2019;t exist.`,name:"save_directory"},{anchor:"diffusers.loaders.LoraLoaderMixin.save_lora_weights.unet_lora_layers",description:`<strong>unet_lora_layers</strong> (<code>Dict[str, torch.nn.Module]</code> or <code>Dict[str, torch.Tensor]</code>) &#x2014;
State dict of the LoRA layers corresponding to the <code>unet</code>.`,name:"unet_lora_layers"},{anchor:"diffusers.loaders.LoraLoaderMixin.save_lora_weights.text_encoder_lora_layers",description:`<strong>text_encoder_lora_layers</strong> (<code>Dict[str, torch.nn.Module]</code> or <code>Dict[str, torch.Tensor]</code>) &#x2014;
State dict of the LoRA layers corresponding to the <code>text_encoder</code>. Must explicitly pass the text
encoder LoRA state dict because it comes from &#x1F917; Transformers.`,name:"text_encoder_lora_layers"},{anchor:"diffusers.loaders.LoraLoaderMixin.save_lora_weights.is_main_process",description:`<strong>is_main_process</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether the process calling this is the main process or not. Useful during distributed training and you
need to call this function on all processes. In this case, set <code>is_main_process=True</code> only on the main
process to avoid race conditions.`,name:"is_main_process"},{anchor:"diffusers.loaders.LoraLoaderMixin.save_lora_weights.save_function",description:`<strong>save_function</strong> (<code>Callable</code>) &#x2014;
The function to use to save the state dictionary. Useful during distributed training when you need to
replace <code>torch.save</code> with another method. Can be configured with the environment variable
<code>DIFFUSERS_SAVE_MODE</code>.`,name:"save_function"},{anchor:"diffusers.loaders.LoraLoaderMixin.save_lora_weights.safe_serialization",description:`<strong>safe_serialization</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to save the model using <code>safetensors</code> or the traditional PyTorch way with <code>pickle</code>.`,name:"safe_serialization"}],source:"https://github.com/huggingface/diffusers/blob/v0.28.0/src/diffusers/loaders/lora.py#L738"}}),ve=new C({props:{name:"set_adapters_for_text_encoder",anchor:"diffusers.loaders.LoraLoaderMixin.set_adapters_for_text_encoder",parameters:[{name:"adapter_names",val:": Union"},{name:"text_encoder",val:": Optional = None"},{name:"text_encoder_weights",val:": Union = None"}],parametersDescription:[{anchor:"diffusers.loaders.LoraLoaderMixin.set_adapters_for_text_encoder.adapter_names",description:`<strong>adapter_names</strong> (<code>List[str]</code> or <code>str</code>) &#x2014;
The names of the adapters to use.`,name:"adapter_names"},{anchor:"diffusers.loaders.LoraLoaderMixin.set_adapters_for_text_encoder.text_encoder",description:`<strong>text_encoder</strong> (<code>torch.nn.Module</code>, <em>optional</em>) &#x2014;
The text encoder module to set the adapter layers for. If <code>None</code>, it will try to get the <code>text_encoder</code>
attribute.`,name:"text_encoder"},{anchor:"diffusers.loaders.LoraLoaderMixin.set_adapters_for_text_encoder.text_encoder_weights",description:`<strong>text_encoder_weights</strong> (<code>List[float]</code>, <em>optional</em>) &#x2014;
The weights to use for the text encoder. If <code>None</code>, the weights are set to <code>1.0</code> for all the adapters.`,name:"text_encoder_weights"}],source:"https://github.com/huggingface/diffusers/blob/v0.28.0/src/diffusers/loaders/lora.py#L989"}}),be=new C({props:{name:"set_lora_device",anchor:"diffusers.loaders.LoraLoaderMixin.set_lora_device",parameters:[{name:"adapter_names",val:": List"},{name:"device",val:": Union"}],parametersDescription:[{anchor:"diffusers.loaders.LoraLoaderMixin.set_lora_device.adapter_names",description:`<strong>adapter_names</strong> (<code>List[str]</code>) &#x2014;
List of adapters to send device to.`,name:"adapter_names"},{anchor:"diffusers.loaders.LoraLoaderMixin.set_lora_device.device",description:`<strong>device</strong> (<code>Union[torch.device, str, int]</code>) &#x2014;
Device to send the adapters to. Can be either a torch device, a str or an integer.`,name:"device"}],source:"https://github.com/huggingface/diffusers/blob/v0.28.0/src/diffusers/loaders/lora.py#L1251"}}),$e=new C({props:{name:"unfuse_lora",anchor:"diffusers.loaders.LoraLoaderMixin.unfuse_lora",parameters:[{name:"unfuse_unet",val:": bool = True"},{name:"unfuse_text_encoder",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.loaders.LoraLoaderMixin.unfuse_lora.unfuse_unet",description:"<strong>unfuse_unet</strong> (<code>bool</code>, defaults to <code>True</code>) &#x2014; Whether to unfuse the UNet LoRA parameters.",name:"unfuse_unet"},{anchor:"diffusers.loaders.LoraLoaderMixin.unfuse_lora.unfuse_text_encoder",description:`<strong>unfuse_text_encoder</strong> (<code>bool</code>, defaults to <code>True</code>) &#x2014;
Whether to unfuse the text encoder LoRA parameters. If the text encoder wasn&#x2019;t monkey-patched with the
LoRA parameters then it won&#x2019;t have any effect.`,name:"unfuse_text_encoder"}],source:"https://github.com/huggingface/diffusers/blob/v0.28.0/src/diffusers/loaders/lora.py#L951"}}),te=new Dt({props:{warning:!0,$$slots:{default:[hr]},$$scope:{ctx:D}}}),we=new C({props:{name:"unload_lora_weights",anchor:"diffusers.loaders.LoraLoaderMixin.unload_lora_weights",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.28.0/src/diffusers/loaders/lora.py#L837"}}),oe=new Co({props:{anchor:"diffusers.loaders.LoraLoaderMixin.unload_lora_weights.example",$$slots:{default:[gr]},$$scope:{ctx:D}}}),ye=new Do({props:{title:"StableDiffusionXLLoraLoaderMixin",local:"diffusers.loaders.StableDiffusionXLLoraLoaderMixin",headingTag:"h2"}}),Me=new C({props:{name:"class diffusers.loaders.StableDiffusionXLLoraLoaderMixin",anchor:"diffusers.loaders.StableDiffusionXLLoraLoaderMixin",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.28.0/src/diffusers/loaders/lora.py#L1305"}}),Te=new C({props:{name:"load_lora_weights",anchor:"diffusers.loaders.StableDiffusionXLLoraLoaderMixin.load_lora_weights",parameters:[{name:"pretrained_model_name_or_path_or_dict",val:": Union"},{name:"adapter_name",val:": Optional = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.loaders.StableDiffusionXLLoraLoaderMixin.load_lora_weights.pretrained_model_name_or_path_or_dict",description:`<strong>pretrained_model_name_or_path_or_dict</strong> (<code>str</code> or <code>os.PathLike</code> or <code>dict</code>) &#x2014;
See <a href="/docs/diffusers/v0.28.0/en/api/loaders/lora#diffusers.loaders.LoraLoaderMixin.lora_state_dict">lora_state_dict()</a>.`,name:"pretrained_model_name_or_path_or_dict"},{anchor:"diffusers.loaders.StableDiffusionXLLoraLoaderMixin.load_lora_weights.adapter_name",description:`<strong>adapter_name</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Adapter name to be used for referencing the loaded adapter model. If not specified, it will use
<code>default_{i}</code> where i is the total number of adapters being loaded.`,name:"adapter_name"},{anchor:"diffusers.loaders.StableDiffusionXLLoraLoaderMixin.load_lora_weights.kwargs",description:`<strong>kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
See <a href="/docs/diffusers/v0.28.0/en/api/loaders/lora#diffusers.loaders.LoraLoaderMixin.lora_state_dict">lora_state_dict()</a>.`,name:"kwargs"}],source:"https://github.com/huggingface/diffusers/blob/v0.28.0/src/diffusers/loaders/lora.py#L1309"}}),Ce=new C({props:{name:"save_lora_weights",anchor:"diffusers.loaders.StableDiffusionXLLoraLoaderMixin.save_lora_weights",parameters:[{name:"save_directory",val:": Union"},{name:"unet_lora_layers",val:": Dict = None"},{name:"text_encoder_lora_layers",val:": Dict = None"},{name:"text_encoder_2_lora_layers",val:": Dict = None"},{name:"is_main_process",val:": bool = True"},{name:"weight_name",val:": str = None"},{name:"save_function",val:": Callable = None"},{name:"safe_serialization",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.loaders.StableDiffusionXLLoraLoaderMixin.save_lora_weights.save_directory",description:`<strong>save_directory</strong> (<code>str</code> or <code>os.PathLike</code>) &#x2014;
Directory to save LoRA parameters to. Will be created if it doesn&#x2019;t exist.`,name:"save_directory"},{anchor:"diffusers.loaders.StableDiffusionXLLoraLoaderMixin.save_lora_weights.unet_lora_layers",description:`<strong>unet_lora_layers</strong> (<code>Dict[str, torch.nn.Module]</code> or <code>Dict[str, torch.Tensor]</code>) &#x2014;
State dict of the LoRA layers corresponding to the <code>unet</code>.`,name:"unet_lora_layers"},{anchor:"diffusers.loaders.StableDiffusionXLLoraLoaderMixin.save_lora_weights.text_encoder_lora_layers",description:`<strong>text_encoder_lora_layers</strong> (<code>Dict[str, torch.nn.Module]</code> or <code>Dict[str, torch.Tensor]</code>) &#x2014;
State dict of the LoRA layers corresponding to the <code>text_encoder</code>. Must explicitly pass the text
encoder LoRA state dict because it comes from &#x1F917; Transformers.`,name:"text_encoder_lora_layers"},{anchor:"diffusers.loaders.StableDiffusionXLLoraLoaderMixin.save_lora_weights.text_encoder_2_lora_layers",description:`<strong>text_encoder_2_lora_layers</strong> (<code>Dict[str, torch.nn.Module]</code> or <code>Dict[str, torch.Tensor]</code>) &#x2014;
State dict of the LoRA layers corresponding to the <code>text_encoder_2</code>. Must explicitly pass the text
encoder LoRA state dict because it comes from &#x1F917; Transformers.`,name:"text_encoder_2_lora_layers"},{anchor:"diffusers.loaders.StableDiffusionXLLoraLoaderMixin.save_lora_weights.is_main_process",description:`<strong>is_main_process</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether the process calling this is the main process or not. Useful during distributed training and you
need to call this function on all processes. In this case, set <code>is_main_process=True</code> only on the main
process to avoid race conditions.`,name:"is_main_process"},{anchor:"diffusers.loaders.StableDiffusionXLLoraLoaderMixin.save_lora_weights.save_function",description:`<strong>save_function</strong> (<code>Callable</code>) &#x2014;
The function to use to save the state dictionary. Useful during distributed training when you need to
replace <code>torch.save</code> with another method. Can be configured with the environment variable
<code>DIFFUSERS_SAVE_MODE</code>.`,name:"save_function"},{anchor:"diffusers.loaders.StableDiffusionXLLoraLoaderMixin.save_lora_weights.safe_serialization",description:`<strong>safe_serialization</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to save the model using <code>safetensors</code> or the traditional PyTorch way with <code>pickle</code>.`,name:"safe_serialization"}],source:"https://github.com/huggingface/diffusers/blob/v0.28.0/src/diffusers/loaders/lora.py#L1386"}}),De=new cr({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/loaders/lora.md"}}),{c(){a=n("meta"),$=o(),l=n("p"),c=o(),_(w.$$.fragment),d=o(),y=n("p"),y.textContent=Ao,pt=o(),ne=n("ul"),ne.innerHTML=Ro,mt=o(),_(j.$$.fragment),ut=o(),_(se.$$.fragment),_t=o(),f=n("div"),_(de.$$.fragment),kt=o(),Se=n("p"),Se.innerHTML=Po,At=o(),Ie=n("div"),_(ie.$$.fragment),Rt=o(),Z=n("div"),_(le.$$.fragment),Pt=o(),Ue=n("p"),Ue.textContent=So,St=o(),X=n("div"),_(ce.$$.fragment),It=o(),Ne=n("p"),Ne.textContent=Io,Ut=o(),P=n("div"),_(fe.$$.fragment),Nt=o(),Ee=n("p"),Ee.textContent=Uo,Et=o(),_(G.$$.fragment),Ht=o(),_(z.$$.fragment),Jt=o(),N=n("div"),_(pe.$$.fragment),Wt=o(),He=n("p"),He.textContent=No,jt=o(),_(V.$$.fragment),Zt=o(),q=n("div"),_(me.$$.fragment),Xt=o(),Je=n("p"),Je.textContent=Eo,Gt=o(),B=n("div"),_(ue.$$.fragment),zt=o(),We=n("p"),We.innerHTML=Ho,Vt=o(),F=n("div"),_(_e.$$.fragment),qt=o(),je=n("p"),je.innerHTML=Jo,Bt=o(),Y=n("div"),_(he.$$.fragment),Ft=o(),Ze=n("p"),Ze.innerHTML=Wo,Yt=o(),k=n("div"),_(ge.$$.fragment),Ot=o(),Xe=n("p"),Xe.innerHTML=jo,Qt=o(),Ge=n("p"),Ge.innerHTML=Zo,Kt=o(),ze=n("p"),ze.innerHTML=Xo,eo=o(),Ve=n("p"),Ve.innerHTML=Go,to=o(),qe=n("p"),qe.innerHTML=zo,oo=o(),E=n("div"),_(xe.$$.fragment),ro=o(),Be=n("p"),Be.textContent=Vo,ao=o(),_(O.$$.fragment),no=o(),Q=n("div"),_(Le.$$.fragment),so=o(),Fe=n("p"),Fe.textContent=qo,io=o(),K=n("div"),_(ve.$$.fragment),lo=o(),Ye=n("p"),Ye.textContent=Bo,co=o(),ee=n("div"),_(be.$$.fragment),fo=o(),Oe=n("p"),Oe.innerHTML=Fo,po=o(),H=n("div"),_($e.$$.fragment),mo=o(),Qe=n("p"),Qe.innerHTML=Yo,uo=o(),_(te.$$.fragment),_o=o(),J=n("div"),_(we.$$.fragment),ho=o(),Ke=n("p"),Ke.textContent=Oo,go=o(),_(oe.$$.fragment),ht=o(),_(ye.$$.fragment),gt=o(),R=n("div"),_(Me.$$.fragment),xo=o(),et=n("p"),et.innerHTML=Qo,Lo=o(),A=n("div"),_(Te.$$.fragment),vo=o(),tt=n("p"),tt.innerHTML=Ko,bo=o(),ot=n("p"),ot.innerHTML=er,$o=o(),rt=n("p"),rt.innerHTML=tr,wo=o(),at=n("p"),at.innerHTML=or,yo=o(),nt=n("p"),nt.innerHTML=rr,Mo=o(),re=n("div"),_(Ce.$$.fragment),To=o(),st=n("p"),st.textContent=ar,xt=o(),_(De.$$.fragment),Lt=o(),ct=n("p"),this.h()},l(e){const p=lr("svelte-u9bgzb",document.head);a=s(p,"META",{name:!0,content:!0}),p.forEach(i),$=r(e),l=s(e,"P",{}),M(l).forEach(i),c=r(e),h(w.$$.fragment,e),d=r(e),y=s(e,"P",{"data-svelte-h":!0}),u(y)!=="svelte-99vqvv"&&(y.textContent=Ao),pt=r(e),ne=s(e,"UL",{"data-svelte-h":!0}),u(ne)!=="svelte-1x6k2ez"&&(ne.innerHTML=Ro),mt=r(e),h(j.$$.fragment,e),ut=r(e),h(se.$$.fragment,e),_t=r(e),f=s(e,"DIV",{class:!0});var m=M(f);h(de.$$.fragment,m),kt=r(m),Se=s(m,"P",{"data-svelte-h":!0}),u(Se)!=="svelte-17pw1ba"&&(Se.innerHTML=Po),At=r(m),Ie=s(m,"DIV",{class:!0});var ft=M(Ie);h(ie.$$.fragment,ft),ft.forEach(i),Rt=r(m),Z=s(m,"DIV",{class:!0});var ke=M(Z);h(le.$$.fragment,ke),Pt=r(ke),Ue=s(ke,"P",{"data-svelte-h":!0}),u(Ue)!=="svelte-tbr0r9"&&(Ue.textContent=So),ke.forEach(i),St=r(m),X=s(m,"DIV",{class:!0});var Ae=M(X);h(ce.$$.fragment,Ae),It=r(Ae),Ne=s(Ae,"P",{"data-svelte-h":!0}),u(Ne)!=="svelte-ujvdgi"&&(Ne.textContent=Io),Ae.forEach(i),Ut=r(m),P=s(m,"DIV",{class:!0});var U=M(P);h(fe.$$.fragment,U),Nt=r(U),Ee=s(U,"P",{"data-svelte-h":!0}),u(Ee)!=="svelte-1nr2dy0"&&(Ee.textContent=Uo),Et=r(U),h(G.$$.fragment,U),Ht=r(U),h(z.$$.fragment,U),U.forEach(i),Jt=r(m),N=s(m,"DIV",{class:!0});var W=M(N);h(pe.$$.fragment,W),Wt=r(W),He=s(W,"P",{"data-svelte-h":!0}),u(He)!=="svelte-h0os0v"&&(He.textContent=No),jt=r(W),h(V.$$.fragment,W),W.forEach(i),Zt=r(m),q=s(m,"DIV",{class:!0});var Re=M(q);h(me.$$.fragment,Re),Xt=r(Re),Je=s(Re,"P",{"data-svelte-h":!0}),u(Je)!=="svelte-1825k9e"&&(Je.textContent=Eo),Re.forEach(i),Gt=r(m),B=s(m,"DIV",{class:!0});var bt=M(B);h(ue.$$.fragment,bt),zt=r(bt),We=s(bt,"P",{"data-svelte-h":!0}),u(We)!=="svelte-1062ci4"&&(We.innerHTML=Ho),bt.forEach(i),Vt=r(m),F=s(m,"DIV",{class:!0});var $t=M(F);h(_e.$$.fragment,$t),qt=r($t),je=s($t,"P",{"data-svelte-h":!0}),u(je)!=="svelte-1lgbsz7"&&(je.innerHTML=Jo),$t.forEach(i),Bt=r(m),Y=s(m,"DIV",{class:!0});var wt=M(Y);h(he.$$.fragment,wt),Ft=r(wt),Ze=s(wt,"P",{"data-svelte-h":!0}),u(Ze)!=="svelte-u3q4so"&&(Ze.innerHTML=Wo),wt.forEach(i),Yt=r(m),k=s(m,"DIV",{class:!0});var S=M(k);h(ge.$$.fragment,S),Ot=r(S),Xe=s(S,"P",{"data-svelte-h":!0}),u(Xe)!=="svelte-vs7s0z"&&(Xe.innerHTML=jo),Qt=r(S),Ge=s(S,"P",{"data-svelte-h":!0}),u(Ge)!=="svelte-15b960v"&&(Ge.innerHTML=Zo),Kt=r(S),ze=s(S,"P",{"data-svelte-h":!0}),u(ze)!=="svelte-1w5khep"&&(ze.innerHTML=Xo),eo=r(S),Ve=s(S,"P",{"data-svelte-h":!0}),u(Ve)!=="svelte-11zlm4s"&&(Ve.innerHTML=Go),to=r(S),qe=s(S,"P",{"data-svelte-h":!0}),u(qe)!=="svelte-126yr4q"&&(qe.innerHTML=zo),S.forEach(i),oo=r(m),E=s(m,"DIV",{class:!0});var dt=M(E);h(xe.$$.fragment,dt),ro=r(dt),Be=s(dt,"P",{"data-svelte-h":!0}),u(Be)!=="svelte-flusvq"&&(Be.textContent=Vo),ao=r(dt),h(O.$$.fragment,dt),dt.forEach(i),no=r(m),Q=s(m,"DIV",{class:!0});var yt=M(Q);h(Le.$$.fragment,yt),so=r(yt),Fe=s(yt,"P",{"data-svelte-h":!0}),u(Fe)!=="svelte-1ufq5ot"&&(Fe.textContent=qo),yt.forEach(i),io=r(m),K=s(m,"DIV",{class:!0});var Mt=M(K);h(ve.$$.fragment,Mt),lo=r(Mt),Ye=s(Mt,"P",{"data-svelte-h":!0}),u(Ye)!=="svelte-kmejci"&&(Ye.textContent=Bo),Mt.forEach(i),co=r(m),ee=s(m,"DIV",{class:!0});var Tt=M(ee);h(be.$$.fragment,Tt),fo=r(Tt),Oe=s(Tt,"P",{"data-svelte-h":!0}),u(Oe)!=="svelte-rvubqa"&&(Oe.innerHTML=Fo),Tt.forEach(i),po=r(m),H=s(m,"DIV",{class:!0});var it=M(H);h($e.$$.fragment,it),mo=r(it),Qe=s(it,"P",{"data-svelte-h":!0}),u(Qe)!=="svelte-56a0bo"&&(Qe.innerHTML=Yo),uo=r(it),h(te.$$.fragment,it),it.forEach(i),_o=r(m),J=s(m,"DIV",{class:!0});var lt=M(J);h(we.$$.fragment,lt),ho=r(lt),Ke=s(lt,"P",{"data-svelte-h":!0}),u(Ke)!=="svelte-119cgd9"&&(Ke.textContent=Oo),go=r(lt),h(oe.$$.fragment,lt),lt.forEach(i),m.forEach(i),ht=r(e),h(ye.$$.fragment,e),gt=r(e),R=s(e,"DIV",{class:!0});var ae=M(R);h(Me.$$.fragment,ae),xo=r(ae),et=s(ae,"P",{"data-svelte-h":!0}),u(et)!=="svelte-1powver"&&(et.innerHTML=Qo),Lo=r(ae),A=s(ae,"DIV",{class:!0});var I=M(A);h(Te.$$.fragment,I),vo=r(I),tt=s(I,"P",{"data-svelte-h":!0}),u(tt)!=="svelte-vs7s0z"&&(tt.innerHTML=Ko),bo=r(I),ot=s(I,"P",{"data-svelte-h":!0}),u(ot)!=="svelte-15b960v"&&(ot.innerHTML=er),$o=r(I),rt=s(I,"P",{"data-svelte-h":!0}),u(rt)!=="svelte-1w5khep"&&(rt.innerHTML=tr),wo=r(I),at=s(I,"P",{"data-svelte-h":!0}),u(at)!=="svelte-11zlm4s"&&(at.innerHTML=or),yo=r(I),nt=s(I,"P",{"data-svelte-h":!0}),u(nt)!=="svelte-126yr4q"&&(nt.innerHTML=rr),I.forEach(i),Mo=r(ae),re=s(ae,"DIV",{class:!0});var Ct=M(re);h(Ce.$$.fragment,Ct),To=r(Ct),st=s(Ct,"P",{"data-svelte-h":!0}),u(st)!=="svelte-1ufq5ot"&&(st.textContent=ar),Ct.forEach(i),ae.forEach(i),xt=r(e),h(De.$$.fragment,e),Lt=r(e),ct=s(e,"P",{}),M(ct).forEach(i),this.h()},h(){T(a,"name","hf:doc:metadata"),T(a,"content",Lr),T(Ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(f,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,p){t(document.head,a),b(e,$,p),b(e,l,p),b(e,c,p),g(w,e,p),b(e,d,p),b(e,y,p),b(e,pt,p),b(e,ne,p),b(e,mt,p),g(j,e,p),b(e,ut,p),g(se,e,p),b(e,_t,p),b(e,f,p),g(de,f,null),t(f,kt),t(f,Se),t(f,At),t(f,Ie),g(ie,Ie,null),t(f,Rt),t(f,Z),g(le,Z,null),t(Z,Pt),t(Z,Ue),t(f,St),t(f,X),g(ce,X,null),t(X,It),t(X,Ne),t(f,Ut),t(f,P),g(fe,P,null),t(P,Nt),t(P,Ee),t(P,Et),g(G,P,null),t(P,Ht),g(z,P,null),t(f,Jt),t(f,N),g(pe,N,null),t(N,Wt),t(N,He),t(N,jt),g(V,N,null),t(f,Zt),t(f,q),g(me,q,null),t(q,Xt),t(q,Je),t(f,Gt),t(f,B),g(ue,B,null),t(B,zt),t(B,We),t(f,Vt),t(f,F),g(_e,F,null),t(F,qt),t(F,je),t(f,Bt),t(f,Y),g(he,Y,null),t(Y,Ft),t(Y,Ze),t(f,Yt),t(f,k),g(ge,k,null),t(k,Ot),t(k,Xe),t(k,Qt),t(k,Ge),t(k,Kt),t(k,ze),t(k,eo),t(k,Ve),t(k,to),t(k,qe),t(f,oo),t(f,E),g(xe,E,null),t(E,ro),t(E,Be),t(E,ao),g(O,E,null),t(f,no),t(f,Q),g(Le,Q,null),t(Q,so),t(Q,Fe),t(f,io),t(f,K),g(ve,K,null),t(K,lo),t(K,Ye),t(f,co),t(f,ee),g(be,ee,null),t(ee,fo),t(ee,Oe),t(f,po),t(f,H),g($e,H,null),t(H,mo),t(H,Qe),t(H,uo),g(te,H,null),t(f,_o),t(f,J),g(we,J,null),t(J,ho),t(J,Ke),t(J,go),g(oe,J,null),b(e,ht,p),g(ye,e,p),b(e,gt,p),b(e,R,p),g(Me,R,null),t(R,xo),t(R,et),t(R,Lo),t(R,A),g(Te,A,null),t(A,vo),t(A,tt),t(A,bo),t(A,ot),t(A,$o),t(A,rt),t(A,wo),t(A,at),t(A,yo),t(A,nt),t(R,Mo),t(R,re),g(Ce,re,null),t(re,To),t(re,st),b(e,xt,p),g(De,e,p),b(e,Lt,p),b(e,ct,p),vt=!0},p(e,[p]){const m={};p&2&&(m.$$scope={dirty:p,ctx:e}),j.$set(m);const ft={};p&2&&(ft.$$scope={dirty:p,ctx:e}),G.$set(ft);const ke={};p&2&&(ke.$$scope={dirty:p,ctx:e}),z.$set(ke);const Ae={};p&2&&(Ae.$$scope={dirty:p,ctx:e}),V.$set(Ae);const U={};p&2&&(U.$$scope={dirty:p,ctx:e}),O.$set(U);const W={};p&2&&(W.$$scope={dirty:p,ctx:e}),te.$set(W);const Re={};p&2&&(Re.$$scope={dirty:p,ctx:e}),oe.$set(Re)},i(e){vt||(x(w.$$.fragment,e),x(j.$$.fragment,e),x(se.$$.fragment,e),x(de.$$.fragment,e),x(ie.$$.fragment,e),x(le.$$.fragment,e),x(ce.$$.fragment,e),x(fe.$$.fragment,e),x(G.$$.fragment,e),x(z.$$.fragment,e),x(pe.$$.fragment,e),x(V.$$.fragment,e),x(me.$$.fragment,e),x(ue.$$.fragment,e),x(_e.$$.fragment,e),x(he.$$.fragment,e),x(ge.$$.fragment,e),x(xe.$$.fragment,e),x(O.$$.fragment,e),x(Le.$$.fragment,e),x(ve.$$.fragment,e),x(be.$$.fragment,e),x($e.$$.fragment,e),x(te.$$.fragment,e),x(we.$$.fragment,e),x(oe.$$.fragment,e),x(ye.$$.fragment,e),x(Me.$$.fragment,e),x(Te.$$.fragment,e),x(Ce.$$.fragment,e),x(De.$$.fragment,e),vt=!0)},o(e){L(w.$$.fragment,e),L(j.$$.fragment,e),L(se.$$.fragment,e),L(de.$$.fragment,e),L(ie.$$.fragment,e),L(le.$$.fragment,e),L(ce.$$.fragment,e),L(fe.$$.fragment,e),L(G.$$.fragment,e),L(z.$$.fragment,e),L(pe.$$.fragment,e),L(V.$$.fragment,e),L(me.$$.fragment,e),L(ue.$$.fragment,e),L(_e.$$.fragment,e),L(he.$$.fragment,e),L(ge.$$.fragment,e),L(xe.$$.fragment,e),L(O.$$.fragment,e),L(Le.$$.fragment,e),L(ve.$$.fragment,e),L(be.$$.fragment,e),L($e.$$.fragment,e),L(te.$$.fragment,e),L(we.$$.fragment,e),L(oe.$$.fragment,e),L(ye.$$.fragment,e),L(Me.$$.fragment,e),L(Te.$$.fragment,e),L(Ce.$$.fragment,e),L(De.$$.fragment,e),vt=!1},d(e){e&&(i($),i(l),i(c),i(d),i(y),i(pt),i(ne),i(mt),i(ut),i(_t),i(f),i(ht),i(gt),i(R),i(xt),i(Lt),i(ct)),i(a),v(w,e),v(j,e),v(se,e),v(de),v(ie),v(le),v(ce),v(fe),v(G),v(z),v(pe),v(V),v(me),v(ue),v(_e),v(he),v(ge),v(xe),v(O),v(Le),v(ve),v(be),v($e),v(te),v(we),v(oe),v(ye,e),v(Me),v(Te),v(Ce),v(De,e)}}}const Lr='{"title":"LoRA","local":"lora","sections":[{"title":"LoraLoaderMixin","local":"diffusers.loaders.LoraLoaderMixin","sections":[],"depth":2},{"title":"StableDiffusionXLLoraLoaderMixin","local":"diffusers.loaders.StableDiffusionXLLoraLoaderMixin","sections":[],"depth":2}],"depth":1}';function vr(D){return sr(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Dr extends dr{constructor(a){super(),ir(this,a,vr,xr,nr,{})}}export{Dr as component};
