sd_denoise_step: Run a single denoise step (low-level)

View source: R/lowlevel.R

sd_denoise_stepR Documentation

Run a single denoise step (low-level)

Description

Runs the diffusion model once on x at sigma and returns the denoised x_0 estimate. The Euler update of x is done by the caller (see sd_sample_stepwise for the full loop). Must be called between sd_sampler_begin and sd_sampler_end.

Usage

sd_denoise_step(
  ctx,
  x,
  sigma,
  cond,
  uncond = list(crossattn = NULL, vector = NULL, concat = NULL),
  cfg_scale = 7,
  step = 1L,
  total_steps = 1L
)

Arguments

ctx

SD context

x

Current latent sd_tensor

sigma

Current sigma (scalar)

cond

Positive conditioning from sd_encode_text

uncond

Negative conditioning; empty (all NULL) disables CFG

cfg_scale

CFG scale (1 disables CFG)

step, total_steps

1-based step index / total, for progress hooks

Value

An sd_tensor list — the denoised x_0 estimate.

See Also

sd_sample_stepwise


sd2R documentation built on June 19, 2026, 9:08 a.m.