{"record":{"id":"d1f1e1d8517dc72f","repo":"invoke-ai/InvokeAI","slug":"this-anima-controlnet-lllite-adapter-is-an-inpaint","errorCode":null,"errorMessage":"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.","messagePattern":"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\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"invokeai/app/invocations/anima_denoise.py","lineNumber":327,"sourceCode":"        lllite_field: AnimaLLLiteField,\n        lllite_model: AnimaControlNetLLLite,\n        latents: torch.Tensor,\n        patch_spatial: int = 2,\n    ) -> torch.Tensor:\n        \"\"\"Build one adapter's LLLite conditioning image tensor (once per generation).\n\n        The cond image is sized from the ACTUAL latent H/W (mirroring the DiT's\n        patch padding) — see target_cond_hw in the backend module.\n        \"\"\"\n        latent_h, latent_w = latents.shape[-2], latents.shape[-1]\n\n        image_pil = context.images.get_pil(lllite_field.image_name, \"RGB\")\n        rgb_01 = to_tensor(image_pil).unsqueeze(0)  # (1, 3, H, W) in [0, 1]\n        rgb_pm1 = prepare_cond_image(rgb_01, latent_h, latent_w, patch_spatial)\n\n        if lllite_model.cond_in_channels == 4:\n            if lllite_field.mask_name is None:\n                raise ValueError(\n                    \"This Anima ControlNet-LLLite adapter is an inpainting adapter (4-channel conditioning) and \"\n                    \"requires a mask. Connect a mask (white = inpaint area) to the Anima ControlNet-LLLite node.\"\n                )\n            mask_pil = context.images.get_pil(lllite_field.mask_name, \"L\")\n            mask_01 = to_tensor(mask_pil).unsqueeze(0)  # (1, 1, H, W) in [0, 1]\n            mask_01 = prepare_mask(mask_01, latent_h, latent_w, patch_spatial)\n            return build_inpaint_cond_image(rgb_pm1, mask_01, lllite_model.inpaint_masked_input)\n\n        if lllite_model.cond_in_channels != 3:\n            raise ValueError(\n                f\"Unsupported Anima ControlNet-LLLite adapter: expected 3 or 4 conditioning channels, got \"\n                f\"{lllite_model.cond_in_channels}.\"\n            )\n        if lllite_field.mask_name is not None:\n            context.logger.warning(\n                \"The selected Anima ControlNet-LLLite adapter does not use a mask (3-channel conditioning); the \"\n                \"connected mask will be ignored.\"\n            )","sourceCodeStart":309,"sourceCodeEnd":345,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/app/invocations/anima_denoise.py#L309-L345","documentation":"_build_lllite_cond_image builds the conditioning image for an LLLite adapter. If the loaded adapter expects 4-channel conditioning (cond_in_channels == 4, i.e. an inpainting adapter) but the AnimaLLLiteField has no mask_name, a ValueError is raised explaining that a mask is required.","triggerScenarios":"Running Anima diffusion with an inpainting-type ControlNet-LLLite adapter whose field lacks mask_name — the loader node was given a control image but no mask image.","commonSituations":"Using an inpaint-trained LLLite adapter intended for masked conditioning without connecting a mask; swapping a 3-channel adapter for an inpaint adapter in an existing workflow that has no mask input wired.","solutions":["Connect a mask image (white = inpaint area) to the ControlNet-LLLite node's mask input","Switch to a 3-channel (non-inpaint) LLLite adapter if no mask is desired","Regenerate the workflow graph so the mask field is populated"],"exampleFix":"// before\nfield = AnimaLLLiteField(control_model=m, image_name=\"cond\")\n// after\nfield = AnimaLLLiteField(control_model=m, image_name=\"cond\", mask_name=\"mask_png\")","handlingStrategy":"validation","validationCode":"if lllite_model.cond_in_channels == 4 and lllite_field.mask_name is None:\n    raise ValueError('inpaint LLLite adapter requires a connected mask')","typeGuard":"def lllite_mask_ok(model, field: AnimaLLLiteField) -> bool:\n    return model.cond_in_channels != 4 or field.mask_name is not None","tryCatchPattern":"try:\n    cond = _build_lllite_cond_image(context, lllite_field, lllite_model, ...)\nexcept ValueError as e:\n    if 'requires a mask' in str(e):\n        raise NodeInputError('Connect a mask to the Anima ControlNet-LLLite node') from e\n    raise","preventionTips":["Always connect a mask when using inpaint (4-channel) LLLite adapters","Check cond_in_channels when building the node graph","Validate required node inputs before running the queue"],"tags":["python","controlnet","anima","mask","validation"],"backgroundTag":"missing-required-input","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}