invoke-ai/InvokeAI · error · ValueError

denoising_start should be 0 when initial latents are not pro

Error message

denoising_start should be 0 when initial latents are not provided.

What it means

When no initial latents are supplied (pure text-to-image), the denoise invocation starts from pure noise, so the sigma schedule must begin at the start of denoising. If denoising_start is greater than ~1e-5 while init_latents is None, _run_diffusion raises ValueError because partial denoising is only meaningful relative to existing (image) latents.

Source

Thrown at invokeai/app/invocations/z_image_denoise.py:382

        # Prepare input latent image
        if init_latents is not None:
            if self.add_noise:
                assert noise is not None
                # Noise the init latents using the first sigma from the clipped
                # InvokeAI schedule.
                #
                # Known limitation: if the selected scheduler later starts from a
                # different first effective sigma/timestep than sigmas[0], the
                # img2img preblend below may not match that scheduler exactly.
                # This is an existing pipeline limitation and affects both
                # internally generated noise and externally supplied noise.
                s_0 = sigmas[0]
                latents = s_0 * noise + (1.0 - s_0) * init_latents
            else:
                latents = init_latents
        else:
            if self.denoising_start > 1e-5:
                raise ValueError("denoising_start should be 0 when initial latents are not provided.")
            assert noise is not None
            latents = noise

        # Short-circuit if no denoising steps
        if total_steps <= 0:
            return latents

        # Prepare inpaint extension
        inpaint_mask = self._prep_inpaint_mask(context, latents)
        inpaint_extension: RectifiedFlowInpaintExtension | None = None
        if inpaint_mask is not None:
            if init_latents is None:
                raise ValueError("Initial latents are required when using an inpaint mask (image-to-image inpainting)")
            assert noise is not None
            inpaint_extension = RectifiedFlowInpaintExtension(
                init_latents=init_latents,
                inpaint_mask=inpaint_mask,
                noise=noise,

View on GitHub (pinned to 0b6a024f2f)

Solutions

  1. Set denoising_start to 0 when no initial latents are provided
  2. Or connect initial latents (img2img) if you intend to skip the first portion of the schedule
  3. Validate in the workflow editor that denoising_start is 0 whenever the latents input is unconnected

Example fix

// before
denoise = ZImageDenoiseInvocation(..., denoising_start=0.3)  # no latents connected
// after
denoise = ZImageDenoiseInvocation(..., denoising_start=0.0)  # txt2img
// or connect initial_latents for img2img
Defensive patterns

Strategy: validation

Validate before calling

if init_latents is None and denoising_start > 1e-5:
    denoising_start = 0.0  # or raise before invoking

Try / catch

try:
    output = denoise.invoke(context)
except ValueError as e:
    if "denoising_start should be 0" in str(e):
        raise GraphConfigError("txt2img graph must use denoising_start=0") from e
    raise

Prevention

When it happens

Trigger: Calling the Z-Image denoise invocation with denoising_start > 1e-5 while the initial latents input is unconnected/None — e.g. a txt2img graph that still has a non-zero denoising_start value.

Common situations: Building a txt2img workflow after copying parameters from an img2img workflow; a UI that keeps a previous denoising_start value after the image input is removed; scripting where latents input is optional and unset.

Related errors


AI-assisted analysis of invoke-ai/InvokeAI@0b6a024f2f (2026-08-29). Data as JSON: /api/errors/0483c72343e3fc4a. Report an issue: GitHub.