invoke-ai/InvokeAI · error · ValueError

denoising_start ({self.denoising_start}) must be less than d

Error message

denoising_start ({self.denoising_start}) must be less than denoising_end ({self.denoising_end}).

What it means

This ValueError guards the denoising window in the Anima denoise invocation: denoising_start must be strictly less than denoising_end. InvokeAI throws it before running diffusion because a zero-width or inverted schedule range is meaningless and would produce invalid sigma timesteps.

Source

Thrown at invokeai/app/invocations/anima_denoise.py:544

            context_embeds_list.append(context_2d)
            context_ranges.append(Range(start=cur_len, end=cur_len + context_2d.shape[0]))
            image_masks.append(tc.mask)
            cur_len += context_2d.shape[0]

        concatenated_context = torch.cat(context_embeds_list, dim=0)

        return AnimaRegionalTextConditioning(
            context_embeds=concatenated_context,
            image_masks=image_masks,
            context_ranges=context_ranges,
        )

    def _run_diffusion(self, context: InvocationContext) -> torch.Tensor:
        device = TorchDevice.choose_torch_device()
        inference_dtype = TorchDevice.choose_anima_inference_dtype(device)

        if self.denoising_start >= self.denoising_end:
            raise ValueError(
                f"denoising_start ({self.denoising_start}) must be less than denoising_end ({self.denoising_end})."
            )

        lllite_fields = self._normalize_control_lllite(self.control_lllite)

        transformer_info = context.models.load(self.transformer.transformer)

        # Compute image token grid dimensions for regional prompting
        img_token_height, img_token_width = self._compute_img_token_grid(self.height, self.width)
        img_seq_len = img_token_height * img_token_width

        # Load positive conditioning with optional regional masks
        pos_text_conditionings = self._load_text_conditionings(
            context=context,
            cond_field=self.positive_conditioning,
            img_token_height=img_token_height,
            img_token_width=img_token_width,
            dtype=inference_dtype,

View on GitHub (pinned to 0b6a024f2f)

Solutions

  1. Check the invocation's denoising_start and denoising_end values and ensure start < end (e.g. start=0.3, end=0.8).
  2. If building the range programmatically, clamp/sort so start is the minimum of the two fractions.
  3. For a full denoise, set denoising_start to 0.0 and denoising_end to 1.0.

Example fix

// before
node.denoising_start = 0.8
node.denoising_end = 0.5
// after
node.denoising_start = 0.5
node.denoising_end = 0.8
Defensive patterns

Strategy: validation

Validate before calling

if not (0.0 <= start < end <= 1.0):
    raise ValueError(f"Invalid denoise window: start={start}, end={end}")
denoise.denoising_start, denoise.denoising_end = start, end

Try / catch

try:
    output = invoker.invoke(denoise_invocation)
except ValueError as e:
    if "denoising_start" in str(e):
        denoise.denoising_start, denoise.denoising_end = sorted([denoise.denoising_start, denoise.denoising_end])
        output = invoker.invoke(denoise_invocation)
    else:
        raise

Prevention

When it happens

Trigger: Calling the Anima denoise invocation with denoising_start >= denoising_end, e.g. start=0.8/end=0.5 (inverted) or start=0.6/end=0.6 (equal, zero-width window).

Common situations: Mistakenly swapping start/end fields in a workflow node; computing a denoise fraction range programmatically where start and end both clamp to the same value; migrating from UI slider defaults where both sliders coincide.

Related errors


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