Buckets:
| import{s as Oe,o as Re,n as ae}from"../chunks/scheduler.182ea377.js";import{S as He,i as Ye,g as m,s as a,r as u,A as ze,h as p,f as s,c as l,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 x,w as M}from"../chunks/index.abf12888.js";import{T as Ae}from"../chunks/Tip.230e2334.js";import{D as ie}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(i){o=p(i,"P",{"data-svelte-h":!0}),y(o)!=="svelte-1d80t6b"&&(o.innerHTML=g)},m(i,r){d(i,o,r)},p:ae,d(i){i&&s(o)}}}function Pe(v){let o,g="Examples:",i,r,f;return r=new je({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvblBpcGVsaW5lJTBBJTBBJTIzJTIwRG93bmxvYWQlMjBwaXBlbGluZSUyMGZyb20lMjBodWdnaW5nZmFjZS5jbyUyMGFuZCUyMGNhY2hlLiUwQXBpcGVsaW5lJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9zaW5nbGVfZmlsZSglMEElMjAlMjAlMjAlMjAlMjJodHRwcyUzQSUyRiUyRmh1Z2dpbmdmYWNlLmNvJTJGV2Fycmlvck1hbWE3NzclMkZPcmFuZ2VNaXhzJTJGYmxvYiUyRm1haW4lMkZNb2RlbHMlMkZBYnlzc09yYW5nZU1peCUyRkFieXNzT3JhbmdlTWl4LnNhZmV0ZW5zb3JzJTIyJTBBKSUwQSUwQSUyMyUyMERvd25sb2FkJTIwcGlwZWxpbmUlMjBmcm9tJTIwbG9jYWwlMjBmaWxlJTBBJTIzJTIwZmlsZSUyMGlzJTIwZG93bmxvYWRlZCUyMHVuZGVyJTIwLiUyRnYxLTUtcHJ1bmVkLWVtYW9ubHkuY2twdCUwQXBpcGVsaW5lJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9zaW5nbGVfZmlsZSglMjIuJTJGdjEtNS1wcnVuZWQtZW1hb25seSUyMiklMEElMEElMjMlMjBFbmFibGUlMjBmbG9hdDE2JTIwYW5kJTIwbW92ZSUyMHRvJTIwR1BVJTBBcGlwZWxpbmUlMjAlM0QlMjBTdGFibGVEaWZmdXNpb25QaXBlbGluZS5mcm9tX3NpbmdsZV9maWxlKCUwQSUyMCUyMCUyMCUyMCUyMmh0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZydW53YXltbCUyRnN0YWJsZS1kaWZmdXNpb24tdjEtNSUyRmJsb2IlMkZtYWluJTJGdjEtNS1wcnVuZWQtZW1hb25seS5ja3B0JTIyJTJDJTBBJTIwJTIwJTIwJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTJDJTBBKSUwQXBpcGVsaW5lLnRvKCUyMmN1ZGElMjIp",highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionPipeline | |
| <span class="hljs-meta">>>> </span><span class="hljs-comment"># Download pipeline from huggingface.co and cache.</span> | |
| <span class="hljs-meta">>>> </span>pipeline = StableDiffusionPipeline.from_single_file( | |
| <span class="hljs-meta">... </span> <span class="hljs-string">"https://huggingface.co/WarriorMama777/OrangeMixs/blob/main/Models/AbyssOrangeMix/AbyssOrangeMix.safetensors"</span> | |
| <span class="hljs-meta">... </span>) | |
| <span class="hljs-meta">>>> </span><span class="hljs-comment"># Download pipeline from local file</span> | |
| <span class="hljs-meta">>>> </span><span class="hljs-comment"># file is downloaded under ./v1-5-pruned-emaonly.ckpt</span> | |
| <span class="hljs-meta">>>> </span>pipeline = StableDiffusionPipeline.from_single_file(<span class="hljs-string">"./v1-5-pruned-emaonly"</span>) | |
| <span class="hljs-meta">>>> </span><span class="hljs-comment"># Enable float16 and move to GPU</span> | |
| <span class="hljs-meta">>>> </span>pipeline = StableDiffusionPipeline.from_single_file( | |
| <span class="hljs-meta">... </span> <span class="hljs-string">"https://huggingface.co/runwayml/stable-diffusion-v1-5/blob/main/v1-5-pruned-emaonly.ckpt"</span>, | |
| <span class="hljs-meta">... </span> torch_dtype=torch.float16, | |
| <span class="hljs-meta">... </span>) | |
| <span class="hljs-meta">>>> </span>pipeline.to(<span class="hljs-string">"cuda"</span>)`,wrap:!1}}),{c(){o=m("p"),o.textContent=g,i=a(),u(r.$$.fragment)},l(t){o=p(t,"P",{"data-svelte-h":!0}),y(o)!=="svelte-kvfsh7"&&(o.textContent=g),i=l(t),_(r.$$.fragment,t)},m(t,h){d(t,o,h),d(t,i,h),b(r,t,h),f=!0},p:ae,i(t){f||(w(r.$$.fragment,t),f=!0)},o(t){x(r.$$.fragment,t),f=!1},d(t){t&&(s(o),s(i)),M(r,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(i){o=p(i,"P",{"data-svelte-h":!0}),y(o)!=="svelte-29ildn"&&(o.innerHTML=g)},m(i,r){d(i,o,r)},p:ae,d(i){i&&s(o)}}}function Xe(v){let o,g="Examples:",i,r,f;return r=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">"https://huggingface.co/stabilityai/sd-vae-ft-mse-original/blob/main/vae-ft-mse-840000-ema-pruned.safetensors"</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,i=a(),u(r.$$.fragment)},l(t){o=p(t,"P",{"data-svelte-h":!0}),y(o)!=="svelte-kvfsh7"&&(o.textContent=g),i=l(t),_(r.$$.fragment,t)},m(t,h){d(t,o,h),d(t,i,h),b(r,t,h),f=!0},p:ae,i(t){f||(w(r.$$.fragment,t),f=!0)},o(t){x(r.$$.fragment,t),f=!1},d(t){t&&(s(o),s(i)),M(r,t)}}}function Qe(v){let o,g="Examples:",i,r,f;return r=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">"https://huggingface.co/lllyasviel/ControlNet-v1-1/blob/main/control_v11p_sd15_canny.pth"</span> <span class="hljs-comment"># can also be a local path</span> | |
| model = ControlNetModel.from_single_file(url) | |
| url = <span class="hljs-string">"https://huggingface.co/runwayml/stable-diffusion-v1-5/blob/main/v1-5-pruned.safetensors"</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,i=a(),u(r.$$.fragment)},l(t){o=p(t,"P",{"data-svelte-h":!0}),y(o)!=="svelte-kvfsh7"&&(o.textContent=g),i=l(t),_(r.$$.fragment,t)},m(t,h){d(t,o,h),d(t,i,h),b(r,t,h),f=!0},p:ae,i(t){f||(w(r.$$.fragment,t),f=!0)},o(t){x(r.$$.fragment,t),f=!1},d(t){t&&(s(o),s(i)),M(r,t)}}}function Ke(v){let o,g,i,r,f,t,h,Ne="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,A,Ge='<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.26.3/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,G,ce,O,fe,T,R,we,Q,Se='Load model weights saved in the <code>.ckpt</code> format into a <a href="/docs/diffusers/v0.26.3/en/api/pipelines/overview#diffusers.DiffusionPipeline">DiffusionPipeline</a>.',xe,Z,H,Me,K,Ie=`Instantiate a <a href="/docs/diffusers/v0.26.3/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,Y,pe,F,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.26.3/en/api/models/autoencoderkl#diffusers.AutoencoderKL">AutoencoderKL</a>.',$e,$,D,Te,oe,Ee=`Instantiate a <a href="/docs/diffusers/v0.26.3/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,I,ke,V,ge,P,he,k,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.26.3/en/api/models/controlnet#diffusers.ControlNetModel">ControlNetModel</a>.',Ze,U,X,Ue,ne,Be=`Instantiate a <a href="/docs/diffusers/v0.26.3/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,re,_e;return f=new be({props:{title:"Single files",local:"single-files",headingTag:"h1"}}),G=new Ae({props:{$$slots:{default:[De]},$$scope:{ctx:v}}}),O=new be({props:{title:"FromSingleFileMixin",local:"diffusers.loaders.FromSingleFileMixin",headingTag:"h2"}}),R=new ie({props:{name:"class diffusers.loaders.FromSingleFileMixin",anchor:"diffusers.loaders.FromSingleFileMixin",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.26.3/src/diffusers/loaders/single_file.py#L136"}}),H=new ie({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>) — | |
| Can be either:<ul> | |
| <li>A link to the <code>.ckpt</code> file (for example | |
| <code>"https://huggingface.co/<repo_id>/blob/main/<path_to_file>.ckpt"</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>) — | |
| 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>) — | |
| 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>) — | |
| 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>) — | |
| 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>) — | |
| A dictionary of proxy servers to use by protocol or endpoint, for example, <code>{'http': 'foo.bar:3128', 'http://hostname': 'foo.bar:4012'}</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>) — | |
| Whether to only load local model weights and configuration files or not. If set to <code>True</code>, the model | |
| won’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>) — | |
| 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>"main"</code>) — | |
| 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>) — | |
| If set to <code>None</code>, the safetensors weights are downloaded if they’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"}],source:"https://github.com/huggingface/diffusers/blob/v0.26.3/src/diffusers/loaders/single_file.py#L141"}}),S=new We({props:{anchor:"diffusers.loaders.FromSingleFileMixin.from_single_file.example",$$slots:{default:[Pe]},$$scope:{ctx:v}}}),Y=new be({props:{title:"FromOriginalVAEMixin",local:"diffusers.loaders.FromOriginalVAEMixin",headingTag:"h2"}}),z=new ie({props:{name:"class diffusers.loaders.FromOriginalVAEMixin",anchor:"diffusers.loaders.FromOriginalVAEMixin",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.26.3/src/diffusers/loaders/autoencoder.py#L23"}}),D=new ie({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>) — | |
| Can be either:<ul> | |
| <li>A link to the <code>.ckpt</code> file (for example | |
| <code>"https://huggingface.co/<repo_id>/blob/main/<path_to_file>.ckpt"</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>) — | |
| 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>) — | |
| Override the default <code>torch.dtype</code> and load the model with another dtype. If <code>"auto"</code> is passed, the | |
| dtype is automatically derived from the model’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>) — | |
| 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>) — | |
| 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>) — | |
| 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>) — | |
| A dictionary of proxy servers to use by protocol or endpoint, for example, <code>{'http': 'foo.bar:3128', 'http://hostname': 'foo.bar:4012'}</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>) — | |
| Whether to only load local model weights and configuration files or not. If set to True, the model | |
| won’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>) — | |
| 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>"main"</code>) — | |
| 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) — | |
| 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) — | |
| 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.use_safetensors",description:`<strong>use_safetensors</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>None</code>) — | |
| If set to <code>None</code>, the safetensors weights are downloaded if they’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.kwargs",description:`<strong>kwargs</strong> (remaining dictionary of keyword arguments, <em>optional</em>) — | |
| 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.26.3/src/diffusers/loaders/autoencoder.py#L28"}}),I=new Ae({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 ie({props:{name:"class diffusers.loaders.FromOriginalControlNetMixin",anchor:"diffusers.loaders.FromOriginalControlNetMixin",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.26.3/src/diffusers/loaders/controlnet.py#L23"}}),X=new ie({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>) — | |
| Can be either:<ul> | |
| <li>A link to the <code>.ckpt</code> file (for example | |
| <code>"https://huggingface.co/<repo_id>/blob/main/<path_to_file>.ckpt"</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>) — | |
| Override the default <code>torch.dtype</code> and load the model with another dtype. If <code>"auto"</code> is passed, the | |
| dtype is automatically derived from the model’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>) — | |
| 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>) — | |
| 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>) — | |
| 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>) — | |
| A dictionary of proxy servers to use by protocol or endpoint, for example, <code>{'http': 'foo.bar:3128', 'http://hostname': 'foo.bar:4012'}</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>) — | |
| Whether to only load local model weights and configuration files or not. If set to True, the model | |
| won’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>) — | |
| 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>"main"</code>) — | |
| 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>) — | |
| If set to <code>None</code>, the safetensors weights are downloaded if they’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) — | |
| 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>) — | |
| 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>) — | |
| 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.26.3/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=a(),i=m("p"),r=a(),u(f.$$.fragment),t=a(),h=m("p"),h.innerHTML=Ne,le=a(),A=m("ul"),A.innerHTML=Ge,de=a(),u(G.$$.fragment),ce=a(),u(O.$$.fragment),fe=a(),T=m("div"),u(R.$$.fragment),we=a(),Q=m("p"),Q.innerHTML=Se,xe=a(),Z=m("div"),u(H.$$.fragment),Me=a(),K=m("p"),K.innerHTML=Ie,ye=a(),u(S.$$.fragment),me=a(),u(Y.$$.fragment),pe=a(),F=m("div"),u(z.$$.fragment),ve=a(),ee=m("p"),ee.innerHTML=Ve,$e=a(),$=m("div"),u(D.$$.fragment),Te=a(),oe=m("p"),oe.innerHTML=Ee,Fe=a(),u(I.$$.fragment),ke=a(),u(V.$$.fragment),ge=a(),u(P.$$.fragment),he=a(),k=m("div"),u(q.$$.fragment),Je=a(),te=m("p"),te.innerHTML=Le,Ze=a(),U=m("div"),u(X.$$.fragment),Ue=a(),ne=m("p"),ne.innerHTML=Be,Ce=a(),u(E.$$.fragment),ue=a(),re=m("p"),this.h()},l(e){const n=ze("svelte-u9bgzb",document.head);o=p(n,"META",{name:!0,content:!0}),n.forEach(s),g=l(e),i=p(e,"P",{}),L(i).forEach(s),r=l(e),_(f.$$.fragment,e),t=l(e),h=p(e,"P",{"data-svelte-h":!0}),y(h)!=="svelte-1waiuhn"&&(h.innerHTML=Ne),le=l(e),A=p(e,"UL",{"data-svelte-h":!0}),y(A)!=="svelte-bept7i"&&(A.innerHTML=Ge),de=l(e),_(G.$$.fragment,e),ce=l(e),_(O.$$.fragment,e),fe=l(e),T=p(e,"DIV",{class:!0});var C=L(T);_(R.$$.fragment,C),we=l(C),Q=p(C,"P",{"data-svelte-h":!0}),y(Q)!=="svelte-xmrm4"&&(Q.innerHTML=Se),xe=l(C),Z=p(C,"DIV",{class:!0});var W=L(Z);_(H.$$.fragment,W),Me=l(W),K=p(W,"P",{"data-svelte-h":!0}),y(K)!=="svelte-lrdzth"&&(K.innerHTML=Ie),ye=l(W),_(S.$$.fragment,W),W.forEach(s),C.forEach(s),me=l(e),_(Y.$$.fragment,e),pe=l(e),F=p(e,"DIV",{class:!0});var j=L(F);_(z.$$.fragment,j),ve=l(j),ee=p(j,"P",{"data-svelte-h":!0}),y(ee)!=="svelte-10ctba0"&&(ee.innerHTML=Ve),$e=l(j),$=p(j,"DIV",{class:!0});var J=L($);_(D.$$.fragment,J),Te=l(J),oe=p(J,"P",{"data-svelte-h":!0}),y(oe)!=="svelte-1xg3g68"&&(oe.innerHTML=Ee),Fe=l(J),_(I.$$.fragment,J),ke=l(J),_(V.$$.fragment,J),J.forEach(s),j.forEach(s),ge=l(e),_(P.$$.fragment,e),he=l(e),k=p(e,"DIV",{class:!0});var N=L(k);_(q.$$.fragment,N),Je=l(N),te=p(N,"P",{"data-svelte-h":!0}),y(te)!=="svelte-mnfduo"&&(te.innerHTML=Le),Ze=l(N),U=p(N,"DIV",{class:!0});var se=L(U);_(X.$$.fragment,se),Ue=l(se),ne=p(se,"P",{"data-svelte-h":!0}),y(ne)!=="svelte-s6vm9g"&&(ne.innerHTML=Be),Ce=l(se),_(E.$$.fragment,se),se.forEach(s),N.forEach(s),ue=l(e),re=p(e,"P",{}),L(re).forEach(s),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($,"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"),B(U,"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")},m(e,n){c(document.head,o),d(e,g,n),d(e,i,n),d(e,r,n),b(f,e,n),d(e,t,n),d(e,h,n),d(e,le,n),d(e,A,n),d(e,de,n),b(G,e,n),d(e,ce,n),b(O,e,n),d(e,fe,n),d(e,T,n),b(R,T,null),c(T,we),c(T,Q),c(T,xe),c(T,Z),b(H,Z,null),c(Z,Me),c(Z,K),c(Z,ye),b(S,Z,null),d(e,me,n),b(Y,e,n),d(e,pe,n),d(e,F,n),b(z,F,null),c(F,ve),c(F,ee),c(F,$e),c(F,$),b(D,$,null),c($,Te),c($,oe),c($,Fe),b(I,$,null),c($,ke),b(V,$,null),d(e,ge,n),b(P,e,n),d(e,he,n),d(e,k,n),b(q,k,null),c(k,Je),c(k,te),c(k,Ze),c(k,U),b(X,U,null),c(U,Ue),c(U,ne),c(U,Ce),b(E,U,null),d(e,ue,n),d(e,re,n),_e=!0},p(e,[n]){const C={};n&2&&(C.$$scope={dirty:n,ctx:e}),G.$set(C);const W={};n&2&&(W.$$scope={dirty:n,ctx:e}),S.$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 N={};n&2&&(N.$$scope={dirty:n,ctx:e}),E.$set(N)},i(e){_e||(w(f.$$.fragment,e),w(G.$$.fragment,e),w(O.$$.fragment,e),w(R.$$.fragment,e),w(H.$$.fragment,e),w(S.$$.fragment,e),w(Y.$$.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(G.$$.fragment,e),x(O.$$.fragment,e),x(R.$$.fragment,e),x(H.$$.fragment,e),x(S.$$.fragment,e),x(Y.$$.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&&(s(g),s(i),s(r),s(t),s(h),s(le),s(A),s(de),s(ce),s(fe),s(T),s(me),s(pe),s(F),s(ge),s(he),s(k),s(ue),s(re)),s(o),M(f,e),M(G,e),M(O,e),M(R),M(H),M(S),M(Y,e),M(z),M(D),M(I),M(V),M(P,e),M(q),M(X),M(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 Re(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class co extends He{constructor(o){super(),Ye(this,o,oo,Ke,Oe,{})}}export{co as component}; | |
Xet Storage Details
- Size:
- 33.4 kB
- Xet hash:
- 3213ec0484abe2ac0030f8b26f5016f1bdd8b8a64c9086a4444f413fe305ace9
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.