fastvideo.v1.pipelines.stages.denoising#

Denoising stage for diffusion pipelines.

Module Contents#

Classes#

DenoisingStage

Stage for running the denoising loop in diffusion pipelines.

Data#

API#

class fastvideo.v1.pipelines.stages.denoising.DenoisingStage(transformer, scheduler)[source]#

Bases: fastvideo.v1.pipelines.stages.base.PipelineStage

Stage for running the denoising loop in diffusion pipelines.

This stage handles the iterative denoising process that transforms the initial noise into the final output.

Initialization

forward(batch: fastvideo.v1.pipelines.pipeline_batch_info.ForwardBatch, fastvideo_args: fastvideo.v1.fastvideo_args.FastVideoArgs) fastvideo.v1.pipelines.pipeline_batch_info.ForwardBatch[source]#

Run the denoising loop.

Parameters:
  • batch – The current batch information.

  • fastvideo_args – The inference arguments.

Returns:

The batch with denoised latents.

prepare_extra_func_kwargs(func, kwargs) Dict[str, Any][source]#

Prepare extra kwargs for the scheduler step / denoise step.

Parameters:
  • func – The function to prepare kwargs for.

  • kwargs – The kwargs to prepare.

Returns:

The prepared kwargs.

progress_bar(iterable: Optional[Iterable] = None, total: Optional[int] = None) tqdm.auto.tqdm[source]#

Create a progress bar for the denoising process.

Parameters:
  • iterable – The iterable to iterate over.

  • total – The total number of items.

Returns:

A tqdm progress bar.

rescale_noise_cfg(noise_cfg, noise_pred_text, guidance_rescale=0.0) torch.Tensor[source]#

Rescale noise prediction according to guidance_rescale.

Based on findings of β€œCommon Diffusion Noise Schedules and Sample Steps are Flawed” (https://arxiv.org/pdf/2305.08891.pdf), Section 3.4.

Parameters:
  • noise_cfg – The noise prediction with guidance.

  • noise_pred_text – The text-conditioned noise prediction.

  • guidance_rescale – The guidance rescale factor.

Returns:

The rescaled noise prediction.

fastvideo.v1.pipelines.stages.denoising.logger[source]#

β€˜init_logger(…)’

fastvideo.v1.pipelines.stages.denoising.spec[source]#

β€˜find_spec(…)’

fastvideo.v1.pipelines.stages.denoising.st_attn_available[source]#

False