import{S as ui,i as gi,s as _i,e as n,k as c,w as b,t as i,M as vi,c as a,d as t,m as f,a as s,x,h as l,b as p,G as e,g as v,y,q as w,o as M,B as $,v as bi,L as Xo}from"../../chunks/vendor-hf-doc-builder.js";import{T as ds}from"../../chunks/Tip-hf-doc-builder.js";import{D as U}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Qo}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as ko}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Ho}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function xi(E){let d,L,u,m,_,r,h,F,A,G,C;return{c(){d=n("p"),L=i("\u{1F9EA} The "),u=n("code"),m=i("LoaderMixins"),_=i(" are highly experimental and prone to future changes. To use private or "),r=n("a"),h=i("gated"),F=i(" models, log-in with "),A=n("code"),G=i("huggingface-cli login"),C=i("."),this.h()},l(Z){d=a(Z,"P",{});var T=s(d);L=l(T,"\u{1F9EA} The "),u=a(T,"CODE",{});var re=s(u);m=l(re,"LoaderMixins"),re.forEach(t),_=l(T," are highly experimental and prone to future changes. To use private or "),r=a(T,"A",{href:!0,rel:!0});var ne=s(r);h=l(ne,"gated"),ne.forEach(t),F=l(T," models, log-in with "),A=a(T,"CODE",{});var z=s(A);G=l(z,"huggingface-cli login"),z.forEach(t),C=l(T,"."),T.forEach(t),this.h()},h(){p(r,"href","https://huggingface.co/docs/hub/models-gated#gated-models"),p(r,"rel","nofollow")},m(Z,T){v(Z,d,T),e(d,L),e(d,u),e(u,m),e(d,_),e(d,r),e(r,h),e(d,F),e(d,A),e(A,G),e(d,C)},d(Z){Z&&t(d)}}}function yi(E){let d,L,u,m,_;return m=new Qo({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvblBpcGVsaW5lJTBBaW1wb3J0JTIwdG9yY2glMEElMEFtb2RlbF9pZCUyMCUzRCUyMCUyMnJ1bndheW1sJTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIyJTBBcGlwZSUyMCUzRCUyMFN0YWJsZURpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZChtb2RlbF9pZCUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNikudG8oJTIyY3VkYSUyMiklMEElMEFwaXBlLmxvYWRfdGV4dHVhbF9pbnZlcnNpb24oJTIyc2QtY29uY2VwdHMtbGlicmFyeSUyRmNhdC10b3klMjIpJTBBJTBBcHJvbXB0JTIwJTNEJTIwJTIyQSUyMCUzQ2NhdC10b3klM0UlMjBiYWNrcGFjayUyMiUwQSUwQWltYWdlJTIwJTNEJTIwcGlwZShwcm9tcHQlMkMlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNENTApLmltYWdlcyU1QjAlNUQlMEFpbWFnZS5zYXZlKCUyMmNhdC1iYWNrcGFjay5wbmclMjIp",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionPipeline
<span class="hljs-keyword">import</span> torch

model_id = <span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16).to(<span class="hljs-string">&quot;cuda&quot;</span>)

pipe.load_textual_inversion(<span class="hljs-string">&quot;sd-concepts-library/cat-toy&quot;</span>)

prompt = <span class="hljs-string">&quot;A &lt;cat-toy&gt; backpack&quot;</span>

image = pipe(prompt, num_inference_steps=<span class="hljs-number">50</span>).images[<span class="hljs-number">0</span>]
image.save(<span class="hljs-string">&quot;cat-backpack.png&quot;</span>)`}}),{c(){d=n("p"),L=i("To load a textual inversion embedding vector in \u{1F917} Diffusers format:"),u=c(),b(m.$$.fragment)},l(r){d=a(r,"P",{});var h=s(d);L=l(h,"To load a textual inversion embedding vector in \u{1F917} Diffusers format:"),h.forEach(t),u=f(r),x(m.$$.fragment,r)},m(r,h){v(r,d,h),e(d,L),v(r,u,h),y(m,r,h),_=!0},p:Xo,i(r){_||(w(m.$$.fragment,r),_=!0)},o(r){M(m.$$.fragment,r),_=!1},d(r){r&&t(d),r&&t(u),$(m,r)}}}function wi(E){let d,L,u,m,_;return m=new Qo({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvblBpcGVsaW5lJTBBaW1wb3J0JTIwdG9yY2glMEElMEFtb2RlbF9pZCUyMCUzRCUyMCUyMnJ1bndheW1sJTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIyJTBBcGlwZSUyMCUzRCUyMFN0YWJsZURpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZChtb2RlbF9pZCUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNikudG8oJTIyY3VkYSUyMiklMEElMEFwaXBlLmxvYWRfdGV4dHVhbF9pbnZlcnNpb24oJTIyLiUyRmNoYXJ0dXJuZXJ2Mi5wdCUyMiUyQyUyMHRva2VuJTNEJTIyY2hhcnR1cm5lcnYyJTIyKSUwQSUwQXByb21wdCUyMCUzRCUyMCUyMmNoYXJ0dXJuZXJ2MiUyQyUyMG11bHRpcGxlJTIwdmlld3MlMjBvZiUyMHRoZSUyMHNhbWUlMjBjaGFyYWN0ZXIlMjBpbiUyMHRoZSUyMHNhbWUlMjBvdXRmaXQlMkMlMjBhJTIwY2hhcmFjdGVyJTIwdHVybmFyb3VuZCUyMG9mJTIwYSUyMHdvbWFuJTIwd2VhcmluZyUyMGElMjBibGFjayUyMGphY2tldCUyMGFuZCUyMHJlZCUyMHNoaXJ0JTJDJTIwYmVzdCUyMHF1YWxpdHklMkMlMjBpbnRyaWNhdGUlMjBkZXRhaWxzLiUyMiUwQSUwQWltYWdlJTIwJTNEJTIwcGlwZShwcm9tcHQlMkMlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNENTApLmltYWdlcyU1QjAlNUQlMEFpbWFnZS5zYXZlKCUyMmNoYXJhY3Rlci5wbmclMjIp",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionPipeline
<span class="hljs-keyword">import</span> torch

model_id = <span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16).to(<span class="hljs-string">&quot;cuda&quot;</span>)

pipe.load_textual_inversion(<span class="hljs-string">&quot;./charturnerv2.pt&quot;</span>, token=<span class="hljs-string">&quot;charturnerv2&quot;</span>)

prompt = <span class="hljs-string">&quot;charturnerv2, multiple views of the same character in the same outfit, a character turnaround of a woman wearing a black jacket and red shirt, best quality, intricate details.&quot;</span>

image = pipe(prompt, num_inference_steps=<span class="hljs-number">50</span>).images[<span class="hljs-number">0</span>]
image.save(<span class="hljs-string">&quot;character.png&quot;</span>)`}}),{c(){d=n("p"),L=i("locally:"),u=c(),b(m.$$.fragment)},l(r){d=a(r,"P",{});var h=s(d);L=l(h,"locally:"),h.forEach(t),u=f(r),x(m.$$.fragment,r)},m(r,h){v(r,d,h),e(d,L),v(r,u,h),y(m,r,h),_=!0},p:Xo,i(r){_||(w(m.$$.fragment,r),_=!0)},o(r){M(m.$$.fragment,r),_=!1},d(r){r&&t(d),r&&t(u),$(m,r)}}}function Mi(E){let d,L,u,m,_;return{c(){d=n("p"),L=i("We support loading A1111 formatted LoRA checkpoints in a limited capacity."),u=c(),m=n("p"),_=i("This function is experimental and might change in the future.")},l(r){d=a(r,"P",{});var h=s(d);L=l(h,"We support loading A1111 formatted LoRA checkpoints in a limited capacity."),h.forEach(t),u=f(r),m=a(r,"P",{});var F=s(m);_=l(F,"This function is experimental and might change in the future."),F.forEach(t)},m(r,h){v(r,d,h),e(d,L),v(r,u,h),v(r,m,h),e(m,_)},d(r){r&&t(d),r&&t(u),r&&t(m)}}}function $i(E){let d,L,u,m,_;return m=new Qo({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>...'}}),{c(){d=n("p"),L=i("Examples:"),u=c(),b(m.$$.fragment)},l(r){d=a(r,"P",{});var h=s(d);L=l(h,"Examples:"),h.forEach(t),u=f(r),x(m.$$.fragment,r)},m(r,h){v(r,d,h),e(d,L),v(r,u,h),y(m,r,h),_=!0},p:Xo,i(r){_||(w(m.$$.fragment,r),_=!0)},o(r){M(m.$$.fragment,r),_=!1},d(r){r&&t(d),r&&t(u),$(m,r)}}}function Li(E){let d,L,u,m,_;return m=new Qo({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvblBpcGVsaW5lJTBBJTBBJTIzJTIwRG93bmxvYWQlMjBwaXBlbGluZSUyMGZyb20lMjBodWdnaW5nZmFjZS5jbyUyMGFuZCUyMGNhY2hlLiUwQXBpcGVsaW5lJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9zaW5nbGVfZmlsZSglMEElMjAlMjAlMjAlMjAlMjJodHRwcyUzQSUyRiUyRmh1Z2dpbmdmYWNlLmNvJTJGV2Fycmlvck1hbWE3NzclMkZPcmFuZ2VNaXhzJTJGYmxvYiUyRm1haW4lMkZNb2RlbHMlMkZBYnlzc09yYW5nZU1peCUyRkFieXNzT3JhbmdlTWl4LnNhZmV0ZW5zb3JzJTIyJTBBKSUwQSUwQSUyMyUyMERvd25sb2FkJTIwcGlwZWxpbmUlMjBmcm9tJTIwbG9jYWwlMjBmaWxlJTBBJTIzJTIwZmlsZSUyMGlzJTIwZG93bmxvYWRlZCUyMHVuZGVyJTIwLiUyRnYxLTUtcHJ1bmVkLWVtYW9ubHkuY2twdCUwQXBpcGVsaW5lJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9zaW5nbGVfZmlsZSglMjIuJTJGdjEtNS1wcnVuZWQtZW1hb25seSUyMiklMEElMEElMjMlMjBFbmFibGUlMjBmbG9hdDE2JTIwYW5kJTIwbW92ZSUyMHRvJTIwR1BVJTBBcGlwZWxpbmUlMjAlM0QlMjBTdGFibGVEaWZmdXNpb25QaXBlbGluZS5mcm9tX3NpbmdsZV9maWxlKCUwQSUyMCUyMCUyMCUyMCUyMmh0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZydW53YXltbCUyRnN0YWJsZS1kaWZmdXNpb24tdjEtNSUyRmJsb2IlMkZtYWluJTJGdjEtNS1wcnVuZWQtZW1hb25seS5ja3B0JTIyJTJDJTBBJTIwJTIwJTIwJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTJDJTBBKSUwQXBpcGVsaW5lLnRvKCUyMmN1ZGElMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionPipeline

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Download pipeline from huggingface.co and cache.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipeline = StableDiffusionPipeline.from_single_file(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;https://huggingface.co/WarriorMama777/OrangeMixs/blob/main/Models/AbyssOrangeMix/AbyssOrangeMix.safetensors&quot;</span>
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Download pipeline from local file</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># file is downloaded under ./v1-5-pruned-emaonly.ckpt</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipeline = StableDiffusionPipeline.from_single_file(<span class="hljs-string">&quot;./v1-5-pruned-emaonly&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Enable float16 and move to GPU</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipeline = StableDiffusionPipeline.from_single_file(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;https://huggingface.co/runwayml/stable-diffusion-v1-5/blob/main/v1-5-pruned-emaonly.ckpt&quot;</span>,
<span class="hljs-meta">... </span>    torch_dtype=torch.float16,
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipeline.to(<span class="hljs-string">&quot;cuda&quot;</span>)`}}),{c(){d=n("p"),L=i("Examples:"),u=c(),b(m.$$.fragment)},l(r){d=a(r,"P",{});var h=s(d);L=l(h,"Examples:"),h.forEach(t),u=f(r),x(m.$$.fragment,r)},m(r,h){v(r,d,h),e(d,L),v(r,u,h),y(m,r,h),_=!0},p:Xo,i(r){_||(w(m.$$.fragment,r),_=!0)},o(r){M(m.$$.fragment,r),_=!1},d(r){r&&t(d),r&&t(u),$(m,r)}}}function Ti(E){let d,L,u,m,_;return m=new Qo({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvbkNvbnRyb2xuZXRQaXBlbGluZSUyQyUyMENvbnRyb2xOZXRNb2RlbCUwQSUwQXVybCUyMCUzRCUyMCUyMmh0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZsbGx5YXN2aWVsJTJGQ29udHJvbE5ldC12MS0xJTJGYmxvYiUyRm1haW4lMkZjb250cm9sX3YxMXBfc2QxNV9jYW5ueS5wdGglMjIlMjAlMjAlMjMlMjBjYW4lMjBhbHNvJTIwYmUlMjBhJTIwbG9jYWwlMjBwYXRoJTBBbW9kZWwlMjAlM0QlMjBDb250cm9sTmV0TW9kZWwuZnJvbV9zaW5nbGVfZmlsZSh1cmwpJTBBJTBBdXJsJTIwJTNEJTIwJTIyaHR0cHMlM0ElMkYlMkZodWdnaW5nZmFjZS5jbyUyRnJ1bndheW1sJTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTJGYmxvYiUyRm1haW4lMkZ2MS01LXBydW5lZC5zYWZldGVuc29ycyUyMiUyMCUyMCUyMyUyMGNhbiUyMGFsc28lMjBiZSUyMGElMjBsb2NhbCUyMHBhdGglMEFwaXBlJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uQ29udHJvbG5ldFBpcGVsaW5lLmZyb21fc2luZ2xlX2ZpbGUodXJsJTJDJTIwY29udHJvbG5ldCUzRGNvbnRyb2xuZXQp",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionControlnetPipeline, ControlNetModel

url = <span class="hljs-string">&quot;https://huggingface.co/lllyasviel/ControlNet-v1-1/blob/main/control_v11p_sd15_canny.pth&quot;</span>  <span class="hljs-comment"># can also be a local path</span>
model = ControlNetModel.from_single_file(url)

url = <span class="hljs-string">&quot;https://huggingface.co/runwayml/stable-diffusion-v1-5/blob/main/v1-5-pruned.safetensors&quot;</span>  <span class="hljs-comment"># can also be a local path</span>
pipe = StableDiffusionControlnetPipeline.from_single_file(url, controlnet=controlnet)`}}),{c(){d=n("p"),L=i("Examples:"),u=c(),b(m.$$.fragment)},l(r){d=a(r,"P",{});var h=s(d);L=l(h,"Examples:"),h.forEach(t),u=f(r),x(m.$$.fragment,r)},m(r,h){v(r,d,h),e(d,L),v(r,u,h),y(m,r,h),_=!0},p:Xo,i(r){_||(w(m.$$.fragment,r),_=!0)},o(r){M(m.$$.fragment,r),_=!1},d(r){r&&t(d),r&&t(u),$(m,r)}}}function ki(E){let d,L,u,m,_,r,h,F,A,G,C;return{c(){d=n("p"),L=i("Make sure to pass both "),u=n("code"),m=i("image_size"),_=i(" and "),r=n("code"),h=i("scaling_factor"),F=i(" to "),A=n("code"),G=i("from_single_file()"),C=i(` if you want to load
a VAE that does accompany a stable diffusion model of v2 or higher or SDXL.`)},l(Z){d=a(Z,"P",{});var T=s(d);L=l(T,"Make sure to pass both "),u=a(T,"CODE",{});var re=s(u);m=l(re,"image_size"),re.forEach(t),_=l(T," and "),r=a(T,"CODE",{});var ne=s(r);h=l(ne,"scaling_factor"),ne.forEach(t),F=l(T," to "),A=a(T,"CODE",{});var z=s(A);G=l(z,"from_single_file()"),z.forEach(t),C=l(T,` if you want to load
a VAE that does accompany a stable diffusion model of v2 or higher or SDXL.`),T.forEach(t)},m(Z,T){v(Z,d,T),e(d,L),e(d,u),e(u,m),e(d,_),e(d,r),e(r,h),e(d,F),e(d,A),e(A,G),e(d,C)},d(Z){Z&&t(d)}}}function Ei(E){let d,L,u,m,_;return m=new Qo({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEF1dG9lbmNvZGVyS0wlMEElMEF1cmwlMjAlM0QlMjAlMjJodHRwcyUzQSUyRiUyRmh1Z2dpbmdmYWNlLmNvJTJGc3RhYmlsaXR5YWklMkZzZC12YWUtZnQtbXNlLW9yaWdpbmFsJTJGYmxvYiUyRm1haW4lMkZ2YWUtZnQtbXNlLTg0MDAwMC1lbWEtcHJ1bmVkLnNhZmV0ZW5zb3JzJTIyJTIwJTIwJTIzJTIwY2FuJTIwYWxzbyUyMGJlJTIwbG9jYWwlMjBmaWxlJTBBbW9kZWwlMjAlM0QlMjBBdXRvZW5jb2RlcktMLmZyb21fc2luZ2xlX2ZpbGUodXJsKQ==",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> AutoencoderKL

url = <span class="hljs-string">&quot;https://huggingface.co/stabilityai/sd-vae-ft-mse-original/blob/main/vae-ft-mse-840000-ema-pruned.safetensors&quot;</span>  <span class="hljs-comment"># can also be local file</span>
model = AutoencoderKL.from_single_file(url)`}}),{c(){d=n("p"),L=i("Examples:"),u=c(),b(m.$$.fragment)},l(r){d=a(r,"P",{});var h=s(d);L=l(h,"Examples:"),h.forEach(t),u=f(r),x(m.$$.fragment,r)},m(r,h){v(r,d,h),e(d,L),v(r,u,h),y(m,r,h),_=!0},p:Xo,i(r){_||(w(m.$$.fragment,r),_=!0)},o(r){M(m.$$.fragment,r),_=!1},d(r){r&&t(d),r&&t(u),$(m,r)}}}function Ui(E){let d,L,u,m,_,r,h,F,A,G,C,Z,T,re,ne,z,ve,Yt,ae,be,Ko,Ve,$r,et,Lr,Ot,B,Be,Tr,xe,qe,kr,q,Er,Eo,Ur,Fr,Ye,ot,Cr,Ir,tt,Jr,Dr,Ar,ye,Oe,Zr,ze,Nr,Uo,Sr,Wr,zt,se,we,rt,He,jr,nt,Gr,Ht,N,Xe,Pr,at,Rr,Vr,I,Qe,Br,Ke,qr,Fo,Yr,Or,zr,st,Hr,Xr,Me,Qr,eo,Kr,oo,en,on,tn,$e,rn,Le,to,nn,it,an,Xt,ie,Te,lt,ro,sn,dt,ln,Qt,k,no,dn,le,cn,Co,fn,mn,ao,ct,pn,hn,un,ke,so,gn,Ee,_n,ft,vn,bn,mt,xn,yn,Ue,io,wn,de,Mn,pt,$n,Ln,ht,Tn,kn,En,J,lo,Un,Y,Fn,ut,Cn,In,gt,Jn,Dn,_t,An,Zn,Nn,co,Sn,vt,Wn,jn,Gn,fo,Pn,Io,Rn,Vn,Bn,ce,qn,Jo,Yn,On,bt,zn,Hn,Xn,fe,Qn,Do,Kn,ea,xt,oa,ta,ra,H,mo,na,yt,aa,sa,Fe,ia,Ce,po,la,wt,da,ca,X,ho,fa,Mt,ma,pa,Ie,Kt,me,Je,$t,uo,ha,Lt,ua,er,O,go,ga,pe,_a,Tt,va,ba,Ao,xa,ya,wa,Q,_o,Ma,S,$a,Zo,La,Ta,kt,ka,Ea,Et,Ua,Fa,Ut,Ca,Ia,Ja,De,or,he,Ae,Ft,vo,Da,Ct,Aa,tr,ue,bo,Za,K,xo,Na,W,Sa,No,Wa,ja,It,Ga,Pa,Jt,Ra,Va,Dt,Ba,qa,Ya,Ze,rr,ge,Ne,At,yo,Oa,Zt,za,nr,_e,wo,Ha,P,Mo,Xa,j,Qa,So,Ka,es,Nt,os,ts,St,rs,ns,Wt,as,ss,is,Se,ls,We,ar;return r=new ko({}),ve=new ds({props:{warning:!0,$$slots:{default:[xi]},$$scope:{ctx:E}}}),Ve=new ko({}),Be=new U({props:{name:"class diffusers.loaders.UNet2DConditionLoadersMixin",anchor:"diffusers.loaders.UNet2DConditionLoadersMixin",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/loaders.py#L184"}}),qe=new U({props:{name:"load_attn_procs",anchor:"diffusers.loaders.UNet2DConditionLoadersMixin.load_attn_procs",parameters:[{name:"pretrained_model_name_or_path_or_dict",val:": typing.Union[str, typing.Dict[str, torch.Tensor]]"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.loaders.UNet2DConditionLoadersMixin.load_attn_procs.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 model id (for example <code>google/ddpm-celebahq-256</code>) of a pretrained model hosted on
the Hub.</li>
<li>A path to a directory (for example <code>./my_model_directory</code>) containing the model weights saved
with <a href="/docs/diffusers/main/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.UNet2DConditionLoadersMixin.load_attn_procs.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.UNet2DConditionLoadersMixin.load_attn_procs.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.`,name:"force_download"},{anchor:"diffusers.loaders.UNet2DConditionLoadersMixin.load_attn_procs.resume_download",description:`<strong>resume_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to resume downloading the model weights and configuration files. If set to <code>False</code>, any
incompletely downloaded files are deleted.`,name:"resume_download"},{anchor:"diffusers.loaders.UNet2DConditionLoadersMixin.load_attn_procs.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.UNet2DConditionLoadersMixin.load_attn_procs.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.UNet2DConditionLoadersMixin.load_attn_procs.use_auth_token",description:`<strong>use_auth_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:"use_auth_token"},{anchor:"diffusers.loaders.UNet2DConditionLoadersMixin.load_attn_procs.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.UNet2DConditionLoadersMixin.load_attn_procs.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.UNet2DConditionLoadersMixin.load_attn_procs.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/main/src/diffusers/loaders.py#L188"}}),Oe=new U({props:{name:"save_attn_procs",anchor:"diffusers.loaders.UNet2DConditionLoadersMixin.save_attn_procs",parameters:[{name:"save_directory",val:": typing.Union[str, os.PathLike]"},{name:"is_main_process",val:": bool = True"},{name:"weight_name",val:": str = None"},{name:"save_function",val:": typing.Callable = None"},{name:"safe_serialization",val:": bool = False"}],parametersDescription:[{anchor:"diffusers.loaders.UNet2DConditionLoadersMixin.save_attn_procs.save_directory",description:`<strong>save_directory</strong> (<code>str</code> or <code>os.PathLike</code>) &#x2014;
Directory to save an attention processor to. Will be created if it doesn&#x2019;t exist.`,name:"save_directory"},{anchor:"diffusers.loaders.UNet2DConditionLoadersMixin.save_attn_procs.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.UNet2DConditionLoadersMixin.save_attn_procs.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"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/loaders.py#L503"}}),He=new ko({}),Xe=new U({props:{name:"class diffusers.loaders.TextualInversionLoaderMixin",anchor:"diffusers.loaders.TextualInversionLoaderMixin",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/loaders.py#L579"}}),Qe=new U({props:{name:"load_textual_inversion",anchor:"diffusers.loaders.TextualInversionLoaderMixin.load_textual_inversion",parameters:[{name:"pretrained_model_name_or_path",val:": typing.Union[str, typing.List[str], typing.Dict[str, torch.Tensor], typing.List[typing.Dict[str, torch.Tensor]]]"},{name:"token",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.loaders.TextualInversionLoaderMixin.load_textual_inversion.pretrained_model_name_or_path",description:`<strong>pretrained_model_name_or_path</strong> (<code>str</code> or <code>os.PathLike</code> or <code>List[str or os.PathLike]</code> or <code>Dict</code> or <code>List[Dict]</code>) &#x2014;
Can be either one of the following or a list of them:</p>
<ul>
<li>A string, the <em>model id</em> (for example <code>sd-concepts-library/low-poly-hd-logos-icons</code>) of a
pretrained model hosted on the Hub.</li>
<li>A path to a <em>directory</em> (for example <code>./my_text_inversion_directory/</code>) containing the textual
inversion weights.</li>
<li>A path to a <em>file</em> (for example <code>./my_text_inversions.pt</code>) containing textual inversion weights.</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"},{anchor:"diffusers.loaders.TextualInversionLoaderMixin.load_textual_inversion.token",description:`<strong>token</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
Override the token to use for the textual inversion weights. If <code>pretrained_model_name_or_path</code> is a
list, then <code>token</code> must also be a list of equal length.`,name:"token"},{anchor:"diffusers.loaders.TextualInversionLoaderMixin.load_textual_inversion.weight_name",description:`<strong>weight_name</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Name of a custom weight file. This should be used when:</p>
<ul>
<li>The saved textual inversion file is in &#x1F917; Diffusers format, but was saved under a specific weight
name such as <code>text_inv.bin</code>.</li>
<li>The saved textual inversion file is in the Automatic1111 format.</li>
</ul>`,name:"weight_name"},{anchor:"diffusers.loaders.TextualInversionLoaderMixin.load_textual_inversion.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.TextualInversionLoaderMixin.load_textual_inversion.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.`,name:"force_download"},{anchor:"diffusers.loaders.TextualInversionLoaderMixin.load_textual_inversion.resume_download",description:`<strong>resume_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to resume downloading the model weights and configuration files. If set to <code>False</code>, any
incompletely downloaded files are deleted.`,name:"resume_download"},{anchor:"diffusers.loaders.TextualInversionLoaderMixin.load_textual_inversion.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.TextualInversionLoaderMixin.load_textual_inversion.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.TextualInversionLoaderMixin.load_textual_inversion.use_auth_token",description:`<strong>use_auth_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:"use_auth_token"},{anchor:"diffusers.loaders.TextualInversionLoaderMixin.load_textual_inversion.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.TextualInversionLoaderMixin.load_textual_inversion.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.TextualInversionLoaderMixin.load_textual_inversion.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/main/src/diffusers/loaders.py#L641"}}),Me=new Ho({props:{anchor:"diffusers.loaders.TextualInversionLoaderMixin.load_textual_inversion.example",$$slots:{default:[yi]},$$scope:{ctx:E}}}),$e=new Ho({props:{anchor:"diffusers.loaders.TextualInversionLoaderMixin.load_textual_inversion.example-2",$$slots:{default:[wi]},$$scope:{ctx:E}}}),to=new U({props:{name:"maybe_convert_prompt",anchor:"diffusers.loaders.TextualInversionLoaderMixin.maybe_convert_prompt",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]]"},{name:"tokenizer",val:": PreTrainedTokenizer"}],parametersDescription:[{anchor:"diffusers.loaders.TextualInversionLoaderMixin.maybe_convert_prompt.prompt",description:`<strong>prompt</strong> (<code>str</code> or list of <code>str</code>) &#x2014;
The prompt or prompts to guide the image generation.`,name:"prompt"},{anchor:"diffusers.loaders.TextualInversionLoaderMixin.maybe_convert_prompt.tokenizer",description:`<strong>tokenizer</strong> (<code>PreTrainedTokenizer</code>) &#x2014;
The tokenizer responsible for encoding the prompt into input tokens.`,name:"tokenizer"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/loaders.py#L584",returnDescription:`
<p>The converted prompt</p>
`,returnType:`
<p><code>str</code> or list of <code>str</code></p>
`}}),ro=new ko({}),no=new U({props:{name:"class diffusers.loaders.LoraLoaderMixin",anchor:"diffusers.loaders.LoraLoaderMixin",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/loaders.py#L910"}}),so=new U({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"}],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"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/loaders.py#L1228"}}),io=new U({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:""}],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"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/loaders.py#L1186"}}),lo=new U({props:{name:"load_lora_weights",anchor:"diffusers.loaders.LoraLoaderMixin.load_lora_weights",parameters:[{name:"pretrained_model_name_or_path_or_dict",val:": typing.Union[str, typing.Dict[str, torch.Tensor]]"},{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/main/en/api/loaders#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/main/en/api/loaders#diffusers.loaders.LoraLoaderMixin.lora_state_dict">lora_state_dict()</a>.`,name:"kwargs"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/loaders.py#L918"}}),mo=new U({props:{name:"lora_state_dict",anchor:"diffusers.loaders.LoraLoaderMixin.lora_state_dict",parameters:[{name:"pretrained_model_name_or_path_or_dict",val:": typing.Union[str, typing.Dict[str, torch.Tensor]]"},{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/main/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.`,name:"force_download"},{anchor:"diffusers.loaders.LoraLoaderMixin.lora_state_dict.resume_download",description:`<strong>resume_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to resume downloading the model weights and configuration files. If set to <code>False</code>, any
incompletely downloaded files are deleted.`,name:"resume_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.use_auth_token",description:`<strong>use_auth_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:"use_auth_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.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/main/src/diffusers/loaders.py#L948"}}),Fe=new ds({props:{warning:!0,$$slots:{default:[Mi]},$$scope:{ctx:E}}}),po=new U({props:{name:"save_lora_weights",anchor:"diffusers.loaders.LoraLoaderMixin.save_lora_weights",parameters:[{name:"save_directory",val:": typing.Union[str, os.PathLike]"},{name:"unet_lora_layers",val:": typing.Dict[str, typing.Union[torch.nn.modules.module.Module, torch.Tensor]] = None"},{name:"text_encoder_lora_layers",val:": typing.Dict[str, torch.nn.modules.module.Module] = None"},{name:"is_main_process",val:": bool = True"},{name:"weight_name",val:": str = None"},{name:"save_function",val:": typing.Callable = None"},{name:"safe_serialization",val:": bool = False"}],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"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/loaders.py#L1411"}}),ho=new U({props:{name:"unload_lora_weights",anchor:"diffusers.loaders.LoraLoaderMixin.unload_lora_weights",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/loaders.py#L1670"}}),Ie=new Ho({props:{anchor:"diffusers.loaders.LoraLoaderMixin.unload_lora_weights.example",$$slots:{default:[$i]},$$scope:{ctx:E}}}),uo=new ko({}),go=new U({props:{name:"class diffusers.loaders.FromSingleFileMixin",anchor:"diffusers.loaders.FromSingleFileMixin",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/loaders.py#L1717"}}),_o=new U({props:{name:"from_single_file",anchor:"diffusers.loaders.FromSingleFileMixin.from_single_file",parameters:[{name:"pretrained_model_link_or_path",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.loaders.FromSingleFileMixin.from_single_file.pretrained_model_link_or_path",description:`<strong>pretrained_model_link_or_path</strong> (<code>str</code> or <code>os.PathLike</code>, <em>optional</em>) &#x2014;
Can be either:<ul>
<li>A link to the <code>.ckpt</code> file (for example
<code>&quot;https://huggingface.co/&lt;repo_id&gt;/blob/main/&lt;path_to_file&gt;.ckpt&quot;</code>) on the Hub.</li>
<li>A path to a <em>file</em> containing all pipeline weights.</li>
</ul>`,name:"pretrained_model_link_or_path"},{anchor:"diffusers.loaders.FromSingleFileMixin.from_single_file.torch_dtype",description:`<strong>torch_dtype</strong> (<code>str</code> or <code>torch.dtype</code>, <em>optional</em>) &#x2014;
Override the default <code>torch.dtype</code> and load the model with another dtype. If <code>&quot;auto&quot;</code> is passed, the
dtype is automatically derived from the model&#x2019;s weights.`,name:"torch_dtype"},{anchor:"diffusers.loaders.FromSingleFileMixin.from_single_file.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.`,name:"force_download"},{anchor:"diffusers.loaders.FromSingleFileMixin.from_single_file.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.FromSingleFileMixin.from_single_file.resume_download",description:`<strong>resume_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to resume downloading the model weights and configuration files. If set to <code>False</code>, any
incompletely downloaded files are deleted.`,name:"resume_download"},{anchor:"diffusers.loaders.FromSingleFileMixin.from_single_file.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.FromSingleFileMixin.from_single_file.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.FromSingleFileMixin.from_single_file.use_auth_token",description:`<strong>use_auth_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:"use_auth_token"},{anchor:"diffusers.loaders.FromSingleFileMixin.from_single_file.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.FromSingleFileMixin.from_single_file.use_safetensors",description:`<strong>use_safetensors</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
If set to <code>None</code>, the safetensors weights are downloaded if they&#x2019;re available <strong>and</strong> if the
safetensors library is installed. If set to <code>True</code>, the model is forcibly loaded from safetensors
weights. If set to <code>False</code>, safetensors weights are not loaded.`,name:"use_safetensors"},{anchor:"diffusers.loaders.FromSingleFileMixin.from_single_file.extract_ema",description:`<strong>extract_ema</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to extract the EMA weights or not. Pass <code>True</code> to extract the EMA weights which usually yield
higher quality images for inference. Non-EMA weights are usually better for continuing finetuning.`,name:"extract_ema"},{anchor:"diffusers.loaders.FromSingleFileMixin.from_single_file.upcast_attention",description:`<strong>upcast_attention</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
Whether the attention computation should always be upcasted.`,name:"upcast_attention"},{anchor:"diffusers.loaders.FromSingleFileMixin.from_single_file.image_size",description:`<strong>image_size</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
The image size the model was trained on. Use 512 for all Stable Diffusion v1 models and the Stable
Diffusion v2 base model. Use 768 for Stable Diffusion v2.`,name:"image_size"},{anchor:"diffusers.loaders.FromSingleFileMixin.from_single_file.prediction_type",description:`<strong>prediction_type</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The prediction type the model was trained on. Use <code>&apos;epsilon&apos;</code> for all Stable Diffusion v1 models and
the Stable Diffusion v2 base model. Use <code>&apos;v_prediction&apos;</code> for Stable Diffusion v2.`,name:"prediction_type"},{anchor:"diffusers.loaders.FromSingleFileMixin.from_single_file.num_in_channels",description:`<strong>num_in_channels</strong> (<code>int</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
The number of input channels. If <code>None</code>, it is automatically inferred.`,name:"num_in_channels"},{anchor:"diffusers.loaders.FromSingleFileMixin.from_single_file.scheduler_type",description:`<strong>scheduler_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pndm&quot;</code>) &#x2014;
Type of scheduler to use. Should be one of <code>[&quot;pndm&quot;, &quot;lms&quot;, &quot;heun&quot;, &quot;euler&quot;, &quot;euler-ancestral&quot;, &quot;dpm&quot;, &quot;ddim&quot;]</code>.`,name:"scheduler_type"},{anchor:"diffusers.loaders.FromSingleFileMixin.from_single_file.load_safety_checker",description:`<strong>load_safety_checker</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to load the safety checker or not.`,name:"load_safety_checker"},{anchor:"diffusers.loaders.FromSingleFileMixin.from_single_file.text_encoder",description:`<strong>text_encoder</strong> (<a href="https://huggingface.co/docs/transformers/main/en/model_doc/clip#transformers.CLIPTextModel" rel="nofollow">CLIPTextModel</a>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
An instance of <code>CLIPTextModel</code> to use, specifically the
<a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a> variant. If this
parameter is <code>None</code>, the function loads a new instance of <code>CLIPTextModel</code> by itself if needed.`,name:"text_encoder"},{anchor:"diffusers.loaders.FromSingleFileMixin.from_single_file.vae",description:`<strong>vae</strong> (<code>AutoencoderKL</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations. If
this parameter is <code>None</code>, the function will load a new instance of [CLIP] by itself, if needed.`,name:"vae"},{anchor:"diffusers.loaders.FromSingleFileMixin.from_single_file.tokenizer",description:`<strong>tokenizer</strong> (<a href="https://huggingface.co/docs/transformers/main/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
An instance of <code>CLIPTokenizer</code> to use. If this parameter is <code>None</code>, the function loads a new instance
of <code>CLIPTokenizer</code> by itself if needed.`,name:"tokenizer"},{anchor:"diffusers.loaders.FromSingleFileMixin.from_single_file.kwargs",description:`<strong>kwargs</strong> (remaining dictionary of keyword arguments, <em>optional</em>) &#x2014;
Can be used to overwrite load and saveable variables (for example the pipeline components of the
specific pipeline class). The overwritten components are directly passed to the pipelines <code>__init__</code>
method. See example below for more information.`,name:"kwargs"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/loaders.py#L1728"}}),De=new Ho({props:{anchor:"diffusers.loaders.FromSingleFileMixin.from_single_file.example",$$slots:{default:[Li]},$$scope:{ctx:E}}}),vo=new ko({}),bo=new U({props:{name:"class diffusers.loaders.FromOriginalControlnetMixin",anchor:"diffusers.loaders.FromOriginalControlnetMixin",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/loaders.py#L2135"}}),xo=new U({props:{name:"from_single_file",anchor:"diffusers.loaders.FromOriginalControlnetMixin.from_single_file",parameters:[{name:"pretrained_model_link_or_path",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.loaders.FromOriginalControlnetMixin.from_single_file.pretrained_model_link_or_path",description:`<strong>pretrained_model_link_or_path</strong> (<code>str</code> or <code>os.PathLike</code>, <em>optional</em>) &#x2014;
Can be either:<ul>
<li>A link to the <code>.ckpt</code> file (for example
<code>&quot;https://huggingface.co/&lt;repo_id&gt;/blob/main/&lt;path_to_file&gt;.ckpt&quot;</code>) on the Hub.</li>
<li>A path to a <em>file</em> containing all pipeline weights.</li>
</ul>`,name:"pretrained_model_link_or_path"},{anchor:"diffusers.loaders.FromOriginalControlnetMixin.from_single_file.torch_dtype",description:`<strong>torch_dtype</strong> (<code>str</code> or <code>torch.dtype</code>, <em>optional</em>) &#x2014;
Override the default <code>torch.dtype</code> and load the model with another dtype. If <code>&quot;auto&quot;</code> is passed, the
dtype is automatically derived from the model&#x2019;s weights.`,name:"torch_dtype"},{anchor:"diffusers.loaders.FromOriginalControlnetMixin.from_single_file.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.`,name:"force_download"},{anchor:"diffusers.loaders.FromOriginalControlnetMixin.from_single_file.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.FromOriginalControlnetMixin.from_single_file.resume_download",description:`<strong>resume_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to resume downloading the model weights and configuration files. If set to <code>False</code>, any
incompletely downloaded files are deleted.`,name:"resume_download"},{anchor:"diffusers.loaders.FromOriginalControlnetMixin.from_single_file.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.FromOriginalControlnetMixin.from_single_file.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 True, the model
won&#x2019;t be downloaded from the Hub.`,name:"local_files_only"},{anchor:"diffusers.loaders.FromOriginalControlnetMixin.from_single_file.use_auth_token",description:`<strong>use_auth_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:"use_auth_token"},{anchor:"diffusers.loaders.FromOriginalControlnetMixin.from_single_file.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.FromOriginalControlnetMixin.from_single_file.use_safetensors",description:`<strong>use_safetensors</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
If set to <code>None</code>, the safetensors weights are downloaded if they&#x2019;re available <strong>and</strong> if the
safetensors library is installed. If set to <code>True</code>, the model is forcibly loaded from safetensors
weights. If set to <code>False</code>, safetensors weights are not loaded.`,name:"use_safetensors"},{anchor:"diffusers.loaders.FromOriginalControlnetMixin.from_single_file.image_size",description:`<strong>image_size</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
The image size the model was trained on. Use 512 for all Stable Diffusion v1 models and the Stable
Diffusion v2 base model. Use 768 for Stable Diffusion v2.`,name:"image_size"},{anchor:"diffusers.loaders.FromOriginalControlnetMixin.from_single_file.upcast_attention",description:`<strong>upcast_attention</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
Whether the attention computation should always be upcasted.`,name:"upcast_attention"},{anchor:"diffusers.loaders.FromOriginalControlnetMixin.from_single_file.kwargs",description:`<strong>kwargs</strong> (remaining dictionary of keyword arguments, <em>optional</em>) &#x2014;
Can be used to overwrite load and saveable variables (for example the pipeline components of the
specific pipeline class). The overwritten components are directly passed to the pipelines <code>__init__</code>
method. See example below for more information.`,name:"kwargs"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/loaders.py#L2136"}}),Ze=new Ho({props:{anchor:"diffusers.loaders.FromOriginalControlnetMixin.from_single_file.example",$$slots:{default:[Ti]},$$scope:{ctx:E}}}),yo=new ko({}),wo=new U({props:{name:"class diffusers.loaders.FromOriginalVAEMixin",anchor:"diffusers.loaders.FromOriginalVAEMixin",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/loaders.py#L1942"}}),Mo=new U({props:{name:"from_single_file",anchor:"diffusers.loaders.FromOriginalVAEMixin.from_single_file",parameters:[{name:"pretrained_model_link_or_path",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.loaders.FromOriginalVAEMixin.from_single_file.pretrained_model_link_or_path",description:`<strong>pretrained_model_link_or_path</strong> (<code>str</code> or <code>os.PathLike</code>, <em>optional</em>) &#x2014;
Can be either:<ul>
<li>A link to the <code>.ckpt</code> file (for example
<code>&quot;https://huggingface.co/&lt;repo_id&gt;/blob/main/&lt;path_to_file&gt;.ckpt&quot;</code>) on the Hub.</li>
<li>A path to a <em>file</em> containing all pipeline weights.</li>
</ul>`,name:"pretrained_model_link_or_path"},{anchor:"diffusers.loaders.FromOriginalVAEMixin.from_single_file.torch_dtype",description:`<strong>torch_dtype</strong> (<code>str</code> or <code>torch.dtype</code>, <em>optional</em>) &#x2014;
Override the default <code>torch.dtype</code> and load the model with another dtype. If <code>&quot;auto&quot;</code> is passed, the
dtype is automatically derived from the model&#x2019;s weights.`,name:"torch_dtype"},{anchor:"diffusers.loaders.FromOriginalVAEMixin.from_single_file.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.`,name:"force_download"},{anchor:"diffusers.loaders.FromOriginalVAEMixin.from_single_file.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.FromOriginalVAEMixin.from_single_file.resume_download",description:`<strong>resume_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to resume downloading the model weights and configuration files. If set to <code>False</code>, any
incompletely downloaded files are deleted.`,name:"resume_download"},{anchor:"diffusers.loaders.FromOriginalVAEMixin.from_single_file.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.FromOriginalVAEMixin.from_single_file.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 True, the model
won&#x2019;t be downloaded from the Hub.`,name:"local_files_only"},{anchor:"diffusers.loaders.FromOriginalVAEMixin.from_single_file.use_auth_token",description:`<strong>use_auth_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:"use_auth_token"},{anchor:"diffusers.loaders.FromOriginalVAEMixin.from_single_file.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.FromOriginalVAEMixin.from_single_file.image_size",description:`<strong>image_size</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
The image size the model was trained on. Use 512 for all Stable Diffusion v1 models and the Stable
Diffusion v2 base model. Use 768 for Stable Diffusion v2.`,name:"image_size"},{anchor:"diffusers.loaders.FromOriginalVAEMixin.from_single_file.use_safetensors",description:`<strong>use_safetensors</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
If set to <code>None</code>, the safetensors weights are downloaded if they&#x2019;re available <strong>and</strong> if the
safetensors library is installed. If set to <code>True</code>, the model is forcibly loaded from safetensors
weights. If set to <code>False</code>, safetensors weights are not loaded.`,name:"use_safetensors"},{anchor:"diffusers.loaders.FromOriginalVAEMixin.from_single_file.upcast_attention",description:`<strong>upcast_attention</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
Whether the attention computation should always be upcasted.`,name:"upcast_attention"},{anchor:"diffusers.loaders.FromOriginalVAEMixin.from_single_file.scaling_factor",description:`<strong>scaling_factor</strong> (<code>float</code>, <em>optional</em>, defaults to 0.18215) &#x2014;
The component-wise standard deviation of the trained latent space computed using the first batch of the
training set. This is used to scale the latent space to have unit variance when training the diffusion
model. The latents are scaled with the formula <code>z = z * scaling_factor</code> before being passed to the
diffusion model. When decoding, the latents are scaled back to the original scale with the formula: <code>z = 1 / scaling_factor * z</code>. For more details, refer to sections 4.3.2 and D.1 of the <a href="https://arxiv.org/abs/2112.10752" rel="nofollow">High-Resolution
Image Synthesis with Latent Diffusion Models</a> paper.`,name:"scaling_factor"},{anchor:"diffusers.loaders.FromOriginalVAEMixin.from_single_file.kwargs",description:`<strong>kwargs</strong> (remaining dictionary of keyword arguments, <em>optional</em>) &#x2014;
Can be used to overwrite load and saveable variables (for example the pipeline components of the
specific pipeline class). The overwritten components are directly passed to the pipelines <code>__init__</code>
method. See example below for more information.`,name:"kwargs"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/loaders.py#L1943"}}),Se=new ds({props:{warning:!0,$$slots:{default:[ki]},$$scope:{ctx:E}}}),We=new Ho({props:{anchor:"diffusers.loaders.FromOriginalVAEMixin.from_single_file.example",$$slots:{default:[Ei]},$$scope:{ctx:E}}}),{c(){d=n("meta"),L=c(),u=n("h1"),m=n("a"),_=n("span"),b(r.$$.fragment),h=c(),F=n("span"),A=i("Loaders"),G=c(),C=n("p"),Z=i("Adapters (textual inversion, LoRA, hypernetworks) allow you to modify a diffusion model to generate images in a specific style without training or finetuning the entire model. The adapter weights are typically only a tiny fraction of the pretrained model\u2019s which making them very portable. \u{1F917} Diffusers provides an easy-to-use "),T=n("code"),re=i("LoaderMixin"),ne=i(" API to load adapter weights."),z=c(),b(ve.$$.fragment),Yt=c(),ae=n("h2"),be=n("a"),Ko=n("span"),b(Ve.$$.fragment),$r=c(),et=n("span"),Lr=i("UNet2DConditionLoadersMixin"),Ot=c(),B=n("div"),b(Be.$$.fragment),Tr=c(),xe=n("div"),b(qe.$$.fragment),kr=c(),q=n("p"),Er=i("Load pretrained attention processor layers into "),Eo=n("a"),Ur=i("UNet2DConditionModel"),Fr=i(`. Attention processor layers have to be
defined in
`),Ye=n("a"),ot=n("code"),Cr=i("attention_processor.py"),Ir=i(`
and be a `),tt=n("code"),Jr=i("torch.nn.Module"),Dr=i(" class."),Ar=c(),ye=n("div"),b(Oe.$$.fragment),Zr=c(),ze=n("p"),Nr=i(`Save an attention processor to a directory so that it can be reloaded using the
`),Uo=n("a"),Sr=i("load_attn_procs()"),Wr=i(" method."),zt=c(),se=n("h2"),we=n("a"),rt=n("span"),b(He.$$.fragment),jr=c(),nt=n("span"),Gr=i("TextualInversionLoaderMixin"),Ht=c(),N=n("div"),b(Xe.$$.fragment),Pr=c(),at=n("p"),Rr=i("Load textual inversion tokens and embeddings to the tokenizer and text encoder."),Vr=c(),I=n("div"),b(Qe.$$.fragment),Br=c(),Ke=n("p"),qr=i("Load textual inversion embeddings into the text encoder of "),Fo=n("a"),Yr=i("StableDiffusionPipeline"),Or=i(` (both \u{1F917} Diffusers and
Automatic1111 formats are supported).`),zr=c(),st=n("p"),Hr=i("Example:"),Xr=c(),b(Me.$$.fragment),Qr=c(),eo=n("p"),Kr=i(`To load a textual inversion embedding vector in Automatic1111 format, make sure to download the vector first
(for example from `),oo=n("a"),en=i("civitAI"),on=i(") and then load the vector"),tn=c(),b($e.$$.fragment),rn=c(),Le=n("div"),b(to.$$.fragment),nn=c(),it=n("p"),an=i(`Processes prompts that include a special token corresponding to a multi-vector textual inversion embedding to
be replaced with multiple special tokens each corresponding to one of the vectors. If the prompt has no textual
inversion token or if the textual inversion token is a single vector, the input prompt is returned.`),Xt=c(),ie=n("h2"),Te=n("a"),lt=n("span"),b(ro.$$.fragment),sn=c(),dt=n("span"),ln=i("LoraLoaderMixin"),Qt=c(),k=n("div"),b(no.$$.fragment),dn=c(),le=n("p"),cn=i("Load LoRA layers into "),Co=n("a"),fn=i("UNet2DConditionModel"),mn=i(` and
`),ao=n("a"),ct=n("code"),pn=i("CLIPTextModel"),hn=i("."),un=c(),ke=n("div"),b(so.$$.fragment),gn=c(),Ee=n("p"),_n=i("This will load the LoRA layers specified in "),ft=n("code"),vn=i("state_dict"),bn=i(" into "),mt=n("code"),xn=i("text_encoder"),yn=c(),Ue=n("div"),b(io.$$.fragment),wn=c(),de=n("p"),Mn=i("This will load the LoRA layers specified in "),pt=n("code"),$n=i("state_dict"),Ln=i(" into "),ht=n("code"),Tn=i("unet"),kn=i("."),En=c(),J=n("div"),b(lo.$$.fragment),Un=c(),Y=n("p"),Fn=i("Load LoRA weights specified in "),ut=n("code"),Cn=i("pretrained_model_name_or_path_or_dict"),In=i(" into "),gt=n("code"),Jn=i("self.unet"),Dn=i(` and
`),_t=n("code"),An=i("self.text_encoder"),Zn=i("."),Nn=c(),co=n("p"),Sn=i("All kwargs are forwarded to "),vt=n("code"),Wn=i("self.lora_state_dict"),jn=i("."),Gn=c(),fo=n("p"),Pn=i("See "),Io=n("a"),Rn=i("lora_state_dict()"),Vn=i(" for more details on how the state dict is loaded."),Bn=c(),ce=n("p"),qn=i("See "),Jo=n("a"),Yn=i("load_lora_into_unet()"),On=i(` for more details on how the state dict is loaded into
`),bt=n("code"),zn=i("self.unet"),Hn=i("."),Xn=c(),fe=n("p"),Qn=i("See "),Do=n("a"),Kn=i("load_lora_into_text_encoder()"),ea=i(` for more details on how the state dict is loaded
into `),xt=n("code"),oa=i("self.text_encoder"),ta=i("."),ra=c(),H=n("div"),b(mo.$$.fragment),na=c(),yt=n("p"),aa=i("Return state dict for lora weights and the network alphas."),sa=c(),b(Fe.$$.fragment),ia=c(),Ce=n("div"),b(po.$$.fragment),la=c(),wt=n("p"),da=i("Save the LoRA parameters corresponding to the UNet and text encoder."),ca=c(),X=n("div"),b(ho.$$.fragment),fa=c(),Mt=n("p"),ma=i("Unloads the LoRA parameters."),pa=c(),b(Ie.$$.fragment),Kt=c(),me=n("h2"),Je=n("a"),$t=n("span"),b(uo.$$.fragment),ha=c(),Lt=n("span"),ua=i("FromSingleFileMixin"),er=c(),O=n("div"),b(go.$$.fragment),ga=c(),pe=n("p"),_a=i("Load model weights saved in the "),Tt=n("code"),va=i(".ckpt"),ba=i(" format into a "),Ao=n("a"),xa=i("DiffusionPipeline"),ya=i("."),wa=c(),Q=n("div"),b(_o.$$.fragment),Ma=c(),S=n("p"),$a=i("Instantiate a "),Zo=n("a"),La=i("DiffusionPipeline"),Ta=i(" from pretrained pipeline weights saved in the "),kt=n("code"),ka=i(".ckpt"),Ea=i(" or "),Et=n("code"),Ua=i(".safetensors"),Fa=i(`
format. The pipeline is set in evaluation mode (`),Ut=n("code"),Ca=i("model.eval()"),Ia=i(") by default."),Ja=c(),b(De.$$.fragment),or=c(),he=n("h2"),Ae=n("a"),Ft=n("span"),b(vo.$$.fragment),Da=c(),Ct=n("span"),Aa=i("FromOriginalControlnetMixin"),tr=c(),ue=n("div"),b(bo.$$.fragment),Za=c(),K=n("div"),b(xo.$$.fragment),Na=c(),W=n("p"),Sa=i("Instantiate a "),No=n("a"),Wa=i("ControlNetModel"),ja=i(" from pretrained controlnet weights saved in the original "),It=n("code"),Ga=i(".ckpt"),Pa=i(` or
`),Jt=n("code"),Ra=i(".safetensors"),Va=i(" format. The pipeline is set in evaluation mode ("),Dt=n("code"),Ba=i("model.eval()"),qa=i(") by default."),Ya=c(),b(Ze.$$.fragment),rr=c(),ge=n("h2"),Ne=n("a"),At=n("span"),b(yo.$$.fragment),Oa=c(),Zt=n("span"),za=i("FromOriginalVAEMixin"),nr=c(),_e=n("div"),b(wo.$$.fragment),Ha=c(),P=n("div"),b(Mo.$$.fragment),Xa=c(),j=n("p"),Qa=i("Instantiate a "),So=n("a"),Ka=i("AutoencoderKL"),es=i(" from pretrained controlnet weights saved in the original "),Nt=n("code"),os=i(".ckpt"),ts=i(` or
`),St=n("code"),rs=i(".safetensors"),ns=i(" format. The pipeline is format. The pipeline is set in evaluation mode ("),Wt=n("code"),as=i("model.eval()"),ss=i(`) by
default.`),is=c(),b(Se.$$.fragment),ls=c(),b(We.$$.fragment),this.h()},l(o){const g=vi('[data-svelte="svelte-1phssyn"]',document.head);d=a(g,"META",{name:!0,content:!0}),g.forEach(t),L=f(o),u=a(o,"H1",{class:!0});var $o=s(u);m=a($o,"A",{id:!0,class:!0,href:!0});var jt=s(m);_=a(jt,"SPAN",{});var Gt=s(_);x(r.$$.fragment,Gt),Gt.forEach(t),jt.forEach(t),h=f($o),F=a($o,"SPAN",{});var Pt=s(F);A=l(Pt,"Loaders"),Pt.forEach(t),$o.forEach(t),G=f(o),C=a(o,"P",{});var Lo=s(C);Z=l(Lo,"Adapters (textual inversion, LoRA, hypernetworks) allow you to modify a diffusion model to generate images in a specific style without training or finetuning the entire model. The adapter weights are typically only a tiny fraction of the pretrained model\u2019s which making them very portable. \u{1F917} Diffusers provides an easy-to-use "),T=a(Lo,"CODE",{});var Rt=s(T);re=l(Rt,"LoaderMixin"),Rt.forEach(t),ne=l(Lo," API to load adapter weights."),Lo.forEach(t),z=f(o),x(ve.$$.fragment,o),Yt=f(o),ae=a(o,"H2",{class:!0});var To=s(ae);be=a(To,"A",{id:!0,class:!0,href:!0});var Vt=s(be);Ko=a(Vt,"SPAN",{});var Bt=s(Ko);x(Ve.$$.fragment,Bt),Bt.forEach(t),Vt.forEach(t),$r=f(To),et=a(To,"SPAN",{});var cs=s(et);Lr=l(cs,"UNet2DConditionLoadersMixin"),cs.forEach(t),To.forEach(t),Ot=f(o),B=a(o,"DIV",{class:!0});var Wo=s(B);x(Be.$$.fragment,Wo),Tr=f(Wo),xe=a(Wo,"DIV",{class:!0});var sr=s(xe);x(qe.$$.fragment,sr),kr=f(sr),q=a(sr,"P",{});var je=s(q);Er=l(je,"Load pretrained attention processor layers into "),Eo=a(je,"A",{href:!0});var fs=s(Eo);Ur=l(fs,"UNet2DConditionModel"),fs.forEach(t),Fr=l(je,`. Attention processor layers have to be
defined in
`),Ye=a(je,"A",{href:!0,rel:!0});var ms=s(Ye);ot=a(ms,"CODE",{});var ps=s(ot);Cr=l(ps,"attention_processor.py"),ps.forEach(t),ms.forEach(t),Ir=l(je,`
and be a `),tt=a(je,"CODE",{});var hs=s(tt);Jr=l(hs,"torch.nn.Module"),hs.forEach(t),Dr=l(je," class."),je.forEach(t),sr.forEach(t),Ar=f(Wo),ye=a(Wo,"DIV",{class:!0});var ir=s(ye);x(Oe.$$.fragment,ir),Zr=f(ir),ze=a(ir,"P",{});var lr=s(ze);Nr=l(lr,`Save an attention processor to a directory so that it can be reloaded using the
`),Uo=a(lr,"A",{href:!0});var us=s(Uo);Sr=l(us,"load_attn_procs()"),us.forEach(t),Wr=l(lr," method."),lr.forEach(t),ir.forEach(t),Wo.forEach(t),zt=f(o),se=a(o,"H2",{class:!0});var dr=s(se);we=a(dr,"A",{id:!0,class:!0,href:!0});var gs=s(we);rt=a(gs,"SPAN",{});var _s=s(rt);x(He.$$.fragment,_s),_s.forEach(t),gs.forEach(t),jr=f(dr),nt=a(dr,"SPAN",{});var vs=s(nt);Gr=l(vs,"TextualInversionLoaderMixin"),vs.forEach(t),dr.forEach(t),Ht=f(o),N=a(o,"DIV",{class:!0});var Ge=s(N);x(Xe.$$.fragment,Ge),Pr=f(Ge),at=a(Ge,"P",{});var bs=s(at);Rr=l(bs,"Load textual inversion tokens and embeddings to the tokenizer and text encoder."),bs.forEach(t),Vr=f(Ge),I=a(Ge,"DIV",{class:!0});var R=s(I);x(Qe.$$.fragment,R),Br=f(R),Ke=a(R,"P",{});var cr=s(Ke);qr=l(cr,"Load textual inversion embeddings into the text encoder of "),Fo=a(cr,"A",{href:!0});var xs=s(Fo);Yr=l(xs,"StableDiffusionPipeline"),xs.forEach(t),Or=l(cr,` (both \u{1F917} Diffusers and
Automatic1111 formats are supported).`),cr.forEach(t),zr=f(R),st=a(R,"P",{});var ys=s(st);Hr=l(ys,"Example:"),ys.forEach(t),Xr=f(R),x(Me.$$.fragment,R),Qr=f(R),eo=a(R,"P",{});var fr=s(eo);Kr=l(fr,`To load a textual inversion embedding vector in Automatic1111 format, make sure to download the vector first
(for example from `),oo=a(fr,"A",{href:!0,rel:!0});var ws=s(oo);en=l(ws,"civitAI"),ws.forEach(t),on=l(fr,") and then load the vector"),fr.forEach(t),tn=f(R),x($e.$$.fragment,R),R.forEach(t),rn=f(Ge),Le=a(Ge,"DIV",{class:!0});var mr=s(Le);x(to.$$.fragment,mr),nn=f(mr),it=a(mr,"P",{});var Ms=s(it);an=l(Ms,`Processes prompts that include a special token corresponding to a multi-vector textual inversion embedding to
be replaced with multiple special tokens each corresponding to one of the vectors. If the prompt has no textual
inversion token or if the textual inversion token is a single vector, the input prompt is returned.`),Ms.forEach(t),mr.forEach(t),Ge.forEach(t),Xt=f(o),ie=a(o,"H2",{class:!0});var pr=s(ie);Te=a(pr,"A",{id:!0,class:!0,href:!0});var $s=s(Te);lt=a($s,"SPAN",{});var Ls=s(lt);x(ro.$$.fragment,Ls),Ls.forEach(t),$s.forEach(t),sn=f(pr),dt=a(pr,"SPAN",{});var Ts=s(dt);ln=l(Ts,"LoraLoaderMixin"),Ts.forEach(t),pr.forEach(t),Qt=f(o),k=a(o,"DIV",{class:!0});var D=s(k);x(no.$$.fragment,D),dn=f(D),le=a(D,"P",{});var jo=s(le);cn=l(jo,"Load LoRA layers into "),Co=a(jo,"A",{href:!0});var ks=s(Co);fn=l(ks,"UNet2DConditionModel"),ks.forEach(t),mn=l(jo,` and
`),ao=a(jo,"A",{href:!0,rel:!0});var Es=s(ao);ct=a(Es,"CODE",{});var Us=s(ct);pn=l(Us,"CLIPTextModel"),Us.forEach(t),Es.forEach(t),hn=l(jo,"."),jo.forEach(t),un=f(D),ke=a(D,"DIV",{class:!0});var hr=s(ke);x(so.$$.fragment,hr),gn=f(hr),Ee=a(hr,"P",{});var qt=s(Ee);_n=l(qt,"This will load the LoRA layers specified in "),ft=a(qt,"CODE",{});var Fs=s(ft);vn=l(Fs,"state_dict"),Fs.forEach(t),bn=l(qt," into "),mt=a(qt,"CODE",{});var Cs=s(mt);xn=l(Cs,"text_encoder"),Cs.forEach(t),qt.forEach(t),hr.forEach(t),yn=f(D),Ue=a(D,"DIV",{class:!0});var ur=s(Ue);x(io.$$.fragment,ur),wn=f(ur),de=a(ur,"P",{});var Go=s(de);Mn=l(Go,"This will load the LoRA layers specified in "),pt=a(Go,"CODE",{});var Is=s(pt);$n=l(Is,"state_dict"),Is.forEach(t),Ln=l(Go," into "),ht=a(Go,"CODE",{});var Js=s(ht);Tn=l(Js,"unet"),Js.forEach(t),kn=l(Go,"."),Go.forEach(t),ur.forEach(t),En=f(D),J=a(D,"DIV",{class:!0});var V=s(J);x(lo.$$.fragment,V),Un=f(V),Y=a(V,"P",{});var Pe=s(Y);Fn=l(Pe,"Load LoRA weights specified in "),ut=a(Pe,"CODE",{});var Ds=s(ut);Cn=l(Ds,"pretrained_model_name_or_path_or_dict"),Ds.forEach(t),In=l(Pe," into "),gt=a(Pe,"CODE",{});var As=s(gt);Jn=l(As,"self.unet"),As.forEach(t),Dn=l(Pe,` and
`),_t=a(Pe,"CODE",{});var Zs=s(_t);An=l(Zs,"self.text_encoder"),Zs.forEach(t),Zn=l(Pe,"."),Pe.forEach(t),Nn=f(V),co=a(V,"P",{});var gr=s(co);Sn=l(gr,"All kwargs are forwarded to "),vt=a(gr,"CODE",{});var Ns=s(vt);Wn=l(Ns,"self.lora_state_dict"),Ns.forEach(t),jn=l(gr,"."),gr.forEach(t),Gn=f(V),fo=a(V,"P",{});var _r=s(fo);Pn=l(_r,"See "),Io=a(_r,"A",{href:!0});var Ss=s(Io);Rn=l(Ss,"lora_state_dict()"),Ss.forEach(t),Vn=l(_r," for more details on how the state dict is loaded."),_r.forEach(t),Bn=f(V),ce=a(V,"P",{});var Po=s(ce);qn=l(Po,"See "),Jo=a(Po,"A",{href:!0});var Ws=s(Jo);Yn=l(Ws,"load_lora_into_unet()"),Ws.forEach(t),On=l(Po,` for more details on how the state dict is loaded into
`),bt=a(Po,"CODE",{});var js=s(bt);zn=l(js,"self.unet"),js.forEach(t),Hn=l(Po,"."),Po.forEach(t),Xn=f(V),fe=a(V,"P",{});var Ro=s(fe);Qn=l(Ro,"See "),Do=a(Ro,"A",{href:!0});var Gs=s(Do);Kn=l(Gs,"load_lora_into_text_encoder()"),Gs.forEach(t),ea=l(Ro,` for more details on how the state dict is loaded
into `),xt=a(Ro,"CODE",{});var Ps=s(xt);oa=l(Ps,"self.text_encoder"),Ps.forEach(t),ta=l(Ro,"."),Ro.forEach(t),V.forEach(t),ra=f(D),H=a(D,"DIV",{class:!0});var Vo=s(H);x(mo.$$.fragment,Vo),na=f(Vo),yt=a(Vo,"P",{});var Rs=s(yt);aa=l(Rs,"Return state dict for lora weights and the network alphas."),Rs.forEach(t),sa=f(Vo),x(Fe.$$.fragment,Vo),Vo.forEach(t),ia=f(D),Ce=a(D,"DIV",{class:!0});var vr=s(Ce);x(po.$$.fragment,vr),la=f(vr),wt=a(vr,"P",{});var Vs=s(wt);da=l(Vs,"Save the LoRA parameters corresponding to the UNet and text encoder."),Vs.forEach(t),vr.forEach(t),ca=f(D),X=a(D,"DIV",{class:!0});var Bo=s(X);x(ho.$$.fragment,Bo),fa=f(Bo),Mt=a(Bo,"P",{});var Bs=s(Mt);ma=l(Bs,"Unloads the LoRA parameters."),Bs.forEach(t),pa=f(Bo),x(Ie.$$.fragment,Bo),Bo.forEach(t),D.forEach(t),Kt=f(o),me=a(o,"H2",{class:!0});var br=s(me);Je=a(br,"A",{id:!0,class:!0,href:!0});var qs=s(Je);$t=a(qs,"SPAN",{});var Ys=s($t);x(uo.$$.fragment,Ys),Ys.forEach(t),qs.forEach(t),ha=f(br),Lt=a(br,"SPAN",{});var Os=s(Lt);ua=l(Os,"FromSingleFileMixin"),Os.forEach(t),br.forEach(t),er=f(o),O=a(o,"DIV",{class:!0});var qo=s(O);x(go.$$.fragment,qo),ga=f(qo),pe=a(qo,"P",{});var Yo=s(pe);_a=l(Yo,"Load model weights saved in the "),Tt=a(Yo,"CODE",{});var zs=s(Tt);va=l(zs,".ckpt"),zs.forEach(t),ba=l(Yo," format into a "),Ao=a(Yo,"A",{href:!0});var Hs=s(Ao);xa=l(Hs,"DiffusionPipeline"),Hs.forEach(t),ya=l(Yo,"."),Yo.forEach(t),wa=f(qo),Q=a(qo,"DIV",{class:!0});var Oo=s(Q);x(_o.$$.fragment,Oo),Ma=f(Oo),S=a(Oo,"P",{});var ee=s(S);$a=l(ee,"Instantiate a "),Zo=a(ee,"A",{href:!0});var Xs=s(Zo);La=l(Xs,"DiffusionPipeline"),Xs.forEach(t),Ta=l(ee," from pretrained pipeline weights saved in the "),kt=a(ee,"CODE",{});var Qs=s(kt);ka=l(Qs,".ckpt"),Qs.forEach(t),Ea=l(ee," or "),Et=a(ee,"CODE",{});var Ks=s(Et);Ua=l(Ks,".safetensors"),Ks.forEach(t),Fa=l(ee,`
format. The pipeline is set in evaluation mode (`),Ut=a(ee,"CODE",{});var ei=s(Ut);Ca=l(ei,"model.eval()"),ei.forEach(t),Ia=l(ee,") by default."),ee.forEach(t),Ja=f(Oo),x(De.$$.fragment,Oo),Oo.forEach(t),qo.forEach(t),or=f(o),he=a(o,"H2",{class:!0});var xr=s(he);Ae=a(xr,"A",{id:!0,class:!0,href:!0});var oi=s(Ae);Ft=a(oi,"SPAN",{});var ti=s(Ft);x(vo.$$.fragment,ti),ti.forEach(t),oi.forEach(t),Da=f(xr),Ct=a(xr,"SPAN",{});var ri=s(Ct);Aa=l(ri,"FromOriginalControlnetMixin"),ri.forEach(t),xr.forEach(t),tr=f(o),ue=a(o,"DIV",{class:!0});var yr=s(ue);x(bo.$$.fragment,yr),Za=f(yr),K=a(yr,"DIV",{class:!0});var zo=s(K);x(xo.$$.fragment,zo),Na=f(zo),W=a(zo,"P",{});var oe=s(W);Sa=l(oe,"Instantiate a "),No=a(oe,"A",{href:!0});var ni=s(No);Wa=l(ni,"ControlNetModel"),ni.forEach(t),ja=l(oe," from pretrained controlnet weights saved in the original "),It=a(oe,"CODE",{});var ai=s(It);Ga=l(ai,".ckpt"),ai.forEach(t),Pa=l(oe,` or
`),Jt=a(oe,"CODE",{});var si=s(Jt);Ra=l(si,".safetensors"),si.forEach(t),Va=l(oe," format. The pipeline is set in evaluation mode ("),Dt=a(oe,"CODE",{});var ii=s(Dt);Ba=l(ii,"model.eval()"),ii.forEach(t),qa=l(oe,") by default."),oe.forEach(t),Ya=f(zo),x(Ze.$$.fragment,zo),zo.forEach(t),yr.forEach(t),rr=f(o),ge=a(o,"H2",{class:!0});var wr=s(ge);Ne=a(wr,"A",{id:!0,class:!0,href:!0});var li=s(Ne);At=a(li,"SPAN",{});var di=s(At);x(yo.$$.fragment,di),di.forEach(t),li.forEach(t),Oa=f(wr),Zt=a(wr,"SPAN",{});var ci=s(Zt);za=l(ci,"FromOriginalVAEMixin"),ci.forEach(t),wr.forEach(t),nr=f(o),_e=a(o,"DIV",{class:!0});var Mr=s(_e);x(wo.$$.fragment,Mr),Ha=f(Mr),P=a(Mr,"DIV",{class:!0});var Re=s(P);x(Mo.$$.fragment,Re),Xa=f(Re),j=a(Re,"P",{});var te=s(j);Qa=l(te,"Instantiate a "),So=a(te,"A",{href:!0});var fi=s(So);Ka=l(fi,"AutoencoderKL"),fi.forEach(t),es=l(te," from pretrained controlnet weights saved in the original "),Nt=a(te,"CODE",{});var mi=s(Nt);os=l(mi,".ckpt"),mi.forEach(t),ts=l(te,` or
`),St=a(te,"CODE",{});var pi=s(St);rs=l(pi,".safetensors"),pi.forEach(t),ns=l(te," format. The pipeline is format. The pipeline is set in evaluation mode ("),Wt=a(te,"CODE",{});var hi=s(Wt);as=l(hi,"model.eval()"),hi.forEach(t),ss=l(te,`) by
default.`),te.forEach(t),is=f(Re),x(Se.$$.fragment,Re),ls=f(Re),x(We.$$.fragment,Re),Re.forEach(t),Mr.forEach(t),this.h()},h(){p(d,"name","hf:doc:metadata"),p(d,"content",JSON.stringify(Fi)),p(m,"id","loaders"),p(m,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(m,"href","#loaders"),p(u,"class","relative group"),p(be,"id","diffusers.loaders.UNet2DConditionLoadersMixin"),p(be,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(be,"href","#diffusers.loaders.UNet2DConditionLoadersMixin"),p(ae,"class","relative group"),p(Eo,"href","/docs/diffusers/main/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel"),p(Ye,"href","https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention_processor.py"),p(Ye,"rel","nofollow"),p(xe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Uo,"href","/docs/diffusers/main/en/api/loaders#diffusers.loaders.UNet2DConditionLoadersMixin.load_attn_procs"),p(ye,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(we,"id","diffusers.loaders.TextualInversionLoaderMixin"),p(we,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(we,"href","#diffusers.loaders.TextualInversionLoaderMixin"),p(se,"class","relative group"),p(Fo,"href","/docs/diffusers/main/en/api/pipelines/stable_diffusion/text2img#diffusers.StableDiffusionPipeline"),p(oo,"href","https://civitai.com/models/3036?modelVersionId=9857"),p(oo,"rel","nofollow"),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(Le,"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(Te,"id","diffusers.loaders.LoraLoaderMixin"),p(Te,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(Te,"href","#diffusers.loaders.LoraLoaderMixin"),p(ie,"class","relative group"),p(Co,"href","/docs/diffusers/main/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel"),p(ao,"href","https://huggingface.co/docs/transformers/model_doc/clip#transformers.CLIPTextModel"),p(ao,"rel","nofollow"),p(ke,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Ue,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Io,"href","/docs/diffusers/main/en/api/loaders#diffusers.loaders.LoraLoaderMixin.lora_state_dict"),p(Jo,"href","/docs/diffusers/main/en/api/loaders#diffusers.loaders.LoraLoaderMixin.load_lora_into_unet"),p(Do,"href","/docs/diffusers/main/en/api/loaders#diffusers.loaders.LoraLoaderMixin.load_lora_into_text_encoder"),p(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Ce,"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(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Je,"id","diffusers.loaders.FromSingleFileMixin"),p(Je,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(Je,"href","#diffusers.loaders.FromSingleFileMixin"),p(me,"class","relative group"),p(Ao,"href","/docs/diffusers/main/en/api/pipelines/overview#diffusers.DiffusionPipeline"),p(Zo,"href","/docs/diffusers/main/en/api/pipelines/overview#diffusers.DiffusionPipeline"),p(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Ae,"id","diffusers.loaders.FromOriginalControlnetMixin"),p(Ae,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(Ae,"href","#diffusers.loaders.FromOriginalControlnetMixin"),p(he,"class","relative group"),p(No,"href","/docs/diffusers/main/en/api/models/controlnet#diffusers.ControlNetModel"),p(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(ue,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Ne,"id","diffusers.loaders.FromOriginalVAEMixin"),p(Ne,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(Ne,"href","#diffusers.loaders.FromOriginalVAEMixin"),p(ge,"class","relative group"),p(So,"href","/docs/diffusers/main/en/api/models/autoencoderkl#diffusers.AutoencoderKL"),p(P,"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")},m(o,g){e(document.head,d),v(o,L,g),v(o,u,g),e(u,m),e(m,_),y(r,_,null),e(u,h),e(u,F),e(F,A),v(o,G,g),v(o,C,g),e(C,Z),e(C,T),e(T,re),e(C,ne),v(o,z,g),y(ve,o,g),v(o,Yt,g),v(o,ae,g),e(ae,be),e(be,Ko),y(Ve,Ko,null),e(ae,$r),e(ae,et),e(et,Lr),v(o,Ot,g),v(o,B,g),y(Be,B,null),e(B,Tr),e(B,xe),y(qe,xe,null),e(xe,kr),e(xe,q),e(q,Er),e(q,Eo),e(Eo,Ur),e(q,Fr),e(q,Ye),e(Ye,ot),e(ot,Cr),e(q,Ir),e(q,tt),e(tt,Jr),e(q,Dr),e(B,Ar),e(B,ye),y(Oe,ye,null),e(ye,Zr),e(ye,ze),e(ze,Nr),e(ze,Uo),e(Uo,Sr),e(ze,Wr),v(o,zt,g),v(o,se,g),e(se,we),e(we,rt),y(He,rt,null),e(se,jr),e(se,nt),e(nt,Gr),v(o,Ht,g),v(o,N,g),y(Xe,N,null),e(N,Pr),e(N,at),e(at,Rr),e(N,Vr),e(N,I),y(Qe,I,null),e(I,Br),e(I,Ke),e(Ke,qr),e(Ke,Fo),e(Fo,Yr),e(Ke,Or),e(I,zr),e(I,st),e(st,Hr),e(I,Xr),y(Me,I,null),e(I,Qr),e(I,eo),e(eo,Kr),e(eo,oo),e(oo,en),e(eo,on),e(I,tn),y($e,I,null),e(N,rn),e(N,Le),y(to,Le,null),e(Le,nn),e(Le,it),e(it,an),v(o,Xt,g),v(o,ie,g),e(ie,Te),e(Te,lt),y(ro,lt,null),e(ie,sn),e(ie,dt),e(dt,ln),v(o,Qt,g),v(o,k,g),y(no,k,null),e(k,dn),e(k,le),e(le,cn),e(le,Co),e(Co,fn),e(le,mn),e(le,ao),e(ao,ct),e(ct,pn),e(le,hn),e(k,un),e(k,ke),y(so,ke,null),e(ke,gn),e(ke,Ee),e(Ee,_n),e(Ee,ft),e(ft,vn),e(Ee,bn),e(Ee,mt),e(mt,xn),e(k,yn),e(k,Ue),y(io,Ue,null),e(Ue,wn),e(Ue,de),e(de,Mn),e(de,pt),e(pt,$n),e(de,Ln),e(de,ht),e(ht,Tn),e(de,kn),e(k,En),e(k,J),y(lo,J,null),e(J,Un),e(J,Y),e(Y,Fn),e(Y,ut),e(ut,Cn),e(Y,In),e(Y,gt),e(gt,Jn),e(Y,Dn),e(Y,_t),e(_t,An),e(Y,Zn),e(J,Nn),e(J,co),e(co,Sn),e(co,vt),e(vt,Wn),e(co,jn),e(J,Gn),e(J,fo),e(fo,Pn),e(fo,Io),e(Io,Rn),e(fo,Vn),e(J,Bn),e(J,ce),e(ce,qn),e(ce,Jo),e(Jo,Yn),e(ce,On),e(ce,bt),e(bt,zn),e(ce,Hn),e(J,Xn),e(J,fe),e(fe,Qn),e(fe,Do),e(Do,Kn),e(fe,ea),e(fe,xt),e(xt,oa),e(fe,ta),e(k,ra),e(k,H),y(mo,H,null),e(H,na),e(H,yt),e(yt,aa),e(H,sa),y(Fe,H,null),e(k,ia),e(k,Ce),y(po,Ce,null),e(Ce,la),e(Ce,wt),e(wt,da),e(k,ca),e(k,X),y(ho,X,null),e(X,fa),e(X,Mt),e(Mt,ma),e(X,pa),y(Ie,X,null),v(o,Kt,g),v(o,me,g),e(me,Je),e(Je,$t),y(uo,$t,null),e(me,ha),e(me,Lt),e(Lt,ua),v(o,er,g),v(o,O,g),y(go,O,null),e(O,ga),e(O,pe),e(pe,_a),e(pe,Tt),e(Tt,va),e(pe,ba),e(pe,Ao),e(Ao,xa),e(pe,ya),e(O,wa),e(O,Q),y(_o,Q,null),e(Q,Ma),e(Q,S),e(S,$a),e(S,Zo),e(Zo,La),e(S,Ta),e(S,kt),e(kt,ka),e(S,Ea),e(S,Et),e(Et,Ua),e(S,Fa),e(S,Ut),e(Ut,Ca),e(S,Ia),e(Q,Ja),y(De,Q,null),v(o,or,g),v(o,he,g),e(he,Ae),e(Ae,Ft),y(vo,Ft,null),e(he,Da),e(he,Ct),e(Ct,Aa),v(o,tr,g),v(o,ue,g),y(bo,ue,null),e(ue,Za),e(ue,K),y(xo,K,null),e(K,Na),e(K,W),e(W,Sa),e(W,No),e(No,Wa),e(W,ja),e(W,It),e(It,Ga),e(W,Pa),e(W,Jt),e(Jt,Ra),e(W,Va),e(W,Dt),e(Dt,Ba),e(W,qa),e(K,Ya),y(Ze,K,null),v(o,rr,g),v(o,ge,g),e(ge,Ne),e(Ne,At),y(yo,At,null),e(ge,Oa),e(ge,Zt),e(Zt,za),v(o,nr,g),v(o,_e,g),y(wo,_e,null),e(_e,Ha),e(_e,P),y(Mo,P,null),e(P,Xa),e(P,j),e(j,Qa),e(j,So),e(So,Ka),e(j,es),e(j,Nt),e(Nt,os),e(j,ts),e(j,St),e(St,rs),e(j,ns),e(j,Wt),e(Wt,as),e(j,ss),e(P,is),y(Se,P,null),e(P,ls),y(We,P,null),ar=!0},p(o,[g]){const $o={};g&2&&($o.$$scope={dirty:g,ctx:o}),ve.$set($o);const jt={};g&2&&(jt.$$scope={dirty:g,ctx:o}),Me.$set(jt);const Gt={};g&2&&(Gt.$$scope={dirty:g,ctx:o}),$e.$set(Gt);const Pt={};g&2&&(Pt.$$scope={dirty:g,ctx:o}),Fe.$set(Pt);const Lo={};g&2&&(Lo.$$scope={dirty:g,ctx:o}),Ie.$set(Lo);const Rt={};g&2&&(Rt.$$scope={dirty:g,ctx:o}),De.$set(Rt);const To={};g&2&&(To.$$scope={dirty:g,ctx:o}),Ze.$set(To);const Vt={};g&2&&(Vt.$$scope={dirty:g,ctx:o}),Se.$set(Vt);const Bt={};g&2&&(Bt.$$scope={dirty:g,ctx:o}),We.$set(Bt)},i(o){ar||(w(r.$$.fragment,o),w(ve.$$.fragment,o),w(Ve.$$.fragment,o),w(Be.$$.fragment,o),w(qe.$$.fragment,o),w(Oe.$$.fragment,o),w(He.$$.fragment,o),w(Xe.$$.fragment,o),w(Qe.$$.fragment,o),w(Me.$$.fragment,o),w($e.$$.fragment,o),w(to.$$.fragment,o),w(ro.$$.fragment,o),w(no.$$.fragment,o),w(so.$$.fragment,o),w(io.$$.fragment,o),w(lo.$$.fragment,o),w(mo.$$.fragment,o),w(Fe.$$.fragment,o),w(po.$$.fragment,o),w(ho.$$.fragment,o),w(Ie.$$.fragment,o),w(uo.$$.fragment,o),w(go.$$.fragment,o),w(_o.$$.fragment,o),w(De.$$.fragment,o),w(vo.$$.fragment,o),w(bo.$$.fragment,o),w(xo.$$.fragment,o),w(Ze.$$.fragment,o),w(yo.$$.fragment,o),w(wo.$$.fragment,o),w(Mo.$$.fragment,o),w(Se.$$.fragment,o),w(We.$$.fragment,o),ar=!0)},o(o){M(r.$$.fragment,o),M(ve.$$.fragment,o),M(Ve.$$.fragment,o),M(Be.$$.fragment,o),M(qe.$$.fragment,o),M(Oe.$$.fragment,o),M(He.$$.fragment,o),M(Xe.$$.fragment,o),M(Qe.$$.fragment,o),M(Me.$$.fragment,o),M($e.$$.fragment,o),M(to.$$.fragment,o),M(ro.$$.fragment,o),M(no.$$.fragment,o),M(so.$$.fragment,o),M(io.$$.fragment,o),M(lo.$$.fragment,o),M(mo.$$.fragment,o),M(Fe.$$.fragment,o),M(po.$$.fragment,o),M(ho.$$.fragment,o),M(Ie.$$.fragment,o),M(uo.$$.fragment,o),M(go.$$.fragment,o),M(_o.$$.fragment,o),M(De.$$.fragment,o),M(vo.$$.fragment,o),M(bo.$$.fragment,o),M(xo.$$.fragment,o),M(Ze.$$.fragment,o),M(yo.$$.fragment,o),M(wo.$$.fragment,o),M(Mo.$$.fragment,o),M(Se.$$.fragment,o),M(We.$$.fragment,o),ar=!1},d(o){t(d),o&&t(L),o&&t(u),$(r),o&&t(G),o&&t(C),o&&t(z),$(ve,o),o&&t(Yt),o&&t(ae),$(Ve),o&&t(Ot),o&&t(B),$(Be),$(qe),$(Oe),o&&t(zt),o&&t(se),$(He),o&&t(Ht),o&&t(N),$(Xe),$(Qe),$(Me),$($e),$(to),o&&t(Xt),o&&t(ie),$(ro),o&&t(Qt),o&&t(k),$(no),$(so),$(io),$(lo),$(mo),$(Fe),$(po),$(ho),$(Ie),o&&t(Kt),o&&t(me),$(uo),o&&t(er),o&&t(O),$(go),$(_o),$(De),o&&t(or),o&&t(he),$(vo),o&&t(tr),o&&t(ue),$(bo),$(xo),$(Ze),o&&t(rr),o&&t(ge),$(yo),o&&t(nr),o&&t(_e),$(wo),$(Mo),$(Se),$(We)}}}const Fi={local:"loaders",sections:[{local:"diffusers.loaders.UNet2DConditionLoadersMixin",title:"UNet2DConditionLoadersMixin"},{local:"diffusers.loaders.TextualInversionLoaderMixin",title:"TextualInversionLoaderMixin"},{local:"diffusers.loaders.LoraLoaderMixin",title:"LoraLoaderMixin"},{local:"diffusers.loaders.FromSingleFileMixin",title:"FromSingleFileMixin"},{local:"diffusers.loaders.FromOriginalControlnetMixin",title:"FromOriginalControlnetMixin"},{local:"diffusers.loaders.FromOriginalVAEMixin",title:"FromOriginalVAEMixin"}],title:"Loaders"};function Ci(E){return bi(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Si extends ui{constructor(d){super();gi(this,d,Ci,Ui,_i,{})}}export{Si as default,Fi as metadata};
