import{s as Hs,o as Ls,n as W}from"../chunks/scheduler.8c3d61f6.js";import{S as Es,i as Qs,g as m,s as f,r as d,A as zs,h as u,f as s,c as r,j as hl,u as h,x as w,k as yl,y as v,a as n,v as y,d as M,t as b,w as g}from"../chunks/index.da70eac4.js";import{T as ml}from"../chunks/Tip.1d9b8c37.js";import{C as $}from"../chunks/CodeBlock.00a903b3.js";import{D as Ds}from"../chunks/DocNotebookDropdown.02900f6b.js";import{H as k,E as qs}from"../chunks/EditOnGithub.1e64e623.js";import{H as Ml,a as x}from"../chunks/HfOption.6ab18950.js";function Ps(T){let t,c='Learn more about the design decisions and why safetensor files are preferred for saving and loading model weights in the <a href="https://blog.eleuther.ai/safetensors-security-audit/" rel="nofollow">Safetensors audited as really safe and becoming the default</a> blog post.';return{c(){t=m("p"),t.innerHTML=c},l(i){t=u(i,"P",{"data-svelte-h":!0}),w(t)!=="svelte-sebmc7"&&(t.innerHTML=c)},m(i,p){n(i,t,p)},p:W,d(i){i&&s(t)}}}function As(T){let t,c='Use the <a href="/docs/diffusers/main/en/api/pipelines/overview#diffusers.DiffusionPipeline.from_pretrained">from_pretrained()</a> method to load a model with safetensors files stored in multiple folders.',i,p,a;return p=new $({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERpZmZ1c2lvblBpcGVsaW5lJTBBJTBBcGlwZWxpbmUlMjAlM0QlMjBEaWZmdXNpb25QaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIyc3RhYmxlLWRpZmZ1c2lvbi12MS01JTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIyJTJDJTBBJTIwJTIwJTIwJTIwdXNlX3NhZmV0ZW5zb3JzJTNEVHJ1ZSUwQSk=",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline

pipeline = DiffusionPipeline.from_pretrained(
    <span class="hljs-string">&quot;stable-diffusion-v1-5/stable-diffusion-v1-5&quot;</span>,
    use_safetensors=<span class="hljs-literal">True</span>
)`,wrap:!1}}),{c(){t=m("p"),t.innerHTML=c,i=f(),d(p.$$.fragment)},l(o){t=u(o,"P",{"data-svelte-h":!0}),w(t)!=="svelte-1sxvo4h"&&(t.innerHTML=c),i=r(o),h(p.$$.fragment,o)},m(o,J){n(o,t,J),n(o,i,J),y(p,o,J),a=!0},p:W,i(o){a||(M(p.$$.fragment,o),a=!0)},o(o){b(p.$$.fragment,o),a=!1},d(o){o&&(s(t),s(i)),g(p,o)}}}function Ks(T){let t,c='Use the <a href="/docs/diffusers/main/en/api/loaders/single_file#diffusers.loaders.FromSingleFileMixin.from_single_file">from_single_file()</a> method to load a model with all the weights stored in a single safetensors file.',i,p,a;return p=new $({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvblBpcGVsaW5lJTBBJTBBcGlwZWxpbmUlMjAlM0QlMjBTdGFibGVEaWZmdXNpb25QaXBlbGluZS5mcm9tX3NpbmdsZV9maWxlKCUwQSUyMCUyMCUyMCUyMCUyMmh0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZXYXJyaW9yTWFtYTc3NyUyRk9yYW5nZU1peHMlMkZibG9iJTJGbWFpbiUyRk1vZGVscyUyRkFieXNzT3JhbmdlTWl4JTJGQWJ5c3NPcmFuZ2VNaXguc2FmZXRlbnNvcnMlMjIlMEEp",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionPipeline

pipeline = StableDiffusionPipeline.from_single_file(
    <span class="hljs-string">&quot;https://huggingface.co/WarriorMama777/OrangeMixs/blob/main/Models/AbyssOrangeMix/AbyssOrangeMix.safetensors&quot;</span>
)`,wrap:!1}}),{c(){t=m("p"),t.innerHTML=c,i=f(),d(p.$$.fragment)},l(o){t=u(o,"P",{"data-svelte-h":!0}),w(t)!=="svelte-gkgkgy"&&(t.innerHTML=c),i=r(o),h(p.$$.fragment,o)},m(o,J){n(o,t,J),n(o,i,J),y(p,o,J),a=!0},p:W,i(o){a||(M(p.$$.fragment,o),a=!0)},o(o){b(p.$$.fragment,o),a=!1},d(o){o&&(s(t),s(i)),g(p,o)}}}function Os(T){let t,c,i,p;return t=new x({props:{id:"safetensors",option:"multifolder",$$slots:{default:[As]},$$scope:{ctx:T}}}),i=new x({props:{id:"safetensors",option:"single file",$$slots:{default:[Ks]},$$scope:{ctx:T}}}),{c(){d(t.$$.fragment),c=f(),d(i.$$.fragment)},l(a){h(t.$$.fragment,a),c=r(a),h(i.$$.fragment,a)},m(a,o){y(t,a,o),n(a,c,o),y(i,a,o),p=!0},p(a,o){const J={};o&2&&(J.$$scope={dirty:o,ctx:a}),t.$set(J);const U={};o&2&&(U.$$scope={dirty:o,ctx:a}),i.$set(U)},i(a){p||(M(t.$$.fragment,a),M(i.$$.fragment,a),p=!0)},o(a){b(t.$$.fragment,a),b(i.$$.fragment,a),p=!1},d(a){a&&s(c),g(t,a),g(i,a)}}}function ei(T){let t,c="Pickled files may be unsafe because they can be exploited to execute malicious code. It is recommended to use safetensors files instead where possible, or convert the weights to safetensors files.";return{c(){t=m("p"),t.textContent=c},l(i){t=u(i,"P",{"data-svelte-h":!0}),w(t)!=="svelte-1k1da22"&&(t.textContent=c)},m(i,p){n(i,t,p)},p:W,d(i){i&&s(t)}}}function li(T){let t,c="DDUF is an experimental file format and APIs related to it can change in the future.";return{c(){t=m("p"),t.textContent=c},l(i){t=u(i,"P",{"data-svelte-h":!0}),w(t)!=="svelte-1oo2wy9"&&(t.textContent=c)},m(i,p){n(i,t,p)},p:W,d(i){i&&s(t)}}}function ti(T){let t,c;return t=new $({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvblhMUGlwZWxpbmUlMEElMEFja3B0X3BhdGglMjAlM0QlMjAlMjJodHRwcyUzQSUyRiUyRmh1Z2dpbmdmYWNlLmNvJTJGc3RhYmlsaXR5YWklMkZzdGFibGUtZGlmZnVzaW9uLXhsLWJhc2UtMS4wJTJGYmxvYiUyRm1haW4lMkZzZF94bF9iYXNlXzEuMF8wLjl2YWUuc2FmZXRlbnNvcnMlMjIlMEFwaXBlbGluZSUyMCUzRCUyMFN0YWJsZURpZmZ1c2lvblhMUGlwZWxpbmUuZnJvbV9zaW5nbGVfZmlsZShja3B0X3BhdGgp",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionXLPipeline

ckpt_path = <span class="hljs-string">&quot;https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/blob/main/sd_xl_base_1.0_0.9vae.safetensors&quot;</span>
pipeline = StableDiffusionXLPipeline.from_single_file(ckpt_path)`,wrap:!1}}),{c(){d(t.$$.fragment)},l(i){h(t.$$.fragment,i)},m(i,p){y(t,i,p),c=!0},p:W,i(i){c||(M(t.$$.fragment,i),c=!0)},o(i){b(t.$$.fragment,i),c=!1},d(i){g(t,i)}}}function si(T){let t,c;return t=new $({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZUNhc2NhZGVVTmV0JTBBJTBBY2twdF9wYXRoJTIwJTNEJTIwJTIyaHR0cHMlM0ElMkYlMkZodWdnaW5nZmFjZS5jbyUyRnN0YWJpbGl0eWFpJTJGc3RhYmxlLWNhc2NhZGUlMkZibG9iJTJGbWFpbiUyRnN0YWdlX2JfbGl0ZS5zYWZldGVuc29ycyUyMiUwQW1vZGVsJTIwJTNEJTIwU3RhYmxlQ2FzY2FkZVVOZXQuZnJvbV9zaW5nbGVfZmlsZShja3B0X3BhdGgp",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableCascadeUNet

ckpt_path = <span class="hljs-string">&quot;https://huggingface.co/stabilityai/stable-cascade/blob/main/stage_b_lite.safetensors&quot;</span>
model = StableCascadeUNet.from_single_file(ckpt_path)`,wrap:!1}}),{c(){d(t.$$.fragment)},l(i){h(t.$$.fragment,i)},m(i,p){y(t,i,p),c=!0},p:W,i(i){c||(M(t.$$.fragment,i),c=!0)},o(i){b(t.$$.fragment,i),c=!1},d(i){g(t,i)}}}function ii(T){let t,c,i,p;return t=new x({props:{id:"pipeline-model",option:"pipeline",$$slots:{default:[ti]},$$scope:{ctx:T}}}),i=new x({props:{id:"pipeline-model",option:"model",$$slots:{default:[si]},$$scope:{ctx:T}}}),{c(){d(t.$$.fragment),c=f(),d(i.$$.fragment)},l(a){h(t.$$.fragment,a),c=r(a),h(i.$$.fragment,a)},m(a,o){y(t,a,o),n(a,c,o),y(i,a,o),p=!0},p(a,o){const J={};o&2&&(J.$$scope={dirty:o,ctx:a}),t.$set(J);const U={};o&2&&(U.$$scope={dirty:o,ctx:a}),i.$set(U)},i(a){p||(M(t.$$.fragment,a),M(i.$$.fragment,a),p=!0)},o(a){b(t.$$.fragment,a),b(i.$$.fragment,a),p=!1},d(a){a&&s(c),g(t,a),g(i,a)}}}function ni(T){let t,c='The <a href="/docs/diffusers/main/en/api/loaders/single_file#diffusers.loaders.FromSingleFileMixin.from_single_file">from_single_file()</a> method automatically maps the checkpoint to the appropriate model repository, but there are cases where it is useful to use the <code>config</code> parameter. For example, if the model components in the checkpoint are different from the original checkpoint or if a checkpoint doesn’t have the necessary metadata to correctly determine the configuration to use for the pipeline.';return{c(){t=m("p"),t.innerHTML=c},l(i){t=u(i,"P",{"data-svelte-h":!0}),w(t)!=="svelte-tlwse4"&&(t.innerHTML=c)},m(i,p){n(i,t,p)},p:W,d(i){i&&s(t)}}}function ai(T){let t,c,i,p='The <a href="/docs/diffusers/main/en/api/loaders/single_file#diffusers.loaders.FromSingleFileMixin.from_single_file">from_single_file()</a> method automatically determines the configuration to use from the configuration file in the model repository. You could also explicitly specify the configuration to use by providing the repository id to the <code>config</code> parameter.',a,o,J,U,_='The model loads the configuration file for the <a href="https://huggingface.co/segmind/SSD-1B/blob/main/unet/config.json" rel="nofollow">UNet</a>, <a href="https://huggingface.co/segmind/SSD-1B/blob/main/vae/config.json" rel="nofollow">VAE</a>, and <a href="https://huggingface.co/segmind/SSD-1B/blob/main/text_encoder/config.json" rel="nofollow">text encoder</a> from their respective subfolders in the repository.',R;return t=new ml({props:{warning:!1,$$slots:{default:[ni]},$$scope:{ctx:T}}}),o=new $({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvblhMUGlwZWxpbmUlMEElMEFja3B0X3BhdGglMjAlM0QlMjAlMjJodHRwcyUzQSUyRiUyRmh1Z2dpbmdmYWNlLmNvJTJGc2VnbWluZCUyRlNTRC0xQiUyRmJsb2IlMkZtYWluJTJGU1NELTFCLnNhZmV0ZW5zb3JzJTIyJTBBcmVwb19pZCUyMCUzRCUyMCUyMnNlZ21pbmQlMkZTU0QtMUIlMjIlMEElMEFwaXBlbGluZSUyMCUzRCUyMFN0YWJsZURpZmZ1c2lvblhMUGlwZWxpbmUuZnJvbV9zaW5nbGVfZmlsZShja3B0X3BhdGglMkMlMjBjb25maWclM0RyZXBvX2lkKQ==",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionXLPipeline

ckpt_path = <span class="hljs-string">&quot;https://huggingface.co/segmind/SSD-1B/blob/main/SSD-1B.safetensors&quot;</span>
repo_id = <span class="hljs-string">&quot;segmind/SSD-1B&quot;</span>

pipeline = StableDiffusionXLPipeline.from_single_file(ckpt_path, config=repo_id)`,wrap:!1}}),{c(){d(t.$$.fragment),c=f(),i=m("p"),i.innerHTML=p,a=f(),d(o.$$.fragment),J=f(),U=m("p"),U.innerHTML=_},l(Z){h(t.$$.fragment,Z),c=r(Z),i=u(Z,"P",{"data-svelte-h":!0}),w(i)!=="svelte-kupwes"&&(i.innerHTML=p),a=r(Z),h(o.$$.fragment,Z),J=r(Z),U=u(Z,"P",{"data-svelte-h":!0}),w(U)!=="svelte-vgyhxu"&&(U.innerHTML=_)},m(Z,j){y(t,Z,j),n(Z,c,j),n(Z,i,j),n(Z,a,j),y(o,Z,j),n(Z,J,j),n(Z,U,j),R=!0},p(Z,j){const ul={};j&2&&(ul.$$scope={dirty:j,ctx:Z}),t.$set(ul)},i(Z){R||(M(t.$$.fragment,Z),M(o.$$.fragment,Z),R=!0)},o(Z){b(t.$$.fragment,Z),b(o.$$.fragment,Z),R=!1},d(Z){Z&&(s(c),s(i),s(a),s(J),s(U)),g(t,Z),g(o,Z)}}}function oi(T){let t,c="Diffusers attempts to infer the pipeline components based on the type signatures of the pipeline class when you use <code>original_config</code> with <code>local_files_only=True</code>, instead of fetching the configuration files from the model repository on the Hub. This prevents backward breaking changes in code that can’t connect to the internet to fetch the necessary configuration files.",i,p,a="This is not as reliable as providing a path to a local model repository with the <code>config</code> parameter, and might lead to errors during pipeline configuration. To avoid errors, run the pipeline with <code>local_files_only=False</code> once to download the appropriate pipeline configuration files to the local cache.";return{c(){t=m("p"),t.innerHTML=c,i=f(),p=m("p"),p.innerHTML=a},l(o){t=u(o,"P",{"data-svelte-h":!0}),w(t)!=="svelte-chnuen"&&(t.innerHTML=c),i=r(o),p=u(o,"P",{"data-svelte-h":!0}),w(p)!=="svelte-qhvpj"&&(p.innerHTML=a)},m(o,J){n(o,t,J),n(o,i,J),n(o,p,J)},p:W,d(o){o&&(s(t),s(i),s(p))}}}function fi(T){let t,c='The <a href="/docs/diffusers/main/en/api/loaders/single_file#diffusers.loaders.FromSingleFileMixin.from_single_file">from_single_file()</a> method can also load the original configuration file of a pipeline that is stored elsewhere. Pass a local path or URL of the original configuration file to the <code>original_config</code> parameter.',i,p,a,o,J;return p=new $({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvblhMUGlwZWxpbmUlMEElMEFja3B0X3BhdGglMjAlM0QlMjAlMjJodHRwcyUzQSUyRiUyRmh1Z2dpbmdmYWNlLmNvJTJGc3RhYmlsaXR5YWklMkZzdGFibGUtZGlmZnVzaW9uLXhsLWJhc2UtMS4wJTJGYmxvYiUyRm1haW4lMkZzZF94bF9iYXNlXzEuMF8wLjl2YWUuc2FmZXRlbnNvcnMlMjIlMEFvcmlnaW5hbF9jb25maWclMjAlM0QlMjAlMjJodHRwcyUzQSUyRiUyRnJhdy5naXRodWJ1c2VyY29udGVudC5jb20lMkZTdGFiaWxpdHktQUklMkZnZW5lcmF0aXZlLW1vZGVscyUyRm1haW4lMkZjb25maWdzJTJGaW5mZXJlbmNlJTJGc2RfeGxfYmFzZS55YW1sJTIyJTBBJTBBcGlwZWxpbmUlMjAlM0QlMjBTdGFibGVEaWZmdXNpb25YTFBpcGVsaW5lLmZyb21fc2luZ2xlX2ZpbGUoY2twdF9wYXRoJTJDJTIwb3JpZ2luYWxfY29uZmlnJTNEb3JpZ2luYWxfY29uZmlnKQ==",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionXLPipeline

ckpt_path = <span class="hljs-string">&quot;https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/blob/main/sd_xl_base_1.0_0.9vae.safetensors&quot;</span>
original_config = <span class="hljs-string">&quot;https://raw.githubusercontent.com/Stability-AI/generative-models/main/configs/inference/sd_xl_base.yaml&quot;</span>

pipeline = StableDiffusionXLPipeline.from_single_file(ckpt_path, original_config=original_config)`,wrap:!1}}),o=new ml({props:{warning:!1,$$slots:{default:[oi]},$$scope:{ctx:T}}}),{c(){t=m("p"),t.innerHTML=c,i=f(),d(p.$$.fragment),a=f(),d(o.$$.fragment)},l(U){t=u(U,"P",{"data-svelte-h":!0}),w(t)!=="svelte-1hpqwop"&&(t.innerHTML=c),i=r(U),h(p.$$.fragment,U),a=r(U),h(o.$$.fragment,U)},m(U,_){n(U,t,_),n(U,i,_),y(p,U,_),n(U,a,_),y(o,U,_),J=!0},p(U,_){const R={};_&2&&(R.$$scope={dirty:_,ctx:U}),o.$set(R)},i(U){J||(M(p.$$.fragment,U),M(o.$$.fragment,U),J=!0)},o(U){b(p.$$.fragment,U),b(o.$$.fragment,U),J=!1},d(U){U&&(s(t),s(i),s(a)),g(p,U),g(o,U)}}}function ri(T){let t,c,i,p;return t=new x({props:{id:"config-file",option:"Hub configuration file",$$slots:{default:[ai]},$$scope:{ctx:T}}}),i=new x({props:{id:"config-file",option:"original configuration file",$$slots:{default:[fi]},$$scope:{ctx:T}}}),{c(){d(t.$$.fragment),c=f(),d(i.$$.fragment)},l(a){h(t.$$.fragment,a),c=r(a),h(i.$$.fragment,a)},m(a,o){y(t,a,o),n(a,c,o),y(i,a,o),p=!0},p(a,o){const J={};o&2&&(J.$$scope={dirty:o,ctx:a}),t.$set(J);const U={};o&2&&(U.$$scope={dirty:o,ctx:a}),i.$set(U)},i(a){p||(M(t.$$.fragment,a),M(i.$$.fragment,a),p=!0)},o(a){b(t.$$.fragment,a),b(i.$$.fragment,a),p=!1},d(a){a&&s(c),g(t,a),g(i,a)}}}function pi(T){let t,c='For example, to scale the image latents in <a href="/docs/diffusers/main/en/api/pipelines/pix2pix#diffusers.StableDiffusionXLInstructPix2PixPipeline">StableDiffusionXLInstructPix2PixPipeline</a> pass the <code>is_cosxl_edit</code> parameter.',i,p,a;return p=new $({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvblhMSW5zdHJ1Y3RQaXgyUGl4UGlwZWxpbmUlMEElMEFja3B0X3BhdGglMjAlM0QlMjAlMjJodHRwcyUzQSUyRiUyRmh1Z2dpbmdmYWNlLmNvJTJGc3RhYmlsaXR5YWklMkZjb3N4bCUyRmJsb2IlMkZtYWluJTJGY29zeGxfZWRpdC5zYWZldGVuc29ycyUyMiUwQXBpcGVsaW5lJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uWExJbnN0cnVjdFBpeDJQaXhQaXBlbGluZS5mcm9tX3NpbmdsZV9maWxlKGNrcHRfcGF0aCUyQyUyMGNvbmZpZyUzRCUyMmRpZmZ1c2VycyUyRnNkeGwtaW5zdHJ1Y3RwaXgycGl4LTc2OCUyMiUyQyUyMGlzX2Nvc3hsX2VkaXQlM0RUcnVlKQ==",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionXLInstructPix2PixPipeline

ckpt_path = <span class="hljs-string">&quot;https://huggingface.co/stabilityai/cosxl/blob/main/cosxl_edit.safetensors&quot;</span>
pipeline = StableDiffusionXLInstructPix2PixPipeline.from_single_file(ckpt_path, config=<span class="hljs-string">&quot;diffusers/sdxl-instructpix2pix-768&quot;</span>, is_cosxl_edit=<span class="hljs-literal">True</span>)`,wrap:!1}}),{c(){t=m("p"),t.innerHTML=c,i=f(),d(p.$$.fragment)},l(o){t=u(o,"P",{"data-svelte-h":!0}),w(t)!=="svelte-1kqnfmq"&&(t.innerHTML=c),i=r(o),h(p.$$.fragment,o)},m(o,J){n(o,t,J),n(o,i,J),y(p,o,J),a=!0},p:W,i(o){a||(M(p.$$.fragment,o),a=!0)},o(o){b(p.$$.fragment,o),a=!1},d(o){o&&(s(t),s(i)),g(p,o)}}}function ci(T){let t,c='For example, to upcast the attention dimensions in a <a href="/docs/diffusers/main/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a> pass the <code>upcast_attention</code> parameter.',i,p,a;return p=new $({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFVOZXQyRENvbmRpdGlvbk1vZGVsJTBBJTBBY2twdF9wYXRoJTIwJTNEJTIwJTIyaHR0cHMlM0ElMkYlMkZodWdnaW5nZmFjZS5jbyUyRnN0YWJpbGl0eWFpJTJGc3RhYmxlLWRpZmZ1c2lvbi14bC1iYXNlLTEuMCUyRmJsb2IlMkZtYWluJTJGc2RfeGxfYmFzZV8xLjBfMC45dmFlLnNhZmV0ZW5zb3JzJTIyJTBBbW9kZWwlMjAlM0QlMjBVTmV0MkRDb25kaXRpb25Nb2RlbC5mcm9tX3NpbmdsZV9maWxlKGNrcHRfcGF0aCUyQyUyMHVwY2FzdF9hdHRlbnRpb24lM0RUcnVlKQ==",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> UNet2DConditionModel

ckpt_path = <span class="hljs-string">&quot;https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/blob/main/sd_xl_base_1.0_0.9vae.safetensors&quot;</span>
model = UNet2DConditionModel.from_single_file(ckpt_path, upcast_attention=<span class="hljs-literal">True</span>)`,wrap:!1}}),{c(){t=m("p"),t.innerHTML=c,i=f(),d(p.$$.fragment)},l(o){t=u(o,"P",{"data-svelte-h":!0}),w(t)!=="svelte-voyebw"&&(t.innerHTML=c),i=r(o),h(p.$$.fragment,o)},m(o,J){n(o,t,J),n(o,i,J),y(p,o,J),a=!0},p:W,i(o){a||(M(p.$$.fragment,o),a=!0)},o(o){b(p.$$.fragment,o),a=!1},d(o){o&&(s(t),s(i)),g(p,o)}}}function mi(T){let t,c,i,p;return t=new x({props:{id:"override",option:"pipeline",$$slots:{default:[pi]},$$scope:{ctx:T}}}),i=new x({props:{id:"override",option:"model",$$slots:{default:[ci]},$$scope:{ctx:T}}}),{c(){d(t.$$.fragment),c=f(),d(i.$$.fragment)},l(a){h(t.$$.fragment,a),c=r(a),h(i.$$.fragment,a)},m(a,o){y(t,a,o),n(a,c,o),y(i,a,o),p=!0},p(a,o){const J={};o&2&&(J.$$scope={dirty:o,ctx:a}),t.$set(J);const U={};o&2&&(U.$$scope={dirty:o,ctx:a}),i.$set(U)},i(a){p||(M(t.$$.fragment,a),M(i.$$.fragment,a),p=!0)},o(a){b(t.$$.fragment,a),b(i.$$.fragment,a),p=!1},d(a){a&&s(c),g(t,a),g(i,a)}}}function ui(T){let t,c;return t=new $({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMGhmX2h1Yl9kb3dubG9hZCUyQyUyMHNuYXBzaG90X2Rvd25sb2FkJTBBJTBBbXlfbG9jYWxfY2hlY2twb2ludF9wYXRoJTIwJTNEJTIwaGZfaHViX2Rvd25sb2FkKCUwQSUyMCUyMCUyMCUyMHJlcG9faWQlM0QlMjJzZWdtaW5kJTJGU1NELTFCJTIyJTJDJTBBJTIwJTIwJTIwJTIwZmlsZW5hbWUlM0QlMjJTU0QtMUIuc2FmZXRlbnNvcnMlMjIlMEEpJTBBJTBBbXlfbG9jYWxfY29uZmlnX3BhdGglMjAlM0QlMjBzbmFwc2hvdF9kb3dubG9hZCglMEElMjAlMjAlMjAlMjByZXBvX2lkJTNEJTIyc2VnbWluZCUyRlNTRC0xQiUyMiUyQyUwQSUyMCUyMCUyMCUyMGFsbG93X3BhdHRlcm5zJTNEJTVCJTIyKi5qc29uJTIyJTJDJTIwJTIyKiolMkYqLmpzb24lMjIlMkMlMjAlMjIqLnR4dCUyMiUyQyUyMCUyMioqJTJGKi50eHQlMjIlNUQlMEEpJTBBJTBBcGlwZWxpbmUlMjAlM0QlMjBTdGFibGVEaWZmdXNpb25YTFBpcGVsaW5lLmZyb21fc2luZ2xlX2ZpbGUobXlfbG9jYWxfY2hlY2twb2ludF9wYXRoJTJDJTIwY29uZmlnJTNEbXlfbG9jYWxfY29uZmlnX3BhdGglMkMlMjBsb2NhbF9maWxlc19vbmx5JTNEVHJ1ZSk=",highlighted:`<span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> hf_hub_download, snapshot_download

my_local_checkpoint_path = hf_hub_download(
    repo_id=<span class="hljs-string">&quot;segmind/SSD-1B&quot;</span>,
    filename=<span class="hljs-string">&quot;SSD-1B.safetensors&quot;</span>
)

my_local_config_path = snapshot_download(
    repo_id=<span class="hljs-string">&quot;segmind/SSD-1B&quot;</span>,
    allow_patterns=[<span class="hljs-string">&quot;*.json&quot;</span>, <span class="hljs-string">&quot;**/*.json&quot;</span>, <span class="hljs-string">&quot;*.txt&quot;</span>, <span class="hljs-string">&quot;**/*.txt&quot;</span>]
)

pipeline = StableDiffusionXLPipeline.from_single_file(my_local_checkpoint_path, config=my_local_config_path, local_files_only=<span class="hljs-literal">True</span>)`,wrap:!1}}),{c(){d(t.$$.fragment)},l(i){h(t.$$.fragment,i)},m(i,p){y(t,i,p),c=!0},p:W,i(i){c||(M(t.$$.fragment,i),c=!0)},o(i){b(t.$$.fragment,i),c=!1},d(i){g(t,i)}}}function di(T){let t,c;return t=new $({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMGhmX2h1Yl9kb3dubG9hZCUyQyUyMHNuYXBzaG90X2Rvd25sb2FkJTBBJTBBbXlfbG9jYWxfY2hlY2twb2ludF9wYXRoJTIwJTNEJTIwaGZfaHViX2Rvd25sb2FkKCUwQSUyMCUyMCUyMCUyMHJlcG9faWQlM0QlMjJzZWdtaW5kJTJGU1NELTFCJTIyJTJDJTBBJTIwJTIwJTIwJTIwZmlsZW5hbWUlM0QlMjJTU0QtMUIuc2FmZXRlbnNvcnMlMjIlMEElMjAlMjAlMjAlMjBsb2NhbF9kaXIlM0QlMjJteV9sb2NhbF9jaGVja3BvaW50cyUyMiUwQSklMEElMEFteV9sb2NhbF9jb25maWdfcGF0aCUyMCUzRCUyMHNuYXBzaG90X2Rvd25sb2FkKCUwQSUyMCUyMCUyMCUyMHJlcG9faWQlM0QlMjJzZWdtaW5kJTJGU1NELTFCJTIyJTJDJTBBJTIwJTIwJTIwJTIwYWxsb3dfcGF0dGVybnMlM0QlNUIlMjIqLmpzb24lMjIlMkMlMjAlMjIqKiUyRiouanNvbiUyMiUyQyUyMCUyMioudHh0JTIyJTJDJTIwJTIyKiolMkYqLnR4dCUyMiU1RCUwQSUyMCUyMCUyMCUyMGxvY2FsX2RpciUzRCUyMm15X2xvY2FsX2NvbmZpZyUyMiUwQSklMEElMEFwaXBlbGluZSUyMCUzRCUyMFN0YWJsZURpZmZ1c2lvblhMUGlwZWxpbmUuZnJvbV9zaW5nbGVfZmlsZShteV9sb2NhbF9jaGVja3BvaW50X3BhdGglMkMlMjBjb25maWclM0RteV9sb2NhbF9jb25maWdfcGF0aCUyQyUyMGxvY2FsX2ZpbGVzX29ubHklM0RUcnVlKQ==",highlighted:`<span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> hf_hub_download, snapshot_download

my_local_checkpoint_path = hf_hub_download(
    repo_id=<span class="hljs-string">&quot;segmind/SSD-1B&quot;</span>,
    filename=<span class="hljs-string">&quot;SSD-1B.safetensors&quot;</span>
    local_dir=<span class="hljs-string">&quot;my_local_checkpoints&quot;</span>
)

my_local_config_path = snapshot_download(
    repo_id=<span class="hljs-string">&quot;segmind/SSD-1B&quot;</span>,
    allow_patterns=[<span class="hljs-string">&quot;*.json&quot;</span>, <span class="hljs-string">&quot;**/*.json&quot;</span>, <span class="hljs-string">&quot;*.txt&quot;</span>, <span class="hljs-string">&quot;**/*.txt&quot;</span>]
    local_dir=<span class="hljs-string">&quot;my_local_config&quot;</span>
)

pipeline = StableDiffusionXLPipeline.from_single_file(my_local_checkpoint_path, config=my_local_config_path, local_files_only=<span class="hljs-literal">True</span>)`,wrap:!1}}),{c(){d(t.$$.fragment)},l(i){h(t.$$.fragment,i)},m(i,p){y(t,i,p),c=!0},p:W,i(i){c||(M(t.$$.fragment,i),c=!0)},o(i){b(t.$$.fragment,i),c=!1},d(i){g(t,i)}}}function hi(T){let t,c,i,p;return t=new x({props:{id:"local",option:"Hub cache directory",$$slots:{default:[ui]},$$scope:{ctx:T}}}),i=new x({props:{id:"local",option:"specific local directory",$$slots:{default:[di]},$$scope:{ctx:T}}}),{c(){d(t.$$.fragment),c=f(),d(i.$$.fragment)},l(a){h(t.$$.fragment,a),c=r(a),h(i.$$.fragment,a)},m(a,o){y(t,a,o),n(a,c,o),y(i,a,o),p=!0},p(a,o){const J={};o&2&&(J.$$scope={dirty:o,ctx:a}),t.$set(J);const U={};o&2&&(U.$$scope={dirty:o,ctx:a}),i.$set(U)},i(a){p||(M(t.$$.fragment,a),M(i.$$.fragment,a),p=!0)},o(a){b(t.$$.fragment,a),b(i.$$.fragment,a),p=!1},d(a){a&&s(c),g(t,a),g(i,a)}}}function yi(T){let t,c='In huggingface_hub&gt;=v0.23.0, the <code>local_dir_use_symlinks</code> argument isn’t necessary for the <a href="https://huggingface.co/docs/huggingface_hub/main/en/package_reference/file_download#huggingface_hub.hf_hub_download" rel="nofollow">hf_hub_download</a> and <a href="https://huggingface.co/docs/huggingface_hub/main/en/package_reference/file_download#huggingface_hub.snapshot_download" rel="nofollow">snapshot_download</a> functions.';return{c(){t=m("p"),t.innerHTML=c},l(i){t=u(i,"P",{"data-svelte-h":!0}),w(t)!=="svelte-1475ajo"&&(t.innerHTML=c)},m(i,p){n(i,t,p)},p:W,d(i){i&&s(t)}}}function Mi(T){let t,c,i,p,a,o,J,U,_,R="Diffusion models are saved in various file types and organized in different layouts. Diffusers stores model weights as safetensors files in <em>Diffusers-multifolder</em> layout and it also supports loading files (like safetensors and ckpt files) from a <em>single-file</em> layout which is commonly used in the diffusion ecosystem.",Z,j,ul="Each layout has its own benefits and use cases, and this guide will show you how to load the different files and layouts, and how to convert them.",bl,z,gl,D,zt='PyTorch model weights are typically saved with Python’s <a href="https://docs.python.org/3/library/pickle.html" rel="nofollow">pickle</a> utility as ckpt or bin files. However, pickle is not secure and pickled files may contain malicious code that can be executed. This vulnerability is a serious concern given the popularity of model sharing. To address this security issue, the <a href="https://hf.co/docs/safetensors" rel="nofollow">Safetensors</a> library was developed as a secure alternative to pickle, which saves models as safetensors files.',wl,q,Jl,C,Ul,P,Dt='<a href="https://hf.co/docs/safetensors" rel="nofollow">Safetensors</a> is a safe and fast file format for securely storing and loading tensors. Safetensors restricts the header size to limit certain types of attacks, supports lazy loading (useful for distributed setups), and has generally faster loading speeds.',Tl,A,qt='Make sure you have the <a href="https://hf.co/docs/safetensors" rel="nofollow">Safetensors</a> library installed.',Zl,K,$l,O,Pt="Safetensors stores weights in a safetensors file. Diffusers loads safetensors files by default if they’re available and the Safetensors library is installed. There are two ways safetensors files can be organized:",_l,ee,At='<li>Diffusers-multifolder layout: there may be several separate safetensors files, one for each pipeline component (text encoder, UNet, VAE), organized in subfolders (check out the <a href="https://hf.co/stable-diffusion-v1-5/stable-diffusion-v1-5/tree/main" rel="nofollow">stable-diffusion-v1-5/stable-diffusion-v1-5</a> repository as an example)</li> <li>single-file layout: all the model weights may be saved in a single file (check out the <a href="https://hf.co/WarriorMama777/OrangeMixs/tree/main/Models/AbyssOrangeMix" rel="nofollow">WarriorMama777/OrangeMixs</a> repository as an example)</li>',jl,I,Gl,le,vl,te,Kt='<a href="https://hf.co/docs/peft/conceptual_guides/adapter#low-rank-adaptation-lora" rel="nofollow">LoRA</a> is a lightweight adapter that is fast and easy to train, making them especially popular for generating images in a certain way or style. These adapters are commonly stored in a safetensors file, and are widely popular on model sharing platforms like <a href="https://civitai.com/" rel="nofollow">civitai</a>.',kl,se,Ot='LoRAs are loaded into a base model with the <a href="/docs/diffusers/main/en/api/loaders/lora#diffusers.loaders.StableDiffusionLoraLoaderMixin.load_lora_weights">load_lora_weights()</a> method.',Wl,ie,Bl,X,es='<img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/blueprint-lora.png"/>',Rl,ne,xl,Y,Cl,ae,ls='PyTorch’s <a href="https://pytorch.org/docs/stable/generated/torch.save.html" rel="nofollow">torch.save</a> function uses Python’s <a href="https://docs.python.org/3/library/pickle.html" rel="nofollow">pickle</a> utility to serialize and save models. These files are saved as a ckpt file and they contain the entire model’s weights.',Il,oe,ts='Use the <a href="/docs/diffusers/main/en/api/loaders/single_file#diffusers.loaders.FromSingleFileMixin.from_single_file">from_single_file()</a> method to directly load a ckpt file.',Xl,fe,Yl,re,Vl,pe,ss="There are two ways model files are organized, either in a Diffusers-multifolder layout or in a single-file layout. The Diffusers-multifolder layout is the default, and each component file (text encoder, UNet, VAE) is stored in a separate subfolder. Diffusers also supports loading models from a single-file layout where all the components are bundled together.",Fl,ce,Sl,me,is="The Diffusers-multifolder layout is the default storage layout for Diffusers. Each component’s (text encoder, UNet, VAE) weights are stored in a separate subfolder. The weights can be stored as safetensors or ckpt files.",Nl,V,ns='<div class="flex-1"><img class="rounded-xl" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/multifolder-layout.png"/> <figcaption class="mt-2 text-center text-sm text-gray-500">multifolder layout</figcaption></div> <div class="flex-1"><img class="rounded-xl" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/multifolder-unet.png"/> <figcaption class="mt-2 text-center text-sm text-gray-500">UNet subfolder</figcaption></div>',Hl,ue,as='To load from Diffusers-multifolder layout, use the <a href="/docs/diffusers/main/en/api/pipelines/overview#diffusers.DiffusionPipeline.from_pretrained">from_pretrained()</a> method.',Ll,de,El,he,os="Benefits of using the Diffusers-multifolder layout include:",Ql,G,ol,fs="<p>Faster to load each component file individually or in parallel.</p>",St,ye,fl,rs='Reduced memory usage because you only load the components you need. For example, models like <a href="https://hf.co/stabilityai/sdxl-turbo" rel="nofollow">SDXL Turbo</a>, <a href="https://hf.co/ByteDance/SDXL-Lightning" rel="nofollow">SDXL Lightning</a>, and <a href="https://hf.co/ByteDance/Hyper-SD" rel="nofollow">Hyper-SD</a> have the same components except for the UNet. You can reuse their shared components with the <a href="/docs/diffusers/main/en/api/pipelines/overview#diffusers.DiffusionPipeline.from_pipe">from_pipe()</a> method without consuming any additional memory (take a look at the <a href="./loading#reuse-a-pipeline">Reuse a pipeline</a> guide) and only load the UNet. This way, you don’t need to download redundant components and unnecessarily use more memory.',Nt,Me,Ht,rl,ps='<p>Reduced storage requirements because if a component, such as the SDXL <a href="https://hf.co/madebyollin/sdxl-vae-fp16-fix" rel="nofollow">VAE</a>, is shared across multiple models, you only need to download and store a single copy of it instead of downloading and storing it multiple times. For 10 SDXL models, this can save ~3.5GB of storage. The storage savings is even greater for newer models like PixArt Sigma, where the <a href="https://hf.co/PixArt-alpha/PixArt-Sigma-XL-2-1024-MS/tree/main/text_encoder" rel="nofollow">text encoder</a> alone is ~19GB!</p>',Lt,be,pl,cs="Flexibility to replace a component in the model with a newer or better version.",Et,ge,Qt,cl,ms='<p>More visibility and information about a model’s components, which are stored in a <a href="https://hf.co/stabilityai/stable-diffusion-xl-base-1.0/blob/main/unet/config.json" rel="nofollow">config.json</a> file in each component subfolder.</p>',zl,we,Dl,Je,us="The single-file layout stores all the model weights in a single file. All the model components (text encoder, UNet, VAE) weights are kept together instead of separately in subfolders. This can be a safetensors or ckpt file.",ql,F,ds='<img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/single-file-layout.png"/>',Pl,Ue,hs='To load from a single-file layout, use the <a href="/docs/diffusers/main/en/api/loaders/single_file#diffusers.loaders.FromSingleFileMixin.from_single_file">from_single_file()</a> method.',Al,Te,Kl,Ze,ys="Benefits of using a single-file layout include:",Ol,$e,Ms='<li>Easy compatibility with diffusion interfaces such as <a href="https://github.com/comfyanonymous/ComfyUI" rel="nofollow">ComfyUI</a> or <a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui" rel="nofollow">Automatic1111</a> which commonly use a single-file layout.</li> <li>Easier to manage (download and share) a single file.</li>',et,_e,lt,S,tt,je,bs="DDUF (<strong>D</strong>DUF <strong>D</strong>iffusion <strong>U</strong>nified <strong>F</strong>ormat) is a file format designed to make storing, distributing, and using diffusion models much easier. Built on the ZIP file format, DDUF offers a standardized, efficient, and flexible way to package all parts of a diffusion model into a single, easy-to-manage file. It provides a balance between Diffusers multi-folder format and the widely popular single-file format.",st,Ge,gs='Learn more details about DDUF on the Hugging Face Hub <a href="https://huggingface.co/docs/hub/dduf" rel="nofollow">documentation</a>.',it,ve,ws='Pass a checkpoint to the <code>dduf_file</code> parameter to load it in <a href="/docs/diffusers/main/en/api/pipelines/overview#diffusers.DiffusionPipeline">DiffusionPipeline</a>.',nt,ke,at,We,Js='To save a pipeline as a <code>.dduf</code> checkpoint, use the <a href="https://huggingface.co/docs/huggingface_hub/main/en/package_reference/serialization#huggingface_hub.export_folder_as_dduf" rel="nofollow">export_folder_as_dduf</a> utility, which takes care of all the necessary file-level validations.',ot,Be,ft,Re,Us='You can also save a model to Diffusers-multifolder layout with the <a href="/docs/diffusers/main/en/api/pipelines/overview#diffusers.DiffusionPipeline.save_pretrained">save_pretrained()</a> method. This creates a directory for you if it doesn’t already exist, and it also saves the files as a safetensors file by default.',rt,xe,pt,Ce,Ts='Lastly, there are also Spaces, such as <a href="https://hf.co/spaces/diffusers/sd-to-diffusers" rel="nofollow">SD To Diffusers</a> and <a href="https://hf.co/spaces/diffusers/sdxl-to-diffusers" rel="nofollow">SD-XL To Diffusers</a>, that provide a more user-friendly interface for converting models to Diffusers-multifolder layout. This is the easiest and most convenient option for converting layouts, and it’ll open a PR on your model repository with the converted files. However, this option is not as reliable as running a script, and the Space may fail for more complicated models.',ct,Ie,mt,Xe,Zs='Now that you’re familiar with the differences between the Diffusers-multifolder and single-file layout, this section shows you how to load models and pipeline components, customize configuration options for loading, and load local files with the <a href="/docs/diffusers/main/en/api/loaders/single_file#diffusers.loaders.FromSingleFileMixin.from_single_file">from_single_file()</a> method.',ut,Ye,dt,Ve,$s='Pass the file path of the pipeline or model to the <a href="/docs/diffusers/main/en/api/loaders/single_file#diffusers.loaders.FromSingleFileMixin.from_single_file">from_single_file()</a> method to load it.',ht,N,yt,Fe,_s='Customize components in the pipeline by passing them directly to the <a href="/docs/diffusers/main/en/api/loaders/single_file#diffusers.loaders.FromSingleFileMixin.from_single_file">from_single_file()</a> method. For example, you can use a different scheduler in a pipeline.',Mt,Se,bt,Ne,js="Or you could use a ControlNet model in the pipeline.",gt,He,wt,Le,Jt,Ee,Gs='Models have a configuration file that define their attributes like the number of inputs in a UNet. Pipelines configuration options are available in the pipeline’s class. For example, if you look at the <a href="/docs/diffusers/main/en/api/pipelines/pix2pix#diffusers.StableDiffusionXLInstructPix2PixPipeline">StableDiffusionXLInstructPix2PixPipeline</a> class, there is an option to scale the image latents with the <code>is_cosxl_edit</code> parameter.',Ut,Qe,vs="These configuration files can be found in the models Hub repository or another location from which the configuration file originated (for example, a GitHub repository or locally on your device).",Tt,H,Zt,ze,ks='While the configuration files specify the pipeline or models default parameters, you can override them by providing the parameters directly to the <a href="/docs/diffusers/main/en/api/loaders/single_file#diffusers.loaders.FromSingleFileMixin.from_single_file">from_single_file()</a> method. Any parameter supported by the model or pipeline class can be configured in this way.',$t,L,_t,De,jt,qe,Ws='In Diffusers&gt;=v0.28.0, the <a href="/docs/diffusers/main/en/api/loaders/single_file#diffusers.loaders.FromSingleFileMixin.from_single_file">from_single_file()</a> method attempts to configure a pipeline or model by inferring the model type from the keys in the checkpoint file. The inferred model type is used to determine the appropriate model repository on the Hugging Face Hub to configure the model or pipeline.',Gt,Pe,Bs='For example, any single file checkpoint based on the Stable Diffusion XL base model will use the <a href="https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0" rel="nofollow">stabilityai/stable-diffusion-xl-base-1.0</a> model repository to configure the pipeline.',vt,Ae,Rs='But if you’re working in an environment with restricted internet access, you should download the configuration files with the <a href="https://huggingface.co/docs/huggingface_hub/main/en/package_reference/file_download#huggingface_hub.snapshot_download" rel="nofollow">snapshot_download</a> function, and the model checkpoint with the <a href="https://huggingface.co/docs/huggingface_hub/main/en/package_reference/file_download#huggingface_hub.hf_hub_download" rel="nofollow">hf_hub_download</a> function. By default, these files are downloaded to the Hugging Face Hub <a href="https://huggingface.co/docs/huggingface_hub/en/guides/manage-cache" rel="nofollow">cache directory</a>, but you can specify a preferred directory to download the files to with the <code>local_dir</code> parameter.',kt,Ke,xs='Pass the configuration and checkpoint paths to the <a href="/docs/diffusers/main/en/api/loaders/single_file#diffusers.loaders.FromSingleFileMixin.from_single_file">from_single_file()</a> method to load locally.',Wt,E,Bt,Oe,Rt,Q,xt,el,Cs='The <a href="/docs/diffusers/main/en/api/loaders/single_file#diffusers.loaders.FromSingleFileMixin.from_single_file">from_single_file()</a> method relies on the <a href="https://hf.co/docs/huggingface_hub/index" rel="nofollow">huggingface_hub</a> caching mechanism to fetch and store checkpoints and configuration files for models and pipelines. If you’re working with a file system that does not support symlinking, you should download the checkpoint file to a local directory first, and disable symlinking with the <code>local_dir_use_symlink=False</code> parameter in the <a href="https://huggingface.co/docs/huggingface_hub/main/en/package_reference/file_download#huggingface_hub.hf_hub_download" rel="nofollow">hf_hub_download</a> function and <a href="https://huggingface.co/docs/huggingface_hub/main/en/package_reference/file_download#huggingface_hub.snapshot_download" rel="nofollow">snapshot_download</a> functions.',Ct,ll,It,tl,Is="Then you can pass the local paths to the <code>pretrained_model_link_or_path</code> and <code>config</code> parameters.",Xt,sl,Yt,il,Vt,dl,Ft;return a=new k({props:{title:"Model files and layouts",local:"model-files-and-layouts",headingTag:"h1"}}),J=new Ds({props:{classNames:"absolute z-10 right-0 top-0",options:[{label:"Mixed",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers_doc/en/other-formats.ipynb"},{label:"PyTorch",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers_doc/en/pytorch/other-formats.ipynb"},{label:"TensorFlow",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers_doc/en/tensorflow/other-formats.ipynb"},{label:"Mixed",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/diffusers_doc/en/other-formats.ipynb"},{label:"PyTorch",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/diffusers_doc/en/pytorch/other-formats.ipynb"},{label:"TensorFlow",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/diffusers_doc/en/tensorflow/other-formats.ipynb"}]}}),z=new k({props:{title:"Files",local:"files",headingTag:"h2"}}),q=new k({props:{title:"safetensors",local:"safetensors",headingTag:"h3"}}),C=new ml({props:{warning:!1,$$slots:{default:[Ps]},$$scope:{ctx:T}}}),K=new $({props:{code:"IXBpcCUyMGluc3RhbGwlMjBzYWZldGVuc29ycw==",highlighted:"!pip install safetensors",wrap:!1}}),I=new Ml({props:{id:"safetensors",options:["multifolder","single file"],$$slots:{default:[Os]},$$scope:{ctx:T}}}),le=new k({props:{title:"LoRA files",local:"lora-files",headingTag:"h4"}}),ie=new $({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvblhMUGlwZWxpbmUlMEFpbXBvcnQlMjB0b3JjaCUwQSUwQSUyMyUyMGJhc2UlMjBtb2RlbCUwQXBpcGVsaW5lJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uWExQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIyTHlrb24lMkZkcmVhbXNoYXBlci14bC0xLTAlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMkMlMjB2YXJpYW50JTNEJTIyZnAxNiUyMiUwQSkudG8oJTIyY3VkYSUyMiklMEElMEElMjMlMjBkb3dubG9hZCUyMExvUkElMjB3ZWlnaHRzJTBBIXdnZXQlMjBodHRwcyUzQSUyRiUyRmNpdml0YWkuY29tJTJGYXBpJTJGZG93bmxvYWQlMkZtb2RlbHMlMkYxNjg3NzYlMjAtTyUyMGJsdWVwcmludGlmeS5zYWZldGVuc29ycyUwQSUwQSUyMyUyMGxvYWQlMjBMb1JBJTIwd2VpZ2h0cyUwQXBpcGVsaW5lLmxvYWRfbG9yYV93ZWlnaHRzKCUyMi4lMjIlMkMlMjB3ZWlnaHRfbmFtZSUzRCUyMmJsdWVwcmludGlmeS5zYWZldGVuc29ycyUyMiklMEFwcm9tcHQlMjAlM0QlMjAlMjJibDN1cHJpbnQlMkMlMjBhJTIwaGlnaGx5JTIwZGV0YWlsZWQlMjBibHVlcHJpbnQlMjBvZiUyMHRoZSUyMGVtcGlyZSUyMHN0YXRlJTIwYnVpbGRpbmclMkMlMjBleHBsYWluaW5nJTIwaG93JTIwdG8lMjBidWlsZCUyMGFsbCUyMHBhcnRzJTJDJTIwbWFueSUyMHR4dCUyQyUyMGJsdWVwcmludCUyMGdyaWQlMjBiYWNrZHJvcCUyMiUwQW5lZ2F0aXZlX3Byb21wdCUyMCUzRCUyMCUyMmxvd3JlcyUyQyUyMGNyb3BwZWQlMkMlMjB3b3JzdCUyMHF1YWxpdHklMkMlMjBsb3clMjBxdWFsaXR5JTJDJTIwbm9ybWFsJTIwcXVhbGl0eSUyQyUyMGFydGlmYWN0cyUyQyUyMHNpZ25hdHVyZSUyQyUyMHdhdGVybWFyayUyQyUyMHVzZXJuYW1lJTJDJTIwYmx1cnJ5JTJDJTIwbW9yZSUyMHRoYW4lMjBvbmUlMjBicmlkZ2UlMkMlMjBiYWQlMjBhcmNoaXRlY3R1cmUlMjIlMEElMEFpbWFnZSUyMCUzRCUyMHBpcGVsaW5lKCUwQSUyMCUyMCUyMCUyMHByb21wdCUzRHByb21wdCUyQyUwQSUyMCUyMCUyMCUyMG5lZ2F0aXZlX3Byb21wdCUzRG5lZ2F0aXZlX3Byb21wdCUyQyUwQSUyMCUyMCUyMCUyMGdlbmVyYXRvciUzRHRvcmNoLm1hbnVhbF9zZWVkKDApJTJDJTBBKS5pbWFnZXMlNUIwJTVEJTBBaW1hZ2U=",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionXLPipeline
<span class="hljs-keyword">import</span> torch

<span class="hljs-comment"># base model</span>
pipeline = StableDiffusionXLPipeline.from_pretrained(
    <span class="hljs-string">&quot;Lykon/dreamshaper-xl-1-0&quot;</span>, torch_dtype=torch.float16, variant=<span class="hljs-string">&quot;fp16&quot;</span>
).to(<span class="hljs-string">&quot;cuda&quot;</span>)

<span class="hljs-comment"># download LoRA weights</span>
!wget https://civitai.com/api/download/models/<span class="hljs-number">168776</span> -O blueprintify.safetensors

<span class="hljs-comment"># load LoRA weights</span>
pipeline.load_lora_weights(<span class="hljs-string">&quot;.&quot;</span>, weight_name=<span class="hljs-string">&quot;blueprintify.safetensors&quot;</span>)
prompt = <span class="hljs-string">&quot;bl3uprint, a highly detailed blueprint of the empire state building, explaining how to build all parts, many txt, blueprint grid backdrop&quot;</span>
negative_prompt = <span class="hljs-string">&quot;lowres, cropped, worst quality, low quality, normal quality, artifacts, signature, watermark, username, blurry, more than one bridge, bad architecture&quot;</span>

image = pipeline(
    prompt=prompt,
    negative_prompt=negative_prompt,
    generator=torch.manual_seed(<span class="hljs-number">0</span>),
).images[<span class="hljs-number">0</span>]
image`,wrap:!1}}),ne=new k({props:{title:"ckpt",local:"ckpt",headingTag:"h3"}}),Y=new ml({props:{warning:!0,$$slots:{default:[ei]},$$scope:{ctx:T}}}),fe=new $({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvblBpcGVsaW5lJTBBJTBBcGlwZWxpbmUlMjAlM0QlMjBTdGFibGVEaWZmdXNpb25QaXBlbGluZS5mcm9tX3NpbmdsZV9maWxlKCUwQSUyMCUyMCUyMCUyMCUyMmh0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZzdGFibGUtZGlmZnVzaW9uLXYxLTUlMkZzdGFibGUtZGlmZnVzaW9uLXYxLTUlMkZibG9iJTJGbWFpbiUyRnYxLTUtcHJ1bmVkLmNrcHQlMjIlMEEp",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionPipeline

pipeline = StableDiffusionPipeline.from_single_file(
    <span class="hljs-string">&quot;https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-v1-5/blob/main/v1-5-pruned.ckpt&quot;</span>
)`,wrap:!1}}),re=new k({props:{title:"Storage layout",local:"storage-layout",headingTag:"h2"}}),ce=new k({props:{title:"Diffusers-multifolder",local:"diffusers-multifolder",headingTag:"h3"}}),de=new $({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERpZmZ1c2lvblBpcGVsaW5lJTBBJTBBcGlwZWxpbmUlMjAlM0QlMjBEaWZmdXNpb25QaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIyc3RhYmlsaXR5YWklMkZzdGFibGUtZGlmZnVzaW9uLXhsLWJhc2UtMS4wJTIyJTJDJTBBJTIwJTIwJTIwJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTJDJTBBJTIwJTIwJTIwJTIwdmFyaWFudCUzRCUyMmZwMTYlMjIlMkMlMEElMjAlMjAlMjAlMjB1c2Vfc2FmZXRlbnNvcnMlM0RUcnVlJTJDJTBBKS50byglMjJjdWRhJTIyKQ==",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>,
    torch_dtype=torch.float16,
    variant=<span class="hljs-string">&quot;fp16&quot;</span>,
    use_safetensors=<span class="hljs-literal">True</span>,
).to(<span class="hljs-string">&quot;cuda&quot;</span>)`,wrap:!1}}),Me=new $({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwU3RhYmxlRGlmZnVzaW9uWExQaXBlbGluZSUyQyUyMFVOZXQyRENvbmRpdGlvbk1vZGVsJTJDJTIwRXVsZXJEaXNjcmV0ZVNjaGVkdWxlciUwQSUwQSUyMyUyMGRvd25sb2FkJTIwb25lJTIwbW9kZWwlMEFzZHhsX3BpcGVsaW5lJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uWExQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIyc3RhYmlsaXR5YWklMkZzdGFibGUtZGlmZnVzaW9uLXhsLWJhc2UtMS4wJTIyJTJDJTBBJTIwJTIwJTIwJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTJDJTBBJTIwJTIwJTIwJTIwdmFyaWFudCUzRCUyMmZwMTYlMjIlMkMlMEElMjAlMjAlMjAlMjB1c2Vfc2FmZXRlbnNvcnMlM0RUcnVlJTJDJTBBKS50byglMjJjdWRhJTIyKSUwQSUwQSUyMyUyMHN3aXRjaCUyMFVOZXQlMjBmb3IlMjBhbm90aGVyJTIwbW9kZWwlMEF1bmV0JTIwJTNEJTIwVU5ldDJEQ29uZGl0aW9uTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMnN0YWJpbGl0eWFpJTJGc2R4bC10dXJibyUyMiUyQyUwQSUyMCUyMCUyMCUyMHN1YmZvbGRlciUzRCUyMnVuZXQlMjIlMkMlMEElMjAlMjAlMjAlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMkMlMEElMjAlMjAlMjAlMjB2YXJpYW50JTNEJTIyZnAxNiUyMiUyQyUwQSUyMCUyMCUyMCUyMHVzZV9zYWZldGVuc29ycyUzRFRydWUlMEEpJTBBJTIzJTIwcmV1c2UlMjBhbGwlMjB0aGUlMjBzYW1lJTIwY29tcG9uZW50cyUyMGluJTIwbmV3JTIwbW9kZWwlMjBleGNlcHQlMjBmb3IlMjB0aGUlMjBVTmV0JTBBdHVyYm9fcGlwZWxpbmUlMjAlM0QlMjBTdGFibGVEaWZmdXNpb25YTFBpcGVsaW5lLmZyb21fcGlwZSglMEElMjAlMjAlMjAlMjBzZHhsX3BpcGVsaW5lJTJDJTIwdW5ldCUzRHVuZXQlMkMlMEEpLnRvKCUyMmN1ZGElMjIpJTBBdHVyYm9fcGlwZWxpbmUuc2NoZWR1bGVyJTIwJTNEJTIwRXVsZXJEaXNjcmV0ZVNjaGVkdWxlci5mcm9tX2NvbmZpZyglMEElMjAlMjAlMjAlMjB0dXJib19waXBlbGluZS5zY2hlZHVsZXIuY29uZmlnJTJDJTBBJTIwJTIwJTIwJTIwdGltZXN0ZXAlMkJzcGFjaW5nJTNEJTIydHJhaWxpbmclMjIlMEEpJTBBaW1hZ2UlMjAlM0QlMjB0dXJib19waXBlbGluZSglMEElMjAlMjAlMjAlMjAlMjJhbiUyMGFzdHJvbmF1dCUyMHJpZGluZyUyMGElMjB1bmljb3JuJTIwb24lMjBtYXJzJTIyJTJDJTBBJTIwJTIwJTIwJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDElMkMlMEElMjAlMjAlMjAlMjBndWlkYW5jZV9zY2FsZSUzRDAuMCUyQyUwQSkuaW1hZ2VzJTVCMCU1RCUwQWltYWdl",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionXLPipeline, UNet2DConditionModel, EulerDiscreteScheduler

<span class="hljs-comment"># download one model</span>
sdxl_pipeline = StableDiffusionXLPipeline.from_pretrained(
    <span class="hljs-string">&quot;stabilityai/stable-diffusion-xl-base-1.0&quot;</span>,
    torch_dtype=torch.float16,
    variant=<span class="hljs-string">&quot;fp16&quot;</span>,
    use_safetensors=<span class="hljs-literal">True</span>,
).to(<span class="hljs-string">&quot;cuda&quot;</span>)

<span class="hljs-comment"># switch UNet for another model</span>
unet = UNet2DConditionModel.from_pretrained(
    <span class="hljs-string">&quot;stabilityai/sdxl-turbo&quot;</span>,
    subfolder=<span class="hljs-string">&quot;unet&quot;</span>,
    torch_dtype=torch.float16,
    variant=<span class="hljs-string">&quot;fp16&quot;</span>,
    use_safetensors=<span class="hljs-literal">True</span>
)
<span class="hljs-comment"># reuse all the same components in new model except for the UNet</span>
turbo_pipeline = StableDiffusionXLPipeline.from_pipe(
    sdxl_pipeline, unet=unet,
).to(<span class="hljs-string">&quot;cuda&quot;</span>)
turbo_pipeline.scheduler = EulerDiscreteScheduler.from_config(
    turbo_pipeline.scheduler.config,
    timestep+spacing=<span class="hljs-string">&quot;trailing&quot;</span>
)
image = turbo_pipeline(
    <span class="hljs-string">&quot;an astronaut riding a unicorn on mars&quot;</span>,
    num_inference_steps=<span class="hljs-number">1</span>,
    guidance_scale=<span class="hljs-number">0.0</span>,
).images[<span class="hljs-number">0</span>]
image`,wrap:!1}}),ge=new $({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERpZmZ1c2lvblBpcGVsaW5lJTJDJTIwQXV0b2VuY29kZXJLTCUwQSUwQXZhZSUyMCUzRCUyMEF1dG9lbmNvZGVyS0wuZnJvbV9wcmV0cmFpbmVkKCUyMm1hZGVieW9sbGluJTJGc2R4bC12YWUtZnAxNi1maXglMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMkMlMjB1c2Vfc2FmZXRlbnNvcnMlM0RUcnVlKSUwQXBpcGVsaW5lJTIwJTNEJTIwRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMnN0YWJpbGl0eWFpJTJGc3RhYmxlLWRpZmZ1c2lvbi14bC1iYXNlLTEuMCUyMiUyQyUwQSUyMCUyMCUyMCUyMHZhZSUzRHZhZSUyQyUwQSUyMCUyMCUyMCUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiUyQyUwQSUyMCUyMCUyMCUyMHZhcmlhbnQlM0QlMjJmcDE2JTIyJTJDJTBBJTIwJTIwJTIwJTIwdXNlX3NhZmV0ZW5zb3JzJTNEVHJ1ZSUyQyUwQSkudG8oJTIyY3VkYSUyMik=",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline, AutoencoderKL

vae = AutoencoderKL.from_pretrained(<span class="hljs-string">&quot;madebyollin/sdxl-vae-fp16-fix&quot;</span>, torch_dtype=torch.float16, use_safetensors=<span class="hljs-literal">True</span>)
pipeline = DiffusionPipeline.from_pretrained(
    <span class="hljs-string">&quot;stabilityai/stable-diffusion-xl-base-1.0&quot;</span>,
    vae=vae,
    torch_dtype=torch.float16,
    variant=<span class="hljs-string">&quot;fp16&quot;</span>,
    use_safetensors=<span class="hljs-literal">True</span>,
).to(<span class="hljs-string">&quot;cuda&quot;</span>)`,wrap:!1}}),we=new k({props:{title:"Single-file",local:"single-file",headingTag:"h3"}}),Te=new $({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwU3RhYmxlRGlmZnVzaW9uWExQaXBlbGluZSUwQSUwQXBpcGVsaW5lJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uWExQaXBlbGluZS5mcm9tX3NpbmdsZV9maWxlKCUwQSUyMCUyMCUyMCUyMCUyMmh0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZzdGFiaWxpdHlhaSUyRnN0YWJsZS1kaWZmdXNpb24teGwtYmFzZS0xLjAlMkZibG9iJTJGbWFpbiUyRnNkX3hsX2Jhc2VfMS4wLnNhZmV0ZW5zb3JzJTIyJTJDJTBBJTIwJTIwJTIwJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTJDJTBBJTIwJTIwJTIwJTIwdmFyaWFudCUzRCUyMmZwMTYlMjIlMkMlMEElMjAlMjAlMjAlMjB1c2Vfc2FmZXRlbnNvcnMlM0RUcnVlJTJDJTBBKS50byglMjJjdWRhJTIyKQ==",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionXLPipeline

pipeline = StableDiffusionXLPipeline.from_single_file(
    <span class="hljs-string">&quot;https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/blob/main/sd_xl_base_1.0.safetensors&quot;</span>,
    torch_dtype=torch.float16,
    variant=<span class="hljs-string">&quot;fp16&quot;</span>,
    use_safetensors=<span class="hljs-literal">True</span>,
).to(<span class="hljs-string">&quot;cuda&quot;</span>)`,wrap:!1}}),_e=new k({props:{title:"DDUF",local:"dduf",headingTag:"h3"}}),S=new ml({props:{warning:!0,$$slots:{default:[li]},$$scope:{ctx:T}}}),ke=new $({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERpZmZ1c2lvblBpcGVsaW5lJTBBaW1wb3J0JTIwdG9yY2glMEElMEFwaXBlJTIwJTNEJTIwRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMkREVUYlMkZGTFVYLjEtZGV2LUREVUYlMjIlMkMlMjBkZHVmX2ZpbGUlM0QlMjJGTFVYLjEtZGV2LmRkdWYlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmJmbG9hdDE2JTBBKS50byglMjJjdWRhJTIyKSUwQWltYWdlJTIwJTNEJTIwcGlwZSglMEElMjAlMjAlMjAlMjAlMjJwaG90byUyMGElMjBjYXQlMjBob2xkaW5nJTIwYSUyMHNpZ24lMjB0aGF0JTIwc2F5cyUyMERpZmZ1c2VycyUyMiUyQyUyMG51bV9pbmZlcmVuY2Vfc3RlcHMlM0Q1MCUyQyUyMGd1aWRhbmNlX3NjYWxlJTNEMy41JTBBKS5pbWFnZXMlNUIwJTVEJTBBaW1hZ2Uuc2F2ZSglMjJjYXQucG5nJTIyKQ==",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline
<span class="hljs-keyword">import</span> torch

pipe = DiffusionPipeline.from_pretrained(
    <span class="hljs-string">&quot;DDUF/FLUX.1-dev-DDUF&quot;</span>, dduf_file=<span class="hljs-string">&quot;FLUX.1-dev.dduf&quot;</span>, torch_dtype=torch.bfloat16
).to(<span class="hljs-string">&quot;cuda&quot;</span>)
image = pipe(
    <span class="hljs-string">&quot;photo a cat holding a sign that says Diffusers&quot;</span>, num_inference_steps=<span class="hljs-number">50</span>, guidance_scale=<span class="hljs-number">3.5</span>
).images[<span class="hljs-number">0</span>]
image.save(<span class="hljs-string">&quot;cat.png&quot;</span>)`,wrap:!1}}),Be=new $({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMGV4cG9ydF9mb2xkZXJfYXNfZGR1ZiUwQWZyb20lMjBkaWZmdXNlcnMlMjBpbXBvcnQlMjBEaWZmdXNpb25QaXBlbGluZSUwQWltcG9ydCUyMHRvcmNoJTIwJTBBJTBBcGlwZSUyMCUzRCUyMERpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMjJibGFjay1mb3Jlc3QtbGFicyUyRkZMVVguMS1kZXYlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmJmbG9hdDE2KSUwQSUwQXNhdmVfZm9sZGVyJTIwJTNEJTIwJTIyZmx1eC1kZXYlMjIlMEFwaXBlLnNhdmVfcHJldHJhaW5lZCglMjJmbHV4LWRldiUyMiklMEFleHBvcnRfZm9sZGVyX2FzX2RkdWYoJTIyZmx1eC1kZXYuZGR1ZiUyMiUyQyUyMGZvbGRlcl9wYXRoJTNEc2F2ZV9mb2xkZXIpJTBBJTBBJTNFJTIwJTVCIVRJUCU1RCUwQSUzRSUyMFBhY2thZ2luZyUyMGFuZCUyMGxvYWRpbmclMjBxdWFudGl6ZWQlMjBjaGVja3BvaW50cyUyMGluJTIwdGhlJTIwRERVRiUyMGZvcm1hdCUyMGlzJTIwc3VwcG9ydGVkJTIwYXMlMjBsb25nJTIwYXMlMjB0aGV5JTIwcmVzcGVjdCUyMHRoZSUyMG11bHRpLWZvbGRlciUyMHN0cnVjdHVyZS4lMEElMEElMjMlMjMlMjBDb252ZXJ0JTIwbGF5b3V0JTIwYW5kJTIwZmlsZXMlMEElMEFEaWZmdXNlcnMlMjBwcm92aWRlcyUyMG1hbnklMjBzY3JpcHRzJTIwYW5kJTIwbWV0aG9kcyUyMHRvJTIwY29udmVydCUyMHN0b3JhZ2UlMjBsYXlvdXRzJTIwYW5kJTIwZmlsZSUyMGZvcm1hdHMlMjB0byUyMGVuYWJsZSUyMGJyb2FkZXIlMjBzdXBwb3J0JTIwYWNyb3NzJTIwdGhlJTIwZGlmZnVzaW9uJTIwZWNvc3lzdGVtLiUwQSUwQVRha2UlMjBhJTIwbG9vayUyMGF0JTIwdGhlJTIwJTVCZGlmZnVzZXJzJTJGc2NyaXB0cyU1RChodHRwcyUzQSUyRiUyRmdpdGh1Yi5jb20lMkZodWdnaW5nZmFjZSUyRmRpZmZ1c2VycyUyRnRyZWUlMkZtYWluJTJGc2NyaXB0cyklMjBjb2xsZWN0aW9uJTIwdG8lMjBmaW5kJTIwYSUyMHNjcmlwdCUyMHRoYXQlMjBmaXRzJTIweW91ciUyMGNvbnZlcnNpb24lMjBuZWVkcy4lMEElMEElM0UlMjAlNUIhVElQJTVEJTBBJTNFJTIwU2NyaXB0cyUyMHRoYXQlMjBoYXZlJTIwJTIyJTYwdG9fZGlmZnVzZXJzJTYwJTIyJTIwYXBwZW5kZWQlMjBhdCUyMHRoZSUyMGVuZCUyMG1lYW4lMjB0aGV5JTIwY29udmVydCUyMGElMjBtb2RlbCUyMHRvJTIwdGhlJTIwRGlmZnVzZXJzLW11bHRpZm9sZGVyJTIwbGF5b3V0LiUyMEVhY2glMjBzY3JpcHQlMjBoYXMlMjB0aGVpciUyMG93biUyMHNwZWNpZmljJTIwc2V0JTIwb2YlMjBhcmd1bWVudHMlMjBmb3IlMjBjb25maWd1cmluZyUyMHRoZSUyMGNvbnZlcnNpb24lMkMlMjBzbyUyMG1ha2UlMjBzdXJlJTIweW91JTIwY2hlY2slMjB3aGF0JTIwYXJndW1lbnRzJTIwYXJlJTIwYXZhaWxhYmxlISUwQSUwQUZvciUyMGV4YW1wbGUlMkMlMjB0byUyMGNvbnZlcnQlMjBhJTIwU3RhYmxlJTIwRGlmZnVzaW9uJTIwWEwlMjBtb2RlbCUyMHN0b3JlZCUyMGluJTIwRGlmZnVzZXJzLW11bHRpZm9sZGVyJTIwbGF5b3V0JTIwdG8lMjBhJTIwc2luZ2xlLWZpbGUlMjBsYXlvdXQlMkMlMjBydW4lMjB0aGUlMjAlNUJjb252ZXJ0X2RpZmZ1c2Vyc190b19vcmlnaW5hbF9zZHhsLnB5JTVEKGh0dHBzJTNBJTJGJTJGZ2l0aHViLmNvbSUyRmh1Z2dpbmdmYWNlJTJGZGlmZnVzZXJzJTJGYmxvYiUyRm1haW4lMkZzY3JpcHRzJTJGY29udmVydF9kaWZmdXNlcnNfdG9fb3JpZ2luYWxfc2R4bC5weSklMjBzY3JpcHQuJTIwUHJvdmlkZSUyMHRoZSUyMHBhdGglMjB0byUyMHRoZSUyMG1vZGVsJTIwdG8lMjBjb252ZXJ0JTJDJTIwYW5kJTIwdGhlJTIwcGF0aCUyMHRvJTIwc2F2ZSUyMHRoZSUyMGNvbnZlcnRlZCUyMG1vZGVsJTIwdG8uJTIwWW91JTIwY2FuJTIwb3B0aW9uYWxseSUyMHNwZWNpZnklMjB3aGV0aGVyJTIweW91JTIwd2FudCUyMHRvJTIwc2F2ZSUyMHRoZSUyMG1vZGVsJTIwYXMlMjBhJTIwc2FmZXRlbnNvcnMlMjBmaWxlJTIwYW5kJTIwd2hldGhlciUyMHRvJTIwc2F2ZSUyMHRoZSUyMG1vZGVsJTIwaW4lMjBoYWxmLXByZWNpc2lvbi4lMEElMEElNjAlNjAlNjBiYXNoJTBBcHl0aG9uJTIwY29udmVydF9kaWZmdXNlcnNfdG9fb3JpZ2luYWxfc2R4bC5weSUyMC0tbW9kZWxfcGF0aCUyMHBhdGglMkZ0byUyRm1vZGVsJTJGdG8lMkZjb252ZXJ0JTIwLS1jaGVja3BvaW50X3BhdGglMjBwYXRoJTJGdG8lMkZzYXZlJTJGbW9kZWwlMkZ0byUyMC0tdXNlX3NhZmV0ZW5zb3Jz",highlighted:`<span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> export_folder_as_dduf
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline
<span class="hljs-keyword">import</span> torch 

pipe = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;black-forest-labs/FLUX.1-dev&quot;</span>, torch_dtype=torch.bfloat16)

save_folder = <span class="hljs-string">&quot;flux-dev&quot;</span>
pipe.save_pretrained(<span class="hljs-string">&quot;flux-dev&quot;</span>)
export_folder_as_dduf(<span class="hljs-string">&quot;flux-dev.dduf&quot;</span>, folder_path=save_folder)

&gt; [!TIP]
&gt; Packaging <span class="hljs-keyword">and</span> loading quantized checkpoints <span class="hljs-keyword">in</span> the DDUF <span class="hljs-built_in">format</span> <span class="hljs-keyword">is</span> supported <span class="hljs-keyword">as</span> long <span class="hljs-keyword">as</span> they respect the multi-folder structure.

<span class="hljs-comment">## Convert layout and files</span>

Diffusers provides many scripts <span class="hljs-keyword">and</span> methods to convert storage layouts <span class="hljs-keyword">and</span> file formats to enable broader support across the diffusion ecosystem.

Take a look at the [diffusers/scripts](https://github.com/huggingface/diffusers/tree/main/scripts) collection to find a script that fits your conversion needs.

&gt; [!TIP]
&gt; Scripts that have <span class="hljs-string">&quot;\`to_diffusers\`&quot;</span> appended at the end mean they convert a model to the Diffusers-multifolder layout. Each script has their own specific <span class="hljs-built_in">set</span> of arguments <span class="hljs-keyword">for</span> configuring the conversion, so make sure you check what arguments are available!

For example, to convert a Stable Diffusion XL model stored <span class="hljs-keyword">in</span> Diffusers-multifolder layout to a single-file layout, run the [convert_diffusers_to_original_sdxl.py](https://github.com/huggingface/diffusers/blob/main/scripts/convert_diffusers_to_original_sdxl.py) script. Provide the path to the model to convert, <span class="hljs-keyword">and</span> the path to save the converted model to. You can optionally specify whether you want to save the model <span class="hljs-keyword">as</span> a safetensors file <span class="hljs-keyword">and</span> whether to save the model <span class="hljs-keyword">in</span> half-precision.

\`\`\`bash
python convert_diffusers_to_original_sdxl.py --model_path path/to/model/to/convert --checkpoint_path path/to/save/model/to --use_safetensors`,wrap:!1}}),xe=new $({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvblhMUGlwZWxpbmUlMEElMEFwaXBlbGluZSUyMCUzRCUyMFN0YWJsZURpZmZ1c2lvblhMUGlwZWxpbmUuZnJvbV9zaW5nbGVfZmlsZSglMEElMjAlMjAlMjAlMjAlMjJodHRwcyUzQSUyRiUyRmh1Z2dpbmdmYWNlLmNvJTJGc3RhYmlsaXR5YWklMkZzdGFibGUtZGlmZnVzaW9uLXhsLWJhc2UtMS4wJTJGYmxvYiUyRm1haW4lMkZzZF94bF9iYXNlXzEuMC5zYWZldGVuc29ycyUyMiUyQyUwQSklMEFwaXBlbGluZS5zYXZlX3ByZXRyYWluZWQoKQ==",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionXLPipeline

pipeline = StableDiffusionXLPipeline.from_single_file(
    <span class="hljs-string">&quot;https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/blob/main/sd_xl_base_1.0.safetensors&quot;</span>,
)
pipeline.save_pretrained()`,wrap:!1}}),Ie=new k({props:{title:"Single-file layout usage",local:"single-file-layout-usage",headingTag:"h2"}}),Ye=new k({props:{title:"Load a pipeline or model",local:"load-a-pipeline-or-model",headingTag:"h3"}}),N=new Ml({props:{id:"pipeline-model",options:["pipeline","model"],$$slots:{default:[ii]},$$scope:{ctx:T}}}),Se=new $({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvblhMUGlwZWxpbmUlMkMlMjBERElNU2NoZWR1bGVyJTBBJTBBY2twdF9wYXRoJTIwJTNEJTIwJTIyaHR0cHMlM0ElMkYlMkZodWdnaW5nZmFjZS5jbyUyRnN0YWJpbGl0eWFpJTJGc3RhYmxlLWRpZmZ1c2lvbi14bC1iYXNlLTEuMCUyRmJsb2IlMkZtYWluJTJGc2RfeGxfYmFzZV8xLjBfMC45dmFlLnNhZmV0ZW5zb3JzJTIyJTBBc2NoZWR1bGVyJTIwJTNEJTIwRERJTVNjaGVkdWxlcigpJTBBcGlwZWxpbmUlMjAlM0QlMjBTdGFibGVEaWZmdXNpb25YTFBpcGVsaW5lLmZyb21fc2luZ2xlX2ZpbGUoY2twdF9wYXRoJTJDJTIwc2NoZWR1bGVyJTNEc2NoZWR1bGVyKQ==",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionXLPipeline, DDIMScheduler

ckpt_path = <span class="hljs-string">&quot;https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/blob/main/sd_xl_base_1.0_0.9vae.safetensors&quot;</span>
scheduler = DDIMScheduler()
pipeline = StableDiffusionXLPipeline.from_single_file(ckpt_path, scheduler=scheduler)`,wrap:!1}}),He=new $({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvbkNvbnRyb2xOZXRQaXBlbGluZSUyQyUyMENvbnRyb2xOZXRNb2RlbCUwQSUwQWNrcHRfcGF0aCUyMCUzRCUyMCUyMmh0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZzdGFibGUtZGlmZnVzaW9uLXYxLTUlMkZzdGFibGUtZGlmZnVzaW9uLXYxLTUlMkZibG9iJTJGbWFpbiUyRnYxLTUtcHJ1bmVkLWVtYW9ubHkuc2FmZXRlbnNvcnMlMjIlMEFjb250cm9sbmV0JTIwJTNEJTIwQ29udHJvbE5ldE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJsbGx5YXN2aWVsJTJGY29udHJvbF92MTFwX3NkMTVfY2FubnklMjIpJTBBcGlwZWxpbmUlMjAlM0QlMjBTdGFibGVEaWZmdXNpb25Db250cm9sTmV0UGlwZWxpbmUuZnJvbV9zaW5nbGVfZmlsZShja3B0X3BhdGglMkMlMjBjb250cm9sbmV0JTNEY29udHJvbG5ldCk=",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionControlNetPipeline, ControlNetModel

ckpt_path = <span class="hljs-string">&quot;https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-v1-5/blob/main/v1-5-pruned-emaonly.safetensors&quot;</span>
controlnet = ControlNetModel.from_pretrained(<span class="hljs-string">&quot;lllyasviel/control_v11p_sd15_canny&quot;</span>)
pipeline = StableDiffusionControlNetPipeline.from_single_file(ckpt_path, controlnet=controlnet)`,wrap:!1}}),Le=new k({props:{title:"Customize configuration options",local:"customize-configuration-options",headingTag:"h3"}}),H=new Ml({props:{id:"config-file",options:["Hub configuration file","original configuration file"],$$slots:{default:[ri]},$$scope:{ctx:T}}}),L=new Ml({props:{id:"override",options:["pipeline","model"],$$slots:{default:[mi]},$$scope:{ctx:T}}}),De=new k({props:{title:"Local files",local:"local-files",headingTag:"h3"}}),E=new Ml({props:{id:"local",options:["Hub cache directory","specific local directory"],$$slots:{default:[hi]},$$scope:{ctx:T}}}),Oe=new k({props:{title:"Local files without symlink",local:"local-files-without-symlink",headingTag:"h4"}}),Q=new ml({props:{warning:!1,$$slots:{default:[yi]},$$scope:{ctx:T}}}),ll=new $({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMGhmX2h1Yl9kb3dubG9hZCUyQyUyMHNuYXBzaG90X2Rvd25sb2FkJTBBJTBBbXlfbG9jYWxfY2hlY2twb2ludF9wYXRoJTIwJTNEJTIwaGZfaHViX2Rvd25sb2FkKCUwQSUyMCUyMCUyMCUyMHJlcG9faWQlM0QlMjJzZWdtaW5kJTJGU1NELTFCJTIyJTJDJTBBJTIwJTIwJTIwJTIwZmlsZW5hbWUlM0QlMjJTU0QtMUIuc2FmZXRlbnNvcnMlMjIlMEElMjAlMjAlMjAlMjBsb2NhbF9kaXIlM0QlMjJteV9sb2NhbF9jaGVja3BvaW50cyUyMiUyQyUwQSUyMCUyMCUyMCUyMGxvY2FsX2Rpcl91c2Vfc3ltbGlua3MlM0RGYWxzZSUwQSklMEFwcmludCglMjJNeSUyMGxvY2FsJTIwY2hlY2twb2ludCUzQSUyMCUyMiUyQyUyMG15X2xvY2FsX2NoZWNrcG9pbnRfcGF0aCklMEElMEFteV9sb2NhbF9jb25maWdfcGF0aCUyMCUzRCUyMHNuYXBzaG90X2Rvd25sb2FkKCUwQSUyMCUyMCUyMCUyMHJlcG9faWQlM0QlMjJzZWdtaW5kJTJGU1NELTFCJTIyJTJDJTBBJTIwJTIwJTIwJTIwYWxsb3dfcGF0dGVybnMlM0QlNUIlMjIqLmpzb24lMjIlMkMlMjAlMjIqKiUyRiouanNvbiUyMiUyQyUyMCUyMioudHh0JTIyJTJDJTIwJTIyKiolMkYqLnR4dCUyMiU1RCUwQSUyMCUyMCUyMCUyMGxvY2FsX2Rpcl91c2Vfc3ltbGlua3MlM0RGYWxzZSUyQyUwQSklMEFwcmludCglMjJNeSUyMGxvY2FsJTIwY29uZmlnJTNBJTIwJTIyJTJDJTIwbXlfbG9jYWxfY29uZmlnX3BhdGgp",highlighted:`<span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> hf_hub_download, snapshot_download

my_local_checkpoint_path = hf_hub_download(
    repo_id=<span class="hljs-string">&quot;segmind/SSD-1B&quot;</span>,
    filename=<span class="hljs-string">&quot;SSD-1B.safetensors&quot;</span>
    local_dir=<span class="hljs-string">&quot;my_local_checkpoints&quot;</span>,
    local_dir_use_symlinks=<span class="hljs-literal">False</span>
)
<span class="hljs-built_in">print</span>(<span class="hljs-string">&quot;My local checkpoint: &quot;</span>, my_local_checkpoint_path)

my_local_config_path = snapshot_download(
    repo_id=<span class="hljs-string">&quot;segmind/SSD-1B&quot;</span>,
    allow_patterns=[<span class="hljs-string">&quot;*.json&quot;</span>, <span class="hljs-string">&quot;**/*.json&quot;</span>, <span class="hljs-string">&quot;*.txt&quot;</span>, <span class="hljs-string">&quot;**/*.txt&quot;</span>]
    local_dir_use_symlinks=<span class="hljs-literal">False</span>,
)
<span class="hljs-built_in">print</span>(<span class="hljs-string">&quot;My local config: &quot;</span>, my_local_config_path)`,wrap:!1}}),sl=new $({props:{code:"cGlwZWxpbmUlMjAlM0QlMjBTdGFibGVEaWZmdXNpb25YTFBpcGVsaW5lLmZyb21fc2luZ2xlX2ZpbGUobXlfbG9jYWxfY2hlY2twb2ludF9wYXRoJTJDJTIwY29uZmlnJTNEbXlfbG9jYWxfY29uZmlnX3BhdGglMkMlMjBsb2NhbF9maWxlc19vbmx5JTNEVHJ1ZSk=",highlighted:'pipeline = StableDiffusionXLPipeline.from_single_file(my_local_checkpoint_path, config=my_local_config_path, local_files_only=<span class="hljs-literal">True</span>)',wrap:!1}}),il=new qs({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/using-diffusers/other-formats.md"}}),{c(){t=m("meta"),c=f(),i=m("p"),p=f(),d(a.$$.fragment),o=f(),d(J.$$.fragment),U=f(),_=m("p"),_.innerHTML=R,Z=f(),j=m("p"),j.textContent=ul,bl=f(),d(z.$$.fragment),gl=f(),D=m("p"),D.innerHTML=zt,wl=f(),d(q.$$.fragment),Jl=f(),d(C.$$.fragment),Ul=f(),P=m("p"),P.innerHTML=Dt,Tl=f(),A=m("p"),A.innerHTML=qt,Zl=f(),d(K.$$.fragment),$l=f(),O=m("p"),O.textContent=Pt,_l=f(),ee=m("ol"),ee.innerHTML=At,jl=f(),d(I.$$.fragment),Gl=f(),d(le.$$.fragment),vl=f(),te=m("p"),te.innerHTML=Kt,kl=f(),se=m("p"),se.innerHTML=Ot,Wl=f(),d(ie.$$.fragment),Bl=f(),X=m("div"),X.innerHTML=es,Rl=f(),d(ne.$$.fragment),xl=f(),d(Y.$$.fragment),Cl=f(),ae=m("p"),ae.innerHTML=ls,Il=f(),oe=m("p"),oe.innerHTML=ts,Xl=f(),d(fe.$$.fragment),Yl=f(),d(re.$$.fragment),Vl=f(),pe=m("p"),pe.textContent=ss,Fl=f(),d(ce.$$.fragment),Sl=f(),me=m("p"),me.textContent=is,Nl=f(),V=m("div"),V.innerHTML=ns,Hl=f(),ue=m("p"),ue.innerHTML=as,Ll=f(),d(de.$$.fragment),El=f(),he=m("p"),he.textContent=os,Ql=f(),G=m("ol"),ol=m("li"),ol.innerHTML=fs,St=f(),ye=m("li"),fl=m("p"),fl.innerHTML=rs,Nt=f(),d(Me.$$.fragment),Ht=f(),rl=m("li"),rl.innerHTML=ps,Lt=f(),be=m("li"),pl=m("p"),pl.textContent=cs,Et=f(),d(ge.$$.fragment),Qt=f(),cl=m("li"),cl.innerHTML=ms,zl=f(),d(we.$$.fragment),Dl=f(),Je=m("p"),Je.textContent=us,ql=f(),F=m("div"),F.innerHTML=ds,Pl=f(),Ue=m("p"),Ue.innerHTML=hs,Al=f(),d(Te.$$.fragment),Kl=f(),Ze=m("p"),Ze.textContent=ys,Ol=f(),$e=m("ol"),$e.innerHTML=Ms,et=f(),d(_e.$$.fragment),lt=f(),d(S.$$.fragment),tt=f(),je=m("p"),je.innerHTML=bs,st=f(),Ge=m("p"),Ge.innerHTML=gs,it=f(),ve=m("p"),ve.innerHTML=ws,nt=f(),d(ke.$$.fragment),at=f(),We=m("p"),We.innerHTML=Js,ot=f(),d(Be.$$.fragment),ft=f(),Re=m("p"),Re.innerHTML=Us,rt=f(),d(xe.$$.fragment),pt=f(),Ce=m("p"),Ce.innerHTML=Ts,ct=f(),d(Ie.$$.fragment),mt=f(),Xe=m("p"),Xe.innerHTML=Zs,ut=f(),d(Ye.$$.fragment),dt=f(),Ve=m("p"),Ve.innerHTML=$s,ht=f(),d(N.$$.fragment),yt=f(),Fe=m("p"),Fe.innerHTML=_s,Mt=f(),d(Se.$$.fragment),bt=f(),Ne=m("p"),Ne.textContent=js,gt=f(),d(He.$$.fragment),wt=f(),d(Le.$$.fragment),Jt=f(),Ee=m("p"),Ee.innerHTML=Gs,Ut=f(),Qe=m("p"),Qe.textContent=vs,Tt=f(),d(H.$$.fragment),Zt=f(),ze=m("p"),ze.innerHTML=ks,$t=f(),d(L.$$.fragment),_t=f(),d(De.$$.fragment),jt=f(),qe=m("p"),qe.innerHTML=Ws,Gt=f(),Pe=m("p"),Pe.innerHTML=Bs,vt=f(),Ae=m("p"),Ae.innerHTML=Rs,kt=f(),Ke=m("p"),Ke.innerHTML=xs,Wt=f(),d(E.$$.fragment),Bt=f(),d(Oe.$$.fragment),Rt=f(),d(Q.$$.fragment),xt=f(),el=m("p"),el.innerHTML=Cs,Ct=f(),d(ll.$$.fragment),It=f(),tl=m("p"),tl.innerHTML=Is,Xt=f(),d(sl.$$.fragment),Yt=f(),d(il.$$.fragment),Vt=f(),dl=m("p"),this.h()},l(e){const l=zs("svelte-u9bgzb",document.head);t=u(l,"META",{name:!0,content:!0}),l.forEach(s),c=r(e),i=u(e,"P",{}),hl(i).forEach(s),p=r(e),h(a.$$.fragment,e),o=r(e),h(J.$$.fragment,e),U=r(e),_=u(e,"P",{"data-svelte-h":!0}),w(_)!=="svelte-kxjzqb"&&(_.innerHTML=R),Z=r(e),j=u(e,"P",{"data-svelte-h":!0}),w(j)!=="svelte-i9ya2i"&&(j.textContent=ul),bl=r(e),h(z.$$.fragment,e),gl=r(e),D=u(e,"P",{"data-svelte-h":!0}),w(D)!=="svelte-11pybq1"&&(D.innerHTML=zt),wl=r(e),h(q.$$.fragment,e),Jl=r(e),h(C.$$.fragment,e),Ul=r(e),P=u(e,"P",{"data-svelte-h":!0}),w(P)!=="svelte-9jg8rl"&&(P.innerHTML=Dt),Tl=r(e),A=u(e,"P",{"data-svelte-h":!0}),w(A)!=="svelte-curlg7"&&(A.innerHTML=qt),Zl=r(e),h(K.$$.fragment,e),$l=r(e),O=u(e,"P",{"data-svelte-h":!0}),w(O)!=="svelte-1yget19"&&(O.textContent=Pt),_l=r(e),ee=u(e,"OL",{"data-svelte-h":!0}),w(ee)!=="svelte-1kpaoly"&&(ee.innerHTML=At),jl=r(e),h(I.$$.fragment,e),Gl=r(e),h(le.$$.fragment,e),vl=r(e),te=u(e,"P",{"data-svelte-h":!0}),w(te)!=="svelte-f23adm"&&(te.innerHTML=Kt),kl=r(e),se=u(e,"P",{"data-svelte-h":!0}),w(se)!=="svelte-1u17jy4"&&(se.innerHTML=Ot),Wl=r(e),h(ie.$$.fragment,e),Bl=r(e),X=u(e,"DIV",{class:!0,"data-svelte-h":!0}),w(X)!=="svelte-pgqu2t"&&(X.innerHTML=es),Rl=r(e),h(ne.$$.fragment,e),xl=r(e),h(Y.$$.fragment,e),Cl=r(e),ae=u(e,"P",{"data-svelte-h":!0}),w(ae)!=="svelte-1vcmkmh"&&(ae.innerHTML=ls),Il=r(e),oe=u(e,"P",{"data-svelte-h":!0}),w(oe)!=="svelte-w2gv44"&&(oe.innerHTML=ts),Xl=r(e),h(fe.$$.fragment,e),Yl=r(e),h(re.$$.fragment,e),Vl=r(e),pe=u(e,"P",{"data-svelte-h":!0}),w(pe)!=="svelte-bc37k5"&&(pe.textContent=ss),Fl=r(e),h(ce.$$.fragment,e),Sl=r(e),me=u(e,"P",{"data-svelte-h":!0}),w(me)!=="svelte-r6jgt3"&&(me.textContent=is),Nl=r(e),V=u(e,"DIV",{class:!0,"data-svelte-h":!0}),w(V)!=="svelte-1taq59g"&&(V.innerHTML=ns),Hl=r(e),ue=u(e,"P",{"data-svelte-h":!0}),w(ue)!=="svelte-1lh7lzt"&&(ue.innerHTML=as),Ll=r(e),h(de.$$.fragment,e),El=r(e),he=u(e,"P",{"data-svelte-h":!0}),w(he)!=="svelte-1s9uno7"&&(he.textContent=os),Ql=r(e),G=u(e,"OL",{});var B=hl(G);ol=u(B,"LI",{"data-svelte-h":!0}),w(ol)!=="svelte-1ev5mj8"&&(ol.innerHTML=fs),St=r(B),ye=u(B,"LI",{});var nl=hl(ye);fl=u(nl,"P",{"data-svelte-h":!0}),w(fl)!=="svelte-ztyuse"&&(fl.innerHTML=rs),Nt=r(nl),h(Me.$$.fragment,nl),nl.forEach(s),Ht=r(B),rl=u(B,"LI",{"data-svelte-h":!0}),w(rl)!=="svelte-vp6v5d"&&(rl.innerHTML=ps),Lt=r(B),be=u(B,"LI",{});var al=hl(be);pl=u(al,"P",{"data-svelte-h":!0}),w(pl)!=="svelte-1acwn3q"&&(pl.textContent=cs),Et=r(al),h(ge.$$.fragment,al),al.forEach(s),Qt=r(B),cl=u(B,"LI",{"data-svelte-h":!0}),w(cl)!=="svelte-xph0z2"&&(cl.innerHTML=ms),B.forEach(s),zl=r(e),h(we.$$.fragment,e),Dl=r(e),Je=u(e,"P",{"data-svelte-h":!0}),w(Je)!=="svelte-2us5xv"&&(Je.textContent=us),ql=r(e),F=u(e,"DIV",{class:!0,"data-svelte-h":!0}),w(F)!=="svelte-ysl4o1"&&(F.innerHTML=ds),Pl=r(e),Ue=u(e,"P",{"data-svelte-h":!0}),w(Ue)!=="svelte-8pvu77"&&(Ue.innerHTML=hs),Al=r(e),h(Te.$$.fragment,e),Kl=r(e),Ze=u(e,"P",{"data-svelte-h":!0}),w(Ze)!=="svelte-1yex5cv"&&(Ze.textContent=ys),Ol=r(e),$e=u(e,"OL",{"data-svelte-h":!0}),w($e)!=="svelte-v6m4il"&&($e.innerHTML=Ms),et=r(e),h(_e.$$.fragment,e),lt=r(e),h(S.$$.fragment,e),tt=r(e),je=u(e,"P",{"data-svelte-h":!0}),w(je)!=="svelte-t2k8zx"&&(je.innerHTML=bs),st=r(e),Ge=u(e,"P",{"data-svelte-h":!0}),w(Ge)!=="svelte-1pvshwg"&&(Ge.innerHTML=gs),it=r(e),ve=u(e,"P",{"data-svelte-h":!0}),w(ve)!=="svelte-18ibybh"&&(ve.innerHTML=ws),nt=r(e),h(ke.$$.fragment,e),at=r(e),We=u(e,"P",{"data-svelte-h":!0}),w(We)!=="svelte-42cttl"&&(We.innerHTML=Js),ot=r(e),h(Be.$$.fragment,e),ft=r(e),Re=u(e,"P",{"data-svelte-h":!0}),w(Re)!=="svelte-1easxua"&&(Re.innerHTML=Us),rt=r(e),h(xe.$$.fragment,e),pt=r(e),Ce=u(e,"P",{"data-svelte-h":!0}),w(Ce)!=="svelte-71tdpy"&&(Ce.innerHTML=Ts),ct=r(e),h(Ie.$$.fragment,e),mt=r(e),Xe=u(e,"P",{"data-svelte-h":!0}),w(Xe)!=="svelte-ldczyw"&&(Xe.innerHTML=Zs),ut=r(e),h(Ye.$$.fragment,e),dt=r(e),Ve=u(e,"P",{"data-svelte-h":!0}),w(Ve)!=="svelte-bgsohb"&&(Ve.innerHTML=$s),ht=r(e),h(N.$$.fragment,e),yt=r(e),Fe=u(e,"P",{"data-svelte-h":!0}),w(Fe)!=="svelte-7cjy1z"&&(Fe.innerHTML=_s),Mt=r(e),h(Se.$$.fragment,e),bt=r(e),Ne=u(e,"P",{"data-svelte-h":!0}),w(Ne)!=="svelte-mgaprw"&&(Ne.textContent=js),gt=r(e),h(He.$$.fragment,e),wt=r(e),h(Le.$$.fragment,e),Jt=r(e),Ee=u(e,"P",{"data-svelte-h":!0}),w(Ee)!=="svelte-v6abd8"&&(Ee.innerHTML=Gs),Ut=r(e),Qe=u(e,"P",{"data-svelte-h":!0}),w(Qe)!=="svelte-h4okww"&&(Qe.textContent=vs),Tt=r(e),h(H.$$.fragment,e),Zt=r(e),ze=u(e,"P",{"data-svelte-h":!0}),w(ze)!=="svelte-3nz3gm"&&(ze.innerHTML=ks),$t=r(e),h(L.$$.fragment,e),_t=r(e),h(De.$$.fragment,e),jt=r(e),qe=u(e,"P",{"data-svelte-h":!0}),w(qe)!=="svelte-1ymqt5e"&&(qe.innerHTML=Ws),Gt=r(e),Pe=u(e,"P",{"data-svelte-h":!0}),w(Pe)!=="svelte-5d71tq"&&(Pe.innerHTML=Bs),vt=r(e),Ae=u(e,"P",{"data-svelte-h":!0}),w(Ae)!=="svelte-1qs3hmf"&&(Ae.innerHTML=Rs),kt=r(e),Ke=u(e,"P",{"data-svelte-h":!0}),w(Ke)!=="svelte-71at32"&&(Ke.innerHTML=xs),Wt=r(e),h(E.$$.fragment,e),Bt=r(e),h(Oe.$$.fragment,e),Rt=r(e),h(Q.$$.fragment,e),xt=r(e),el=u(e,"P",{"data-svelte-h":!0}),w(el)!=="svelte-q37tu5"&&(el.innerHTML=Cs),Ct=r(e),h(ll.$$.fragment,e),It=r(e),tl=u(e,"P",{"data-svelte-h":!0}),w(tl)!=="svelte-15leuyd"&&(tl.innerHTML=Is),Xt=r(e),h(sl.$$.fragment,e),Yt=r(e),h(il.$$.fragment,e),Vt=r(e),dl=u(e,"P",{}),hl(dl).forEach(s),this.h()},h(){yl(t,"name","hf:doc:metadata"),yl(t,"content",bi),yl(X,"class","flex justify-center"),yl(V,"class","flex flex-row gap-4"),yl(F,"class","flex justify-center")},m(e,l){v(document.head,t),n(e,c,l),n(e,i,l),n(e,p,l),y(a,e,l),n(e,o,l),y(J,e,l),n(e,U,l),n(e,_,l),n(e,Z,l),n(e,j,l),n(e,bl,l),y(z,e,l),n(e,gl,l),n(e,D,l),n(e,wl,l),y(q,e,l),n(e,Jl,l),y(C,e,l),n(e,Ul,l),n(e,P,l),n(e,Tl,l),n(e,A,l),n(e,Zl,l),y(K,e,l),n(e,$l,l),n(e,O,l),n(e,_l,l),n(e,ee,l),n(e,jl,l),y(I,e,l),n(e,Gl,l),y(le,e,l),n(e,vl,l),n(e,te,l),n(e,kl,l),n(e,se,l),n(e,Wl,l),y(ie,e,l),n(e,Bl,l),n(e,X,l),n(e,Rl,l),y(ne,e,l),n(e,xl,l),y(Y,e,l),n(e,Cl,l),n(e,ae,l),n(e,Il,l),n(e,oe,l),n(e,Xl,l),y(fe,e,l),n(e,Yl,l),y(re,e,l),n(e,Vl,l),n(e,pe,l),n(e,Fl,l),y(ce,e,l),n(e,Sl,l),n(e,me,l),n(e,Nl,l),n(e,V,l),n(e,Hl,l),n(e,ue,l),n(e,Ll,l),y(de,e,l),n(e,El,l),n(e,he,l),n(e,Ql,l),n(e,G,l),v(G,ol),v(G,St),v(G,ye),v(ye,fl),v(ye,Nt),y(Me,ye,null),v(G,Ht),v(G,rl),v(G,Lt),v(G,be),v(be,pl),v(be,Et),y(ge,be,null),v(G,Qt),v(G,cl),n(e,zl,l),y(we,e,l),n(e,Dl,l),n(e,Je,l),n(e,ql,l),n(e,F,l),n(e,Pl,l),n(e,Ue,l),n(e,Al,l),y(Te,e,l),n(e,Kl,l),n(e,Ze,l),n(e,Ol,l),n(e,$e,l),n(e,et,l),y(_e,e,l),n(e,lt,l),y(S,e,l),n(e,tt,l),n(e,je,l),n(e,st,l),n(e,Ge,l),n(e,it,l),n(e,ve,l),n(e,nt,l),y(ke,e,l),n(e,at,l),n(e,We,l),n(e,ot,l),y(Be,e,l),n(e,ft,l),n(e,Re,l),n(e,rt,l),y(xe,e,l),n(e,pt,l),n(e,Ce,l),n(e,ct,l),y(Ie,e,l),n(e,mt,l),n(e,Xe,l),n(e,ut,l),y(Ye,e,l),n(e,dt,l),n(e,Ve,l),n(e,ht,l),y(N,e,l),n(e,yt,l),n(e,Fe,l),n(e,Mt,l),y(Se,e,l),n(e,bt,l),n(e,Ne,l),n(e,gt,l),y(He,e,l),n(e,wt,l),y(Le,e,l),n(e,Jt,l),n(e,Ee,l),n(e,Ut,l),n(e,Qe,l),n(e,Tt,l),y(H,e,l),n(e,Zt,l),n(e,ze,l),n(e,$t,l),y(L,e,l),n(e,_t,l),y(De,e,l),n(e,jt,l),n(e,qe,l),n(e,Gt,l),n(e,Pe,l),n(e,vt,l),n(e,Ae,l),n(e,kt,l),n(e,Ke,l),n(e,Wt,l),y(E,e,l),n(e,Bt,l),y(Oe,e,l),n(e,Rt,l),y(Q,e,l),n(e,xt,l),n(e,el,l),n(e,Ct,l),y(ll,e,l),n(e,It,l),n(e,tl,l),n(e,Xt,l),y(sl,e,l),n(e,Yt,l),y(il,e,l),n(e,Vt,l),n(e,dl,l),Ft=!0},p(e,[l]){const B={};l&2&&(B.$$scope={dirty:l,ctx:e}),C.$set(B);const nl={};l&2&&(nl.$$scope={dirty:l,ctx:e}),I.$set(nl);const al={};l&2&&(al.$$scope={dirty:l,ctx:e}),Y.$set(al);const Xs={};l&2&&(Xs.$$scope={dirty:l,ctx:e}),S.$set(Xs);const Ys={};l&2&&(Ys.$$scope={dirty:l,ctx:e}),N.$set(Ys);const Vs={};l&2&&(Vs.$$scope={dirty:l,ctx:e}),H.$set(Vs);const Fs={};l&2&&(Fs.$$scope={dirty:l,ctx:e}),L.$set(Fs);const Ss={};l&2&&(Ss.$$scope={dirty:l,ctx:e}),E.$set(Ss);const Ns={};l&2&&(Ns.$$scope={dirty:l,ctx:e}),Q.$set(Ns)},i(e){Ft||(M(a.$$.fragment,e),M(J.$$.fragment,e),M(z.$$.fragment,e),M(q.$$.fragment,e),M(C.$$.fragment,e),M(K.$$.fragment,e),M(I.$$.fragment,e),M(le.$$.fragment,e),M(ie.$$.fragment,e),M(ne.$$.fragment,e),M(Y.$$.fragment,e),M(fe.$$.fragment,e),M(re.$$.fragment,e),M(ce.$$.fragment,e),M(de.$$.fragment,e),M(Me.$$.fragment,e),M(ge.$$.fragment,e),M(we.$$.fragment,e),M(Te.$$.fragment,e),M(_e.$$.fragment,e),M(S.$$.fragment,e),M(ke.$$.fragment,e),M(Be.$$.fragment,e),M(xe.$$.fragment,e),M(Ie.$$.fragment,e),M(Ye.$$.fragment,e),M(N.$$.fragment,e),M(Se.$$.fragment,e),M(He.$$.fragment,e),M(Le.$$.fragment,e),M(H.$$.fragment,e),M(L.$$.fragment,e),M(De.$$.fragment,e),M(E.$$.fragment,e),M(Oe.$$.fragment,e),M(Q.$$.fragment,e),M(ll.$$.fragment,e),M(sl.$$.fragment,e),M(il.$$.fragment,e),Ft=!0)},o(e){b(a.$$.fragment,e),b(J.$$.fragment,e),b(z.$$.fragment,e),b(q.$$.fragment,e),b(C.$$.fragment,e),b(K.$$.fragment,e),b(I.$$.fragment,e),b(le.$$.fragment,e),b(ie.$$.fragment,e),b(ne.$$.fragment,e),b(Y.$$.fragment,e),b(fe.$$.fragment,e),b(re.$$.fragment,e),b(ce.$$.fragment,e),b(de.$$.fragment,e),b(Me.$$.fragment,e),b(ge.$$.fragment,e),b(we.$$.fragment,e),b(Te.$$.fragment,e),b(_e.$$.fragment,e),b(S.$$.fragment,e),b(ke.$$.fragment,e),b(Be.$$.fragment,e),b(xe.$$.fragment,e),b(Ie.$$.fragment,e),b(Ye.$$.fragment,e),b(N.$$.fragment,e),b(Se.$$.fragment,e),b(He.$$.fragment,e),b(Le.$$.fragment,e),b(H.$$.fragment,e),b(L.$$.fragment,e),b(De.$$.fragment,e),b(E.$$.fragment,e),b(Oe.$$.fragment,e),b(Q.$$.fragment,e),b(ll.$$.fragment,e),b(sl.$$.fragment,e),b(il.$$.fragment,e),Ft=!1},d(e){e&&(s(c),s(i),s(p),s(o),s(U),s(_),s(Z),s(j),s(bl),s(gl),s(D),s(wl),s(Jl),s(Ul),s(P),s(Tl),s(A),s(Zl),s($l),s(O),s(_l),s(ee),s(jl),s(Gl),s(vl),s(te),s(kl),s(se),s(Wl),s(Bl),s(X),s(Rl),s(xl),s(Cl),s(ae),s(Il),s(oe),s(Xl),s(Yl),s(Vl),s(pe),s(Fl),s(Sl),s(me),s(Nl),s(V),s(Hl),s(ue),s(Ll),s(El),s(he),s(Ql),s(G),s(zl),s(Dl),s(Je),s(ql),s(F),s(Pl),s(Ue),s(Al),s(Kl),s(Ze),s(Ol),s($e),s(et),s(lt),s(tt),s(je),s(st),s(Ge),s(it),s(ve),s(nt),s(at),s(We),s(ot),s(ft),s(Re),s(rt),s(pt),s(Ce),s(ct),s(mt),s(Xe),s(ut),s(dt),s(Ve),s(ht),s(yt),s(Fe),s(Mt),s(bt),s(Ne),s(gt),s(wt),s(Jt),s(Ee),s(Ut),s(Qe),s(Tt),s(Zt),s(ze),s($t),s(_t),s(jt),s(qe),s(Gt),s(Pe),s(vt),s(Ae),s(kt),s(Ke),s(Wt),s(Bt),s(Rt),s(xt),s(el),s(Ct),s(It),s(tl),s(Xt),s(Yt),s(Vt),s(dl)),s(t),g(a,e),g(J,e),g(z,e),g(q,e),g(C,e),g(K,e),g(I,e),g(le,e),g(ie,e),g(ne,e),g(Y,e),g(fe,e),g(re,e),g(ce,e),g(de,e),g(Me),g(ge),g(we,e),g(Te,e),g(_e,e),g(S,e),g(ke,e),g(Be,e),g(xe,e),g(Ie,e),g(Ye,e),g(N,e),g(Se,e),g(He,e),g(Le,e),g(H,e),g(L,e),g(De,e),g(E,e),g(Oe,e),g(Q,e),g(ll,e),g(sl,e),g(il,e)}}}const bi='{"title":"Model files and layouts","local":"model-files-and-layouts","sections":[{"title":"Files","local":"files","sections":[{"title":"safetensors","local":"safetensors","sections":[{"title":"LoRA files","local":"lora-files","sections":[],"depth":4}],"depth":3},{"title":"ckpt","local":"ckpt","sections":[],"depth":3}],"depth":2},{"title":"Storage layout","local":"storage-layout","sections":[{"title":"Diffusers-multifolder","local":"diffusers-multifolder","sections":[],"depth":3},{"title":"Single-file","local":"single-file","sections":[],"depth":3},{"title":"DDUF","local":"dduf","sections":[],"depth":3}],"depth":2},{"title":"Single-file layout usage","local":"single-file-layout-usage","sections":[{"title":"Load a pipeline or model","local":"load-a-pipeline-or-model","sections":[],"depth":3},{"title":"Customize configuration options","local":"customize-configuration-options","sections":[],"depth":3},{"title":"Local files","local":"local-files","sections":[{"title":"Local files without symlink","local":"local-files-without-symlink","sections":[],"depth":4}],"depth":3}],"depth":2}],"depth":1}';function gi(T){return Ls(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ji extends Es{constructor(t){super(),Qs(this,t,gi,Mi,Hs,{})}}export{ji as component};
