Buckets:
| import"../chunks/DsnmJJEf.js";import{i as I,h as j,C as B,H as t,D as s,E as W,s as q,a as z}from"../chunks/BtE7mKSK.js";import{p as E,o as K,s as e,f as k,a as h,b as V,c as r,d as p,n as d,r as o}from"../chunks/jDjavuwI.js";import{E as F}from"../chunks/SrSJA0zO.js";const X='{"title":"Schedulers","local":"schedulers","sections":[{"title":"Noise schedules and schedule types","local":"noise-schedules-and-schedule-types","sections":[],"depth":2},{"title":"SchedulerMixin","local":"diffusers.SchedulerMixin","sections":[],"depth":2},{"title":"SchedulerOutput","local":"diffusers.schedulers.scheduling_utils.SchedulerOutput","sections":[],"depth":2},{"title":"KarrasDiffusionSchedulers","local":"karrasdiffusionschedulers","sections":[],"depth":2},{"title":"PushToHubMixin","local":"diffusers.utils.PushToHubMixin","sections":[],"depth":2}],"depth":1}';var R=p('<meta name="hf:doc:metadata"/>'),G=p("<p>Examples:</p> <!>",1),O=p(`<p></p> <!> <!> <p>🤗 Diffusers provides many scheduler functions for the diffusion process. A scheduler takes a model’s output (the sample which the diffusion process is iterating on) and a timestep to return a denoised sample. The timestep is important because it dictates where in the diffusion process the step is; data is generated by iterating forward <em>n</em> timesteps and inference occurs by propagating backward through the timesteps. Based on the timestep, a scheduler may be <em>discrete</em> in which case the timestep is an <code>int</code> or <em>continuous</em> in which case the timestep is a <code>float</code>.</p> <p>Depending on the context, a scheduler defines how to iteratively add noise to an image or how to update a sample based on a model’s output:</p> <ul><li>during <em>training</em>, a scheduler adds noise (there are different algorithms for how to add noise) to a sample to train a diffusion model</li> <li>during <em>inference</em>, a scheduler defines how to update a sample based on a pretrained model’s output</li></ul> <p>Many schedulers are implemented from the <a href="https://github.com/crowsonkb/k-diffusion" rel="nofollow">k-diffusion</a> library by <a href="https://github.com/crowsonkb/" rel="nofollow">Katherine Crowson</a>, and they’re also widely used in A1111. To help you map the schedulers from k-diffusion and A1111 to the schedulers in 🤗 Diffusers, take a look at the table below:</p> <table><thead><tr><th>A1111/k-diffusion</th><th>🤗 Diffusers</th><th>Usage</th></tr></thead><tbody><tr><td>DPM++ 2M</td><td><a href="/docs/diffusers/pr_14178/en/api/schedulers/multistep_dpm_solver#diffusers.DPMSolverMultistepScheduler">DPMSolverMultistepScheduler</a></td><td></td></tr><tr><td>DPM++ 2M Karras</td><td><a href="/docs/diffusers/pr_14178/en/api/schedulers/multistep_dpm_solver#diffusers.DPMSolverMultistepScheduler">DPMSolverMultistepScheduler</a></td><td>init with <code>use_karras_sigmas=True</code></td></tr><tr><td>DPM++ 2M SDE</td><td><a href="/docs/diffusers/pr_14178/en/api/schedulers/multistep_dpm_solver#diffusers.DPMSolverMultistepScheduler">DPMSolverMultistepScheduler</a></td><td>init with <code>algorithm_type="sde-dpmsolver++"</code></td></tr><tr><td>DPM++ 2M SDE Karras</td><td><a href="/docs/diffusers/pr_14178/en/api/schedulers/multistep_dpm_solver#diffusers.DPMSolverMultistepScheduler">DPMSolverMultistepScheduler</a></td><td>init with <code>use_karras_sigmas=True</code> and <code>algorithm_type="sde-dpmsolver++"</code></td></tr><tr><td>DPM++ 2S a</td><td>N/A</td><td>very similar to <code>DPMSolverSinglestepScheduler</code></td></tr><tr><td>DPM++ 2S a Karras</td><td>N/A</td><td>very similar to <code>DPMSolverSinglestepScheduler(use_karras_sigmas=True, ...)</code></td></tr><tr><td>DPM++ SDE</td><td><a href="/docs/diffusers/pr_14178/en/api/schedulers/singlestep_dpm_solver#diffusers.DPMSolverSinglestepScheduler">DPMSolverSinglestepScheduler</a></td><td></td></tr><tr><td>DPM++ SDE Karras</td><td><a href="/docs/diffusers/pr_14178/en/api/schedulers/singlestep_dpm_solver#diffusers.DPMSolverSinglestepScheduler">DPMSolverSinglestepScheduler</a></td><td>init with <code>use_karras_sigmas=True</code></td></tr><tr><td>DPM2</td><td><a href="/docs/diffusers/pr_14178/en/api/schedulers/dpm_discrete#diffusers.KDPM2DiscreteScheduler">KDPM2DiscreteScheduler</a></td><td></td></tr><tr><td>DPM2 Karras</td><td><a href="/docs/diffusers/pr_14178/en/api/schedulers/dpm_discrete#diffusers.KDPM2DiscreteScheduler">KDPM2DiscreteScheduler</a></td><td>init with <code>use_karras_sigmas=True</code></td></tr><tr><td>DPM2 a</td><td><a href="/docs/diffusers/pr_14178/en/api/schedulers/dpm_discrete_ancestral#diffusers.KDPM2AncestralDiscreteScheduler">KDPM2AncestralDiscreteScheduler</a></td><td></td></tr><tr><td>DPM2 a Karras</td><td><a href="/docs/diffusers/pr_14178/en/api/schedulers/dpm_discrete_ancestral#diffusers.KDPM2AncestralDiscreteScheduler">KDPM2AncestralDiscreteScheduler</a></td><td>init with <code>use_karras_sigmas=True</code></td></tr><tr><td>DPM adaptive</td><td>N/A</td><td></td></tr><tr><td>DPM fast</td><td>N/A</td><td></td></tr><tr><td>Euler</td><td><a href="/docs/diffusers/pr_14178/en/api/schedulers/euler#diffusers.EulerDiscreteScheduler">EulerDiscreteScheduler</a></td><td></td></tr><tr><td>Euler a</td><td><a href="/docs/diffusers/pr_14178/en/api/schedulers/euler_ancestral#diffusers.EulerAncestralDiscreteScheduler">EulerAncestralDiscreteScheduler</a></td><td></td></tr><tr><td>Heun</td><td><a href="/docs/diffusers/pr_14178/en/api/schedulers/heun#diffusers.HeunDiscreteScheduler">HeunDiscreteScheduler</a></td><td></td></tr><tr><td>LMS</td><td><a href="/docs/diffusers/pr_14178/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a></td><td></td></tr><tr><td>LMS Karras</td><td><a href="/docs/diffusers/pr_14178/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a></td><td>init with <code>use_karras_sigmas=True</code></td></tr><tr><td>N/A</td><td><a href="/docs/diffusers/pr_14178/en/api/schedulers/deis#diffusers.DEISMultistepScheduler">DEISMultistepScheduler</a></td><td></td></tr><tr><td>N/A</td><td><a href="/docs/diffusers/pr_14178/en/api/schedulers/unipc#diffusers.UniPCMultistepScheduler">UniPCMultistepScheduler</a></td><td></td></tr></tbody></table> <!> <table><thead><tr><th>A1111/k-diffusion</th><th>🤗 Diffusers</th></tr></thead><tbody><tr><td>Karras</td><td>init with <code>use_karras_sigmas=True</code></td></tr><tr><td>sgm_uniform</td><td>init with <code>timestep_spacing="trailing"</code></td></tr><tr><td>simple</td><td>init with <code>timestep_spacing="trailing"</code></td></tr><tr><td>exponential</td><td>init with <code>timestep_spacing="linspace"</code>, <code>use_exponential_sigmas=True</code></td></tr><tr><td>beta</td><td>init with <code>timestep_spacing="linspace"</code>, <code>use_beta_sigmas=True</code></td></tr></tbody></table> <p>All schedulers are built from the base <a href="/docs/diffusers/pr_14178/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a> class which implements low level utilities shared by all schedulers.</p> <!> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Base class for all schedulers.</p> <p><a href="/docs/diffusers/pr_14178/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a> contains common functions shared by all schedulers such as general loading and saving | |
| functionalities.</p> <p><a href="/docs/diffusers/pr_14178/en/api/configuration#diffusers.ConfigMixin">ConfigMixin</a> takes care of storing the configuration attributes (like <code>num_train_timesteps</code>) that are passed to | |
| the scheduler’s <code>__init__</code> function, and the attributes can be accessed by <code>scheduler.config.num_train_timesteps</code>.</p> <p>Class attributes:</p> <ul><li><strong>_compatibles</strong> (<code>list[str]</code>) — A list of scheduler classes that are compatible with the parent scheduler | |
| class. Use <a href="/docs/diffusers/pr_14178/en/api/configuration#diffusers.ConfigMixin.from_config">from_config()</a> to load a different compatible scheduler class (should be overridden | |
| by parent class).</li></ul> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Instantiate a scheduler from a pre-defined JSON configuration file in a local directory or Hub repository.</p> <blockquote class="tip"><p>> To use private or <a href="https://huggingface.co/docs/hub/models-gated#gated-models" rel="nofollow">gated models</a>, log-in | |
| with <code>hf > auth login</code>. You can also activate the special > <a href="https://huggingface.co/diffusers/installation.html#offline-mode" rel="nofollow">“offline-mode”</a> to use this method in a > | |
| firewalled environment.</p></blockquote></div> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Save a scheduler configuration object to a directory so that it can be reloaded using the <a href="/docs/diffusers/pr_14178/en/api/schedulers/overview#diffusers.SchedulerMixin.from_pretrained">from_pretrained()</a> class method.</p></div></div> <!> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Base class for the output of a scheduler’s <code>step</code> function.</p></div> <!> <p><code>KarrasDiffusionSchedulers</code> are a broad generalization of schedulers in 🤗 Diffusers. The schedulers in this class are distinguished at a high level by their noise sampling strategy, the type of network and scaling, the training strategy, and how the loss is weighed.</p> <p>The different schedulers in this class, depending on the ordinary differential equations (ODE) solver type, fall into the above taxonomy and provide a good abstraction for the design of the main schedulers implemented in 🤗 Diffusers. The schedulers in this class are given <a href="https://github.com/huggingface/diffusers/blob/a69754bb879ed55b9b6dc9dd0b3cf4fa4124c765/src/diffusers/schedulers/scheduling_utils.py#L32" rel="nofollow">here</a>.</p> <!> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>A Mixin to push a model, scheduler, or pipeline to the Hugging Face Hub.</p> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Upload model, scheduler, or pipeline files to the 🤗 Hugging Face Hub.</p> <!></div></div> <!> <p></p>`,1);function te(H,U){E(U,!1),K(()=>{new URLSearchParams(window.location.search).get("fw")}),I();var f=O();j("j97yjc",i=>{var u=R();q(u,"content",X),h(i,u)});var m=e(k(f),2);B(m,{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"});var g=e(m,2);t(g,{title:"Schedulers",local:"schedulers",headingTag:"h1"});var _=e(g,12);t(_,{title:"Noise schedules and schedule types",local:"noise-schedules-and-schedule-types",headingTag:"h2"});var b=e(_,6);t(b,{title:"SchedulerMixin",local:"diffusers.SchedulerMixin",headingTag:"h2"});var a=e(b,2),v=r(a);s(v,{name:"class diffusers.SchedulerMixin",anchor:"diffusers.SchedulerMixin",source:"https://github.com/huggingface/diffusers/blob/vr_14178/src/diffusers/schedulers/scheduling_utils.py#L74",parameters:[]});var n=e(v,12),N=r(n);s(N,{name:"from_pretrained",anchor:"diffusers.SchedulerMixin.from_pretrained",source:"https://github.com/huggingface/diffusers/blob/vr_14178/src/diffusers/schedulers/scheduling_utils.py#L94",parameters:[{name:"pretrained_model_name_or_path",val:": str | os.PathLike | None = None"},{name:"subfolder",val:": str | None = None"},{name:"return_unused_kwargs",val:" = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.SchedulerMixin.from_pretrained.pretrained_model_name_or_path",description:`<strong>pretrained_model_name_or_path</strong> (<code>str</code> or <code>os.PathLike</code>, <em>optional</em>) — | |
| Can be either:</p> | |
| <ul> | |
| <li>A string, the <em>model id</em> (for example <code>google/ddpm-celebahq-256</code>) of a pretrained model hosted on | |
| the Hub.</li> | |
| <li>A path to a <em>directory</em> (for example <code>./my_model_directory</code>) containing the scheduler | |
| configuration saved with <a href="/docs/diffusers/pr_14178/en/api/schedulers/overview#diffusers.SchedulerMixin.save_pretrained">save_pretrained()</a>.</li> | |
| </ul>`,name:"pretrained_model_name_or_path"},{anchor:"diffusers.SchedulerMixin.from_pretrained.subfolder",description:`<strong>subfolder</strong> (<code>str</code>, <em>optional</em>) — | |
| The subfolder location of a model file within a larger model repository on the Hub or locally.`,name:"subfolder"},{anchor:"diffusers.SchedulerMixin.from_pretrained.return_unused_kwargs",description:`<strong>return_unused_kwargs</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) — | |
| Whether kwargs that are not consumed by the Python class should be returned or not.`,name:"return_unused_kwargs"},{anchor:"diffusers.SchedulerMixin.from_pretrained.cache_dir",description:`<strong>cache_dir</strong> (<code>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.SchedulerMixin.from_pretrained.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.SchedulerMixin.from_pretrained.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.SchedulerMixin.from_pretrained.output_loading_info(bool,",description:`<strong>output_loading_info(<code>bool</code>,</strong> <em>optional</em>, defaults to <code>False</code>) — | |
| Whether or not to also return a dictionary containing missing keys, unexpected keys and error messages.`,name:"output_loading_info(bool,"},{anchor:"diffusers.SchedulerMixin.from_pretrained.local_files_only(bool,",description:`<strong>local_files_only(<code>bool</code>,</strong> <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(bool,"},{anchor:"diffusers.SchedulerMixin.from_pretrained.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.SchedulerMixin.from_pretrained.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"}]}),d(4),o(n);var M=e(n,2),C=r(M);s(C,{name:"save_pretrained",anchor:"diffusers.SchedulerMixin.save_pretrained",source:"https://github.com/huggingface/diffusers/blob/vr_14178/src/diffusers/schedulers/scheduling_utils.py#L155",parameters:[{name:"save_directory",val:": str | os.PathLike"},{name:"push_to_hub",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.SchedulerMixin.save_pretrained.save_directory",description:`<strong>save_directory</strong> (<code>str</code> or <code>os.PathLike</code>) — | |
| Directory where the configuration JSON file will be saved (will be created if it does not exist).`,name:"save_directory"},{anchor:"diffusers.SchedulerMixin.save_pretrained.push_to_hub",description:`<strong>push_to_hub</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) — | |
| Whether or not to push your model to the Hugging Face Hub after saving it. You can specify the | |
| repository you want to push to with <code>repo_id</code> (will default to the name of <code>save_directory</code> in your | |
| namespace).`,name:"push_to_hub"},{anchor:"diffusers.SchedulerMixin.save_pretrained.kwargs",description:`<strong>kwargs</strong> (<code>dict[str, Any]</code>, <em>optional</em>) — | |
| Additional keyword arguments passed along to the <a href="/docs/diffusers/pr_14178/en/api/schedulers/overview#diffusers.utils.PushToHubMixin.push_to_hub">push_to_hub()</a> method.`,name:"kwargs"}]}),d(2),o(M),o(a);var y=e(a,2);t(y,{title:"SchedulerOutput",local:"diffusers.schedulers.scheduling_utils.SchedulerOutput",headingTag:"h2"});var l=e(y,2),Z=r(l);s(Z,{name:"class diffusers.schedulers.scheduling_utils.SchedulerOutput",anchor:"diffusers.schedulers.scheduling_utils.SchedulerOutput",source:"https://github.com/huggingface/diffusers/blob/vr_14178/src/diffusers/schedulers/scheduling_utils.py#L61",parameters:[{name:"prev_sample",val:": Tensor"}],parametersDescription:[{anchor:"diffusers.schedulers.scheduling_utils.SchedulerOutput.prev_sample",description:`<strong>prev_sample</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, num_channels, height, width)</code> for images) — | |
| Computed sample <code>(x_{t-1})</code> of previous timestep. <code>prev_sample</code> should be used as next model input in the | |
| denoising loop.`,name:"prev_sample"}]}),d(2),o(l);var S=e(l,2);t(S,{title:"KarrasDiffusionSchedulers",local:"karrasdiffusionschedulers",headingTag:"h2"});var x=e(S,6);t(x,{title:"PushToHubMixin",local:"diffusers.utils.PushToHubMixin",headingTag:"h2"});var c=e(x,2),w=r(c);s(w,{name:"class diffusers.utils.PushToHubMixin",anchor:"diffusers.utils.PushToHubMixin",source:"https://github.com/huggingface/diffusers/blob/vr_14178/src/diffusers/utils/hub_utils.py#L483",parameters:[]});var D=e(w,4),T=r(D);s(T,{name:"push_to_hub",anchor:"diffusers.utils.PushToHubMixin.push_to_hub",source:"https://github.com/huggingface/diffusers/blob/vr_14178/src/diffusers/utils/hub_utils.py#L518",parameters:[{name:"repo_id",val:": str"},{name:"commit_message",val:": str | None = None"},{name:"private",val:": bool | None = None"},{name:"token",val:": str | None = None"},{name:"create_pr",val:": bool = False"},{name:"safe_serialization",val:": bool = True"},{name:"variant",val:": str | None = None"},{name:"subfolder",val:": str | None = None"}],parametersDescription:[{anchor:"diffusers.utils.PushToHubMixin.push_to_hub.repo_id",description:`<strong>repo_id</strong> (<code>str</code>) — | |
| The name of the repository you want to push your model, scheduler, or pipeline files to. It should | |
| contain your organization name when pushing to an organization. <code>repo_id</code> can also be a path to a local | |
| directory.`,name:"repo_id"},{anchor:"diffusers.utils.PushToHubMixin.push_to_hub.commit_message",description:`<strong>commit_message</strong> (<code>str</code>, <em>optional</em>) — | |
| Message to commit while pushing. Default to <code>"Upload {object}"</code>.`,name:"commit_message"},{anchor:"diffusers.utils.PushToHubMixin.push_to_hub.private",description:`<strong>private</strong> (<code>bool</code>, <em>optional</em>) — | |
| Whether to make the repo private. If <code>None</code> (default), the repo will be public unless the | |
| organization’s default is private. This value is ignored if the repo already exists.`,name:"private"},{anchor:"diffusers.utils.PushToHubMixin.push_to_hub.token",description:`<strong>token</strong> (<code>str</code>, <em>optional</em>) — | |
| The token to use as HTTP bearer authorization for remote files. The token generated when running <code>hf auth login</code> (stored in <code>~/.huggingface</code>).`,name:"token"},{anchor:"diffusers.utils.PushToHubMixin.push_to_hub.create_pr",description:`<strong>create_pr</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) — | |
| Whether or not to create a PR with the uploaded files or directly commit.`,name:"create_pr"},{anchor:"diffusers.utils.PushToHubMixin.push_to_hub.safe_serialization",description:`<strong>safe_serialization</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) — | |
| Whether or not to convert the model weights to the <code>safetensors</code> format.`,name:"safe_serialization"},{anchor:"diffusers.utils.PushToHubMixin.push_to_hub.variant",description:`<strong>variant</strong> (<code>str</code>, <em>optional</em>) — | |
| If specified, weights are saved in the format <code>pytorch_model.<variant>.bin</code>.`,name:"variant"}]});var A=e(T,4);F(A,{anchor:"diffusers.utils.PushToHubMixin.push_to_hub.example",children:(i,u)=>{var P=G(),L=e(k(P),2);z(L,{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFVOZXQyRENvbmRpdGlvbk1vZGVsJTBBJTBBdW5ldCUyMCUzRCUyMFVOZXQyRENvbmRpdGlvbk1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJzdGFiaWxpdHlhaSUyRnN0YWJsZS1kaWZmdXNpb24tMiUyMiUyQyUyMHN1YmZvbGRlciUzRCUyMnVuZXQlMjIpJTBBJTBBJTIzJTIwUHVzaCUyMHRoZSUyMCU2MHVuZXQlNjAlMjB0byUyMHlvdXIlMjBuYW1lc3BhY2UlMjB3aXRoJTIwdGhlJTIwbmFtZSUyMCUyMm15LWZpbmV0dW5lZC11bmV0JTIyLiUwQXVuZXQucHVzaF90b19odWIoJTIybXktZmluZXR1bmVkLXVuZXQlMjIpJTBBJTBBJTIzJTIwUHVzaCUyMHRoZSUyMCU2MHVuZXQlNjAlMjB0byUyMGFuJTIwb3JnYW5pemF0aW9uJTIwd2l0aCUyMHRoZSUyMG5hbWUlMjAlMjJteS1maW5ldHVuZWQtdW5ldCUyMi4lMEF1bmV0LnB1c2hfdG9faHViKCUyMnlvdXItb3JnJTJGbXktZmluZXR1bmVkLXVuZXQlMjIp",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> UNet2DConditionModel | |
| unet = UNet2DConditionModel.from_pretrained(<span class="hljs-string">"stabilityai/stable-diffusion-2"</span>, subfolder=<span class="hljs-string">"unet"</span>) | |
| <span class="hljs-comment"># Push the \`unet\` to your namespace with the name "my-finetuned-unet".</span> | |
| unet.push_to_hub(<span class="hljs-string">"my-finetuned-unet"</span>) | |
| <span class="hljs-comment"># Push the \`unet\` to an organization with the name "my-finetuned-unet".</span> | |
| unet.push_to_hub(<span class="hljs-string">"your-org/my-finetuned-unet"</span>)`,lang:"python",wrap:!1}),h(i,P)},$$slots:{default:!0}}),o(D),o(c);var J=e(c,2);W(J,{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/schedulers/overview.md"}),d(2),h(H,f),V()}export{te as component}; | |
Xet Storage Details
- Size:
- 22.7 kB
- Xet hash:
- 25adaa844a381facaaed386eafc2eab24f77fe8711e81a738789353ab02f84c8
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.