import{s as qe,o as ze,n as ae}from"../chunks/scheduler.182ea377.js";import{S as Oe,i as Pe,g as m,s as a,r as u,A as Re,h as p,f as i,c as l,j as V,u as _,x as M,k as A,y as c,a as d,v as b,d as x,t as w,w as y}from"../chunks/index.abf12888.js";import{T as Be}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 Se}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(s){o=p(s,"P",{"data-svelte-h":!0}),M(o)!=="svelte-1d80t6b"&&(o.innerHTML=g)},m(s,r){d(s,o,r)},p:ae,d(s){s&&i(o)}}}function He(v){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=a(),u(r.$$.fragment)},l(t){o=p(t,"P",{"data-svelte-h":!0}),M(o)!=="svelte-kvfsh7"&&(o.textContent=g),s=l(t),_(r.$$.fragment,t)},m(t,h){d(t,o,h),d(t,s,h),b(r,t,h),f=!0},p:ae,i(t){f||(x(r.$$.fragment,t),f=!0)},o(t){w(r.$$.fragment,t),f=!1},d(t){t&&(i(o),i(s)),y(r,t)}}}function Ye(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(s){o=p(s,"P",{"data-svelte-h":!0}),M(o)!=="svelte-29ildn"&&(o.innerHTML=g)},m(s,r){d(s,o,r)},p:ae,d(s){s&&i(o)}}}function Xe(v){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=a(),u(r.$$.fragment)},l(t){o=p(t,"P",{"data-svelte-h":!0}),M(o)!=="svelte-kvfsh7"&&(o.textContent=g),s=l(t),_(r.$$.fragment,t)},m(t,h){d(t,o,h),d(t,s,h),b(r,t,h),f=!0},p:ae,i(t){f||(x(r.$$.fragment,t),f=!0)},o(t){w(r.$$.fragment,t),f=!1},d(t){t&&(i(o),i(s)),y(r,t)}}}function Qe(v){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=a(),u(r.$$.fragment)},l(t){o=p(t,"P",{"data-svelte-h":!0}),M(o)!=="svelte-kvfsh7"&&(o.textContent=g),s=l(t),_(r.$$.fragment,t)},m(t,h){d(t,o,h),d(t,s,h),b(r,t,h),f=!0},p:ae,i(t){f||(x(r.$$.fragment,t),f=!0)},o(t){w(r.$$.fragment,t),f=!1},d(t){t&&(i(o),i(s)),y(r,t)}}}function Ke(v){let o,g,s,r,f,t,h,je="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:",le,B,Ie='<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,I,ce,q,fe,T,z,xe,Q,Ge='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>.',we,C,O,ye,K,Ee=`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.`,Me,G,me,P,pe,F,R,ve,ee,Le='Load pretrained ControlNet weights saved in the <code>.ckpt</code> or <code>.safetensors</code> format into an <a href="/docs/diffusers/main/en/api/models/autoencoderkl#diffusers.AutoencoderKL">AutoencoderKL</a>.',$e,$,D,Te,oe,Ne=`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.`,Fe,E,ke,L,ge,H,he,k,Y,Je,te,Ve='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>.',Ce,Z,X,Ze,ne,Ae=`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,N,ue,re,_e;return f=new be({props:{title:"Single files",local:"single-files",headingTag:"h1"}}),I=new Be({props:{$$slots:{default:[De]},$$scope:{ctx:v}}}),q=new be({props:{title:"FromSingleFileMixin",local:"diffusers.loaders.FromSingleFileMixin",headingTag:"h2"}}),z=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#L42"}}),O=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. 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.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.use_safetensors",description:`<strong>use_safetensors</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
If set to <code>None</code>, the safetensors weights are downloaded if they&#x2019;re available <strong>and</strong> if the
safetensors library is installed. If set to <code>True</code>, the model is forcibly loaded from safetensors
weights. If set to <code>False</code>, safetensors weights are not loaded.`,name:"use_safetensors"},{anchor:"diffusers.loaders.FromSingleFileMixin.from_single_file.extract_ema",description:`<strong>extract_ema</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to extract the EMA weights or not. Pass <code>True</code> to extract the EMA weights which usually yield
higher quality images for inference. Non-EMA weights are usually better for continuing finetuning.`,name:"extract_ema"},{anchor:"diffusers.loaders.FromSingleFileMixin.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.FromSingleFileMixin.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.FromSingleFileMixin.from_single_file.prediction_type",description:`<strong>prediction_type</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The prediction type the model was trained on. Use <code>&apos;epsilon&apos;</code> for all Stable Diffusion v1 models and
the Stable Diffusion v2 base model. Use <code>&apos;v_prediction&apos;</code> for Stable Diffusion v2.`,name:"prediction_type"},{anchor:"diffusers.loaders.FromSingleFileMixin.from_single_file.num_in_channels",description:`<strong>num_in_channels</strong> (<code>int</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
The number of input channels. If <code>None</code>, it is automatically inferred.`,name:"num_in_channels"},{anchor:"diffusers.loaders.FromSingleFileMixin.from_single_file.scheduler_type",description:`<strong>scheduler_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pndm&quot;</code>) &#x2014;
Type of scheduler to use. Should be one of <code>[&quot;pndm&quot;, &quot;lms&quot;, &quot;heun&quot;, &quot;euler&quot;, &quot;euler-ancestral&quot;, &quot;dpm&quot;, &quot;ddim&quot;]</code>.`,name:"scheduler_type"},{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>True</code>) &#x2014;
Whether to load the safety checker or not.`,name:"load_safety_checker"},{anchor:"diffusers.loaders.FromSingleFileMixin.from_single_file.text_encoder",description:`<strong>text_encoder</strong> (<a href="https://huggingface.co/docs/transformers/main/en/model_doc/clip#transformers.CLIPTextModel" rel="nofollow">CLIPTextModel</a>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
An instance of <code>CLIPTextModel</code> to use, specifically the
<a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a> variant. If this
parameter is <code>None</code>, the function loads a new instance of <code>CLIPTextModel</code> by itself if needed.`,name:"text_encoder"},{anchor:"diffusers.loaders.FromSingleFileMixin.from_single_file.vae",description:`<strong>vae</strong> (<code>AutoencoderKL</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations. If
this parameter is <code>None</code>, the function will load a new instance of [CLIP] by itself, if needed.`,name:"vae"},{anchor:"diffusers.loaders.FromSingleFileMixin.from_single_file.tokenizer",description:`<strong>tokenizer</strong> (<a href="https://huggingface.co/docs/transformers/main/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
An instance of <code>CLIPTokenizer</code> to use. If this parameter is <code>None</code>, the function loads a new instance
of <code>CLIPTokenizer</code> by itself if needed.`,name:"tokenizer"},{anchor:"diffusers.loaders.FromSingleFileMixin.from_single_file.original_config_file",description:`<strong>original_config_file</strong> (<code>str</code>) &#x2014;
Path to <code>.yaml</code> config file corresponding to the original architecture. If <code>None</code>, will be
automatically inferred by looking for a key that only exists in SD2.0 models.`,name:"original_config_file"},{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 (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/single_file.py#L53"}}),G=new Se({props:{anchor:"diffusers.loaders.FromSingleFileMixin.from_single_file.example",$$slots:{default:[He]},$$scope:{ctx:v}}}),P=new be({props:{title:"FromOriginalVAEMixin",local:"diffusers.loaders.FromOriginalVAEMixin",headingTag:"h2"}}),R=new se({props:{name:"class diffusers.loaders.FromOriginalVAEMixin",anchor:"diffusers.loaders.FromOriginalVAEMixin",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/loaders/single_file.py#L290"}}),D=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.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.use_safetensors",description:`<strong>use_safetensors</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
If set to <code>None</code>, the safetensors weights are downloaded if they&#x2019;re available <strong>and</strong> if the
safetensors library is installed. If set to <code>True</code>, the model is forcibly loaded from safetensors
weights. If set to <code>False</code>, safetensors weights are not loaded.`,name:"use_safetensors"},{anchor:"diffusers.loaders.FromOriginalVAEMixin.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.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/single_file.py#L295"}}),E=new Be({props:{warning:!0,$$slots:{default:[Ye]},$$scope:{ctx:v}}}),L=new Se({props:{anchor:"diffusers.loaders.FromOriginalVAEMixin.from_single_file.example",$$slots:{default:[Xe]},$$scope:{ctx:v}}}),H=new be({props:{title:"FromOriginalControlnetMixin",local:"diffusers.loaders.FromOriginalControlnetMixin",headingTag:"h2"}}),Y=new se({props:{name:"class diffusers.loaders.FromOriginalControlnetMixin",anchor:"diffusers.loaders.FromOriginalControlnetMixin",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/loaders/single_file.py#L488"}}),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.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.use_safetensors",description:`<strong>use_safetensors</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
If set to <code>None</code>, the safetensors weights are downloaded if they&#x2019;re available <strong>and</strong> if the
safetensors library is installed. If set to <code>True</code>, the model is forcibly loaded from safetensors
weights. If set to <code>False</code>, safetensors weights are not loaded.`,name:"use_safetensors"},{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/single_file.py#L493"}}),N=new Se({props:{anchor:"diffusers.loaders.FromOriginalControlnetMixin.from_single_file.example",$$slots:{default:[Qe]},$$scope:{ctx:v}}}),{c(){o=m("meta"),g=a(),s=m("p"),r=a(),u(f.$$.fragment),t=a(),h=m("p"),h.innerHTML=je,le=a(),B=m("ul"),B.innerHTML=Ie,de=a(),u(I.$$.fragment),ce=a(),u(q.$$.fragment),fe=a(),T=m("div"),u(z.$$.fragment),xe=a(),Q=m("p"),Q.innerHTML=Ge,we=a(),C=m("div"),u(O.$$.fragment),ye=a(),K=m("p"),K.innerHTML=Ee,Me=a(),u(G.$$.fragment),me=a(),u(P.$$.fragment),pe=a(),F=m("div"),u(R.$$.fragment),ve=a(),ee=m("p"),ee.innerHTML=Le,$e=a(),$=m("div"),u(D.$$.fragment),Te=a(),oe=m("p"),oe.innerHTML=Ne,Fe=a(),u(E.$$.fragment),ke=a(),u(L.$$.fragment),ge=a(),u(H.$$.fragment),he=a(),k=m("div"),u(Y.$$.fragment),Je=a(),te=m("p"),te.innerHTML=Ve,Ce=a(),Z=m("div"),u(X.$$.fragment),Ze=a(),ne=m("p"),ne.innerHTML=Ae,Ue=a(),u(N.$$.fragment),ue=a(),re=m("p"),this.h()},l(e){const n=Re("svelte-u9bgzb",document.head);o=p(n,"META",{name:!0,content:!0}),n.forEach(i),g=l(e),s=p(e,"P",{}),V(s).forEach(i),r=l(e),_(f.$$.fragment,e),t=l(e),h=p(e,"P",{"data-svelte-h":!0}),M(h)!=="svelte-1waiuhn"&&(h.innerHTML=je),le=l(e),B=p(e,"UL",{"data-svelte-h":!0}),M(B)!=="svelte-btej2e"&&(B.innerHTML=Ie),de=l(e),_(I.$$.fragment,e),ce=l(e),_(q.$$.fragment,e),fe=l(e),T=p(e,"DIV",{class:!0});var U=V(T);_(z.$$.fragment,U),xe=l(U),Q=p(U,"P",{"data-svelte-h":!0}),M(Q)!=="svelte-11v9qjy"&&(Q.innerHTML=Ge),we=l(U),C=p(U,"DIV",{class:!0});var S=V(C);_(O.$$.fragment,S),ye=l(S),K=p(S,"P",{"data-svelte-h":!0}),M(K)!=="svelte-pmqrln"&&(K.innerHTML=Ee),Me=l(S),_(G.$$.fragment,S),S.forEach(i),U.forEach(i),me=l(e),_(P.$$.fragment,e),pe=l(e),F=p(e,"DIV",{class:!0});var W=V(F);_(R.$$.fragment,W),ve=l(W),ee=p(W,"P",{"data-svelte-h":!0}),M(ee)!=="svelte-9412da"&&(ee.innerHTML=Le),$e=l(W),$=p(W,"DIV",{class:!0});var J=V($);_(D.$$.fragment,J),Te=l(J),oe=p(J,"P",{"data-svelte-h":!0}),M(oe)!=="svelte-hmojnk"&&(oe.innerHTML=Ne),Fe=l(J),_(E.$$.fragment,J),ke=l(J),_(L.$$.fragment,J),J.forEach(i),W.forEach(i),ge=l(e),_(H.$$.fragment,e),he=l(e),k=p(e,"DIV",{class:!0});var j=V(k);_(Y.$$.fragment,j),Je=l(j),te=p(j,"P",{"data-svelte-h":!0}),M(te)!=="svelte-1xsfbj6"&&(te.innerHTML=Ve),Ce=l(j),Z=p(j,"DIV",{class:!0});var ie=V(Z);_(X.$$.fragment,ie),Ze=l(ie),ne=p(ie,"P",{"data-svelte-h":!0}),M(ne)!=="svelte-1sfw6v0"&&(ne.innerHTML=Ae),Ue=l(ie),_(N.$$.fragment,ie),ie.forEach(i),j.forEach(i),ue=l(e),re=p(e,"P",{}),V(re).forEach(i),this.h()},h(){A(o,"name","hf:doc:metadata"),A(o,"content",eo),A(C,"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(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),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(k,"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,le,n),d(e,B,n),d(e,de,n),b(I,e,n),d(e,ce,n),b(q,e,n),d(e,fe,n),d(e,T,n),b(z,T,null),c(T,xe),c(T,Q),c(T,we),c(T,C),b(O,C,null),c(C,ye),c(C,K),c(C,Me),b(G,C,null),d(e,me,n),b(P,e,n),d(e,pe,n),d(e,F,n),b(R,F,null),c(F,ve),c(F,ee),c(F,$e),c(F,$),b(D,$,null),c($,Te),c($,oe),c($,Fe),b(E,$,null),c($,ke),b(L,$,null),d(e,ge,n),b(H,e,n),d(e,he,n),d(e,k,n),b(Y,k,null),c(k,Je),c(k,te),c(k,Ce),c(k,Z),b(X,Z,null),c(Z,Ze),c(Z,ne),c(Z,Ue),b(N,Z,null),d(e,ue,n),d(e,re,n),_e=!0},p(e,[n]){const U={};n&2&&(U.$$scope={dirty:n,ctx:e}),I.$set(U);const S={};n&2&&(S.$$scope={dirty:n,ctx:e}),G.$set(S);const W={};n&2&&(W.$$scope={dirty:n,ctx:e}),E.$set(W);const J={};n&2&&(J.$$scope={dirty:n,ctx:e}),L.$set(J);const j={};n&2&&(j.$$scope={dirty:n,ctx:e}),N.$set(j)},i(e){_e||(x(f.$$.fragment,e),x(I.$$.fragment,e),x(q.$$.fragment,e),x(z.$$.fragment,e),x(O.$$.fragment,e),x(G.$$.fragment,e),x(P.$$.fragment,e),x(R.$$.fragment,e),x(D.$$.fragment,e),x(E.$$.fragment,e),x(L.$$.fragment,e),x(H.$$.fragment,e),x(Y.$$.fragment,e),x(X.$$.fragment,e),x(N.$$.fragment,e),_e=!0)},o(e){w(f.$$.fragment,e),w(I.$$.fragment,e),w(q.$$.fragment,e),w(z.$$.fragment,e),w(O.$$.fragment,e),w(G.$$.fragment,e),w(P.$$.fragment,e),w(R.$$.fragment,e),w(D.$$.fragment,e),w(E.$$.fragment,e),w(L.$$.fragment,e),w(H.$$.fragment,e),w(Y.$$.fragment,e),w(X.$$.fragment,e),w(N.$$.fragment,e),_e=!1},d(e){e&&(i(g),i(s),i(r),i(t),i(h),i(le),i(B),i(de),i(ce),i(fe),i(T),i(me),i(pe),i(F),i(ge),i(he),i(k),i(ue),i(re)),i(o),y(f,e),y(I,e),y(q,e),y(z),y(O),y(G),y(P,e),y(R),y(D),y(E),y(L),y(H,e),y(Y),y(X),y(N)}}}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 ze(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class co extends Oe{constructor(o){super(),Pe(this,o,oo,Ke,qe,{})}}export{co as component};
