Comfy-Org/ComfyUI · error · Exception

Character mask and image must be the same size

Error message

Character mask and image must be the same size

What it means

Error "Character mask and image must be the same size" thrown in Comfy-Org/ComfyUI.

Source

Thrown at comfy_api_nodes/nodes_ideogram.py:278

        if character_image is not None:
            input_tensor = character_image.squeeze().cpu()
            if character_mask is not None:
                character_mask = resize_mask_to_image(character_mask, character_image, allow_gradient=False)
                character_mask = 1.0 - character_mask
                if character_mask.shape[1:] != character_image.shape[1:-1]:
                    raise Exception("Character mask and image must be the same size")

                mask_np = (character_mask.squeeze().cpu().numpy() * 255).astype(np.uint8)
                mask_img = Image.fromarray(mask_np)

View on GitHub (pinned to 1c6d8d45b3)

Solutions

  1. Resize the character mask so it matches the character image dimensions.

When it happens

Trigger: Thrown at comfy_api_nodes/nodes_ideogram.py:278 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Comfy-Org/ComfyUI@1c6d8d45b3 (2026-08-14). Data as JSON: /api/errors/f092894a5469215c. Report an issue: GitHub.