Diffusers documentation

ConsistencyDecoderScheduler

You are viewing v0.31.0 version. A newer version v0.32.0 is available.
Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

to get started

ConsistencyDecoderScheduler

This scheduler is a part of the ConsistencyDecoderPipeline and was introduced in DALL-E 3.

The original codebase can be found at openai/consistency_models.

ConsistencyDecoderScheduler

class diffusers.schedulers.ConsistencyDecoderScheduler

< >

( num_train_timesteps: int = 1024 sigma_data: float = 0.5 )

scale_model_input

< >

( sample: Tensor timestep: Optional = None ) torch.Tensor

Parameters

  • sample (torch.Tensor) — The input sample.
  • timestep (int, optional) — The current timestep in the diffusion chain.

Returns

torch.Tensor

A scaled input sample.

Ensures interchangeability with schedulers that need to scale the denoising model input depending on the current timestep.

step

< >

( model_output: Tensor timestep: Union sample: Tensor generator: Optional = None return_dict: bool = True ) ~schedulers.scheduling_consistency_models.ConsistencyDecoderSchedulerOutput or tuple

Parameters

  • model_output (torch.Tensor) — The direct output from the learned diffusion model.
  • timestep (float) — The current timestep in the diffusion chain.
  • sample (torch.Tensor) — A current instance of a sample created by the diffusion process.
  • generator (torch.Generator, optional) — A random number generator.
  • return_dict (bool, optional, defaults to True) — Whether or not to return a ~schedulers.scheduling_consistency_models.ConsistencyDecoderSchedulerOutput or tuple.

Returns

~schedulers.scheduling_consistency_models.ConsistencyDecoderSchedulerOutput or tuple

If return_dict is True, ~schedulers.scheduling_consistency_models.ConsistencyDecoderSchedulerOutput is returned, otherwise a tuple is returned where the first element is the sample tensor.

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).

< > Update on GitHub