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
< source >( num_train_timesteps: int = 1024 sigma_data: float = 0.5 )
scale_model_input
< source >( sample: FloatTensor timestep: typing.Optional[int] = None ) → torch.FloatTensor
Ensures interchangeability with schedulers that need to scale the denoising model input depending on the current timestep.
step
< source >( model_output: FloatTensor timestep: typing.Union[float, torch.FloatTensor] sample: FloatTensor generator: typing.Optional[torch._C.Generator] = 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 toTrue
) — Whether or not to return a~schedulers.scheduling_consistency_models.ConsistencyDecoderSchedulerOutput
ortuple
.
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).