Diffusers documentation

ConsistencyDecoderScheduler

You are viewing main version, which requires installation from source. If you'd like regular pip install, checkout the latest stable version (v0.27.2).
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: FloatTensor timestep: Optional = None ) torch.FloatTensor

Parameters

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

Returns

torch.FloatTensor

A scaled input sample.

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

step

< >

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

Parameters

  • model_output (torch.FloatTensor) — The direct output from the learned diffusion model.
  • timestep (float) — The current timestep in the diffusion chain.
  • sample (torch.FloatTensor) — 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