IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /max/get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).

Python function

run_denoising_step

run_denoising_step()​

max.pipelines.diffusion.run_denoising_step(step, cache_state, cache_config, device, compute_fn, taylorseer=None)

source

Execute one denoising step with caching logic.

This is a standalone version of DiffusionPipeline.run_denoising_step that does not require inheritance. The caller provides a compute_fn callback that runs the transformer and returns the raw result tuple.

Parameters:

  • step (int) – Current step index.
  • cache_state (DenoisingCacheState) – Per-request mutable cache state for this stream.
  • cache_config (DenoisingCacheConfig) – Cache configuration.
  • device (Device) – Target device.
  • compute_fn (Callable[[], tuple[Tensor, ...]]) – Callable that runs the transformer and returns the result tuple. The tuple format depends on the cache mode: (noise_pred,) for standard, (new_residual, noise_pred) for FBCache.
  • taylorseer (TaylorSeer | None) – Optional TaylorSeer instance. Required when cache_config.taylorseer is True.

Returns:

noise_pred tensor for this step.

Return type:

Tensor