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, pipeline=None)[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.

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

Prepare Sliding Tile Attention (STA) parameters and settings.

Parameters:
  • batch – The current batch information.

  • fastvideo_args – The inference arguments.

progress_bar(iterable: collections.abc.Iterable | None = None, total: int | None = 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.

save_sta_search_results(batch: fastvideo.v1.pipelines.pipeline_batch_info.ForwardBatch)[source]#

Save the STA mask search results.

Parameters:

batch – The current batch information.

verify_input(batch: fastvideo.v1.pipelines.pipeline_batch_info.ForwardBatch, fastvideo_args: fastvideo.v1.fastvideo_args.FastVideoArgs) fastvideo.v1.pipelines.stages.validators.VerificationResult[source]#

Verify denoising stage inputs.

verify_output(batch: fastvideo.v1.pipelines.pipeline_batch_info.ForwardBatch, fastvideo_args: fastvideo.v1.fastvideo_args.FastVideoArgs) fastvideo.v1.pipelines.stages.validators.VerificationResult[source]#

Verify denoising stage outputs.

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

β€˜init_logger(…)’