fastvideo.v1.pipelines.stages.denoising
#
Denoising stage for diffusion pipelines.
Module Contents#
Classes#
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.