import{s as Re,o as Ye,n as le}from"../chunks/scheduler.182ea377.js";import{S as He,i as Oe,g as m,s as l,r as u,A as De,h as p,f as i,c as a,j as L,u as _,x as y,k as B,y as c,a as d,v as b,d as w,t as M,w as x}from"../chunks/index.abf12888.js";import{T as Ae}from"../chunks/Tip.230e2334.js";import{D as se}from"../chunks/Docstring.93f6f462.js";import{C as We}from"../chunks/CodeBlock.57fe6e13.js";import{E as je}from"../chunks/ExampleCodeBlock.658f5cd6.js";import{H as be}from"../chunks/Heading.16916d63.js";function ze($){let o,g='To learn more about how to load single file weights, see the <a href="../../using-diffusers/other-formats">Load different Stable Diffusion formats</a> loading guide.';return{c(){o=m("p"),o.innerHTML=g},l(s){o=p(s,"P",{"data-svelte-h":!0}),y(o)!=="svelte-1d80t6b"&&(o.innerHTML=g)},m(s,r){d(s,o,r)},p:le,d(s){s&&i(o)}}}function Pe($){let o,g="Examples:",s,r,f;return r=new We({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvblBpcGVsaW5lJTBBJTBBJTIzJTIwRG93bmxvYWQlMjBwaXBlbGluZSUyMGZyb20lMjBodWdnaW5nZmFjZS5jbyUyMGFuZCUyMGNhY2hlLiUwQXBpcGVsaW5lJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9zaW5nbGVfZmlsZSglMEElMjAlMjAlMjAlMjAlMjJodHRwcyUzQSUyRiUyRmh1Z2dpbmdmYWNlLmNvJTJGV2Fycmlvck1hbWE3NzclMkZPcmFuZ2VNaXhzJTJGYmxvYiUyRm1haW4lMkZNb2RlbHMlMkZBYnlzc09yYW5nZU1peCUyRkFieXNzT3JhbmdlTWl4LnNhZmV0ZW5zb3JzJTIyJTBBKSUwQSUwQSUyMyUyMERvd25sb2FkJTIwcGlwZWxpbmUlMjBmcm9tJTIwbG9jYWwlMjBmaWxlJTBBJTIzJTIwZmlsZSUyMGlzJTIwZG93bmxvYWRlZCUyMHVuZGVyJTIwLiUyRnYxLTUtcHJ1bmVkLWVtYW9ubHkuY2twdCUwQXBpcGVsaW5lJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9zaW5nbGVfZmlsZSglMjIuJTJGdjEtNS1wcnVuZWQtZW1hb25seSUyMiklMEElMEElMjMlMjBFbmFibGUlMjBmbG9hdDE2JTIwYW5kJTIwbW92ZSUyMHRvJTIwR1BVJTBBcGlwZWxpbmUlMjAlM0QlMjBTdGFibGVEaWZmdXNpb25QaXBlbGluZS5mcm9tX3NpbmdsZV9maWxlKCUwQSUyMCUyMCUyMCUyMCUyMmh0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZydW53YXltbCUyRnN0YWJsZS1kaWZmdXNpb24tdjEtNSUyRmJsb2IlMkZtYWluJTJGdjEtNS1wcnVuZWQtZW1hb25seS5ja3B0JTIyJTJDJTBBJTIwJTIwJTIwJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTJDJTBBKSUwQXBpcGVsaW5lLnRvKCUyMmN1ZGElMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionPipeline

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Enable float16 and move to GPU</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipeline = StableDiffusionPipeline.from_single_file(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;https://huggingface.co/runwayml/stable-diffusion-v1-5/blob/main/v1-5-pruned-emaonly.ckpt&quot;</span>,
<span class="hljs-meta">... </span>    torch_dtype=torch.float16,
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipeline.to(<span class="hljs-string">&quot;cuda&quot;</span>)`,wrap:!1}}),{c(){o=m("p"),o.textContent=g,s=l(),u(r.$$.fragment)},l(t){o=p(t,"P",{"data-svelte-h":!0}),y(o)!=="svelte-kvfsh7"&&(o.textContent=g),s=a(t),_(r.$$.fragment,t)},m(t,h){d(t,o,h),d(t,s,h),b(r,t,h),f=!0},p:le,i(t){f||(w(r.$$.fragment,t),f=!0)},o(t){M(r.$$.fragment,t),f=!1},d(t){t&&(i(o),i(s)),x(r,t)}}}function qe($){let o,g=`Make sure to pass both <code>image_size</code> and <code>scaling_factor</code> to <code>from_single_file()</code> if you’re loading
a VAE from SDXL or a Stable Diffusion v2 model or higher.`;return{c(){o=m("p"),o.innerHTML=g},l(s){o=p(s,"P",{"data-svelte-h":!0}),y(o)!=="svelte-29ildn"&&(o.innerHTML=g)},m(s,r){d(s,o,r)},p:le,d(s){s&&i(o)}}}function Xe($){let o,g="Examples:",s,r,f;return r=new We({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEF1dG9lbmNvZGVyS0wlMEElMEF1cmwlMjAlM0QlMjAlMjJodHRwcyUzQSUyRiUyRmh1Z2dpbmdmYWNlLmNvJTJGc3RhYmlsaXR5YWklMkZzZC12YWUtZnQtbXNlLW9yaWdpbmFsJTJGYmxvYiUyRm1haW4lMkZ2YWUtZnQtbXNlLTg0MDAwMC1lbWEtcHJ1bmVkLnNhZmV0ZW5zb3JzJTIyJTIwJTIwJTIzJTIwY2FuJTIwYWxzbyUyMGJlJTIwbG9jYWwlMjBmaWxlJTBBbW9kZWwlMjAlM0QlMjBBdXRvZW5jb2RlcktMLmZyb21fc2luZ2xlX2ZpbGUodXJsKQ==",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> AutoencoderKL

url = <span class="hljs-string">&quot;https://huggingface.co/stabilityai/sd-vae-ft-mse-original/blob/main/vae-ft-mse-840000-ema-pruned.safetensors&quot;</span>  <span class="hljs-comment"># can also be local file</span>
model = AutoencoderKL.from_single_file(url)`,wrap:!1}}),{c(){o=m("p"),o.textContent=g,s=l(),u(r.$$.fragment)},l(t){o=p(t,"P",{"data-svelte-h":!0}),y(o)!=="svelte-kvfsh7"&&(o.textContent=g),s=a(t),_(r.$$.fragment,t)},m(t,h){d(t,o,h),d(t,s,h),b(r,t,h),f=!0},p:le,i(t){f||(w(r.$$.fragment,t),f=!0)},o(t){M(r.$$.fragment,t),f=!1},d(t){t&&(i(o),i(s)),x(r,t)}}}function Qe($){let o,g="Examples:",s,r,f;return r=new We({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvbkNvbnRyb2xOZXRQaXBlbGluZSUyQyUyMENvbnRyb2xOZXRNb2RlbCUwQSUwQXVybCUyMCUzRCUyMCUyMmh0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZsbGx5YXN2aWVsJTJGQ29udHJvbE5ldC12MS0xJTJGYmxvYiUyRm1haW4lMkZjb250cm9sX3YxMXBfc2QxNV9jYW5ueS5wdGglMjIlMjAlMjAlMjMlMjBjYW4lMjBhbHNvJTIwYmUlMjBhJTIwbG9jYWwlMjBwYXRoJTBBbW9kZWwlMjAlM0QlMjBDb250cm9sTmV0TW9kZWwuZnJvbV9zaW5nbGVfZmlsZSh1cmwpJTBBJTBBdXJsJTIwJTNEJTIwJTIyaHR0cHMlM0ElMkYlMkZodWdnaW5nZmFjZS5jbyUyRnJ1bndheW1sJTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTJGYmxvYiUyRm1haW4lMkZ2MS01LXBydW5lZC5zYWZldGVuc29ycyUyMiUyMCUyMCUyMyUyMGNhbiUyMGFsc28lMjBiZSUyMGElMjBsb2NhbCUyMHBhdGglMEFwaXBlJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uQ29udHJvbE5ldFBpcGVsaW5lLmZyb21fc2luZ2xlX2ZpbGUodXJsJTJDJTIwY29udHJvbG5ldCUzRGNvbnRyb2xuZXQp",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionControlNetPipeline, ControlNetModel

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

url = <span class="hljs-string">&quot;https://huggingface.co/runwayml/stable-diffusion-v1-5/blob/main/v1-5-pruned.safetensors&quot;</span>  <span class="hljs-comment"># can also be a local path</span>
pipe = StableDiffusionControlNetPipeline.from_single_file(url, controlnet=controlnet)`,wrap:!1}}),{c(){o=m("p"),o.textContent=g,s=l(),u(r.$$.fragment)},l(t){o=p(t,"P",{"data-svelte-h":!0}),y(o)!=="svelte-kvfsh7"&&(o.textContent=g),s=a(t),_(r.$$.fragment,t)},m(t,h){d(t,o,h),d(t,s,h),b(r,t,h),f=!0},p:le,i(t){f||(w(r.$$.fragment,t),f=!0)},o(t){M(r.$$.fragment,t),f=!1},d(t){t&&(i(o),i(s)),x(r,t)}}}function Ke($){let o,g,s,r,f,t,h,Ge="Diffusers supports loading pretrained pipeline (or model) weights stored in a single file, such as a <code>ckpt</code> or <code>safetensors</code> file. These single file types are typically produced from community trained models. There are three classes for loading single file weights:",ae,A,Ne='<li><code>FromSingleFileMixin</code> supports loading pretrained pipeline weights stored in a single file, which can either be a <code>ckpt</code> or <code>safetensors</code> file.</li> <li><code>FromOriginalVAEMixin</code> supports loading a pretrained <a href="/docs/diffusers/main/en/api/models/autoencoderkl#diffusers.AutoencoderKL">AutoencoderKL</a> from pretrained ControlNet weights stored in a single file, which can either be a <code>ckpt</code> or <code>safetensors</code> file.</li> <li><code>FromOriginalControlnetMixin</code> supports loading pretrained ControlNet weights stored in a single file, which can either be a <code>ckpt</code> or <code>safetensors</code> file.</li>',de,N,ce,R,fe,T,Y,we,Q,Se='Load model weights saved in the <code>.ckpt</code> format into a <a href="/docs/diffusers/main/en/api/pipelines/overview#diffusers.DiffusionPipeline">DiffusionPipeline</a>.',Me,Z,H,xe,K,Ve=`Instantiate a <a href="/docs/diffusers/main/en/api/pipelines/overview#diffusers.DiffusionPipeline">DiffusionPipeline</a> from pretrained pipeline weights saved in the <code>.ckpt</code> or <code>.safetensors</code>
format. The pipeline is set in evaluation mode (<code>model.eval()</code>) by default.`,ye,S,me,O,pe,k,D,$e,ee,Ee='Load pretrained AutoencoderKL weights saved in the <code>.ckpt</code> or <code>.safetensors</code> format into a <a href="/docs/diffusers/main/en/api/models/autoencoderkl#diffusers.AutoencoderKL">AutoencoderKL</a>.',ve,v,z,Te,oe,Ie=`Instantiate a <a href="/docs/diffusers/main/en/api/models/autoencoderkl#diffusers.AutoencoderKL">AutoencoderKL</a> from pretrained ControlNet weights saved in the original <code>.ckpt</code> or
<code>.safetensors</code> format. The pipeline is set in evaluation mode (<code>model.eval()</code>) by default.`,ke,V,Fe,E,ge,P,he,F,q,Je,te,Le='Load pretrained ControlNet weights saved in the <code>.ckpt</code> or <code>.safetensors</code> format into a <a href="/docs/diffusers/main/en/api/models/controlnet#diffusers.ControlNetModel">ControlNetModel</a>.',Ze,C,X,Ce,ne,Be=`Instantiate a <a href="/docs/diffusers/main/en/api/models/controlnet#diffusers.ControlNetModel">ControlNetModel</a> from pretrained ControlNet weights saved in the original <code>.ckpt</code> or
<code>.safetensors</code> format. The pipeline is set in evaluation mode (<code>model.eval()</code>) by default.`,Ue,I,ue,re,_e;return f=new be({props:{title:"Single files",local:"single-files",headingTag:"h1"}}),N=new Ae({props:{$$slots:{default:[ze]},$$scope:{ctx:$}}}),R=new be({props:{title:"FromSingleFileMixin",local:"diffusers.loaders.FromSingleFileMixin",headingTag:"h2"}}),Y=new se({props:{name:"class diffusers.loaders.FromSingleFileMixin",anchor:"diffusers.loaders.FromSingleFileMixin",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/loaders/single_file.py#L143"}}),H=new se({props:{name:"from_single_file",anchor:"diffusers.loaders.FromSingleFileMixin.from_single_file",parameters:[{name:"pretrained_model_link_or_path",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.loaders.FromSingleFileMixin.from_single_file.pretrained_model_link_or_path",description:`<strong>pretrained_model_link_or_path</strong> (<code>str</code> or <code>os.PathLike</code>, <em>optional</em>) &#x2014;
Can be either:<ul>
<li>A link to the <code>.ckpt</code> file (for example
<code>&quot;https://huggingface.co/&lt;repo_id&gt;/blob/main/&lt;path_to_file&gt;.ckpt&quot;</code>) on the Hub.</li>
<li>A path to a <em>file</em> containing all pipeline weights.</li>
</ul>`,name:"pretrained_model_link_or_path"},{anchor:"diffusers.loaders.FromSingleFileMixin.from_single_file.torch_dtype",description:`<strong>torch_dtype</strong> (<code>str</code> or <code>torch.dtype</code>, <em>optional</em>) &#x2014;
Override the default <code>torch.dtype</code> and load the model with another dtype.`,name:"torch_dtype"},{anchor:"diffusers.loaders.FromSingleFileMixin.from_single_file.force_download",description:`<strong>force_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to force the (re-)download of the model weights and configuration files, overriding the
cached versions if they exist.`,name:"force_download"},{anchor:"diffusers.loaders.FromSingleFileMixin.from_single_file.cache_dir",description:`<strong>cache_dir</strong> (<code>Union[str, os.PathLike]</code>, <em>optional</em>) &#x2014;
Path to a directory where a downloaded pretrained model configuration is cached if the standard cache
is not used.`,name:"cache_dir"},{anchor:"diffusers.loaders.FromSingleFileMixin.from_single_file.resume_download",description:`<strong>resume_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to resume downloading the model weights and configuration files. If set to <code>False</code>, any
incompletely downloaded files are deleted.`,name:"resume_download"},{anchor:"diffusers.loaders.FromSingleFileMixin.from_single_file.proxies",description:`<strong>proxies</strong> (<code>Dict[str, str]</code>, <em>optional</em>) &#x2014;
A dictionary of proxy servers to use by protocol or endpoint, for example, <code>{&apos;http&apos;: &apos;foo.bar:3128&apos;, &apos;http://hostname&apos;: &apos;foo.bar:4012&apos;}</code>. The proxies are used on each request.`,name:"proxies"},{anchor:"diffusers.loaders.FromSingleFileMixin.from_single_file.local_files_only",description:`<strong>local_files_only</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to only load local model weights and configuration files or not. If set to <code>True</code>, the model
won&#x2019;t be downloaded from the Hub.`,name:"local_files_only"},{anchor:"diffusers.loaders.FromSingleFileMixin.from_single_file.token",description:`<strong>token</strong> (<code>str</code> or <em>bool</em>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. If <code>True</code>, the token generated from
<code>diffusers-cli login</code> (stored in <code>~/.huggingface</code>) is used.`,name:"token"},{anchor:"diffusers.loaders.FromSingleFileMixin.from_single_file.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;main&quot;</code>) &#x2014;
The specific model version to use. It can be a branch name, a tag name, a commit id, or any identifier
allowed by Git.`,name:"revision"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/loaders/single_file.py#L148"}}),S=new je({props:{anchor:"diffusers.loaders.FromSingleFileMixin.from_single_file.example",$$slots:{default:[Pe]},$$scope:{ctx:$}}}),O=new be({props:{title:"FromOriginalVAEMixin",local:"diffusers.loaders.FromOriginalVAEMixin",headingTag:"h2"}}),D=new se({props:{name:"class diffusers.loaders.FromOriginalVAEMixin",anchor:"diffusers.loaders.FromOriginalVAEMixin",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/loaders/autoencoder.py#L23"}}),z=new se({props:{name:"from_single_file",anchor:"diffusers.loaders.FromOriginalVAEMixin.from_single_file",parameters:[{name:"pretrained_model_link_or_path",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.loaders.FromOriginalVAEMixin.from_single_file.pretrained_model_link_or_path",description:`<strong>pretrained_model_link_or_path</strong> (<code>str</code> or <code>os.PathLike</code>, <em>optional</em>) &#x2014;
Can be either:<ul>
<li>A link to the <code>.ckpt</code> file (for example
<code>&quot;https://huggingface.co/&lt;repo_id&gt;/blob/main/&lt;path_to_file&gt;.ckpt&quot;</code>) on the Hub.</li>
<li>A path to a <em>file</em> containing all pipeline weights.</li>
</ul>`,name:"pretrained_model_link_or_path"},{anchor:"diffusers.loaders.FromOriginalVAEMixin.from_single_file.config_file",description:`<strong>config_file</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Filepath to the configuration YAML file associated with the model. If not provided it will default to:
<a href="https://raw.githubusercontent.com/CompVis/stable-diffusion/main/configs/stable-diffusion/v1-inference.yaml" rel="nofollow">https://raw.githubusercontent.com/CompVis/stable-diffusion/main/configs/stable-diffusion/v1-inference.yaml</a>`,name:"config_file"},{anchor:"diffusers.loaders.FromOriginalVAEMixin.from_single_file.torch_dtype",description:`<strong>torch_dtype</strong> (<code>str</code> or <code>torch.dtype</code>, <em>optional</em>) &#x2014;
Override the default <code>torch.dtype</code> and load the model with another dtype. If <code>&quot;auto&quot;</code> is passed, the
dtype is automatically derived from the model&#x2019;s weights.`,name:"torch_dtype"},{anchor:"diffusers.loaders.FromOriginalVAEMixin.from_single_file.force_download",description:`<strong>force_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to force the (re-)download of the model weights and configuration files, overriding the
cached versions if they exist.`,name:"force_download"},{anchor:"diffusers.loaders.FromOriginalVAEMixin.from_single_file.cache_dir",description:`<strong>cache_dir</strong> (<code>Union[str, os.PathLike]</code>, <em>optional</em>) &#x2014;
Path to a directory where a downloaded pretrained model configuration is cached if the standard cache
is not used.`,name:"cache_dir"},{anchor:"diffusers.loaders.FromOriginalVAEMixin.from_single_file.resume_download",description:`<strong>resume_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to resume downloading the model weights and configuration files. If set to <code>False</code>, any
incompletely downloaded files are deleted.`,name:"resume_download"},{anchor:"diffusers.loaders.FromOriginalVAEMixin.from_single_file.proxies",description:`<strong>proxies</strong> (<code>Dict[str, str]</code>, <em>optional</em>) &#x2014;
A dictionary of proxy servers to use by protocol or endpoint, for example, <code>{&apos;http&apos;: &apos;foo.bar:3128&apos;, &apos;http://hostname&apos;: &apos;foo.bar:4012&apos;}</code>. The proxies are used on each request.`,name:"proxies"},{anchor:"diffusers.loaders.FromOriginalVAEMixin.from_single_file.local_files_only",description:`<strong>local_files_only</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to only load local model weights and configuration files or not. If set to True, the model
won&#x2019;t be downloaded from the Hub.`,name:"local_files_only"},{anchor:"diffusers.loaders.FromOriginalVAEMixin.from_single_file.token",description:`<strong>token</strong> (<code>str</code> or <em>bool</em>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. If <code>True</code>, the token generated from
<code>diffusers-cli login</code> (stored in <code>~/.huggingface</code>) is used.`,name:"token"},{anchor:"diffusers.loaders.FromOriginalVAEMixin.from_single_file.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;main&quot;</code>) &#x2014;
The specific model version to use. It can be a branch name, a tag name, a commit id, or any identifier
allowed by Git.`,name:"revision"},{anchor:"diffusers.loaders.FromOriginalVAEMixin.from_single_file.image_size",description:`<strong>image_size</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
The image size the model was trained on. Use 512 for all Stable Diffusion v1 models and the Stable
Diffusion v2 base model. Use 768 for Stable Diffusion v2.`,name:"image_size"},{anchor:"diffusers.loaders.FromOriginalVAEMixin.from_single_file.scaling_factor",description:`<strong>scaling_factor</strong> (<code>float</code>, <em>optional</em>, defaults to 0.18215) &#x2014;
The component-wise standard deviation of the trained latent space computed using the first batch of the
training set. This is used to scale the latent space to have unit variance when training the diffusion
model. The latents are scaled with the formula <code>z = z * scaling_factor</code> before being passed to the
diffusion model. When decoding, the latents are scaled back to the original scale with the formula: <code>z = 1 / scaling_factor * z</code>. For more details, refer to sections 4.3.2 and D.1 of the <a href="https://arxiv.org/abs/2112.10752" rel="nofollow">High-Resolution
Image Synthesis with Latent Diffusion Models</a> paper.`,name:"scaling_factor"},{anchor:"diffusers.loaders.FromOriginalVAEMixin.from_single_file.kwargs",description:`<strong>kwargs</strong> (remaining dictionary of keyword arguments, <em>optional</em>) &#x2014;
Can be used to overwrite load and saveable variables (for example the pipeline components of the
specific pipeline class). The overwritten components are directly passed to the pipelines <code>__init__</code>
method. See example below for more information.`,name:"kwargs"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/loaders/autoencoder.py#L28"}}),V=new Ae({props:{warning:!0,$$slots:{default:[qe]},$$scope:{ctx:$}}}),E=new je({props:{anchor:"diffusers.loaders.FromOriginalVAEMixin.from_single_file.example",$$slots:{default:[Xe]},$$scope:{ctx:$}}}),P=new be({props:{title:"FromOriginalControlnetMixin",local:"diffusers.loaders.FromOriginalControlNetMixin",headingTag:"h2"}}),q=new se({props:{name:"class diffusers.loaders.FromOriginalControlNetMixin",anchor:"diffusers.loaders.FromOriginalControlNetMixin",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/loaders/controlnet.py#L23"}}),X=new se({props:{name:"from_single_file",anchor:"diffusers.loaders.FromOriginalControlNetMixin.from_single_file",parameters:[{name:"pretrained_model_link_or_path",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.loaders.FromOriginalControlNetMixin.from_single_file.pretrained_model_link_or_path",description:`<strong>pretrained_model_link_or_path</strong> (<code>str</code> or <code>os.PathLike</code>, <em>optional</em>) &#x2014;
Can be either:<ul>
<li>A link to the <code>.ckpt</code> file (for example
<code>&quot;https://huggingface.co/&lt;repo_id&gt;/blob/main/&lt;path_to_file&gt;.ckpt&quot;</code>) on the Hub.</li>
<li>A path to a <em>file</em> containing all pipeline weights.</li>
</ul>`,name:"pretrained_model_link_or_path"},{anchor:"diffusers.loaders.FromOriginalControlNetMixin.from_single_file.config_file",description:`<strong>config_file</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Filepath to the configuration YAML file associated with the model. If not provided it will default to:
<a href="https://raw.githubusercontent.com/lllyasviel/ControlNet/main/models/cldm_v15.yaml" rel="nofollow">https://raw.githubusercontent.com/lllyasviel/ControlNet/main/models/cldm_v15.yaml</a>`,name:"config_file"},{anchor:"diffusers.loaders.FromOriginalControlNetMixin.from_single_file.torch_dtype",description:`<strong>torch_dtype</strong> (<code>str</code> or <code>torch.dtype</code>, <em>optional</em>) &#x2014;
Override the default <code>torch.dtype</code> and load the model with another dtype. If <code>&quot;auto&quot;</code> is passed, the
dtype is automatically derived from the model&#x2019;s weights.`,name:"torch_dtype"},{anchor:"diffusers.loaders.FromOriginalControlNetMixin.from_single_file.force_download",description:`<strong>force_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to force the (re-)download of the model weights and configuration files, overriding the
cached versions if they exist.`,name:"force_download"},{anchor:"diffusers.loaders.FromOriginalControlNetMixin.from_single_file.cache_dir",description:`<strong>cache_dir</strong> (<code>Union[str, os.PathLike]</code>, <em>optional</em>) &#x2014;
Path to a directory where a downloaded pretrained model configuration is cached if the standard cache
is not used.`,name:"cache_dir"},{anchor:"diffusers.loaders.FromOriginalControlNetMixin.from_single_file.resume_download",description:`<strong>resume_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to resume downloading the model weights and configuration files. If set to <code>False</code>, any
incompletely downloaded files are deleted.`,name:"resume_download"},{anchor:"diffusers.loaders.FromOriginalControlNetMixin.from_single_file.proxies",description:`<strong>proxies</strong> (<code>Dict[str, str]</code>, <em>optional</em>) &#x2014;
A dictionary of proxy servers to use by protocol or endpoint, for example, <code>{&apos;http&apos;: &apos;foo.bar:3128&apos;, &apos;http://hostname&apos;: &apos;foo.bar:4012&apos;}</code>. The proxies are used on each request.`,name:"proxies"},{anchor:"diffusers.loaders.FromOriginalControlNetMixin.from_single_file.local_files_only",description:`<strong>local_files_only</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to only load local model weights and configuration files or not. If set to True, the model
won&#x2019;t be downloaded from the Hub.`,name:"local_files_only"},{anchor:"diffusers.loaders.FromOriginalControlNetMixin.from_single_file.token",description:`<strong>token</strong> (<code>str</code> or <em>bool</em>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. If <code>True</code>, the token generated from
<code>diffusers-cli login</code> (stored in <code>~/.huggingface</code>) is used.`,name:"token"},{anchor:"diffusers.loaders.FromOriginalControlNetMixin.from_single_file.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;main&quot;</code>) &#x2014;
The specific model version to use. It can be a branch name, a tag name, a commit id, or any identifier
allowed by Git.`,name:"revision"},{anchor:"diffusers.loaders.FromOriginalControlNetMixin.from_single_file.image_size",description:`<strong>image_size</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
The image size the model was trained on. Use 512 for all Stable Diffusion v1 models and the Stable
Diffusion v2 base model. Use 768 for Stable Diffusion v2.`,name:"image_size"},{anchor:"diffusers.loaders.FromOriginalControlNetMixin.from_single_file.upcast_attention",description:`<strong>upcast_attention</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
Whether the attention computation should always be upcasted.`,name:"upcast_attention"},{anchor:"diffusers.loaders.FromOriginalControlNetMixin.from_single_file.kwargs",description:`<strong>kwargs</strong> (remaining dictionary of keyword arguments, <em>optional</em>) &#x2014;
Can be used to overwrite load and saveable variables (for example the pipeline components of the
specific pipeline class). The overwritten components are directly passed to the pipelines <code>__init__</code>
method. See example below for more information.`,name:"kwargs"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/loaders/controlnet.py#L28"}}),I=new je({props:{anchor:"diffusers.loaders.FromOriginalControlNetMixin.from_single_file.example",$$slots:{default:[Qe]},$$scope:{ctx:$}}}),{c(){o=m("meta"),g=l(),s=m("p"),r=l(),u(f.$$.fragment),t=l(),h=m("p"),h.innerHTML=Ge,ae=l(),A=m("ul"),A.innerHTML=Ne,de=l(),u(N.$$.fragment),ce=l(),u(R.$$.fragment),fe=l(),T=m("div"),u(Y.$$.fragment),we=l(),Q=m("p"),Q.innerHTML=Se,Me=l(),Z=m("div"),u(H.$$.fragment),xe=l(),K=m("p"),K.innerHTML=Ve,ye=l(),u(S.$$.fragment),me=l(),u(O.$$.fragment),pe=l(),k=m("div"),u(D.$$.fragment),$e=l(),ee=m("p"),ee.innerHTML=Ee,ve=l(),v=m("div"),u(z.$$.fragment),Te=l(),oe=m("p"),oe.innerHTML=Ie,ke=l(),u(V.$$.fragment),Fe=l(),u(E.$$.fragment),ge=l(),u(P.$$.fragment),he=l(),F=m("div"),u(q.$$.fragment),Je=l(),te=m("p"),te.innerHTML=Le,Ze=l(),C=m("div"),u(X.$$.fragment),Ce=l(),ne=m("p"),ne.innerHTML=Be,Ue=l(),u(I.$$.fragment),ue=l(),re=m("p"),this.h()},l(e){const n=De("svelte-u9bgzb",document.head);o=p(n,"META",{name:!0,content:!0}),n.forEach(i),g=a(e),s=p(e,"P",{}),L(s).forEach(i),r=a(e),_(f.$$.fragment,e),t=a(e),h=p(e,"P",{"data-svelte-h":!0}),y(h)!=="svelte-1waiuhn"&&(h.innerHTML=Ge),ae=a(e),A=p(e,"UL",{"data-svelte-h":!0}),y(A)!=="svelte-btej2e"&&(A.innerHTML=Ne),de=a(e),_(N.$$.fragment,e),ce=a(e),_(R.$$.fragment,e),fe=a(e),T=p(e,"DIV",{class:!0});var U=L(T);_(Y.$$.fragment,U),we=a(U),Q=p(U,"P",{"data-svelte-h":!0}),y(Q)!=="svelte-11v9qjy"&&(Q.innerHTML=Se),Me=a(U),Z=p(U,"DIV",{class:!0});var j=L(Z);_(H.$$.fragment,j),xe=a(j),K=p(j,"P",{"data-svelte-h":!0}),y(K)!=="svelte-pmqrln"&&(K.innerHTML=Ve),ye=a(j),_(S.$$.fragment,j),j.forEach(i),U.forEach(i),me=a(e),_(O.$$.fragment,e),pe=a(e),k=p(e,"DIV",{class:!0});var W=L(k);_(D.$$.fragment,W),$e=a(W),ee=p(W,"P",{"data-svelte-h":!0}),y(ee)!=="svelte-rijvye"&&(ee.innerHTML=Ee),ve=a(W),v=p(W,"DIV",{class:!0});var J=L(v);_(z.$$.fragment,J),Te=a(J),oe=p(J,"P",{"data-svelte-h":!0}),y(oe)!=="svelte-hmojnk"&&(oe.innerHTML=Ie),ke=a(J),_(V.$$.fragment,J),Fe=a(J),_(E.$$.fragment,J),J.forEach(i),W.forEach(i),ge=a(e),_(P.$$.fragment,e),he=a(e),F=p(e,"DIV",{class:!0});var G=L(F);_(q.$$.fragment,G),Je=a(G),te=p(G,"P",{"data-svelte-h":!0}),y(te)!=="svelte-1xsfbj6"&&(te.innerHTML=Le),Ze=a(G),C=p(G,"DIV",{class:!0});var ie=L(C);_(X.$$.fragment,ie),Ce=a(ie),ne=p(ie,"P",{"data-svelte-h":!0}),y(ne)!=="svelte-1sfw6v0"&&(ne.innerHTML=Be),Ue=a(ie),_(I.$$.fragment,ie),ie.forEach(i),G.forEach(i),ue=a(e),re=p(e,"P",{}),L(re).forEach(i),this.h()},h(){B(o,"name","hf:doc:metadata"),B(o,"content",eo),B(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),B(T,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),B(v,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),B(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),B(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),B(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,n){c(document.head,o),d(e,g,n),d(e,s,n),d(e,r,n),b(f,e,n),d(e,t,n),d(e,h,n),d(e,ae,n),d(e,A,n),d(e,de,n),b(N,e,n),d(e,ce,n),b(R,e,n),d(e,fe,n),d(e,T,n),b(Y,T,null),c(T,we),c(T,Q),c(T,Me),c(T,Z),b(H,Z,null),c(Z,xe),c(Z,K),c(Z,ye),b(S,Z,null),d(e,me,n),b(O,e,n),d(e,pe,n),d(e,k,n),b(D,k,null),c(k,$e),c(k,ee),c(k,ve),c(k,v),b(z,v,null),c(v,Te),c(v,oe),c(v,ke),b(V,v,null),c(v,Fe),b(E,v,null),d(e,ge,n),b(P,e,n),d(e,he,n),d(e,F,n),b(q,F,null),c(F,Je),c(F,te),c(F,Ze),c(F,C),b(X,C,null),c(C,Ce),c(C,ne),c(C,Ue),b(I,C,null),d(e,ue,n),d(e,re,n),_e=!0},p(e,[n]){const U={};n&2&&(U.$$scope={dirty:n,ctx:e}),N.$set(U);const j={};n&2&&(j.$$scope={dirty:n,ctx:e}),S.$set(j);const W={};n&2&&(W.$$scope={dirty:n,ctx:e}),V.$set(W);const J={};n&2&&(J.$$scope={dirty:n,ctx:e}),E.$set(J);const G={};n&2&&(G.$$scope={dirty:n,ctx:e}),I.$set(G)},i(e){_e||(w(f.$$.fragment,e),w(N.$$.fragment,e),w(R.$$.fragment,e),w(Y.$$.fragment,e),w(H.$$.fragment,e),w(S.$$.fragment,e),w(O.$$.fragment,e),w(D.$$.fragment,e),w(z.$$.fragment,e),w(V.$$.fragment,e),w(E.$$.fragment,e),w(P.$$.fragment,e),w(q.$$.fragment,e),w(X.$$.fragment,e),w(I.$$.fragment,e),_e=!0)},o(e){M(f.$$.fragment,e),M(N.$$.fragment,e),M(R.$$.fragment,e),M(Y.$$.fragment,e),M(H.$$.fragment,e),M(S.$$.fragment,e),M(O.$$.fragment,e),M(D.$$.fragment,e),M(z.$$.fragment,e),M(V.$$.fragment,e),M(E.$$.fragment,e),M(P.$$.fragment,e),M(q.$$.fragment,e),M(X.$$.fragment,e),M(I.$$.fragment,e),_e=!1},d(e){e&&(i(g),i(s),i(r),i(t),i(h),i(ae),i(A),i(de),i(ce),i(fe),i(T),i(me),i(pe),i(k),i(ge),i(he),i(F),i(ue),i(re)),i(o),x(f,e),x(N,e),x(R,e),x(Y),x(H),x(S),x(O,e),x(D),x(z),x(V),x(E),x(P,e),x(q),x(X),x(I)}}}const eo='{"title":"Single files","local":"single-files","sections":[{"title":"FromSingleFileMixin","local":"diffusers.loaders.FromSingleFileMixin","sections":[],"depth":2},{"title":"FromOriginalVAEMixin","local":"diffusers.loaders.FromOriginalVAEMixin","sections":[],"depth":2},{"title":"FromOriginalControlnetMixin","local":"diffusers.loaders.FromOriginalControlNetMixin","sections":[],"depth":2}],"depth":1}';function oo($){return Ye(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class co extends He{constructor(o){super(),Oe(this,o,oo,Ke,Re,{})}}export{co as component};
