invoke-ai/InvokeAI · error · ValueError

Unsupported Anima ControlNet-LLLite adapter: expected 3 or 4

Error message

Unsupported Anima ControlNet-LLLite adapter: expected 3 or 4 conditioning channels, got {lllite_model.cond_in_channels}.

What it means

_build_lllite_cond_image supports only 3-channel (RGB) or 4-channel (inpaint) LLLite adapters. Any other cond_in_channels value triggers a ValueError reporting the actual channel count, indicating an unsupported or incompatible adapter architecture.

Source

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

        latent_h, latent_w = latents.shape[-2], latents.shape[-1]

        image_pil = context.images.get_pil(lllite_field.image_name, "RGB")
        rgb_01 = to_tensor(image_pil).unsqueeze(0)  # (1, 3, H, W) in [0, 1]
        rgb_pm1 = prepare_cond_image(rgb_01, latent_h, latent_w, patch_spatial)

        if lllite_model.cond_in_channels == 4:
            if lllite_field.mask_name is None:
                raise ValueError(
                    "This Anima ControlNet-LLLite adapter is an inpainting adapter (4-channel conditioning) and "
                    "requires a mask. Connect a mask (white = inpaint area) to the Anima ControlNet-LLLite node."
                )
            mask_pil = context.images.get_pil(lllite_field.mask_name, "L")
            mask_01 = to_tensor(mask_pil).unsqueeze(0)  # (1, 1, H, W) in [0, 1]
            mask_01 = prepare_mask(mask_01, latent_h, latent_w, patch_spatial)
            return build_inpaint_cond_image(rgb_pm1, mask_01, lllite_model.inpaint_masked_input)

        if lllite_model.cond_in_channels != 3:
            raise ValueError(
                f"Unsupported Anima ControlNet-LLLite adapter: expected 3 or 4 conditioning channels, got "
                f"{lllite_model.cond_in_channels}."
            )
        if lllite_field.mask_name is not None:
            context.logger.warning(
                "The selected Anima ControlNet-LLLite adapter does not use a mask (3-channel conditioning); the "
                "connected mask will be ignored."
            )
        return rgb_pm1

    @staticmethod
    def _get_lllite_multiplier(lllite_field: AnimaLLLiteField, step_index: int, total_steps: int) -> float:
        """Step-range gate for one LLLite adapter's multiplier.

        Uses the same user-facing step-index/percent convention as
        BaseControlNetExtension._get_weight.
        """
        first_step = math.floor(lllite_field.begin_step_percent * total_steps)

View on GitHub (pinned to 0b6a024f2f)

Solutions

  1. Use a standard RGB (3-channel) or inpaint (4-channel) Anima LLLite adapter
  2. Re-export/retrain the adapter with 3 or 4 conditioning channels
  3. Update InvokeAI if a newer version supports this adapter type

Example fix

// before
lllite_model.cond_in_channels  # e.g. 8 -> unsupported
// after
# select an adapter with cond_in_channels in (3, 4) before wiring it into the graph
Defensive patterns

Strategy: validation

Validate before calling

if lllite_model.cond_in_channels not in (3, 4):
    raise ValueError(f'unsupported LLLite cond_in_channels: {lllite_model.cond_in_channels}')

Type guard

def is_supported_lllite(model) -> bool:
    return getattr(model, 'cond_in_channels', 0) in (3, 4)

Try / catch

try:
    cond = _build_lllite_cond_image(context, lllite_field, lllite_model, ...)
except ValueError as e:
    if 'conditioning channels' in str(e):
        raise ModelIncompatibleError(str(e)) from e
    raise

Prevention

When it happens

Trigger: Loading a ControlNet-LLLite adapter whose cond_in_channels is neither 3 nor 4 (e.g. a depth-conditioned or custom adapter variant) and using it in Anima diffusion.

Common situations: Importing LLLite checkpoints trained for other model families; corrupt or non-standard adapter exports; adapter code changes altering channel count across versions.

Related errors


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