import{s as zs,o as Qs,n as W}from"../chunks/scheduler.8c3d61f6.js";import{S as Ds,i as qs,g as u,s as f,r as h,A as Ps,h as m,f as s,c as r,j as Ml,u as M,x as d,k as yl,y as v,a as i,v as y,d as b,t as g,w}from"../chunks/index.da70eac4.js";import{T as ml}from"../chunks/Tip.1d9b8c37.js";import{C as $}from"../chunks/CodeBlock.a9c4becf.js";import{D as As}from"../chunks/DocNotebookDropdown.48852948.js";import{H as k,E as Ks}from"../chunks/getInferenceSnippets.725ed3d4.js";import{H as bl,a as R}from"../chunks/HfOption.6ab18950.js";function Os(U){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=u("p"),t.innerHTML=c},l(n){t=m(n,"P",{"data-svelte-h":!0}),d(t)!=="svelte-sebmc7"&&(t.innerHTML=c)},m(n,p){i(n,t,p)},p:W,d(n){n&&s(t)}}}function en(U){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.',n,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=u("p"),t.innerHTML=c,n=f(),h(p.$$.fragment)},l(o){t=m(o,"P",{"data-svelte-h":!0}),d(t)!=="svelte-1sxvo4h"&&(t.innerHTML=c),n=r(o),M(p.$$.fragment,o)},m(o,J){i(o,t,J),i(o,n,J),y(p,o,J),a=!0},p:W,i(o){a||(b(p.$$.fragment,o),a=!0)},o(o){g(p.$$.fragment,o),a=!1},d(o){o&&(s(t),s(n)),w(p,o)}}}function ln(U){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.',n,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=u("p"),t.innerHTML=c,n=f(),h(p.$$.fragment)},l(o){t=m(o,"P",{"data-svelte-h":!0}),d(t)!=="svelte-gkgkgy"&&(t.innerHTML=c),n=r(o),M(p.$$.fragment,o)},m(o,J){i(o,t,J),i(o,n,J),y(p,o,J),a=!0},p:W,i(o){a||(b(p.$$.fragment,o),a=!0)},o(o){g(p.$$.fragment,o),a=!1},d(o){o&&(s(t),s(n)),w(p,o)}}}function tn(U){let t,c,n,p;return t=new R({props:{id:"safetensors",option:"multifolder",$$slots:{default:[en]},$$scope:{ctx:U}}}),n=new R({props:{id:"safetensors",option:"single file",$$slots:{default:[ln]},$$scope:{ctx:U}}}),{c(){h(t.$$.fragment),c=f(),h(n.$$.fragment)},l(a){M(t.$$.fragment,a),c=r(a),M(n.$$.fragment,a)},m(a,o){y(t,a,o),i(a,c,o),y(n,a,o),p=!0},p(a,o){const J={};o&2&&(J.$$scope={dirty:o,ctx:a}),t.$set(J);const T={};o&2&&(T.$$scope={dirty:o,ctx:a}),n.$set(T)},i(a){p||(b(t.$$.fragment,a),b(n.$$.fragment,a),p=!0)},o(a){g(t.$$.fragment,a),g(n.$$.fragment,a),p=!1},d(a){a&&s(c),w(t,a),w(n,a)}}}function sn(U){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=u("p"),t.textContent=c},l(n){t=m(n,"P",{"data-svelte-h":!0}),d(t)!=="svelte-1k1da22"&&(t.textContent=c)},m(n,p){i(n,t,p)},p:W,d(n){n&&s(t)}}}function nn(U){let t,c="DDUF is an experimental file format and APIs related to it can change in the future.";return{c(){t=u("p"),t.textContent=c},l(n){t=m(n,"P",{"data-svelte-h":!0}),d(t)!=="svelte-1oo2wy9"&&(t.textContent=c)},m(n,p){i(n,t,p)},p:W,d(n){n&&s(t)}}}function an(U){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(){h(t.$$.fragment)},l(n){M(t.$$.fragment,n)},m(n,p){y(t,n,p),c=!0},p:W,i(n){c||(b(t.$$.fragment,n),c=!0)},o(n){g(t.$$.fragment,n),c=!1},d(n){w(t,n)}}}function on(U){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(){h(t.$$.fragment)},l(n){M(t.$$.fragment,n)},m(n,p){y(t,n,p),c=!0},p:W,i(n){c||(b(t.$$.fragment,n),c=!0)},o(n){g(t.$$.fragment,n),c=!1},d(n){w(t,n)}}}function fn(U){let t,c,n,p;return t=new R({props:{id:"pipeline-model",option:"pipeline",$$slots:{default:[an]},$$scope:{ctx:U}}}),n=new R({props:{id:"pipeline-model",option:"model",$$slots:{default:[on]},$$scope:{ctx:U}}}),{c(){h(t.$$.fragment),c=f(),h(n.$$.fragment)},l(a){M(t.$$.fragment,a),c=r(a),M(n.$$.fragment,a)},m(a,o){y(t,a,o),i(a,c,o),y(n,a,o),p=!0},p(a,o){const J={};o&2&&(J.$$scope={dirty:o,ctx:a}),t.$set(J);const T={};o&2&&(T.$$scope={dirty:o,ctx:a}),n.$set(T)},i(a){p||(b(t.$$.fragment,a),b(n.$$.fragment,a),p=!0)},o(a){g(t.$$.fragment,a),g(n.$$.fragment,a),p=!1},d(a){a&&s(c),w(t,a),w(n,a)}}}function rn(U){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=u("p"),t.innerHTML=c},l(n){t=m(n,"P",{"data-svelte-h":!0}),d(t)!=="svelte-tlwse4"&&(t.innerHTML=c)},m(n,p){i(n,t,p)},p:W,d(n){n&&s(t)}}}function pn(U){let t,c,n,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,T,_='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.',x;return t=new ml({props:{warning:!1,$$slots:{default:[rn]},$$scope:{ctx:U}}}),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(){h(t.$$.fragment),c=f(),n=u("p"),n.innerHTML=p,a=f(),h(o.$$.fragment),J=f(),T=u("p"),T.innerHTML=_},l(Z){M(t.$$.fragment,Z),c=r(Z),n=m(Z,"P",{"data-svelte-h":!0}),d(n)!=="svelte-kupwes"&&(n.innerHTML=p),a=r(Z),M(o.$$.fragment,Z),J=r(Z),T=m(Z,"P",{"data-svelte-h":!0}),d(T)!=="svelte-vgyhxu"&&(T.innerHTML=_)},m(Z,j){y(t,Z,j),i(Z,c,j),i(Z,n,j),i(Z,a,j),y(o,Z,j),i(Z,J,j),i(Z,T,j),x=!0},p(Z,j){const dl={};j&2&&(dl.$$scope={dirty:j,ctx:Z}),t.$set(dl)},i(Z){x||(b(t.$$.fragment,Z),b(o.$$.fragment,Z),x=!0)},o(Z){g(t.$$.fragment,Z),g(o.$$.fragment,Z),x=!1},d(Z){Z&&(s(c),s(n),s(a),s(J),s(T)),w(t,Z),w(o,Z)}}}function cn(U){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.",n,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=u("p"),t.innerHTML=c,n=f(),p=u("p"),p.innerHTML=a},l(o){t=m(o,"P",{"data-svelte-h":!0}),d(t)!=="svelte-chnuen"&&(t.innerHTML=c),n=r(o),p=m(o,"P",{"data-svelte-h":!0}),d(p)!=="svelte-qhvpj"&&(p.innerHTML=a)},m(o,J){i(o,t,J),i(o,n,J),i(o,p,J)},p:W,d(o){o&&(s(t),s(n),s(p))}}}function un(U){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.',n,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:[cn]},$$scope:{ctx:U}}}),{c(){t=u("p"),t.innerHTML=c,n=f(),h(p.$$.fragment),a=f(),h(o.$$.fragment)},l(T){t=m(T,"P",{"data-svelte-h":!0}),d(t)!=="svelte-1hpqwop"&&(t.innerHTML=c),n=r(T),M(p.$$.fragment,T),a=r(T),M(o.$$.fragment,T)},m(T,_){i(T,t,_),i(T,n,_),y(p,T,_),i(T,a,_),y(o,T,_),J=!0},p(T,_){const x={};_&2&&(x.$$scope={dirty:_,ctx:T}),o.$set(x)},i(T){J||(b(p.$$.fragment,T),b(o.$$.fragment,T),J=!0)},o(T){g(p.$$.fragment,T),g(o.$$.fragment,T),J=!1},d(T){T&&(s(t),s(n),s(a)),w(p,T),w(o,T)}}}function mn(U){let t,c,n,p;return t=new R({props:{id:"config-file",option:"Hub configuration file",$$slots:{default:[pn]},$$scope:{ctx:U}}}),n=new R({props:{id:"config-file",option:"original configuration file",$$slots:{default:[un]},$$scope:{ctx:U}}}),{c(){h(t.$$.fragment),c=f(),h(n.$$.fragment)},l(a){M(t.$$.fragment,a),c=r(a),M(n.$$.fragment,a)},m(a,o){y(t,a,o),i(a,c,o),y(n,a,o),p=!0},p(a,o){const J={};o&2&&(J.$$scope={dirty:o,ctx:a}),t.$set(J);const T={};o&2&&(T.$$scope={dirty:o,ctx:a}),n.$set(T)},i(a){p||(b(t.$$.fragment,a),b(n.$$.fragment,a),p=!0)},o(a){g(t.$$.fragment,a),g(n.$$.fragment,a),p=!1},d(a){a&&s(c),w(t,a),w(n,a)}}}function dn(U){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.',n,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=u("p"),t.innerHTML=c,n=f(),h(p.$$.fragment)},l(o){t=m(o,"P",{"data-svelte-h":!0}),d(t)!=="svelte-1kqnfmq"&&(t.innerHTML=c),n=r(o),M(p.$$.fragment,o)},m(o,J){i(o,t,J),i(o,n,J),y(p,o,J),a=!0},p:W,i(o){a||(b(p.$$.fragment,o),a=!0)},o(o){g(p.$$.fragment,o),a=!1},d(o){o&&(s(t),s(n)),w(p,o)}}}function hn(U){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.',n,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=u("p"),t.innerHTML=c,n=f(),h(p.$$.fragment)},l(o){t=m(o,"P",{"data-svelte-h":!0}),d(t)!=="svelte-voyebw"&&(t.innerHTML=c),n=r(o),M(p.$$.fragment,o)},m(o,J){i(o,t,J),i(o,n,J),y(p,o,J),a=!0},p:W,i(o){a||(b(p.$$.fragment,o),a=!0)},o(o){g(p.$$.fragment,o),a=!1},d(o){o&&(s(t),s(n)),w(p,o)}}}function Mn(U){let t,c,n,p;return t=new R({props:{id:"override",option:"pipeline",$$slots:{default:[dn]},$$scope:{ctx:U}}}),n=new R({props:{id:"override",option:"model",$$slots:{default:[hn]},$$scope:{ctx:U}}}),{c(){h(t.$$.fragment),c=f(),h(n.$$.fragment)},l(a){M(t.$$.fragment,a),c=r(a),M(n.$$.fragment,a)},m(a,o){y(t,a,o),i(a,c,o),y(n,a,o),p=!0},p(a,o){const J={};o&2&&(J.$$scope={dirty:o,ctx:a}),t.$set(J);const T={};o&2&&(T.$$scope={dirty:o,ctx:a}),n.$set(T)},i(a){p||(b(t.$$.fragment,a),b(n.$$.fragment,a),p=!0)},o(a){g(t.$$.fragment,a),g(n.$$.fragment,a),p=!1},d(a){a&&s(c),w(t,a),w(n,a)}}}function yn(U){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(){h(t.$$.fragment)},l(n){M(t.$$.fragment,n)},m(n,p){y(t,n,p),c=!0},p:W,i(n){c||(b(t.$$.fragment,n),c=!0)},o(n){g(t.$$.fragment,n),c=!1},d(n){w(t,n)}}}function bn(U){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(){h(t.$$.fragment)},l(n){M(t.$$.fragment,n)},m(n,p){y(t,n,p),c=!0},p:W,i(n){c||(b(t.$$.fragment,n),c=!0)},o(n){g(t.$$.fragment,n),c=!1},d(n){w(t,n)}}}function gn(U){let t,c,n,p;return t=new R({props:{id:"local",option:"Hub cache directory",$$slots:{default:[yn]},$$scope:{ctx:U}}}),n=new R({props:{id:"local",option:"specific local directory",$$slots:{default:[bn]},$$scope:{ctx:U}}}),{c(){h(t.$$.fragment),c=f(),h(n.$$.fragment)},l(a){M(t.$$.fragment,a),c=r(a),M(n.$$.fragment,a)},m(a,o){y(t,a,o),i(a,c,o),y(n,a,o),p=!0},p(a,o){const J={};o&2&&(J.$$scope={dirty:o,ctx:a}),t.$set(J);const T={};o&2&&(T.$$scope={dirty:o,ctx:a}),n.$set(T)},i(a){p||(b(t.$$.fragment,a),b(n.$$.fragment,a),p=!0)},o(a){g(t.$$.fragment,a),g(n.$$.fragment,a),p=!1},d(a){a&&s(c),w(t,a),w(n,a)}}}function wn(U){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=u("p"),t.innerHTML=c},l(n){t=m(n,"P",{"data-svelte-h":!0}),d(t)!=="svelte-1475ajo"&&(t.innerHTML=c)},m(n,p){i(n,t,p)},p:W,d(n){n&&s(t)}}}function Jn(U){let t,c,n,p,a,o,J,T,_,x="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,dl="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.",gl,Q,wl,D,qt='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.',Jl,q,Tl,I,Ul,P,Pt='<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.',Zl,A,At='Make sure you have the <a href="https://hf.co/docs/safetensors" rel="nofollow">Safetensors</a> library installed.',$l,K,_l,O,Kt="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:",jl,ee,Ot='<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>',Gl,C,vl,le,kl,te,es='<a href="../tutorials/using_peft_for_inference">LoRAs</a> are lightweight checkpoints fine-tuned to generate images or video in a specific style. If you are using a checkpoint trained with a Diffusers training script, the LoRA configuration is automatically saved as metadata in a safetensors file. When the safetensors file is loaded, the metadata is parsed to correctly configure the LoRA and avoids missing or incorrect LoRA configurations.',Wl,se,ls="The easiest way to inspect the metadata, if available, is by clicking on the Safetensors logo next to the weights.",Bl,X,ts='<img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/safetensors_lora.png"/>',xl,ne,ss='For LoRAs that aren’t trained with Diffusers, you can still save metadata with the <code>transformer_lora_adapter_metadata</code> and <code>text_encoder_lora_adapter_metadata</code> arguments in <a href="/docs/diffusers/main/en/api/loaders/lora#diffusers.loaders.FluxLoraLoaderMixin.save_lora_weights">save_lora_weights()</a> as long as it is a safetensors file.',Rl,ie,Il,ae,Cl,Y,Xl,oe,ns='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.',Yl,fe,is='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.',Vl,re,Fl,pe,Nl,ce,as="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.",Sl,ue,Hl,me,os="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.",Ll,V,fs='<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>',El,de,rs='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.',zl,he,Ql,Me,ps="Benefits of using the Diffusers-multifolder layout include:",Dl,G,fl,cs="<p>Faster to load each component file individually or in parallel.</p>",Ht,ye,rl,us='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.',Lt,be,Et,pl,ms='<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>',zt,ge,cl,ds="Flexibility to replace a component in the model with a newer or better version.",Qt,we,Dt,ul,hs='<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>',ql,Je,Pl,Te,Ms="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.",Al,F,ys='<img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/single-file-layout.png"/>',Kl,Ue,bs='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.',Ol,Ze,et,$e,gs="Benefits of using a single-file layout include:",lt,_e,ws='<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>',tt,je,st,N,nt,Ge,Js="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.",it,ve,Ts='Learn more details about DDUF on the Hugging Face Hub <a href="https://huggingface.co/docs/hub/dduf" rel="nofollow">documentation</a>.',at,ke,Us='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>.',ot,We,ft,Be,Zs='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.',rt,xe,pt,Re,$s='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.',ct,Ie,ut,Ce,_s='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.',mt,Xe,dt,Ye,js='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.',ht,Ve,Mt,Fe,Gs='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.',yt,S,bt,Ne,vs='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.',gt,Se,wt,He,ks="Or you could use a ControlNet model in the pipeline.",Jt,Le,Tt,Ee,Ut,ze,Ws='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.',Zt,Qe,Bs="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).",$t,H,_t,De,xs='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.',jt,L,Gt,qe,vt,Pe,Rs='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.',kt,Ae,Is='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.',Wt,Ke,Cs='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.',Bt,Oe,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.',xt,E,Rt,el,It,z,Ct,ll,Ys='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.',Xt,tl,Yt,sl,Vs="Then you can pass the local paths to the <code>pretrained_model_link_or_path</code> and <code>config</code> parameters.",Vt,nl,Ft,il,Nt,hl,St;return a=new k({props:{title:"Model files and layouts",local:"model-files-and-layouts",headingTag:"h1"}}),J=new As({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"}]}}),Q=new k({props:{title:"Files",local:"files",headingTag:"h2"}}),q=new k({props:{title:"safetensors",local:"safetensors",headingTag:"h3"}}),I=new ml({props:{warning:!1,$$slots:{default:[Os]},$$scope:{ctx:U}}}),K=new $({props:{code:"IXBpcCUyMGluc3RhbGwlMjBzYWZldGVuc29ycw==",highlighted:"!pip install safetensors",wrap:!1}}),C=new bl({props:{id:"safetensors",options:["multifolder","single file"],$$slots:{default:[tn]},$$scope:{ctx:U}}}),le=new k({props:{title:"LoRAs",local:"loras",headingTag:"h4"}}),ie=new $({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwRmx1eFBpcGVsaW5lJTBBJTBBcGlwZWxpbmUlMjAlM0QlMjBGbHV4UGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMmJsYWNrLWZvcmVzdC1sYWJzJTJGRkxVWC4xLWRldiUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guYmZsb2F0MTYlMEEpLnRvKCUyMmN1ZGElMjIpJTBBcGlwZWxpbmUubG9hZF9sb3JhX3dlaWdodHMoJTIybGlub3l0cyUyRnlhcm5fYXJ0X0ZsdXhfTG9SQSUyMiklMEFwaXBlbGluZS5zYXZlX2xvcmFfd2VpZ2h0cyglMEElMjAlMjAlMjAlMjB0cmFuc2Zvcm1lcl9sb3JhX2FkYXB0ZXJfbWV0YWRhdGElM0QlN0IlMjJyJTIyJTNBJTIwMTYlMkMlMjAlMjJsb3JhX2FscGhhJTIyJTNBJTIwMTYlN0QlMkMlMEElMjAlMjAlMjAlMjB0ZXh0X2VuY29kZXJfbG9yYV9hZGFwdGVyX21ldGFkYXRhJTNEJTdCJTIyciUyMiUzQSUyMDglMkMlMjAlMjJsb3JhX2FscGhhJTIyJTNBJTIwOCU3RCUwQSk=",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> FluxPipeline

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