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 ze,h as p,f as i,c as a,j as L,u as _,x as M,k as A,y as c,a as d,v as b,d as w,t as x,w as y}from"../chunks/index.abf12888.js";import{T as Be}from"../chunks/Tip.230e2334.js";import{D as re}from"../chunks/Docstring.93f6f462.js";import{C as je}from"../chunks/CodeBlock.57fe6e13.js";import{E as We}from"../chunks/ExampleCodeBlock.658f5cd6.js";import{H as be}from"../chunks/Heading.16916d63.js";function De(v){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(r){o=p(r,"P",{"data-svelte-h":!0}),M(o)!=="svelte-1d80t6b"&&(o.innerHTML=g)},m(r,s){d(r,o,s)},p:le,d(r){r&&i(o)}}}function Pe(v){let o,g="Examples:",r,s,f;return s=new je({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,r=l(),u(s.$$.fragment)},l(t){o=p(t,"P",{"data-svelte-h":!0}),M(o)!=="svelte-kvfsh7"&&(o.textContent=g),r=a(t),_(s.$$.fragment,t)},m(t,h){d(t,o,h),d(t,r,h),b(s,t,h),f=!0},p:le,i(t){f||(w(s.$$.fragment,t),f=!0)},o(t){x(s.$$.fragment,t),f=!1},d(t){t&&(i(o),i(r)),y(s,t)}}}function qe(v){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(r){o=p(r,"P",{"data-svelte-h":!0}),M(o)!=="svelte-29ildn"&&(o.innerHTML=g)},m(r,s){d(r,o,s)},p:le,d(r){r&&i(o)}}}function Xe(v){let o,g="Examples:",r,s,f;return s=new je({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,r=l(),u(s.$$.fragment)},l(t){o=p(t,"P",{"data-svelte-h":!0}),M(o)!=="svelte-kvfsh7"&&(o.textContent=g),r=a(t),_(s.$$.fragment,t)},m(t,h){d(t,o,h),d(t,r,h),b(s,t,h),f=!0},p:le,i(t){f||(w(s.$$.fragment,t),f=!0)},o(t){x(s.$$.fragment,t),f=!1},d(t){t&&(i(o),i(r)),y(s,t)}}}function Qe(v){let o,g="Examples:",r,s,f;return s=new je({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,r=l(),u(s.$$.fragment)},l(t){o=p(t,"P",{"data-svelte-h":!0}),M(o)!=="svelte-kvfsh7"&&(o.textContent=g),r=a(t),_(s.$$.fragment,t)},m(t,h){d(t,o,h),d(t,r,h),b(s,t,h),f=!0},p:le,i(t){f||(w(s.$$.fragment,t),f=!0)},o(t){x(s.$$.fragment,t),f=!1},d(t){t&&(i(o),i(r)),y(s,t)}}}function Ke(v){let o,g,r,s,f,t,h,Se="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,B,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/v0.27.1/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,Ge='Load model weights saved in the <code>.ckpt</code> format into a <a href="/docs/diffusers/v0.27.1/en/api/pipelines/overview#diffusers.DiffusionPipeline">DiffusionPipeline</a>.',xe,Z,H,ye,K,Ie=`Instantiate a <a href="/docs/diffusers/v0.27.1/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.`,Me,G,me,O,pe,k,z,ve,ee,Ve='Load pretrained AutoencoderKL weights saved in the <code>.ckpt</code> or <code>.safetensors</code> format into a <a href="/docs/diffusers/v0.27.1/en/api/models/autoencoderkl#diffusers.AutoencoderKL">AutoencoderKL</a>.',$e,$,D,Te,oe,Ee=`Instantiate a <a href="/docs/diffusers/v0.27.1/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,I,Fe,V,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/v0.27.1/en/api/models/controlnet#diffusers.ControlNetModel">ControlNetModel</a>.',Ze,U,X,Ue,ne,Ae=`Instantiate a <a href="/docs/diffusers/v0.27.1/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.`,Ce,E,ue,se,_e;return f=new be({props:{title:"Single files",local:"single-files",headingTag:"h1"}}),N=new Be({props:{$$slots:{default:[De]},$$scope:{ctx:v}}}),R=new be({props:{title:"FromSingleFileMixin",local:"diffusers.loaders.FromSingleFileMixin",headingTag:"h2"}}),Y=new re({props:{name:"class diffusers.loaders.FromSingleFileMixin",anchor:"diffusers.loaders.FromSingleFileMixin",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.27.1/src/diffusers/loaders/single_file.py#L154"}}),H=new re({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"},{anchor:"diffusers.loaders.FromSingleFileMixin.from_single_file.original_config_file",description:`<strong>original_config_file</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The path to the original config file that was used to train the model. If not provided, the config file
will be inferred from the checkpoint file.`,name:"original_config_file"},{anchor:"diffusers.loaders.FromSingleFileMixin.from_single_file.model_type",description:`<strong>model_type</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The type of model to load. If not provided, the model type will be inferred from the checkpoint file.`,name:"model_type"},{anchor:"diffusers.loaders.FromSingleFileMixin.from_single_file.image_size",description:`<strong>image_size</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The size of the image output. It&#x2019;s used to configure the <code>sample_size</code> parameter of the UNet and VAE model.`,name:"image_size"},{anchor:"diffusers.loaders.FromSingleFileMixin.from_single_file.load_safety_checker",description:`<strong>load_safety_checker</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to load the safety checker model or not. By default, the safety checker is not loaded unless a <code>safety_checker</code> component is passed to the <code>kwargs</code>.`,name:"load_safety_checker"},{anchor:"diffusers.loaders.FromSingleFileMixin.from_single_file.num_in_channels",description:`<strong>num_in_channels</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Specify the number of input channels for the UNet model. Read more about how to configure UNet model with this parameter
<a href="https://huggingface.co/docs/diffusers/training/adapt_a_model#configure-unet2dconditionmodel-parameters" rel="nofollow">here</a>.`,name:"num_in_channels"},{anchor:"diffusers.loaders.FromSingleFileMixin.from_single_file.scaling_factor",description:`<strong>scaling_factor</strong> (<code>float</code>, <em>optional</em>) &#x2014;
The scaling factor to use for the VAE model. If not provided, it is inferred from the config file first.
If the scaling factor is not found in the config file, the default value 0.18215 is used.`,name:"scaling_factor"},{anchor:"diffusers.loaders.FromSingleFileMixin.from_single_file.scheduler_type",description:`<strong>scheduler_type</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The type of scheduler to load. If not provided, the scheduler type will be inferred from the checkpoint file.`,name:"scheduler_type"},{anchor:"diffusers.loaders.FromSingleFileMixin.from_single_file.prediction_type",description:`<strong>prediction_type</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The type of prediction to load. If not provided, the prediction type will be inferred from the checkpoint file.`,name:"prediction_type"},{anchor:"diffusers.loaders.FromSingleFileMixin.from_single_file.kwargs",description:`<strong>kwargs</strong> (remaining dictionary of keyword arguments, <em>optional</em>) &#x2014;
Can be used to overwrite load and saveable variables (the pipeline components of the specific pipeline
class). The overwritten components are passed directly to the pipelines <code>__init__</code> method. See example
below for more information.`,name:"kwargs"}],source:"https://github.com/huggingface/diffusers/blob/v0.27.1/src/diffusers/loaders/single_file.py#L159"}}),G=new We({props:{anchor:"diffusers.loaders.FromSingleFileMixin.from_single_file.example",$$slots:{default:[Pe]},$$scope:{ctx:v}}}),O=new be({props:{title:"FromOriginalVAEMixin",local:"diffusers.loaders.FromOriginalVAEMixin",headingTag:"h2"}}),z=new re({props:{name:"class diffusers.loaders.FromOriginalVAEMixin",anchor:"diffusers.loaders.FromOriginalVAEMixin",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.27.1/src/diffusers/loaders/autoencoder.py#L23"}}),D=new re({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/v0.27.1/src/diffusers/loaders/autoencoder.py#L28"}}),I=new Be({props:{warning:!0,$$slots:{default:[qe]},$$scope:{ctx:v}}}),V=new We({props:{anchor:"diffusers.loaders.FromOriginalVAEMixin.from_single_file.example",$$slots:{default:[Xe]},$$scope:{ctx:v}}}),P=new be({props:{title:"FromOriginalControlnetMixin",local:"diffusers.loaders.FromOriginalControlNetMixin",headingTag:"h2"}}),q=new re({props:{name:"class diffusers.loaders.FromOriginalControlNetMixin",anchor:"diffusers.loaders.FromOriginalControlNetMixin",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.27.1/src/diffusers/loaders/controlnet.py#L23"}}),X=new re({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/v0.27.1/src/diffusers/loaders/controlnet.py#L28"}}),E=new We({props:{anchor:"diffusers.loaders.FromOriginalControlNetMixin.from_single_file.example",$$slots:{default:[Qe]},$$scope:{ctx:v}}}),{c(){o=m("meta"),g=l(),r=m("p"),s=l(),u(f.$$.fragment),t=l(),h=m("p"),h.innerHTML=Se,ae=l(),B=m("ul"),B.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=Ge,xe=l(),Z=m("div"),u(H.$$.fragment),ye=l(),K=m("p"),K.innerHTML=Ie,Me=l(),u(G.$$.fragment),me=l(),u(O.$$.fragment),pe=l(),k=m("div"),u(z.$$.fragment),ve=l(),ee=m("p"),ee.innerHTML=Ve,$e=l(),$=m("div"),u(D.$$.fragment),Te=l(),oe=m("p"),oe.innerHTML=Ee,ke=l(),u(I.$$.fragment),Fe=l(),u(V.$$.fragment),ge=l(),u(P.$$.fragment),he=l(),F=m("div"),u(q.$$.fragment),Je=l(),te=m("p"),te.innerHTML=Le,Ze=l(),U=m("div"),u(X.$$.fragment),Ue=l(),ne=m("p"),ne.innerHTML=Ae,Ce=l(),u(E.$$.fragment),ue=l(),se=m("p"),this.h()},l(e){const n=ze("svelte-u9bgzb",document.head);o=p(n,"META",{name:!0,content:!0}),n.forEach(i),g=a(e),r=p(e,"P",{}),L(r).forEach(i),s=a(e),_(f.$$.fragment,e),t=a(e),h=p(e,"P",{"data-svelte-h":!0}),M(h)!=="svelte-1waiuhn"&&(h.innerHTML=Se),ae=a(e),B=p(e,"UL",{"data-svelte-h":!0}),M(B)!=="svelte-1xeuxwx"&&(B.innerHTML=Ne),de=a(e),_(N.$$.fragment,e),ce=a(e),_(R.$$.fragment,e),fe=a(e),T=p(e,"DIV",{class:!0});var C=L(T);_(Y.$$.fragment,C),we=a(C),Q=p(C,"P",{"data-svelte-h":!0}),M(Q)!=="svelte-1hqz0ap"&&(Q.innerHTML=Ge),xe=a(C),Z=p(C,"DIV",{class:!0});var W=L(Z);_(H.$$.fragment,W),ye=a(W),K=p(W,"P",{"data-svelte-h":!0}),M(K)!=="svelte-14hrga6"&&(K.innerHTML=Ie),Me=a(W),_(G.$$.fragment,W),W.forEach(i),C.forEach(i),me=a(e),_(O.$$.fragment,e),pe=a(e),k=p(e,"DIV",{class:!0});var j=L(k);_(z.$$.fragment,j),ve=a(j),ee=p(j,"P",{"data-svelte-h":!0}),M(ee)!=="svelte-16ek7y5"&&(ee.innerHTML=Ve),$e=a(j),$=p(j,"DIV",{class:!0});var J=L($);_(D.$$.fragment,J),Te=a(J),oe=p(J,"P",{"data-svelte-h":!0}),M(oe)!=="svelte-19opx8j"&&(oe.innerHTML=Ee),ke=a(J),_(I.$$.fragment,J),Fe=a(J),_(V.$$.fragment,J),J.forEach(i),j.forEach(i),ge=a(e),_(P.$$.fragment,e),he=a(e),F=p(e,"DIV",{class:!0});var S=L(F);_(q.$$.fragment,S),Je=a(S),te=p(S,"P",{"data-svelte-h":!0}),M(te)!=="svelte-1i670wb"&&(te.innerHTML=Le),Ze=a(S),U=p(S,"DIV",{class:!0});var ie=L(U);_(X.$$.fragment,ie),Ue=a(ie),ne=p(ie,"P",{"data-svelte-h":!0}),M(ne)!=="svelte-i9bcef"&&(ne.innerHTML=Ae),Ce=a(ie),_(E.$$.fragment,ie),ie.forEach(i),S.forEach(i),ue=a(e),se=p(e,"P",{}),L(se).forEach(i),this.h()},h(){A(o,"name","hf:doc:metadata"),A(o,"content",eo),A(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(T,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(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,r,n),d(e,s,n),b(f,e,n),d(e,t,n),d(e,h,n),d(e,ae,n),d(e,B,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,xe),c(T,Z),b(H,Z,null),c(Z,ye),c(Z,K),c(Z,Me),b(G,Z,null),d(e,me,n),b(O,e,n),d(e,pe,n),d(e,k,n),b(z,k,null),c(k,ve),c(k,ee),c(k,$e),c(k,$),b(D,$,null),c($,Te),c($,oe),c($,ke),b(I,$,null),c($,Fe),b(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,U),b(X,U,null),c(U,Ue),c(U,ne),c(U,Ce),b(E,U,null),d(e,ue,n),d(e,se,n),_e=!0},p(e,[n]){const C={};n&2&&(C.$$scope={dirty:n,ctx:e}),N.$set(C);const W={};n&2&&(W.$$scope={dirty:n,ctx:e}),G.$set(W);const j={};n&2&&(j.$$scope={dirty:n,ctx:e}),I.$set(j);const J={};n&2&&(J.$$scope={dirty:n,ctx:e}),V.$set(J);const S={};n&2&&(S.$$scope={dirty:n,ctx:e}),E.$set(S)},i(e){_e||(w(f.$$.fragment,e),w(N.$$.fragment,e),w(R.$$.fragment,e),w(Y.$$.fragment,e),w(H.$$.fragment,e),w(G.$$.fragment,e),w(O.$$.fragment,e),w(z.$$.fragment,e),w(D.$$.fragment,e),w(I.$$.fragment,e),w(V.$$.fragment,e),w(P.$$.fragment,e),w(q.$$.fragment,e),w(X.$$.fragment,e),w(E.$$.fragment,e),_e=!0)},o(e){x(f.$$.fragment,e),x(N.$$.fragment,e),x(R.$$.fragment,e),x(Y.$$.fragment,e),x(H.$$.fragment,e),x(G.$$.fragment,e),x(O.$$.fragment,e),x(z.$$.fragment,e),x(D.$$.fragment,e),x(I.$$.fragment,e),x(V.$$.fragment,e),x(P.$$.fragment,e),x(q.$$.fragment,e),x(X.$$.fragment,e),x(E.$$.fragment,e),_e=!1},d(e){e&&(i(g),i(r),i(s),i(t),i(h),i(ae),i(B),i(de),i(ce),i(fe),i(T),i(me),i(pe),i(k),i(ge),i(he),i(F),i(ue),i(se)),i(o),y(f,e),y(N,e),y(R,e),y(Y),y(H),y(G),y(O,e),y(z),y(D),y(I),y(V),y(P,e),y(q),y(X),y(E)}}}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(v){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};
