class_docstr: A stochastic scheduler tailored to variance-expanding models.
  
  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.
  
  <Tip>
  
  For more details on the parameters, see [Appendix E](https://arxiv.org/abs/2206.00364). The grid search values used
  to find the optimal `{s_noise, s_churn, s_min, s_max}` for a specific model are described in Table 5 of the paper.
  
  </Tip>
  
  Args:
      sigma_min (`float`, defaults to 0.02):
          The minimum noise magnitude.
      sigma_max (`float`, defaults to 100):
          The maximum noise magnitude.
      s_noise (`float`, defaults to 1.007):
          The amount of additional noise to counteract loss of detail during sampling. A reasonable range is [1.000,
          1.011].
      s_churn (`float`, defaults to 80):
          The parameter controlling the overall amount of stochasticity. A reasonable range is [0, 100].
      s_min (`float`, defaults to 0.05):
          The start value of the sigma range to add noise (enable stochasticity). A reasonable range is [0, 10].
      s_max (`float`, defaults to 50):
          The end value of the sigma range to add noise. A reasonable range is [0.2, 80].
class_docstr_tok: ["A","stochastic","scheduler","tailored","to","variance-expanding","models",".","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",".","<","Tip",">","For","more","details","on","the","parameters",",","see","[","Appendix","E","]","(","https",":","\/\/arxiv.org\/abs\/2206.00364",")",".","The","grid","search","values","used","to","find","the","optimal","`","{","s_noise",",","s_churn",",","s_min",",","s_max","}","`","for","a","specific","model","are","described","in","Table","5","of","the","paper",".","<","\/Tip",">","Args",":","sigma_min","(","`","float","`",",","defaults","to","0.02",")",":","The","minimum","noise","magnitude",".","sigma_max","(","`","float","`",",","defaults","to","100",")",":","The","maximum","noise","magnitude",".","s_noise","(","`","float","`",",","defaults","to","1.007",")",":","The","amount","of","additional","noise","to","counteract","loss","of","detail","during","sampling",".","A","reasonable","range","is","[","1.000",",","1.011","]",".","s_churn","(","`","float","`",",","defaults","to","80",")",":","The","parameter","controlling","the","overall","amount","of","stochasticity",".","A","reasonable","range","is","[","0",",","100","]",".","s_min","(","`","float","`",",","defaults","to","0.05",")",":","The","start","value","of","the","sigma","range","to","add","noise","(","enable","stochasticity",")",".","A","reasonable","range","is","[","0",",","10","]",".","s_max","(","`","float","`",",","defaults","to","50",")",":","The","end","value","of","the","sigma","range","to","add","noise",".","A","reasonable","range","is","[","0.2",",","80","]","."]
docstr: 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).
  
  Args:
      model_output (`torch.FloatTensor`):
          The direct output from learned diffusion model.
      sigma_hat (`float`):
      sigma_prev (`float`):
      sample_hat (`torch.FloatTensor`):
      return_dict (`bool`, *optional*, defaults to `True`):
          Whether or not to return a [`~schedulers.scheduling_karras_ve.KarrasVESchedulerOutput`] or `tuple`.
  
  Returns:
      [`~schedulers.scheduling_karras_ve.KarrasVESchedulerOutput`] or `tuple`:
          If return_dict is `True`, [`~schedulers.scheduling_karras_ve.KarrasVESchedulerOutput`] is returned,
          otherwise a tuple is returned where the first element is the sample tensor.
docstr_tok: ["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",")",".","Args",":","model_output","(","`","torch.FloatTensor","`",")",":","The","direct","output","from","learned","diffusion","model",".","sigma_hat","(","`","float","`",")",":","sigma_prev","(","`","float","`",")",":","sample_hat","(","`","torch.FloatTensor","`",")",":","return_dict","(","`","bool","`",",","*","optional","*",",","defaults","to","`","True","`",")",":","Whether","or","not","to","return","a","[","`","~schedulers.scheduling_karras_ve.KarrasVESchedulerOutput","`","]","or","`","tuple","`",".","Returns",":","[","`","~schedulers.scheduling_karras_ve.KarrasVESchedulerOutput","`","]","or","`","tuple","`",":","If","return_dict","is","`","True","`",",","[","`","~schedulers.scheduling_karras_ve.KarrasVESchedulerOutput","`","]","is","returned",",","otherwise","a","tuple","is","returned","where","the","first","element","is","the","sample","tensor","."]
code: def step(
      self,
      model_output: torch.FloatTensor,
      sigma_hat: float,
      sigma_prev: float,
      sample_hat: torch.FloatTensor,
      return_dict: bool = True,
  ) -> Union[KarrasVeOutput, Tuple]:
      """
      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).
  
      Args:
          model_output (`torch.FloatTensor`):
              The direct output from learned diffusion model.
          sigma_hat (`float`):
          sigma_prev (`float`):
          sample_hat (`torch.FloatTensor`):
          return_dict (`bool`, *optional*, defaults to `True`):
              Whether or not to return a [`~schedulers.scheduling_karras_ve.KarrasVESchedulerOutput`] or `tuple`.
  
      Returns:
          [`~schedulers.scheduling_karras_ve.KarrasVESchedulerOutput`] or `tuple`:
              If return_dict is `True`, [`~schedulers.scheduling_karras_ve.KarrasVESchedulerOutput`] is returned,
              otherwise a tuple is returned where the first element is the sample tensor.
  
      """
  
      pred_original_sample = sample_hat + sigma_hat * model_output
      derivative = (sample_hat - pred_original_sample) / sigma_hat
      sample_prev = sample_hat + (sigma_prev - sigma_hat) * derivative
  
      if not return_dict:
          return (sample_prev, derivative)
  
      return KarrasVeOutput(
          prev_sample=sample_prev,
          derivative=derivative,
          pred_original_sample=pred_original_sample,
      )
  
file_path: llmga/llmga/diffusers/src/diffusers/schedulers/scheduling_karras_ve.py
imports: from dataclasses import dataclass
  from typing import Optional, Tuple, Union
  import numpy
  import torch
  from ..configuration_utils import ConfigMixin, register_to_config
  from ..utils import BaseOutput
  from ..utils.torch_utils import randn_tensor
  from .scheduling_utils import SchedulerMixin
label_desc: Use image node_id 5 for calling the KarrasVeScheduler obj's underlying member method code with example usage: obj.step(model_output, sigma_hat, sigma_prev, sample_hat, return_dict) and returns: KarrasVeOutput, sample_prev,  derivative