import{s as Oe,n as Le,o as qe}from"../chunks/scheduler.8c3d61f6.js";import{S as Ne,i as Pe,g as a,s as n,r as u,A as Ie,h as d,f as t,c as o,j as E,u as p,x as y,k as S,y as s,a as l,v as m,d as f,t as h,w as g}from"../chunks/index.da70eac4.js";import{D as G}from"../chunks/Docstring.c021b19a.js";import{H as ve,E as ke}from"../chunks/getInferenceSnippets.725ed3d4.js";function ze(xe){let _,B,R,j,T,Y,w,$e='The Euler scheduler (Algorithm 2) is from the Elucidating the Design Space of Diffusion-Based Generative Models paper by Karras et al. This is a fast scheduler which can often generate good outputs in 20-30 steps. The scheduler is based on the original k-diffusion implementation by Katherine Crowson.',J,C,Q,i,O,de,M,De="Euler scheduler.",ce,H,Ee=`This model inherits from SchedulerMixin and ConfigMixin. Check the superclass documentation for the generic methods the library implements for all schedulers such as loading and saving.`,le,v,L,ue,F,ye=`Ensures interchangeability with schedulers that need to scale the denoising model input depending on the current timestep. Scales the denoising model input by (sigma**2 + 1) ** 0.5 to match the Euler algorithm.`,pe,x,q,me,A,Se="Sets the begin index for the scheduler. This function should be run from pipeline before the inference.",fe,$,N,he,V,Te="Sets the discrete timesteps used for the diffusion chain (to be run before inference).",ge,D,P,_e,U,we=`Predict the sample from the previous timestep by reversing the SDE. This function propagates the diffusion process from the learned model outputs (most often the predicted noise).`,X,I,Z,b,k,be,W,Ce="Output class for the scheduler’s step function output.",ee,z,te,K,se;return T=new ve({props:{title:"EulerDiscreteScheduler",local:"eulerdiscretescheduler",headingTag:"h1"}}),C=new ve({props:{title:"EulerDiscreteScheduler",local:"diffusers.EulerDiscreteScheduler",headingTag:"h2"}}),O=new G({props:{name:"class diffusers.EulerDiscreteScheduler",anchor:"diffusers.EulerDiscreteScheduler",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:": str = 'linear'"},{name:"trained_betas",val:": typing.Union[numpy.ndarray, typing.List[float], NoneType] = None"},{name:"prediction_type",val:": str = 'epsilon'"},{name:"interpolation_type",val:": str = 'linear'"},{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:"sigma_min",val:": typing.Optional[float] = None"},{name:"sigma_max",val:": typing.Optional[float] = None"},{name:"timestep_spacing",val:": str = 'linspace'"},{name:"timestep_type",val:": str = 'discrete'"},{name:"steps_offset",val:": int = 0"},{name:"rescale_betas_zero_snr",val:": bool = False"},{name:"final_sigmas_type",val:": str = 'zero'"}],parametersDescription:[{anchor:"diffusers.EulerDiscreteScheduler.num_train_timesteps",description:`num_train_timesteps (int, defaults to 1000) — The number of diffusion steps to train the model.`,name:"num_train_timesteps"},{anchor:"diffusers.EulerDiscreteScheduler.beta_start",description:`beta_start (float, defaults to 0.0001) — The starting beta value of inference.`,name:"beta_start"},{anchor:"diffusers.EulerDiscreteScheduler.beta_end",description:`beta_end (float, defaults to 0.02) — The final beta value.`,name:"beta_end"},{anchor:"diffusers.EulerDiscreteScheduler.beta_schedule",description:`beta_schedule (str, defaults to "linear") — The beta schedule, a mapping from a beta range to a sequence of betas for stepping the model. Choose from linear or scaled_linear.`,name:"beta_schedule"},{anchor:"diffusers.EulerDiscreteScheduler.trained_betas",description:`trained_betas (np.ndarray, optional) — Pass an array of betas directly to the constructor to bypass beta_start and beta_end.`,name:"trained_betas"},{anchor:"diffusers.EulerDiscreteScheduler.prediction_type",description:`prediction_type (str, defaults to epsilon, optional) — Prediction type of the scheduler function; can be epsilon (predicts the noise of the diffusion process), sample (directly predicts the noisy sample) or v_prediction\` (see section 2.4 of Imagen Video paper).`,name:"prediction_type"},{anchor:"diffusers.EulerDiscreteScheduler.interpolation_type(str,",description:`interpolation_type(str, defaults to "linear", optional) — The interpolation type to compute intermediate sigmas for the scheduler denoising steps. Should be on of "linear" or "log_linear".`,name:"interpolation_type(str,"},{anchor:"diffusers.EulerDiscreteScheduler.use_karras_sigmas",description:`use_karras_sigmas (bool, optional, defaults to False) — Whether to use Karras sigmas for step sizes in the noise schedule during the sampling process. If True, the sigmas are determined according to a sequence of noise levels {σi}.`,name:"use_karras_sigmas"},{anchor:"diffusers.EulerDiscreteScheduler.use_exponential_sigmas",description:`use_exponential_sigmas (bool, optional, defaults to False) — Whether to use exponential sigmas for step sizes in the noise schedule during the sampling process.`,name:"use_exponential_sigmas"},{anchor:"diffusers.EulerDiscreteScheduler.use_beta_sigmas",description:`use_beta_sigmas (bool, optional, defaults to False) — Whether to use beta sigmas for step sizes in the noise schedule during the sampling process. Refer to Beta Sampling is All You Need for more information.`,name:"use_beta_sigmas"},{anchor:"diffusers.EulerDiscreteScheduler.timestep_spacing",description:`timestep_spacing (str, defaults to "linspace") — The way the timesteps should be scaled. Refer to Table 2 of the Common Diffusion Noise Schedules and Sample Steps are Flawed for more information.`,name:"timestep_spacing"},{anchor:"diffusers.EulerDiscreteScheduler.steps_offset",description:`steps_offset (int, defaults to 0) — An offset added to the inference steps, as required by some model families.`,name:"steps_offset"},{anchor:"diffusers.EulerDiscreteScheduler.rescale_betas_zero_snr",description:`rescale_betas_zero_snr (bool, defaults to False) — 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 --offset_noise.`,name:"rescale_betas_zero_snr"},{anchor:"diffusers.EulerDiscreteScheduler.final_sigmas_type",description:`final_sigmas_type (str, defaults to "zero") — The final sigma value for the noise schedule during the sampling process. If "sigma_min", the final sigma is the same as the last sigma in the training schedule. If zero, the final sigma is set to 0.`,name:"final_sigmas_type"}],source:"https://github.com/huggingface/diffusers/blob/v0.35.1/src/diffusers/schedulers/scheduling_euler_discrete.py#L135"}}),L=new G({props:{name:"scale_model_input",anchor:"diffusers.EulerDiscreteScheduler.scale_model_input",parameters:[{name:"sample",val:": Tensor"},{name:"timestep",val:": typing.Union[float, torch.Tensor]"}],parametersDescription:[{anchor:"diffusers.EulerDiscreteScheduler.scale_model_input.sample",description:`sample (torch.Tensor) — The input sample.`,name:"sample"},{anchor:"diffusers.EulerDiscreteScheduler.scale_model_input.timestep",description:`timestep (int, optional) — The current timestep in the diffusion chain.`,name:"timestep"}],source:"https://github.com/huggingface/diffusers/blob/v0.35.1/src/diffusers/schedulers/scheduling_euler_discrete.py#L295",returnDescription:`