import{s as wt,n as Dt,o as qt}from"../chunks/scheduler.53228c21.js";import{S as Lt,i as It,e as r,s as n,c as p,h as Ot,a,d as s,b as o,f as v,g as m,j as u,k as b,l as t,m as l,n as h,t as f,o as g,p as _}from"../chunks/index.100fac89.js";import{C as zt}from"../chunks/CopyLLMTxtMenu.999d3d86.js";import{D as x}from"../chunks/Docstring.46d0934e.js";import{H as Ae,E as kt}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.d27ae4df.js";function Ft(ct){let y,fe,me,ge,L,_e,I,ve,O,ut='<code>UniPCMultistepScheduler</code> is a training-free framework designed for fast sampling of diffusion models. It was introduced in <a href="https://huggingface.co/papers/2302.04867" rel="nofollow">UniPC: A Unified Predictor-Corrector Framework for Fast Sampling of Diffusion Models</a> by Wenliang Zhao, Lujia Bai, Yongming Rao, Jie Zhou, Jiwen Lu.',be,z,pt=`It consists of a corrector (UniC) and a predictor (UniP) that share a unified analytical form and support arbitrary orders.
UniPC is by design model-agnostic, supporting pixel-space/latent-space DPMs on unconditional/conditional sampling. It can also be applied to both noise prediction and data prediction models. The corrector UniC can be also applied after any off-the-shelf solvers to increase the order of accuracy.`,xe,k,mt="The abstract from the paper is:",ye,F,ht='<em>Diffusion probabilistic models (DPMs) have demonstrated a very promising ability in high-resolution image synthesis. However, sampling from a pre-trained DPM is time-consuming due to the multiple evaluations of the denoising network, making it more and more important to accelerate the sampling of DPMs. Despite recent progress in designing fast samplers, existing methods still cannot generate satisfying images in many applications where fewer steps (e.g., &lt;10) are favored. In this paper, we develop a unified corrector (UniC) that can be applied after any existing DPM sampler to increase the order of accuracy without extra model evaluations, and derive a unified predictor (UniP) that supports arbitrary order as a byproduct. Combining UniP and UniC, we propose a unified predictor-corrector framework called UniPC for the fast sampling of DPMs, which has a unified analytical form for any order and can significantly improve the sampling quality over previous methods, especially in extremely few steps. We evaluate our methods through extensive experiments including both unconditional and conditional sampling using pixel-space and latent-space DPMs. Our UniPC can achieve 3.87 FID on CIFAR10 (unconditional) and 7.51 FID on ImageNet 256×256 (conditional) with only 10 function evaluations. Code is available at <a href="https://github.com/wl-zhao/UniPC" rel="nofollow">this https URL</a>.</em>',Ce,N,$e,E,ft="It is recommended to set <code>solver_order</code> to 2 for guide sampling, and <code>solver_order=3</code> for unconditional sampling.",Te,H,gt=`Dynamic thresholding from <a href="https://huggingface.co/papers/2205.11487" rel="nofollow">Imagen</a> is supported, and for pixel-space
diffusion models, you can set both <code>predict_x0=True</code> and <code>thresholding=True</code> to use dynamic thresholding. This thresholding method is unsuitable for latent-space diffusion models such as Stable Diffusion.`,Pe,V,Me,d,A,We,te,_t="<code>UniPCMultistepScheduler</code> is a training-free framework designed for the fast sampling of diffusion models.",Re,se,vt=`This model inherits from <a href="/docs/diffusers/main/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a> and <a href="/docs/diffusers/main/en/api/configuration#diffusers.ConfigMixin">ConfigMixin</a>. Check the superclass documentation for the generic
methods the library implements for all schedulers such as loading and saving.`,je,$,W,Be,ne,bt="Add noise to the original samples according to the noise schedule at the specified timesteps.",Je,T,R,Ye,oe,xt="Convert the model output to the corresponding type the UniPC algorithm needs.",Ze,P,j,Ge,ie,yt="Find the index for a given timestep in the schedule.",Ke,M,B,Qe,re,Ct="One step for the UniC (B(h) version).",Xe,S,J,et,ae,$t="One step for the UniP (B(h) version). Alternatively, <code>self.solver_p</code> is used if is specified.",tt,U,Y,st,de,Tt=`Ensures interchangeability with schedulers that need to scale the denoising model input depending on the
current timestep.`,nt,w,Z,ot,le,Pt="Sets the begin index for the scheduler. This function should be run from pipeline before the inference.",it,D,G,rt,ce,Mt="Sets the discrete timesteps used for the diffusion chain (to be run before inference).",at,q,K,dt,ue,St=`Predict the sample from the previous timestep by reversing the SDE. This function propagates the sample with
the multistep UniPC.`,Se,Q,Ue,C,X,lt,pe,Ut="Base class for the output of a scheduler’s <code>step</code> function.",we,ee,De,he,qe;return L=new zt({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),I=new Ae({props:{title:"UniPCMultistepScheduler",local:"unipcmultistepscheduler",headingTag:"h1"}}),N=new Ae({props:{title:"Tips",local:"tips",headingTag:"h2"}}),V=new Ae({props:{title:"UniPCMultistepScheduler",local:"diffusers.UniPCMultistepScheduler",headingTag:"h2"}}),A=new x({props:{name:"class diffusers.UniPCMultistepScheduler",anchor:"diffusers.UniPCMultistepScheduler",parameters:[{name:"num_train_timesteps",val:": int = 1000"},{name:"beta_start",val:": float = 0.0001"},{name:"beta_end",val:": float = 0.02"},{name:"beta_schedule",val:": typing.Literal['linear', 'scaled_linear', 'squaredcos_cap_v2'] = 'linear'"},{name:"trained_betas",val:": typing.Union[numpy.ndarray, typing.List[float], NoneType] = None"},{name:"solver_order",val:": int = 2"},{name:"prediction_type",val:": typing.Literal['epsilon', 'sample', 'v_prediction', 'flow_prediction'] = 'epsilon'"},{name:"thresholding",val:": bool = False"},{name:"dynamic_thresholding_ratio",val:": float = 0.995"},{name:"sample_max_value",val:": float = 1.0"},{name:"predict_x0",val:": bool = True"},{name:"solver_type",val:": typing.Literal['bh1', 'bh2'] = 'bh2'"},{name:"lower_order_final",val:": bool = True"},{name:"disable_corrector",val:": typing.List[int] = []"},{name:"solver_p",val:": typing.Optional[diffusers.schedulers.scheduling_utils.SchedulerMixin] = None"},{name:"use_karras_sigmas",val:": typing.Optional[bool] = False"},{name:"use_exponential_sigmas",val:": typing.Optional[bool] = False"},{name:"use_beta_sigmas",val:": typing.Optional[bool] = False"},{name:"use_flow_sigmas",val:": typing.Optional[bool] = False"},{name:"flow_shift",val:": typing.Optional[float] = 1.0"},{name:"timestep_spacing",val:": typing.Literal['linspace', 'leading', 'trailing'] = 'linspace'"},{name:"steps_offset",val:": int = 0"},{name:"final_sigmas_type",val:": typing.Optional[typing.Literal['zero', 'sigma_min']] = 'zero'"},{name:"rescale_betas_zero_snr",val:": bool = False"},{name:"use_dynamic_shifting",val:": bool = False"},{name:"time_shift_type",val:": typing.Literal['exponential'] = 'exponential'"}],parametersDescription:[{anchor:"diffusers.UniPCMultistepScheduler.num_train_timesteps",description:`<strong>num_train_timesteps</strong> (<code>int</code>, defaults to 1000) &#x2014;
The number of diffusion steps to train the model.`,name:"num_train_timesteps"},{anchor:"diffusers.UniPCMultistepScheduler.beta_start",description:`<strong>beta_start</strong> (<code>float</code>, defaults to 0.0001) &#x2014;
The starting <code>beta</code> value of inference.`,name:"beta_start"},{anchor:"diffusers.UniPCMultistepScheduler.beta_end",description:`<strong>beta_end</strong> (<code>float</code>, defaults to 0.02) &#x2014;
The final <code>beta</code> value.`,name:"beta_end"},{anchor:"diffusers.UniPCMultistepScheduler.beta_schedule",description:`<strong>beta_schedule</strong> (<code>&quot;linear&quot;</code>, <code>&quot;scaled_linear&quot;</code>, or <code>&quot;squaredcos_cap_v2&quot;</code>, defaults to <code>&quot;linear&quot;</code>) &#x2014;
The beta schedule, a mapping from a beta range to a sequence of betas for stepping the model. Choose from
<code>linear</code>, <code>scaled_linear</code>, or <code>squaredcos_cap_v2</code>.`,name:"beta_schedule"},{anchor:"diffusers.UniPCMultistepScheduler.trained_betas",description:`<strong>trained_betas</strong> (<code>np.ndarray</code>, <em>optional</em>) &#x2014;
Pass an array of betas directly to the constructor to bypass <code>beta_start</code> and <code>beta_end</code>.`,name:"trained_betas"},{anchor:"diffusers.UniPCMultistepScheduler.solver_order",description:`<strong>solver_order</strong> (<code>int</code>, defaults to <code>2</code>) &#x2014;
The UniPC order which can be any positive integer. The effective order of accuracy is <code>solver_order + 1</code>
due to the UniC. It is recommended to use <code>solver_order=2</code> for guided sampling, and <code>solver_order=3</code> for
unconditional sampling.`,name:"solver_order"},{anchor:"diffusers.UniPCMultistepScheduler.prediction_type",description:`<strong>prediction_type</strong> (<code>&quot;epsilon&quot;</code>, <code>&quot;sample&quot;</code>, <code>&quot;v_prediction&quot;</code>, or <code>&quot;flow_prediction&quot;</code>, defaults to <code>&quot;epsilon&quot;</code>, <em>optional</em>) &#x2014;
Prediction type of the scheduler function; can be <code>epsilon</code> (predicts the noise of the diffusion process),
<code>sample</code> (directly predicts the noisy sample<code>), </code>v_prediction<code>(see section 2.4 of [Imagen Video](https://huggingface.co/papers/2210.02303) paper), or</code>flow_prediction\`.`,name:"prediction_type"},{anchor:"diffusers.UniPCMultistepScheduler.thresholding",description:`<strong>thresholding</strong> (<code>bool</code>, defaults to <code>False</code>) &#x2014;
Whether to use the &#x201C;dynamic thresholding&#x201D; method. This is unsuitable for latent-space diffusion models such
as Stable Diffusion.`,name:"thresholding"},{anchor:"diffusers.UniPCMultistepScheduler.dynamic_thresholding_ratio",description:`<strong>dynamic_thresholding_ratio</strong> (<code>float</code>, defaults to 0.995) &#x2014;
The ratio for the dynamic thresholding method. Valid only when <code>thresholding=True</code>.`,name:"dynamic_thresholding_ratio"},{anchor:"diffusers.UniPCMultistepScheduler.sample_max_value",description:`<strong>sample_max_value</strong> (<code>float</code>, defaults to 1.0) &#x2014;
The threshold value for dynamic thresholding. Valid only when <code>thresholding=True</code> and <code>predict_x0=True</code>.`,name:"sample_max_value"},{anchor:"diffusers.UniPCMultistepScheduler.predict_x0",description:`<strong>predict_x0</strong> (<code>bool</code>, defaults to <code>True</code>) &#x2014;
Whether to use the updating algorithm on the predicted x0.`,name:"predict_x0"},{anchor:"diffusers.UniPCMultistepScheduler.solver_type",description:`<strong>solver_type</strong> (<code>&quot;bh1&quot;</code> or <code>&quot;bh2&quot;</code>, defaults to <code>&quot;bh2&quot;</code>) &#x2014;
Solver type for UniPC. It is recommended to use <code>bh1</code> for unconditional sampling when steps &lt; 10, and <code>bh2</code>
otherwise.`,name:"solver_type"},{anchor:"diffusers.UniPCMultistepScheduler.lower_order_final",description:`<strong>lower_order_final</strong> (<code>bool</code>, default <code>True</code>) &#x2014;
Whether to use lower-order solvers in the final steps. Only valid for &lt; 15 inference steps. This can
stabilize the sampling of DPMSolver for steps &lt; 15, especially for steps &lt;= 10.`,name:"lower_order_final"},{anchor:"diffusers.UniPCMultistepScheduler.disable_corrector",description:`<strong>disable_corrector</strong> (<code>list</code>, default <code>[]</code>) &#x2014;
Decides which step to disable the corrector to mitigate the misalignment between <code>epsilon_theta(x_t, c)</code>
and <code>epsilon_theta(x_t^c, c)</code> which can influence convergence for a large guidance scale. Corrector is
usually disabled during the first few steps.`,name:"disable_corrector"},{anchor:"diffusers.UniPCMultistepScheduler.solver_p",description:`<strong>solver_p</strong> (<code>SchedulerMixin</code>, default <code>None</code>) &#x2014;
Any other scheduler that if specified, the algorithm becomes <code>solver_p + UniC</code>.`,name:"solver_p"},{anchor:"diffusers.UniPCMultistepScheduler.use_karras_sigmas",description:`<strong>use_karras_sigmas</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to use Karras sigmas for step sizes in the noise schedule during the sampling process. If <code>True</code>,
the sigmas are determined according to a sequence of noise levels {&#x3C3;i}.`,name:"use_karras_sigmas"},{anchor:"diffusers.UniPCMultistepScheduler.use_exponential_sigmas",description:`<strong>use_exponential_sigmas</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to use exponential sigmas for step sizes in the noise schedule during the sampling process.`,name:"use_exponential_sigmas"},{anchor:"diffusers.UniPCMultistepScheduler.use_beta_sigmas",description:`<strong>use_beta_sigmas</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to use beta sigmas for step sizes in the noise schedule during the sampling process. Refer to <a href="https://huggingface.co/papers/2407.12173" rel="nofollow">Beta
Sampling is All You Need</a> for more information.`,name:"use_beta_sigmas"},{anchor:"diffusers.UniPCMultistepScheduler.use_flow_sigmas",description:`<strong>use_flow_sigmas</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to use flow sigmas for step sizes in the noise schedule during the sampling process.`,name:"use_flow_sigmas"},{anchor:"diffusers.UniPCMultistepScheduler.timestep_spacing",description:`<strong>timestep_spacing</strong> (<code>&quot;linspace&quot;</code>, <code>&quot;leading&quot;</code>, or <code>&quot;trailing&quot;</code>, defaults to <code>&quot;linspace&quot;</code>) &#x2014;
The way the timesteps should be scaled. Refer to Table 2 of the <a href="https://huggingface.co/papers/2305.08891" rel="nofollow">Common Diffusion Noise Schedules and
Sample Steps are Flawed</a> for more information.`,name:"timestep_spacing"},{anchor:"diffusers.UniPCMultistepScheduler.steps_offset",description:`<strong>steps_offset</strong> (<code>int</code>, defaults to 0) &#x2014;
An offset added to the inference steps, as required by some model families.`,name:"steps_offset"},{anchor:"diffusers.UniPCMultistepScheduler.final_sigmas_type",description:`<strong>final_sigmas_type</strong> (<code>&quot;zero&quot;</code> or <code>&quot;sigma_min&quot;</code>, defaults to <code>&quot;zero&quot;</code>) &#x2014;
The final <code>sigma</code> value for the noise schedule during the sampling process. If <code>&quot;sigma_min&quot;</code>, the final
sigma is the same as the last sigma in the training schedule. If <code>zero</code>, the final sigma is set to 0.`,name:"final_sigmas_type"},{anchor:"diffusers.UniPCMultistepScheduler.rescale_betas_zero_snr",description:`<strong>rescale_betas_zero_snr</strong> (<code>bool</code>, defaults to <code>False</code>) &#x2014;
Whether to rescale the betas to have zero terminal SNR. This enables the model to generate very bright and
dark samples instead of limiting it to samples with medium brightness. Loosely related to
<a href="https://github.com/huggingface/diffusers/blob/74fd735eb073eb1d774b1ab4154a0876eb82f055/examples/dreambooth/train_dreambooth.py#L506" rel="nofollow"><code>--offset_noise</code></a>.`,name:"rescale_betas_zero_snr"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/schedulers/scheduling_unipc_multistep.py#L116"}}),W=new x({props:{name:"add_noise",anchor:"diffusers.UniPCMultistepScheduler.add_noise",parameters:[{name:"original_samples",val:": Tensor"},{name:"noise",val:": Tensor"},{name:"timesteps",val:": IntTensor"}],parametersDescription:[{anchor:"diffusers.UniPCMultistepScheduler.add_noise.original_samples",description:`<strong>original_samples</strong> (<code>torch.Tensor</code>) &#x2014;
The original samples without noise.`,name:"original_samples"},{anchor:"diffusers.UniPCMultistepScheduler.add_noise.noise",description:`<strong>noise</strong> (<code>torch.Tensor</code>) &#x2014;
The noise to add to the samples.`,name:"noise"},{anchor:"diffusers.UniPCMultistepScheduler.add_noise.timesteps",description:`<strong>timesteps</strong> (<code>torch.IntTensor</code>) &#x2014;
The timesteps at which to add noise to the samples.`,name:"timesteps"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/schedulers/scheduling_unipc_multistep.py#L1148",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>The noisy samples.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>torch.Tensor</code></p>
`}}),R=new x({props:{name:"convert_model_output",anchor:"diffusers.UniPCMultistepScheduler.convert_model_output",parameters:[{name:"model_output",val:": Tensor"},{name:"*args",val:""},{name:"sample",val:": Tensor = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.UniPCMultistepScheduler.convert_model_output.model_output",description:`<strong>model_output</strong> (<code>torch.Tensor</code>) &#x2014;
The direct output from the learned diffusion model.`,name:"model_output"},{anchor:"diffusers.UniPCMultistepScheduler.convert_model_output.timestep",description:`<strong>timestep</strong> (<code>int</code>) &#x2014;
The current discrete timestep in the diffusion chain.`,name:"timestep"},{anchor:"diffusers.UniPCMultistepScheduler.convert_model_output.sample",description:`<strong>sample</strong> (<code>torch.Tensor</code>) &#x2014;
A current instance of a sample created by the diffusion process.`,name:"sample"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/schedulers/scheduling_unipc_multistep.py#L660",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>The converted model output.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>torch.Tensor</code></p>
`}}),j=new x({props:{name:"index_for_timestep",anchor:"diffusers.UniPCMultistepScheduler.index_for_timestep",parameters:[{name:"timestep",val:": typing.Union[int, torch.Tensor]"},{name:"schedule_timesteps",val:": typing.Optional[torch.Tensor] = None"}],parametersDescription:[{anchor:"diffusers.UniPCMultistepScheduler.index_for_timestep.timestep",description:`<strong>timestep</strong> (<code>int</code> or <code>torch.Tensor</code>) &#x2014;
The timestep for which to find the index.`,name:"timestep"},{anchor:"diffusers.UniPCMultistepScheduler.index_for_timestep.schedule_timesteps",description:`<strong>schedule_timesteps</strong> (<code>torch.Tensor</code>, <em>optional</em>) &#x2014;
The timestep schedule to search in. If <code>None</code>, uses <code>self.timesteps</code>.`,name:"schedule_timesteps"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/schedulers/scheduling_unipc_multistep.py#L1000",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>The index of the timestep in the schedule.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>int</code></p>
`}}),B=new x({props:{name:"multistep_uni_c_bh_update",anchor:"diffusers.UniPCMultistepScheduler.multistep_uni_c_bh_update",parameters:[{name:"this_model_output",val:": Tensor"},{name:"*args",val:""},{name:"last_sample",val:": Tensor = None"},{name:"this_sample",val:": Tensor = None"},{name:"order",val:": int = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.UniPCMultistepScheduler.multistep_uni_c_bh_update.this_model_output",description:`<strong>this_model_output</strong> (<code>torch.Tensor</code>) &#x2014;
The model outputs at <code>x_t</code>.`,name:"this_model_output"},{anchor:"diffusers.UniPCMultistepScheduler.multistep_uni_c_bh_update.this_timestep",description:`<strong>this_timestep</strong> (<code>int</code>) &#x2014;
The current timestep <code>t</code>.`,name:"this_timestep"},{anchor:"diffusers.UniPCMultistepScheduler.multistep_uni_c_bh_update.last_sample",description:`<strong>last_sample</strong> (<code>torch.Tensor</code>) &#x2014;
The generated sample before the last predictor <code>x_{t-1}</code>.`,name:"last_sample"},{anchor:"diffusers.UniPCMultistepScheduler.multistep_uni_c_bh_update.this_sample",description:`<strong>this_sample</strong> (<code>torch.Tensor</code>) &#x2014;
The generated sample after the last predictor <code>x_{t}</code>.`,name:"this_sample"},{anchor:"diffusers.UniPCMultistepScheduler.multistep_uni_c_bh_update.order",description:`<strong>order</strong> (<code>int</code>) &#x2014;
The <code>p</code> of UniC-p at this step. The effective order of accuracy should be <code>order + 1</code>.`,name:"order"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/schedulers/scheduling_unipc_multistep.py#L862",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>The corrected sample tensor at the current timestep.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>torch.Tensor</code></p>
`}}),J=new x({props:{name:"multistep_uni_p_bh_update",anchor:"diffusers.UniPCMultistepScheduler.multistep_uni_p_bh_update",parameters:[{name:"model_output",val:": Tensor"},{name:"*args",val:""},{name:"sample",val:": Tensor = None"},{name:"order",val:": int = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.UniPCMultistepScheduler.multistep_uni_p_bh_update.model_output",description:`<strong>model_output</strong> (<code>torch.Tensor</code>) &#x2014;
The direct output from the learned diffusion model at the current timestep.`,name:"model_output"},{anchor:"diffusers.UniPCMultistepScheduler.multistep_uni_p_bh_update.prev_timestep",description:`<strong>prev_timestep</strong> (<code>int</code>) &#x2014;
The previous discrete timestep in the diffusion chain.`,name:"prev_timestep"},{anchor:"diffusers.UniPCMultistepScheduler.multistep_uni_p_bh_update.sample",description:`<strong>sample</strong> (<code>torch.Tensor</code>) &#x2014;
A current instance of a sample created by the diffusion process.`,name:"sample"},{anchor:"diffusers.UniPCMultistepScheduler.multistep_uni_p_bh_update.order",description:`<strong>order</strong> (<code>int</code>) &#x2014;
The order of UniP at this timestep (corresponds to the <em>p</em> in UniPC-p).`,name:"order"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/schedulers/scheduling_unipc_multistep.py#L733",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>The sample tensor at the previous timestep.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>torch.Tensor</code></p>
`}}),Y=new x({props:{name:"scale_model_input",anchor:"diffusers.UniPCMultistepScheduler.scale_model_input",parameters:[{name:"sample",val:": Tensor"},{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.UniPCMultistepScheduler.scale_model_input.sample",description:`<strong>sample</strong> (<code>torch.Tensor</code>) &#x2014;
The input sample.`,name:"sample"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/schedulers/scheduling_unipc_multistep.py#L1132",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A scaled input sample.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>torch.Tensor</code></p>
`}}),Z=new x({props:{name:"set_begin_index",anchor:"diffusers.UniPCMultistepScheduler.set_begin_index",parameters:[{name:"begin_index",val:": int = 0"}],parametersDescription:[{anchor:"diffusers.UniPCMultistepScheduler.set_begin_index.begin_index",description:`<strong>begin_index</strong> (<code>int</code>, defaults to <code>0</code>) &#x2014;
The begin index for the scheduler.`,name:"begin_index"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/schedulers/scheduling_unipc_multistep.py#L296"}}),G=new x({props:{name:"set_timesteps",anchor:"diffusers.UniPCMultistepScheduler.set_timesteps",parameters:[{name:"num_inference_steps",val:": int"},{name:"device",val:": typing.Union[str, torch.device, NoneType] = None"},{name:"mu",val:": typing.Optional[float] = None"}],parametersDescription:[{anchor:"diffusers.UniPCMultistepScheduler.set_timesteps.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>) &#x2014;
The number of diffusion steps used when generating samples with a pre-trained model.`,name:"num_inference_steps"},{anchor:"diffusers.UniPCMultistepScheduler.set_timesteps.device",description:`<strong>device</strong> (<code>str</code> or <code>torch.device</code>, <em>optional</em>) &#x2014;
The device to which the timesteps should be moved to. If <code>None</code>, the timesteps are not moved.`,name:"device"},{anchor:"diffusers.UniPCMultistepScheduler.set_timesteps.mu",description:`<strong>mu</strong> (<code>float</code>, <em>optional</em>) &#x2014;
Optional mu parameter for dynamic shifting when using exponential time shift type.`,name:"mu"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/schedulers/scheduling_unipc_multistep.py#L306"}}),K=new x({props:{name:"step",anchor:"diffusers.UniPCMultistepScheduler.step",parameters:[{name:"model_output",val:": Tensor"},{name:"timestep",val:": typing.Union[int, torch.Tensor]"},{name:"sample",val:": Tensor"},{name:"return_dict",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.UniPCMultistepScheduler.step.model_output",description:`<strong>model_output</strong> (<code>torch.Tensor</code>) &#x2014;
The direct output from learned diffusion model.`,name:"model_output"},{anchor:"diffusers.UniPCMultistepScheduler.step.timestep",description:`<strong>timestep</strong> (<code>int</code> or <code>torch.Tensor</code>) &#x2014;
The current discrete timestep in the diffusion chain.`,name:"timestep"},{anchor:"diffusers.UniPCMultistepScheduler.step.sample",description:`<strong>sample</strong> (<code>torch.Tensor</code>) &#x2014;
A current instance of a sample created by the diffusion process.`,name:"sample"},{anchor:"diffusers.UniPCMultistepScheduler.step.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/main/en/api/schedulers/pndm#diffusers.schedulers.scheduling_utils.SchedulerOutput">SchedulerOutput</a> or <code>tuple</code>.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/schedulers/scheduling_unipc_multistep.py#L1051",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>If return_dict is <code>True</code>, <a
  href="/docs/diffusers/main/en/api/schedulers/pndm#diffusers.schedulers.scheduling_utils.SchedulerOutput"
>SchedulerOutput</a> is returned, otherwise a
tuple is returned where the first element is the sample tensor.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/diffusers/main/en/api/schedulers/pndm#diffusers.schedulers.scheduling_utils.SchedulerOutput"
>SchedulerOutput</a> or <code>tuple</code></p>
`}}),Q=new Ae({props:{title:"SchedulerOutput",local:"diffusers.schedulers.scheduling_utils.SchedulerOutput",headingTag:"h2"}}),X=new x({props:{name:"class diffusers.schedulers.scheduling_utils.SchedulerOutput",anchor:"diffusers.schedulers.scheduling_utils.SchedulerOutput",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) &#x2014;
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"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/schedulers/scheduling_utils.py#L62"}}),ee=new kt({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/schedulers/unipc.md"}}),{c(){y=r("meta"),fe=n(),me=r("p"),ge=n(),p(L.$$.fragment),_e=n(),p(I.$$.fragment),ve=n(),O=r("p"),O.innerHTML=ut,be=n(),z=r("p"),z.textContent=pt,xe=n(),k=r("p"),k.textContent=mt,ye=n(),F=r("p"),F.innerHTML=ht,Ce=n(),p(N.$$.fragment),$e=n(),E=r("p"),E.innerHTML=ft,Te=n(),H=r("p"),H.innerHTML=gt,Pe=n(),p(V.$$.fragment),Me=n(),d=r("div"),p(A.$$.fragment),We=n(),te=r("p"),te.innerHTML=_t,Re=n(),se=r("p"),se.innerHTML=vt,je=n(),$=r("div"),p(W.$$.fragment),Be=n(),ne=r("p"),ne.textContent=bt,Je=n(),T=r("div"),p(R.$$.fragment),Ye=n(),oe=r("p"),oe.textContent=xt,Ze=n(),P=r("div"),p(j.$$.fragment),Ge=n(),ie=r("p"),ie.textContent=yt,Ke=n(),M=r("div"),p(B.$$.fragment),Qe=n(),re=r("p"),re.textContent=Ct,Xe=n(),S=r("div"),p(J.$$.fragment),et=n(),ae=r("p"),ae.innerHTML=$t,tt=n(),U=r("div"),p(Y.$$.fragment),st=n(),de=r("p"),de.textContent=Tt,nt=n(),w=r("div"),p(Z.$$.fragment),ot=n(),le=r("p"),le.textContent=Pt,it=n(),D=r("div"),p(G.$$.fragment),rt=n(),ce=r("p"),ce.textContent=Mt,at=n(),q=r("div"),p(K.$$.fragment),dt=n(),ue=r("p"),ue.textContent=St,Se=n(),p(Q.$$.fragment),Ue=n(),C=r("div"),p(X.$$.fragment),lt=n(),pe=r("p"),pe.innerHTML=Ut,we=n(),p(ee.$$.fragment),De=n(),he=r("p"),this.h()},l(e){const i=Ot("svelte-u9bgzb",document.head);y=a(i,"META",{name:!0,content:!0}),i.forEach(s),fe=o(e),me=a(e,"P",{}),v(me).forEach(s),ge=o(e),m(L.$$.fragment,e),_e=o(e),m(I.$$.fragment,e),ve=o(e),O=a(e,"P",{"data-svelte-h":!0}),u(O)!=="svelte-1tyrzxd"&&(O.innerHTML=ut),be=o(e),z=a(e,"P",{"data-svelte-h":!0}),u(z)!=="svelte-16di28y"&&(z.textContent=pt),xe=o(e),k=a(e,"P",{"data-svelte-h":!0}),u(k)!=="svelte-1cwsb16"&&(k.textContent=mt),ye=o(e),F=a(e,"P",{"data-svelte-h":!0}),u(F)!=="svelte-1n6uqo6"&&(F.innerHTML=ht),Ce=o(e),m(N.$$.fragment,e),$e=o(e),E=a(e,"P",{"data-svelte-h":!0}),u(E)!=="svelte-pt2glg"&&(E.innerHTML=ft),Te=o(e),H=a(e,"P",{"data-svelte-h":!0}),u(H)!=="svelte-j7jp76"&&(H.innerHTML=gt),Pe=o(e),m(V.$$.fragment,e),Me=o(e),d=a(e,"DIV",{class:!0});var c=v(d);m(A.$$.fragment,c),We=o(c),te=a(c,"P",{"data-svelte-h":!0}),u(te)!=="svelte-lu1m8w"&&(te.innerHTML=_t),Re=o(c),se=a(c,"P",{"data-svelte-h":!0}),u(se)!=="svelte-linuuh"&&(se.innerHTML=vt),je=o(c),$=a(c,"DIV",{class:!0});var Le=v($);m(W.$$.fragment,Le),Be=o(Le),ne=a(Le,"P",{"data-svelte-h":!0}),u(ne)!=="svelte-rz9b5o"&&(ne.textContent=bt),Le.forEach(s),Je=o(c),T=a(c,"DIV",{class:!0});var Ie=v(T);m(R.$$.fragment,Ie),Ye=o(Ie),oe=a(Ie,"P",{"data-svelte-h":!0}),u(oe)!=="svelte-ixnexx"&&(oe.textContent=xt),Ie.forEach(s),Ze=o(c),P=a(c,"DIV",{class:!0});var Oe=v(P);m(j.$$.fragment,Oe),Ge=o(Oe),ie=a(Oe,"P",{"data-svelte-h":!0}),u(ie)!=="svelte-1c8f4j7"&&(ie.textContent=yt),Oe.forEach(s),Ke=o(c),M=a(c,"DIV",{class:!0});var ze=v(M);m(B.$$.fragment,ze),Qe=o(ze),re=a(ze,"P",{"data-svelte-h":!0}),u(re)!=="svelte-d0n1u7"&&(re.textContent=Ct),ze.forEach(s),Xe=o(c),S=a(c,"DIV",{class:!0});var ke=v(S);m(J.$$.fragment,ke),et=o(ke),ae=a(ke,"P",{"data-svelte-h":!0}),u(ae)!=="svelte-s6vwmd"&&(ae.innerHTML=$t),ke.forEach(s),tt=o(c),U=a(c,"DIV",{class:!0});var Fe=v(U);m(Y.$$.fragment,Fe),st=o(Fe),de=a(Fe,"P",{"data-svelte-h":!0}),u(de)!=="svelte-1rkfgpx"&&(de.textContent=Tt),Fe.forEach(s),nt=o(c),w=a(c,"DIV",{class:!0});var Ne=v(w);m(Z.$$.fragment,Ne),ot=o(Ne),le=a(Ne,"P",{"data-svelte-h":!0}),u(le)!=="svelte-1k141rk"&&(le.textContent=Pt),Ne.forEach(s),it=o(c),D=a(c,"DIV",{class:!0});var Ee=v(D);m(G.$$.fragment,Ee),rt=o(Ee),ce=a(Ee,"P",{"data-svelte-h":!0}),u(ce)!=="svelte-1vzm9q"&&(ce.textContent=Mt),Ee.forEach(s),at=o(c),q=a(c,"DIV",{class:!0});var He=v(q);m(K.$$.fragment,He),dt=o(He),ue=a(He,"P",{"data-svelte-h":!0}),u(ue)!=="svelte-5y602c"&&(ue.textContent=St),He.forEach(s),c.forEach(s),Se=o(e),m(Q.$$.fragment,e),Ue=o(e),C=a(e,"DIV",{class:!0});var Ve=v(C);m(X.$$.fragment,Ve),lt=o(Ve),pe=a(Ve,"P",{"data-svelte-h":!0}),u(pe)!=="svelte-6ojmkw"&&(pe.innerHTML=Ut),Ve.forEach(s),we=o(e),m(ee.$$.fragment,e),De=o(e),he=a(e,"P",{}),v(he).forEach(s),this.h()},h(){b(y,"name","hf:doc:metadata"),b(y,"content",Nt),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(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(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(S,"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(w,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(d,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,i){t(document.head,y),l(e,fe,i),l(e,me,i),l(e,ge,i),h(L,e,i),l(e,_e,i),h(I,e,i),l(e,ve,i),l(e,O,i),l(e,be,i),l(e,z,i),l(e,xe,i),l(e,k,i),l(e,ye,i),l(e,F,i),l(e,Ce,i),h(N,e,i),l(e,$e,i),l(e,E,i),l(e,Te,i),l(e,H,i),l(e,Pe,i),h(V,e,i),l(e,Me,i),l(e,d,i),h(A,d,null),t(d,We),t(d,te),t(d,Re),t(d,se),t(d,je),t(d,$),h(W,$,null),t($,Be),t($,ne),t(d,Je),t(d,T),h(R,T,null),t(T,Ye),t(T,oe),t(d,Ze),t(d,P),h(j,P,null),t(P,Ge),t(P,ie),t(d,Ke),t(d,M),h(B,M,null),t(M,Qe),t(M,re),t(d,Xe),t(d,S),h(J,S,null),t(S,et),t(S,ae),t(d,tt),t(d,U),h(Y,U,null),t(U,st),t(U,de),t(d,nt),t(d,w),h(Z,w,null),t(w,ot),t(w,le),t(d,it),t(d,D),h(G,D,null),t(D,rt),t(D,ce),t(d,at),t(d,q),h(K,q,null),t(q,dt),t(q,ue),l(e,Se,i),h(Q,e,i),l(e,Ue,i),l(e,C,i),h(X,C,null),t(C,lt),t(C,pe),l(e,we,i),h(ee,e,i),l(e,De,i),l(e,he,i),qe=!0},p:Dt,i(e){qe||(f(L.$$.fragment,e),f(I.$$.fragment,e),f(N.$$.fragment,e),f(V.$$.fragment,e),f(A.$$.fragment,e),f(W.$$.fragment,e),f(R.$$.fragment,e),f(j.$$.fragment,e),f(B.$$.fragment,e),f(J.$$.fragment,e),f(Y.$$.fragment,e),f(Z.$$.fragment,e),f(G.$$.fragment,e),f(K.$$.fragment,e),f(Q.$$.fragment,e),f(X.$$.fragment,e),f(ee.$$.fragment,e),qe=!0)},o(e){g(L.$$.fragment,e),g(I.$$.fragment,e),g(N.$$.fragment,e),g(V.$$.fragment,e),g(A.$$.fragment,e),g(W.$$.fragment,e),g(R.$$.fragment,e),g(j.$$.fragment,e),g(B.$$.fragment,e),g(J.$$.fragment,e),g(Y.$$.fragment,e),g(Z.$$.fragment,e),g(G.$$.fragment,e),g(K.$$.fragment,e),g(Q.$$.fragment,e),g(X.$$.fragment,e),g(ee.$$.fragment,e),qe=!1},d(e){e&&(s(fe),s(me),s(ge),s(_e),s(ve),s(O),s(be),s(z),s(xe),s(k),s(ye),s(F),s(Ce),s($e),s(E),s(Te),s(H),s(Pe),s(Me),s(d),s(Se),s(Ue),s(C),s(we),s(De),s(he)),s(y),_(L,e),_(I,e),_(N,e),_(V,e),_(A),_(W),_(R),_(j),_(B),_(J),_(Y),_(Z),_(G),_(K),_(Q,e),_(X),_(ee,e)}}}const Nt='{"title":"UniPCMultistepScheduler","local":"unipcmultistepscheduler","sections":[{"title":"Tips","local":"tips","sections":[],"depth":2},{"title":"UniPCMultistepScheduler","local":"diffusers.UniPCMultistepScheduler","sections":[],"depth":2},{"title":"SchedulerOutput","local":"diffusers.schedulers.scheduling_utils.SchedulerOutput","sections":[],"depth":2}],"depth":1}';function Et(ct){return qt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class jt extends Lt{constructor(y){super(),It(this,y,Et,Ft,wt,{})}}export{jt as component};
