import{s as ui,o as mi,n as j}from"../chunks/scheduler.8c3d61f6.js";import{S as ci,i as di,g as m,s as f,r as h,A as hi,h as c,f as s,c as r,j as Tt,u as y,x as d,k as _t,y as x,a as n,v as g,d as M,t as b,w}from"../chunks/index.da70eac4.js";import{T as z}from"../chunks/Tip.1d9b8c37.js";import{C as U}from"../chunks/CodeBlock.a9c4becf.js";import{D as yi}from"../chunks/DocNotebookDropdown.48852948.js";import{H as G,E as gi}from"../chunks/getInferenceSnippets.cd165132.js";import{H as Ut,a as B}from"../chunks/HfOption.6c3b4e77.js";function Mi(T){let l,u='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(){l=m("p"),l.innerHTML=u},l(i){l=c(i,"P",{"data-svelte-h":!0}),d(l)!=="svelte-sebmc7"&&(l.innerHTML=u)},m(i,p){n(i,l,p)},p:j,d(i){i&&s(l)}}}function bi(T){let l,u='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 U({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(){l=m("p"),l.innerHTML=u,i=f(),h(p.$$.fragment)},l(o){l=c(o,"P",{"data-svelte-h":!0}),d(l)!=="svelte-1sxvo4h"&&(l.innerHTML=u),i=r(o),y(p.$$.fragment,o)},m(o,$){n(o,l,$),n(o,i,$),g(p,o,$),a=!0},p:j,i(o){a||(M(p.$$.fragment,o),a=!0)},o(o){b(p.$$.fragment,o),a=!1},d(o){o&&(s(l),s(i)),w(p,o)}}}function wi(T){let l,u='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 U({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(){l=m("p"),l.innerHTML=u,i=f(),h(p.$$.fragment)},l(o){l=c(o,"P",{"data-svelte-h":!0}),d(l)!=="svelte-gkgkgy"&&(l.innerHTML=u),i=r(o),y(p.$$.fragment,o)},m(o,$){n(o,l,$),n(o,i,$),g(p,o,$),a=!0},p:j,i(o){a||(M(p.$$.fragment,o),a=!0)},o(o){b(p.$$.fragment,o),a=!1},d(o){o&&(s(l),s(i)),w(p,o)}}}function $i(T){let l,u,i,p;return l=new B({props:{id:"safetensors",option:"multifolder",$$slots:{default:[bi]},$$scope:{ctx:T}}}),i=new B({props:{id:"safetensors",option:"single file",$$slots:{default:[wi]},$$scope:{ctx:T}}}),{c(){h(l.$$.fragment),u=f(),h(i.$$.fragment)},l(a){y(l.$$.fragment,a),u=r(a),y(i.$$.fragment,a)},m(a,o){g(l,a,o),n(a,u,o),g(i,a,o),p=!0},p(a,o){const $={};o&2&&($.$$scope={dirty:o,ctx:a}),l.$set($);const J={};o&2&&(J.$$scope={dirty:o,ctx:a}),i.$set(J)},i(a){p||(M(l.$$.fragment,a),M(i.$$.fragment,a),p=!0)},o(a){b(l.$$.fragment,a),b(i.$$.fragment,a),p=!1},d(a){a&&s(u),w(l,a),w(i,a)}}}function Ji(T){let l,u="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(){l=m("p"),l.textContent=u},l(i){l=c(i,"P",{"data-svelte-h":!0}),d(l)!=="svelte-1k1da22"&&(l.textContent=u)},m(i,p){n(i,l,p)},p:j,d(i){i&&s(l)}}}function Ti(T){let l,u="DDUF is an experimental file format and APIs related to it can change in the future.";return{c(){l=m("p"),l.textContent=u},l(i){l=c(i,"P",{"data-svelte-h":!0}),d(l)!=="svelte-1oo2wy9"&&(l.textContent=u)},m(i,p){n(i,l,p)},p:j,d(i){i&&s(l)}}}function _i(T){let l,u="Packaging and loading quantized checkpoints in the DDUF format is supported as long as they respect the multi-folder structure.";return{c(){l=m("p"),l.textContent=u},l(i){l=c(i,"P",{"data-svelte-h":!0}),d(l)!=="svelte-1fmg6cu"&&(l.textContent=u)},m(i,p){n(i,l,p)},p:j,d(i){i&&s(l)}}}function Ui(T){let l,u="Scripts that have ”<code>to_diffusers</code>” appended at the end mean they convert a model to the Diffusers-multifolder layout. Each script has their own specific set of arguments for configuring the conversion, so make sure you check what arguments are available!";return{c(){l=m("p"),l.innerHTML=u},l(i){l=c(i,"P",{"data-svelte-h":!0}),d(l)!=="svelte-1rkueqo"&&(l.innerHTML=u)},m(i,p){n(i,l,p)},p:j,d(i){i&&s(l)}}}function Zi(T){let l,u;return l=new U({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(l.$$.fragment)},l(i){y(l.$$.fragment,i)},m(i,p){g(l,i,p),u=!0},p:j,i(i){u||(M(l.$$.fragment,i),u=!0)},o(i){b(l.$$.fragment,i),u=!1},d(i){w(l,i)}}}function vi(T){let l,u;return l=new U({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(l.$$.fragment)},l(i){y(l.$$.fragment,i)},m(i,p){g(l,i,p),u=!0},p:j,i(i){u||(M(l.$$.fragment,i),u=!0)},o(i){b(l.$$.fragment,i),u=!1},d(i){w(l,i)}}}function ji(T){let l,u,i,p;return l=new B({props:{id:"pipeline-model",option:"pipeline",$$slots:{default:[Zi]},$$scope:{ctx:T}}}),i=new B({props:{id:"pipeline-model",option:"model",$$slots:{default:[vi]},$$scope:{ctx:T}}}),{c(){h(l.$$.fragment),u=f(),h(i.$$.fragment)},l(a){y(l.$$.fragment,a),u=r(a),y(i.$$.fragment,a)},m(a,o){g(l,a,o),n(a,u,o),g(i,a,o),p=!0},p(a,o){const $={};o&2&&($.$$scope={dirty:o,ctx:a}),l.$set($);const J={};o&2&&(J.$$scope={dirty:o,ctx:a}),i.$set(J)},i(a){p||(M(l.$$.fragment,a),M(i.$$.fragment,a),p=!0)},o(a){b(l.$$.fragment,a),b(i.$$.fragment,a),p=!1},d(a){a&&s(u),w(l,a),w(i,a)}}}function Gi(T){let l,u='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(){l=m("p"),l.innerHTML=u},l(i){l=c(i,"P",{"data-svelte-h":!0}),d(l)!=="svelte-tlwse4"&&(l.innerHTML=u)},m(i,p){n(i,l,p)},p:j,d(i){i&&s(l)}}}function ki(T){let l,u,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,Z='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.',C;return l=new z({props:{warning:!1,$$slots:{default:[Gi]},$$scope:{ctx:T}}}),o=new U({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(l.$$.fragment),u=f(),i=m("p"),i.innerHTML=p,a=f(),h(o.$$.fragment),$=f(),J=m("p"),J.innerHTML=Z},l(_){y(l.$$.fragment,_),u=r(_),i=c(_,"P",{"data-svelte-h":!0}),d(i)!=="svelte-kupwes"&&(i.innerHTML=p),a=r(_),y(o.$$.fragment,_),$=r(_),J=c(_,"P",{"data-svelte-h":!0}),d(J)!=="svelte-vgyhxu"&&(J.innerHTML=Z)},m(_,v){g(l,_,v),n(_,u,v),n(_,i,v),n(_,a,v),g(o,_,v),n(_,$,v),n(_,J,v),C=!0},p(_,v){const $t={};v&2&&($t.$$scope={dirty:v,ctx:_}),l.$set($t)},i(_){C||(M(l.$$.fragment,_),M(o.$$.fragment,_),C=!0)},o(_){b(l.$$.fragment,_),b(o.$$.fragment,_),C=!1},d(_){_&&(s(u),s(i),s(a),s($),s(J)),w(l,_),w(o,_)}}}function xi(T){let l,u="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(){l=m("p"),l.innerHTML=u,i=f(),p=m("p"),p.innerHTML=a},l(o){l=c(o,"P",{"data-svelte-h":!0}),d(l)!=="svelte-chnuen"&&(l.innerHTML=u),i=r(o),p=c(o,"P",{"data-svelte-h":!0}),d(p)!=="svelte-qhvpj"&&(p.innerHTML=a)},m(o,$){n(o,l,$),n(o,i,$),n(o,p,$)},p:j,d(o){o&&(s(l),s(i),s(p))}}}function Wi(T){let l,u='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,$;return p=new U({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 z({props:{warning:!1,$$slots:{default:[xi]},$$scope:{ctx:T}}}),{c(){l=m("p"),l.innerHTML=u,i=f(),h(p.$$.fragment),a=f(),h(o.$$.fragment)},l(J){l=c(J,"P",{"data-svelte-h":!0}),d(l)!=="svelte-1hpqwop"&&(l.innerHTML=u),i=r(J),y(p.$$.fragment,J),a=r(J),y(o.$$.fragment,J)},m(J,Z){n(J,l,Z),n(J,i,Z),g(p,J,Z),n(J,a,Z),g(o,J,Z),$=!0},p(J,Z){const C={};Z&2&&(C.$$scope={dirty:Z,ctx:J}),o.$set(C)},i(J){$||(M(p.$$.fragment,J),M(o.$$.fragment,J),$=!0)},o(J){b(p.$$.fragment,J),b(o.$$.fragment,J),$=!1},d(J){J&&(s(l),s(i),s(a)),w(p,J),w(o,J)}}}function Ci(T){let l,u,i,p;return l=new B({props:{id:"config-file",option:"Hub configuration file",$$slots:{default:[ki]},$$scope:{ctx:T}}}),i=new B({props:{id:"config-file",option:"original configuration file",$$slots:{default:[Wi]},$$scope:{ctx:T}}}),{c(){h(l.$$.fragment),u=f(),h(i.$$.fragment)},l(a){y(l.$$.fragment,a),u=r(a),y(i.$$.fragment,a)},m(a,o){g(l,a,o),n(a,u,o),g(i,a,o),p=!0},p(a,o){const $={};o&2&&($.$$scope={dirty:o,ctx:a}),l.$set($);const J={};o&2&&(J.$$scope={dirty:o,ctx:a}),i.$set(J)},i(a){p||(M(l.$$.fragment,a),M(i.$$.fragment,a),p=!0)},o(a){b(l.$$.fragment,a),b(i.$$.fragment,a),p=!1},d(a){a&&s(u),w(l,a),w(i,a)}}}function Bi(T){let l,u='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 U({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(){l=m("p"),l.innerHTML=u,i=f(),h(p.$$.fragment)},l(o){l=c(o,"P",{"data-svelte-h":!0}),d(l)!=="svelte-1kqnfmq"&&(l.innerHTML=u),i=r(o),y(p.$$.fragment,o)},m(o,$){n(o,l,$),n(o,i,$),g(p,o,$),a=!0},p:j,i(o){a||(M(p.$$.fragment,o),a=!0)},o(o){b(p.$$.fragment,o),a=!1},d(o){o&&(s(l),s(i)),w(p,o)}}}function Ri(T){let l,u='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 U({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(){l=m("p"),l.innerHTML=u,i=f(),h(p.$$.fragment)},l(o){l=c(o,"P",{"data-svelte-h":!0}),d(l)!=="svelte-voyebw"&&(l.innerHTML=u),i=r(o),y(p.$$.fragment,o)},m(o,$){n(o,l,$),n(o,i,$),g(p,o,$),a=!0},p:j,i(o){a||(M(p.$$.fragment,o),a=!0)},o(o){b(p.$$.fragment,o),a=!1},d(o){o&&(s(l),s(i)),w(p,o)}}}function Xi(T){let l,u,i,p;return l=new B({props:{id:"override",option:"pipeline",$$slots:{default:[Bi]},$$scope:{ctx:T}}}),i=new B({props:{id:"override",option:"model",$$slots:{default:[Ri]},$$scope:{ctx:T}}}),{c(){h(l.$$.fragment),u=f(),h(i.$$.fragment)},l(a){y(l.$$.fragment,a),u=r(a),y(i.$$.fragment,a)},m(a,o){g(l,a,o),n(a,u,o),g(i,a,o),p=!0},p(a,o){const $={};o&2&&($.$$scope={dirty:o,ctx:a}),l.$set($);const J={};o&2&&(J.$$scope={dirty:o,ctx:a}),i.$set(J)},i(a){p||(M(l.$$.fragment,a),M(i.$$.fragment,a),p=!0)},o(a){b(l.$$.fragment,a),b(i.$$.fragment,a),p=!1},d(a){a&&s(u),w(l,a),w(i,a)}}}function Fi(T){let l,u;return l=new U({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(l.$$.fragment)},l(i){y(l.$$.fragment,i)},m(i,p){g(l,i,p),u=!0},p:j,i(i){u||(M(l.$$.fragment,i),u=!0)},o(i){b(l.$$.fragment,i),u=!1},d(i){w(l,i)}}}function Ii(T){let l,u;return l=new U({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(l.$$.fragment)},l(i){y(l.$$.fragment,i)},m(i,p){g(l,i,p),u=!0},p:j,i(i){u||(M(l.$$.fragment,i),u=!0)},o(i){b(l.$$.fragment,i),u=!1},d(i){w(l,i)}}}function Yi(T){let l,u,i,p;return l=new B({props:{id:"local",option:"Hub cache directory",$$slots:{default:[Fi]},$$scope:{ctx:T}}}),i=new B({props:{id:"local",option:"specific local directory",$$slots:{default:[Ii]},$$scope:{ctx:T}}}),{c(){h(l.$$.fragment),u=f(),h(i.$$.fragment)},l(a){y(l.$$.fragment,a),u=r(a),y(i.$$.fragment,a)},m(a,o){g(l,a,o),n(a,u,o),g(i,a,o),p=!0},p(a,o){const $={};o&2&&($.$$scope={dirty:o,ctx:a}),l.$set($);const J={};o&2&&(J.$$scope={dirty:o,ctx:a}),i.$set(J)},i(a){p||(M(l.$$.fragment,a),M(i.$$.fragment,a),p=!0)},o(a){b(l.$$.fragment,a),b(i.$$.fragment,a),p=!1},d(a){a&&s(u),w(l,a),w(i,a)}}}function Vi(T){let l,u='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(){l=m("p"),l.innerHTML=u},l(i){l=c(i,"P",{"data-svelte-h":!0}),d(l)!=="svelte-1475ajo"&&(l.innerHTML=u)},m(i,p){n(i,l,p)},p:j,d(i){i&&s(l)}}}function Si(T){let l,u,i,p,a,o,$,J,Z,C="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.",_,v,$t="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.",Zt,P,vt,A,rs='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.',jt,K,Gt,R,kt,O,ps='<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.',xt,ee,us='Make sure you have the <a href="https://hf.co/docs/safetensors" rel="nofollow">Safetensors</a> library installed.',Wt,te,Ct,le,ms="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:",Bt,se,cs='<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>',Rt,X,Xt,ie,Ft,ne,ds='<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.',It,ae,hs="The easiest way to inspect the metadata, if available, is by clicking on the Safetensors logo next to the weights.",Yt,F,ys='<img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/safetensors_lora.png"/>',Vt,oe,gs='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.',St,fe,Lt,re,Nt,I,Ht,pe,Ms='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.',Et,ue,bs='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.',Qt,me,qt,ce,Dt,de,ws="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.",zt,he,Pt,ye,$s="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.",At,Y,Js='<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>',Kt,ge,Ts='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.',Ot,Me,el,be,_s="Benefits of using the Diffusers-multifolder layout include:",tl,k,yt,Us="<p>Faster to load each component file individually or in parallel.</p>",ss,we,gt,Zs='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.',is,$e,ns,Mt,vs='<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>',as,Je,bt,js="Flexibility to replace a component in the model with a newer or better version.",os,Te,fs,wt,Gs='<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>',ll,_e,sl,Ue,ks="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.",il,V,xs='<img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/single-file-layout.png"/>',nl,Ze,Ws='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,ve,ol,je,Cs="Benefits of using a single-file layout include:",fl,Ge,Bs='<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>',rl,ke,pl,S,ul,xe,Rs="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.",ml,We,Xs='Learn more details about DDUF on the Hugging Face Hub <a href="https://huggingface.co/docs/hub/dduf" rel="nofollow">documentation</a>.',cl,Ce,Fs='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>.',dl,Be,hl,Re,Is='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.',yl,Xe,gl,L,Ml,Fe,bl,Ie,Ys="Diffusers provides many scripts and methods to convert storage layouts and file formats to enable broader support across the diffusion ecosystem.",wl,Ye,Vs='Take a look at the <a href="https://github.com/huggingface/diffusers/tree/main/scripts" rel="nofollow">diffusers/scripts</a> collection to find a script that fits your conversion needs.',$l,N,Jl,Ve,Ss='For example, to convert a Stable Diffusion XL model stored in Diffusers-multifolder layout to a single-file layout, run the <a href="https://github.com/huggingface/diffusers/blob/main/scripts/convert_diffusers_to_original_sdxl.py" rel="nofollow">convert_diffusers_to_original_sdxl.py</a> script. Provide the path to the model to convert, and the path to save the converted model to. You can optionally specify whether you want to save the model as a safetensors file and whether to save the model in half-precision.',Tl,Se,_l,Le,Ls='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.',Ul,Ne,Zl,He,Ns='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.',vl,Ee,jl,Qe,Hs='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.',Gl,qe,kl,De,Es='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.',xl,H,Wl,ze,Qs='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.',Cl,Pe,Bl,Ae,qs="Or you could use a ControlNet model in the pipeline.",Rl,Ke,Xl,Oe,Fl,et,Ds='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.',Il,tt,zs="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).",Yl,E,Vl,lt,Ps='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.',Sl,Q,Ll,st,Nl,it,As='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.',Hl,nt,Ks='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.',El,at,Os='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.',Ql,ot,ei='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.',ql,q,Dl,ft,zl,D,Pl,rt,ti='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.',Al,pt,Kl,ut,li="Then you can pass the local paths to the <code>pretrained_model_link_or_path</code> and <code>config</code> parameters.",Ol,mt,es,ct,ts,Jt,ls;return a=new G({props:{title:"Model files and layouts",local:"model-files-and-layouts",headingTag:"h1"}}),$=new yi({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"}]}}),P=new G({props:{title:"Files",local:"files",headingTag:"h2"}}),K=new G({props:{title:"safetensors",local:"safetensors",headingTag:"h3"}}),R=new z({props:{warning:!1,$$slots:{default:[Mi]},$$scope:{ctx:T}}}),te=new U({props:{code:"IXBpcCUyMGluc3RhbGwlMjBzYWZldGVuc29ycw==",highlighted:"!pip install safetensors",wrap:!1}}),X=new Ut({props:{id:"safetensors",options:["multifolder","single file"],$$slots:{default:[$i]},$$scope:{ctx:T}}}),ie=new G({props:{title:"LoRAs",local:"loras",headingTag:"h4"}}),fe=new U({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}}),re=new G({props:{title:"ckpt",local:"ckpt",headingTag:"h3"}}),I=new z({props:{warning:!0,$$slots:{default:[Ji]},$$scope:{ctx:T}}}),me=new U({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}}),ce=new G({props:{title:"Storage layout",local:"storage-layout",headingTag:"h2"}}),he=new G({props:{title:"Diffusers-multifolder",local:"diffusers-multifolder",headingTag:"h3"}}),Me=new U({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}}),$e=new U({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwU3RhYmxlRGlmZnVzaW9uWExQaXBlbGluZSUyQyUyMFVOZXQyRENvbmRpdGlvbk1vZGVsJTJDJTIwRXVsZXJEaXNjcmV0ZVNjaGVkdWxlciUwQSUwQSUyMyUyMGRvd25sb2FkJTIwb25lJTIwbW9kZWwlMEFzZHhsX3BpcGVsaW5lJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uWExQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIyc3RhYmlsaXR5YWklMkZzdGFibGUtZGlmZnVzaW9uLXhsLWJhc2UtMS4wJTIyJTJDJTBBJTIwJTIwJTIwJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTJDJTBBJTIwJTIwJTIwJTIwdmFyaWFudCUzRCUyMmZwMTYlMjIlMkMlMEElMjAlMjAlMjAlMjB1c2Vfc2FmZXRlbnNvcnMlM0RUcnVlJTJDJTBBKS50byglMjJjdWRhJTIyKSUwQSUwQSUyMyUyMHN3aXRjaCUyMFVOZXQlMjBmb3IlMjBhbm90aGVyJTIwbW9kZWwlMEF1bmV0JTIwJTNEJTIwVU5ldDJEQ29uZGl0aW9uTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMnN0YWJpbGl0eWFpJTJGc2R4bC10dXJibyUyMiUyQyUwQSUyMCUyMCUyMCUyMHN1YmZvbGRlciUzRCUyMnVuZXQlMjIlMkMlMEElMjAlMjAlMjAlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMkMlMEElMjAlMjAlMjAlMjB2YXJpYW50JTNEJTIyZnAxNiUyMiUyQyUwQSUyMCUyMCUyMCUyMHVzZV9zYWZldGVuc29ycyUzRFRydWUlMEEpJTBBJTIzJTIwcmV1c2UlMjBhbGwlMjB0aGUlMjBzYW1lJTIwY29tcG9uZW50cyUyMGluJTIwbmV3JTIwbW9kZWwlMjBleGNlcHQlMjBmb3IlMjB0aGUlMjBVTmV0JTBBdHVyYm9fcGlwZWxpbmUlMjAlM0QlMjBTdGFibGVEaWZmdXNpb25YTFBpcGVsaW5lLmZyb21fcGlwZSglMEElMjAlMjAlMjAlMjBzZHhsX3BpcGVsaW5lJTJDJTIwdW5ldCUzRHVuZXQlMkMlMEEpLnRvKCUyMmN1ZGElMjIpJTBBdHVyYm9fcGlwZWxpbmUuc2NoZWR1bGVyJTIwJTNEJTIwRXVsZXJEaXNjcmV0ZVNjaGVkdWxlci5mcm9tX2NvbmZpZyglMEElMjAlMjAlMjAlMjB0dXJib19waXBlbGluZS5zY2hlZHVsZXIuY29uZmlnJTJDJTBBJTIwJTIwJTIwJTIwdGltZXN0ZXBfc3BhY2luZyUzRCUyMnRyYWlsaW5nJTIyJTBBKSUwQWltYWdlJTIwJTNEJTIwdHVyYm9fcGlwZWxpbmUoJTBBJTIwJTIwJTIwJTIwJTIyYW4lMjBhc3Ryb25hdXQlMjByaWRpbmclMjBhJTIwdW5pY29ybiUyMG9uJTIwbWFycyUyMiUyQyUwQSUyMCUyMCUyMCUyMG51bV9pbmZlcmVuY2Vfc3RlcHMlM0QxJTJDJTBBJTIwJTIwJTIwJTIwZ3VpZGFuY2Vfc2NhbGUlM0QwLjAlMkMlMEEpLmltYWdlcyU1QjAlNUQlMEFpbWFnZQ==",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}}),Te=new U({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}}),_e=new G({props:{title:"Single-file",local:"single-file",headingTag:"h3"}}),ve=new U({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}}),ke=new G({props:{title:"DDUF",local:"dduf",headingTag:"h3"}}),S=new z({props:{warning:!0,$$slots:{default:[Ti]},$$scope:{ctx:T}}}),Be=new U({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 U({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMGV4cG9ydF9mb2xkZXJfYXNfZGR1ZiUwQWZyb20lMjBkaWZmdXNlcnMlMjBpbXBvcnQlMjBEaWZmdXNpb25QaXBlbGluZSUwQWltcG9ydCUyMHRvcmNoJTIwJTBBJTBBcGlwZSUyMCUzRCUyMERpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMjJibGFjay1mb3Jlc3QtbGFicyUyRkZMVVguMS1kZXYlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmJmbG9hdDE2KSUwQSUwQXNhdmVfZm9sZGVyJTIwJTNEJTIwJTIyZmx1eC1kZXYlMjIlMEFwaXBlLnNhdmVfcHJldHJhaW5lZCglMjJmbHV4LWRldiUyMiklMEFleHBvcnRfZm9sZGVyX2FzX2RkdWYoJTIyZmx1eC1kZXYuZGR1ZiUyMiUyQyUyMGZvbGRlcl9wYXRoJTNEc2F2ZV9mb2xkZXIp",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)`,wrap:!1}}),L=new z({props:{warning:!1,$$slots:{default:[_i]},$$scope:{ctx:T}}}),Fe=new G({props:{title:"Convert layout and files",local:"convert-layout-and-files",headingTag:"h2"}}),N=new z({props:{warning:!1,$$slots:{default:[Ui]},$$scope:{ctx:T}}}),Se=new U({props:{code:"cHl0aG9uJTIwY29udmVydF9kaWZmdXNlcnNfdG9fb3JpZ2luYWxfc2R4bC5weSUyMC0tbW9kZWxfcGF0aCUyMHBhdGglMkZ0byUyRm1vZGVsJTJGdG8lMkZjb252ZXJ0JTIwLS1jaGVja3BvaW50X3BhdGglMjBwYXRoJTJGdG8lMkZzYXZlJTJGbW9kZWwlMkZ0byUyMC0tdXNlX3NhZmV0ZW5zb3Jz",highlighted:"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}}),Ne=new U({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}}),Ee=new G({props:{title:"Single-file layout usage",local:"single-file-layout-usage",headingTag:"h2"}}),qe=new G({props:{title:"Load a pipeline or model",local:"load-a-pipeline-or-model",headingTag:"h3"}}),H=new Ut({props:{id:"pipeline-model",options:["pipeline","model"],$$slots:{default:[ji]},$$scope:{ctx:T}}}),Pe=new U({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}}),Ke=new U({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}}),Oe=new G({props:{title:"Customize configuration options",local:"customize-configuration-options",headingTag:"h3"}}),E=new Ut({props:{id:"config-file",options:["Hub configuration file","original configuration file"],$$slots:{default:[Ci]},$$scope:{ctx:T}}}),Q=new Ut({props:{id:"override",options:["pipeline","model"],$$slots:{default:[Xi]},$$scope:{ctx:T}}}),st=new G({props:{title:"Local files",local:"local-files",headingTag:"h3"}}),q=new Ut({props:{id:"local",options:["Hub cache directory","specific local directory"],$$slots:{default:[Yi]},$$scope:{ctx:T}}}),ft=new G({props:{title:"Local files without symlink",local:"local-files-without-symlink",headingTag:"h4"}}),D=new z({props:{warning:!1,$$slots:{default:[Vi]},$$scope:{ctx:T}}}),pt=new U({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}}),mt=new U({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}}),ct=new gi({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/using-diffusers/other-formats.md"}}),{c(){l=m("meta"),u=f(),i=m("p"),p=f(),h(a.$$.fragment),o=f(),h($.$$.fragment),J=f(),Z=m("p"),Z.innerHTML=C,_=f(),v=m("p"),v.textContent=$t,Zt=f(),h(P.$$.fragment),vt=f(),A=m("p"),A.innerHTML=rs,jt=f(),h(K.$$.fragment),Gt=f(),h(R.$$.fragment),kt=f(),O=m("p"),O.innerHTML=ps,xt=f(),ee=m("p"),ee.innerHTML=us,Wt=f(),h(te.$$.fragment),Ct=f(),le=m("p"),le.textContent=ms,Bt=f(),se=m("ol"),se.innerHTML=cs,Rt=f(),h(X.$$.fragment),Xt=f(),h(ie.$$.fragment),Ft=f(),ne=m("p"),ne.innerHTML=ds,It=f(),ae=m("p"),ae.textContent=hs,Yt=f(),F=m("div"),F.innerHTML=ys,Vt=f(),oe=m("p"),oe.innerHTML=gs,St=f(),h(fe.$$.fragment),Lt=f(),h(re.$$.fragment),Nt=f(),h(I.$$.fragment),Ht=f(),pe=m("p"),pe.innerHTML=Ms,Et=f(),ue=m("p"),ue.innerHTML=bs,Qt=f(),h(me.$$.fragment),qt=f(),h(ce.$$.fragment),Dt=f(),de=m("p"),de.textContent=ws,zt=f(),h(he.$$.fragment),Pt=f(),ye=m("p"),ye.textContent=$s,At=f(),Y=m("div"),Y.innerHTML=Js,Kt=f(),ge=m("p"),ge.innerHTML=Ts,Ot=f(),h(Me.$$.fragment),el=f(),be=m("p"),be.textContent=_s,tl=f(),k=m("ol"),yt=m("li"),yt.innerHTML=Us,ss=f(),we=m("li"),gt=m("p"),gt.innerHTML=Zs,is=f(),h($e.$$.fragment),ns=f(),Mt=m("li"),Mt.innerHTML=vs,as=f(),Je=m("li"),bt=m("p"),bt.textContent=js,os=f(),h(Te.$$.fragment),fs=f(),wt=m("li"),wt.innerHTML=Gs,ll=f(),h(_e.$$.fragment),sl=f(),Ue=m("p"),Ue.textContent=ks,il=f(),V=m("div"),V.innerHTML=xs,nl=f(),Ze=m("p"),Ze.innerHTML=Ws,al=f(),h(ve.$$.fragment),ol=f(),je=m("p"),je.textContent=Cs,fl=f(),Ge=m("ol"),Ge.innerHTML=Bs,rl=f(),h(ke.$$.fragment),pl=f(),h(S.$$.fragment),ul=f(),xe=m("p"),xe.innerHTML=Rs,ml=f(),We=m("p"),We.innerHTML=Xs,cl=f(),Ce=m("p"),Ce.innerHTML=Fs,dl=f(),h(Be.$$.fragment),hl=f(),Re=m("p"),Re.innerHTML=Is,yl=f(),h(Xe.$$.fragment),gl=f(),h(L.$$.fragment),Ml=f(),h(Fe.$$.fragment),bl=f(),Ie=m("p"),Ie.textContent=Ys,wl=f(),Ye=m("p"),Ye.innerHTML=Vs,$l=f(),h(N.$$.fragment),Jl=f(),Ve=m("p"),Ve.innerHTML=Ss,Tl=f(),h(Se.$$.fragment),_l=f(),Le=m("p"),Le.innerHTML=Ls,Ul=f(),h(Ne.$$.fragment),Zl=f(),He=m("p"),He.innerHTML=Ns,vl=f(),h(Ee.$$.fragment),jl=f(),Qe=m("p"),Qe.innerHTML=Hs,Gl=f(),h(qe.$$.fragment),kl=f(),De=m("p"),De.innerHTML=Es,xl=f(),h(H.$$.fragment),Wl=f(),ze=m("p"),ze.innerHTML=Qs,Cl=f(),h(Pe.$$.fragment),Bl=f(),Ae=m("p"),Ae.textContent=qs,Rl=f(),h(Ke.$$.fragment),Xl=f(),h(Oe.$$.fragment),Fl=f(),et=m("p"),et.innerHTML=Ds,Il=f(),tt=m("p"),tt.textContent=zs,Yl=f(),h(E.$$.fragment),Vl=f(),lt=m("p"),lt.innerHTML=Ps,Sl=f(),h(Q.$$.fragment),Ll=f(),h(st.$$.fragment),Nl=f(),it=m("p"),it.innerHTML=As,Hl=f(),nt=m("p"),nt.innerHTML=Ks,El=f(),at=m("p"),at.innerHTML=Os,Ql=f(),ot=m("p"),ot.innerHTML=ei,ql=f(),h(q.$$.fragment),Dl=f(),h(ft.$$.fragment),zl=f(),h(D.$$.fragment),Pl=f(),rt=m("p"),rt.innerHTML=ti,Al=f(),h(pt.$$.fragment),Kl=f(),ut=m("p"),ut.innerHTML=li,Ol=f(),h(mt.$$.fragment),es=f(),h(ct.$$.fragment),ts=f(),Jt=m("p"),this.h()},l(e){const t=hi("svelte-u9bgzb",document.head);l=c(t,"META",{name:!0,content:!0}),t.forEach(s),u=r(e),i=c(e,"P",{}),Tt(i).forEach(s),p=r(e),y(a.$$.fragment,e),o=r(e),y($.$$.fragment,e),J=r(e),Z=c(e,"P",{"data-svelte-h":!0}),d(Z)!=="svelte-kxjzqb"&&(Z.innerHTML=C),_=r(e),v=c(e,"P",{"data-svelte-h":!0}),d(v)!=="svelte-i9ya2i"&&(v.textContent=$t),Zt=r(e),y(P.$$.fragment,e),vt=r(e),A=c(e,"P",{"data-svelte-h":!0}),d(A)!=="svelte-11pybq1"&&(A.innerHTML=rs),jt=r(e),y(K.$$.fragment,e),Gt=r(e),y(R.$$.fragment,e),kt=r(e),O=c(e,"P",{"data-svelte-h":!0}),d(O)!=="svelte-9jg8rl"&&(O.innerHTML=ps),xt=r(e),ee=c(e,"P",{"data-svelte-h":!0}),d(ee)!=="svelte-curlg7"&&(ee.innerHTML=us),Wt=r(e),y(te.$$.fragment,e),Ct=r(e),le=c(e,"P",{"data-svelte-h":!0}),d(le)!=="svelte-1yget19"&&(le.textContent=ms),Bt=r(e),se=c(e,"OL",{"data-svelte-h":!0}),d(se)!=="svelte-1kpaoly"&&(se.innerHTML=cs),Rt=r(e),y(X.$$.fragment,e),Xt=r(e),y(ie.$$.fragment,e),Ft=r(e),ne=c(e,"P",{"data-svelte-h":!0}),d(ne)!=="svelte-1b4xx2j"&&(ne.innerHTML=ds),It=r(e),ae=c(e,"P",{"data-svelte-h":!0}),d(ae)!=="svelte-t293qm"&&(ae.textContent=hs),Yt=r(e),F=c(e,"DIV",{class:!0,"data-svelte-h":!0}),d(F)!=="svelte-1kdc64d"&&(F.innerHTML=ys),Vt=r(e),oe=c(e,"P",{"data-svelte-h":!0}),d(oe)!=="svelte-122jiy8"&&(oe.innerHTML=gs),St=r(e),y(fe.$$.fragment,e),Lt=r(e),y(re.$$.fragment,e),Nt=r(e),y(I.$$.fragment,e),Ht=r(e),pe=c(e,"P",{"data-svelte-h":!0}),d(pe)!=="svelte-1vcmkmh"&&(pe.innerHTML=Ms),Et=r(e),ue=c(e,"P",{"data-svelte-h":!0}),d(ue)!=="svelte-w2gv44"&&(ue.innerHTML=bs),Qt=r(e),y(me.$$.fragment,e),qt=r(e),y(ce.$$.fragment,e),Dt=r(e),de=c(e,"P",{"data-svelte-h":!0}),d(de)!=="svelte-bc37k5"&&(de.textContent=ws),zt=r(e),y(he.$$.fragment,e),Pt=r(e),ye=c(e,"P",{"data-svelte-h":!0}),d(ye)!=="svelte-r6jgt3"&&(ye.textContent=$s),At=r(e),Y=c(e,"DIV",{class:!0,"data-svelte-h":!0}),d(Y)!=="svelte-1taq59g"&&(Y.innerHTML=Js),Kt=r(e),ge=c(e,"P",{"data-svelte-h":!0}),d(ge)!=="svelte-1lh7lzt"&&(ge.innerHTML=Ts),Ot=r(e),y(Me.$$.fragment,e),el=r(e),be=c(e,"P",{"data-svelte-h":!0}),d(be)!=="svelte-1s9uno7"&&(be.textContent=_s),tl=r(e),k=c(e,"OL",{});var W=Tt(k);yt=c(W,"LI",{"data-svelte-h":!0}),d(yt)!=="svelte-1ev5mj8"&&(yt.innerHTML=Us),ss=r(W),we=c(W,"LI",{});var dt=Tt(we);gt=c(dt,"P",{"data-svelte-h":!0}),d(gt)!=="svelte-ztyuse"&&(gt.innerHTML=Zs),is=r(dt),y($e.$$.fragment,dt),dt.forEach(s),ns=r(W),Mt=c(W,"LI",{"data-svelte-h":!0}),d(Mt)!=="svelte-vp6v5d"&&(Mt.innerHTML=vs),as=r(W),Je=c(W,"LI",{});var ht=Tt(Je);bt=c(ht,"P",{"data-svelte-h":!0}),d(bt)!=="svelte-1acwn3q"&&(bt.textContent=js),os=r(ht),y(Te.$$.fragment,ht),ht.forEach(s),fs=r(W),wt=c(W,"LI",{"data-svelte-h":!0}),d(wt)!=="svelte-xph0z2"&&(wt.innerHTML=Gs),W.forEach(s),ll=r(e),y(_e.$$.fragment,e),sl=r(e),Ue=c(e,"P",{"data-svelte-h":!0}),d(Ue)!=="svelte-2us5xv"&&(Ue.textContent=ks),il=r(e),V=c(e,"DIV",{class:!0,"data-svelte-h":!0}),d(V)!=="svelte-ysl4o1"&&(V.innerHTML=xs),nl=r(e),Ze=c(e,"P",{"data-svelte-h":!0}),d(Ze)!=="svelte-8pvu77"&&(Ze.innerHTML=Ws),al=r(e),y(ve.$$.fragment,e),ol=r(e),je=c(e,"P",{"data-svelte-h":!0}),d(je)!=="svelte-1yex5cv"&&(je.textContent=Cs),fl=r(e),Ge=c(e,"OL",{"data-svelte-h":!0}),d(Ge)!=="svelte-v6m4il"&&(Ge.innerHTML=Bs),rl=r(e),y(ke.$$.fragment,e),pl=r(e),y(S.$$.fragment,e),ul=r(e),xe=c(e,"P",{"data-svelte-h":!0}),d(xe)!=="svelte-t2k8zx"&&(xe.innerHTML=Rs),ml=r(e),We=c(e,"P",{"data-svelte-h":!0}),d(We)!=="svelte-1pvshwg"&&(We.innerHTML=Xs),cl=r(e),Ce=c(e,"P",{"data-svelte-h":!0}),d(Ce)!=="svelte-18ibybh"&&(Ce.innerHTML=Fs),dl=r(e),y(Be.$$.fragment,e),hl=r(e),Re=c(e,"P",{"data-svelte-h":!0}),d(Re)!=="svelte-42cttl"&&(Re.innerHTML=Is),yl=r(e),y(Xe.$$.fragment,e),gl=r(e),y(L.$$.fragment,e),Ml=r(e),y(Fe.$$.fragment,e),bl=r(e),Ie=c(e,"P",{"data-svelte-h":!0}),d(Ie)!=="svelte-kszp4r"&&(Ie.textContent=Ys),wl=r(e),Ye=c(e,"P",{"data-svelte-h":!0}),d(Ye)!=="svelte-llrwg1"&&(Ye.innerHTML=Vs),$l=r(e),y(N.$$.fragment,e),Jl=r(e),Ve=c(e,"P",{"data-svelte-h":!0}),d(Ve)!=="svelte-r41ob9"&&(Ve.innerHTML=Ss),Tl=r(e),y(Se.$$.fragment,e),_l=r(e),Le=c(e,"P",{"data-svelte-h":!0}),d(Le)!=="svelte-1easxua"&&(Le.innerHTML=Ls),Ul=r(e),y(Ne.$$.fragment,e),Zl=r(e),He=c(e,"P",{"data-svelte-h":!0}),d(He)!=="svelte-71tdpy"&&(He.innerHTML=Ns),vl=r(e),y(Ee.$$.fragment,e),jl=r(e),Qe=c(e,"P",{"data-svelte-h":!0}),d(Qe)!=="svelte-ldczyw"&&(Qe.innerHTML=Hs),Gl=r(e),y(qe.$$.fragment,e),kl=r(e),De=c(e,"P",{"data-svelte-h":!0}),d(De)!=="svelte-bgsohb"&&(De.innerHTML=Es),xl=r(e),y(H.$$.fragment,e),Wl=r(e),ze=c(e,"P",{"data-svelte-h":!0}),d(ze)!=="svelte-7cjy1z"&&(ze.innerHTML=Qs),Cl=r(e),y(Pe.$$.fragment,e),Bl=r(e),Ae=c(e,"P",{"data-svelte-h":!0}),d(Ae)!=="svelte-mgaprw"&&(Ae.textContent=qs),Rl=r(e),y(Ke.$$.fragment,e),Xl=r(e),y(Oe.$$.fragment,e),Fl=r(e),et=c(e,"P",{"data-svelte-h":!0}),d(et)!=="svelte-v6abd8"&&(et.innerHTML=Ds),Il=r(e),tt=c(e,"P",{"data-svelte-h":!0}),d(tt)!=="svelte-h4okww"&&(tt.textContent=zs),Yl=r(e),y(E.$$.fragment,e),Vl=r(e),lt=c(e,"P",{"data-svelte-h":!0}),d(lt)!=="svelte-3nz3gm"&&(lt.innerHTML=Ps),Sl=r(e),y(Q.$$.fragment,e),Ll=r(e),y(st.$$.fragment,e),Nl=r(e),it=c(e,"P",{"data-svelte-h":!0}),d(it)!=="svelte-1ymqt5e"&&(it.innerHTML=As),Hl=r(e),nt=c(e,"P",{"data-svelte-h":!0}),d(nt)!=="svelte-5d71tq"&&(nt.innerHTML=Ks),El=r(e),at=c(e,"P",{"data-svelte-h":!0}),d(at)!=="svelte-1qs3hmf"&&(at.innerHTML=Os),Ql=r(e),ot=c(e,"P",{"data-svelte-h":!0}),d(ot)!=="svelte-71at32"&&(ot.innerHTML=ei),ql=r(e),y(q.$$.fragment,e),Dl=r(e),y(ft.$$.fragment,e),zl=r(e),y(D.$$.fragment,e),Pl=r(e),rt=c(e,"P",{"data-svelte-h":!0}),d(rt)!=="svelte-q37tu5"&&(rt.innerHTML=ti),Al=r(e),y(pt.$$.fragment,e),Kl=r(e),ut=c(e,"P",{"data-svelte-h":!0}),d(ut)!=="svelte-15leuyd"&&(ut.innerHTML=li),Ol=r(e),y(mt.$$.fragment,e),es=r(e),y(ct.$$.fragment,e),ts=r(e),Jt=c(e,"P",{}),Tt(Jt).forEach(s),this.h()},h(){_t(l,"name","hf:doc:metadata"),_t(l,"content",Li),_t(F,"class","flex justify-center"),_t(Y,"class","flex flex-row gap-4"),_t(V,"class","flex justify-center")},m(e,t){x(document.head,l),n(e,u,t),n(e,i,t),n(e,p,t),g(a,e,t),n(e,o,t),g($,e,t),n(e,J,t),n(e,Z,t),n(e,_,t),n(e,v,t),n(e,Zt,t),g(P,e,t),n(e,vt,t),n(e,A,t),n(e,jt,t),g(K,e,t),n(e,Gt,t),g(R,e,t),n(e,kt,t),n(e,O,t),n(e,xt,t),n(e,ee,t),n(e,Wt,t),g(te,e,t),n(e,Ct,t),n(e,le,t),n(e,Bt,t),n(e,se,t),n(e,Rt,t),g(X,e,t),n(e,Xt,t),g(ie,e,t),n(e,Ft,t),n(e,ne,t),n(e,It,t),n(e,ae,t),n(e,Yt,t),n(e,F,t),n(e,Vt,t),n(e,oe,t),n(e,St,t),g(fe,e,t),n(e,Lt,t),g(re,e,t),n(e,Nt,t),g(I,e,t),n(e,Ht,t),n(e,pe,t),n(e,Et,t),n(e,ue,t),n(e,Qt,t),g(me,e,t),n(e,qt,t),g(ce,e,t),n(e,Dt,t),n(e,de,t),n(e,zt,t),g(he,e,t),n(e,Pt,t),n(e,ye,t),n(e,At,t),n(e,Y,t),n(e,Kt,t),n(e,ge,t),n(e,Ot,t),g(Me,e,t),n(e,el,t),n(e,be,t),n(e,tl,t),n(e,k,t),x(k,yt),x(k,ss),x(k,we),x(we,gt),x(we,is),g($e,we,null),x(k,ns),x(k,Mt),x(k,as),x(k,Je),x(Je,bt),x(Je,os),g(Te,Je,null),x(k,fs),x(k,wt),n(e,ll,t),g(_e,e,t),n(e,sl,t),n(e,Ue,t),n(e,il,t),n(e,V,t),n(e,nl,t),n(e,Ze,t),n(e,al,t),g(ve,e,t),n(e,ol,t),n(e,je,t),n(e,fl,t),n(e,Ge,t),n(e,rl,t),g(ke,e,t),n(e,pl,t),g(S,e,t),n(e,ul,t),n(e,xe,t),n(e,ml,t),n(e,We,t),n(e,cl,t),n(e,Ce,t),n(e,dl,t),g(Be,e,t),n(e,hl,t),n(e,Re,t),n(e,yl,t),g(Xe,e,t),n(e,gl,t),g(L,e,t),n(e,Ml,t),g(Fe,e,t),n(e,bl,t),n(e,Ie,t),n(e,wl,t),n(e,Ye,t),n(e,$l,t),g(N,e,t),n(e,Jl,t),n(e,Ve,t),n(e,Tl,t),g(Se,e,t),n(e,_l,t),n(e,Le,t),n(e,Ul,t),g(Ne,e,t),n(e,Zl,t),n(e,He,t),n(e,vl,t),g(Ee,e,t),n(e,jl,t),n(e,Qe,t),n(e,Gl,t),g(qe,e,t),n(e,kl,t),n(e,De,t),n(e,xl,t),g(H,e,t),n(e,Wl,t),n(e,ze,t),n(e,Cl,t),g(Pe,e,t),n(e,Bl,t),n(e,Ae,t),n(e,Rl,t),g(Ke,e,t),n(e,Xl,t),g(Oe,e,t),n(e,Fl,t),n(e,et,t),n(e,Il,t),n(e,tt,t),n(e,Yl,t),g(E,e,t),n(e,Vl,t),n(e,lt,t),n(e,Sl,t),g(Q,e,t),n(e,Ll,t),g(st,e,t),n(e,Nl,t),n(e,it,t),n(e,Hl,t),n(e,nt,t),n(e,El,t),n(e,at,t),n(e,Ql,t),n(e,ot,t),n(e,ql,t),g(q,e,t),n(e,Dl,t),g(ft,e,t),n(e,zl,t),g(D,e,t),n(e,Pl,t),n(e,rt,t),n(e,Al,t),g(pt,e,t),n(e,Kl,t),n(e,ut,t),n(e,Ol,t),g(mt,e,t),n(e,es,t),g(ct,e,t),n(e,ts,t),n(e,Jt,t),ls=!0},p(e,[t]){const W={};t&2&&(W.$$scope={dirty:t,ctx:e}),R.$set(W);const dt={};t&2&&(dt.$$scope={dirty:t,ctx:e}),X.$set(dt);const ht={};t&2&&(ht.$$scope={dirty:t,ctx:e}),I.$set(ht);const si={};t&2&&(si.$$scope={dirty:t,ctx:e}),S.$set(si);const ii={};t&2&&(ii.$$scope={dirty:t,ctx:e}),L.$set(ii);const ni={};t&2&&(ni.$$scope={dirty:t,ctx:e}),N.$set(ni);const ai={};t&2&&(ai.$$scope={dirty:t,ctx:e}),H.$set(ai);const oi={};t&2&&(oi.$$scope={dirty:t,ctx:e}),E.$set(oi);const fi={};t&2&&(fi.$$scope={dirty:t,ctx:e}),Q.$set(fi);const ri={};t&2&&(ri.$$scope={dirty:t,ctx:e}),q.$set(ri);const pi={};t&2&&(pi.$$scope={dirty:t,ctx:e}),D.$set(pi)},i(e){ls||(M(a.$$.fragment,e),M($.$$.fragment,e),M(P.$$.fragment,e),M(K.$$.fragment,e),M(R.$$.fragment,e),M(te.$$.fragment,e),M(X.$$.fragment,e),M(ie.$$.fragment,e),M(fe.$$.fragment,e),M(re.$$.fragment,e),M(I.$$.fragment,e),M(me.$$.fragment,e),M(ce.$$.fragment,e),M(he.$$.fragment,e),M(Me.$$.fragment,e),M($e.$$.fragment,e),M(Te.$$.fragment,e),M(_e.$$.fragment,e),M(ve.$$.fragment,e),M(ke.$$.fragment,e),M(S.$$.fragment,e),M(Be.$$.fragment,e),M(Xe.$$.fragment,e),M(L.$$.fragment,e),M(Fe.$$.fragment,e),M(N.$$.fragment,e),M(Se.$$.fragment,e),M(Ne.$$.fragment,e),M(Ee.$$.fragment,e),M(qe.$$.fragment,e),M(H.$$.fragment,e),M(Pe.$$.fragment,e),M(Ke.$$.fragment,e),M(Oe.$$.fragment,e),M(E.$$.fragment,e),M(Q.$$.fragment,e),M(st.$$.fragment,e),M(q.$$.fragment,e),M(ft.$$.fragment,e),M(D.$$.fragment,e),M(pt.$$.fragment,e),M(mt.$$.fragment,e),M(ct.$$.fragment,e),ls=!0)},o(e){b(a.$$.fragment,e),b($.$$.fragment,e),b(P.$$.fragment,e),b(K.$$.fragment,e),b(R.$$.fragment,e),b(te.$$.fragment,e),b(X.$$.fragment,e),b(ie.$$.fragment,e),b(fe.$$.fragment,e),b(re.$$.fragment,e),b(I.$$.fragment,e),b(me.$$.fragment,e),b(ce.$$.fragment,e),b(he.$$.fragment,e),b(Me.$$.fragment,e),b($e.$$.fragment,e),b(Te.$$.fragment,e),b(_e.$$.fragment,e),b(ve.$$.fragment,e),b(ke.$$.fragment,e),b(S.$$.fragment,e),b(Be.$$.fragment,e),b(Xe.$$.fragment,e),b(L.$$.fragment,e),b(Fe.$$.fragment,e),b(N.$$.fragment,e),b(Se.$$.fragment,e),b(Ne.$$.fragment,e),b(Ee.$$.fragment,e),b(qe.$$.fragment,e),b(H.$$.fragment,e),b(Pe.$$.fragment,e),b(Ke.$$.fragment,e),b(Oe.$$.fragment,e),b(E.$$.fragment,e),b(Q.$$.fragment,e),b(st.$$.fragment,e),b(q.$$.fragment,e),b(ft.$$.fragment,e),b(D.$$.fragment,e),b(pt.$$.fragment,e),b(mt.$$.fragment,e),b(ct.$$.fragment,e),ls=!1},d(e){e&&(s(u),s(i),s(p),s(o),s(J),s(Z),s(_),s(v),s(Zt),s(vt),s(A),s(jt),s(Gt),s(kt),s(O),s(xt),s(ee),s(Wt),s(Ct),s(le),s(Bt),s(se),s(Rt),s(Xt),s(Ft),s(ne),s(It),s(ae),s(Yt),s(F),s(Vt),s(oe),s(St),s(Lt),s(Nt),s(Ht),s(pe),s(Et),s(ue),s(Qt),s(qt),s(Dt),s(de),s(zt),s(Pt),s(ye),s(At),s(Y),s(Kt),s(ge),s(Ot),s(el),s(be),s(tl),s(k),s(ll),s(sl),s(Ue),s(il),s(V),s(nl),s(Ze),s(al),s(ol),s(je),s(fl),s(Ge),s(rl),s(pl),s(ul),s(xe),s(ml),s(We),s(cl),s(Ce),s(dl),s(hl),s(Re),s(yl),s(gl),s(Ml),s(bl),s(Ie),s(wl),s(Ye),s($l),s(Jl),s(Ve),s(Tl),s(_l),s(Le),s(Ul),s(Zl),s(He),s(vl),s(jl),s(Qe),s(Gl),s(kl),s(De),s(xl),s(Wl),s(ze),s(Cl),s(Bl),s(Ae),s(Rl),s(Xl),s(Fl),s(et),s(Il),s(tt),s(Yl),s(Vl),s(lt),s(Sl),s(Ll),s(Nl),s(it),s(Hl),s(nt),s(El),s(at),s(Ql),s(ot),s(ql),s(Dl),s(zl),s(Pl),s(rt),s(Al),s(Kl),s(ut),s(Ol),s(es),s(ts),s(Jt)),s(l),w(a,e),w($,e),w(P,e),w(K,e),w(R,e),w(te,e),w(X,e),w(ie,e),w(fe,e),w(re,e),w(I,e),w(me,e),w(ce,e),w(he,e),w(Me,e),w($e),w(Te),w(_e,e),w(ve,e),w(ke,e),w(S,e),w(Be,e),w(Xe,e),w(L,e),w(Fe,e),w(N,e),w(Se,e),w(Ne,e),w(Ee,e),w(qe,e),w(H,e),w(Pe,e),w(Ke,e),w(Oe,e),w(E,e),w(Q,e),w(st,e),w(q,e),w(ft,e),w(D,e),w(pt,e),w(mt,e),w(ct,e)}}}const Li='{"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":"Convert layout and files","local":"convert-layout-and-files","sections":[],"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 Ni(T){return mi(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ai extends ci{constructor(l){super(),di(this,l,Ni,Si,ui,{})}}export{Ai as component};
