{"record":{"id":"54c7ab80ccad45a1","repo":"Comfy-Org/ComfyUI","slug":"mask-and-image-must-be-the-same-size","errorCode":null,"errorMessage":"Mask and Image must be the same size","messagePattern":"Mask and Image must be the same size","errorType":"validation","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"comfy_api_nodes/nodes_ideogram.py","lineNumber":309,"sourceCode":"            # Resize mask to match image dimension\n            mask = resize_mask_to_image(mask, image, allow_gradient=False)\n            # Invert mask, as Ideogram API will edit black areas instead of white areas (opposite of convention).\n            mask = 1.0 - mask\n\n            # Validate mask dimensions match image\n            if mask.shape[1:] != image.shape[1:-1]:\n                raise Exception(\"Mask and Image must be the same size\")\n\n            # Process image\n            img_np = (input_tensor.numpy() * 255).astype(np.uint8)","sourceCodeStart":291,"sourceCodeEnd":327,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_api_nodes/nodes_ideogram.py#L291-L327","documentation":"Error \"Mask and Image must be the same size\" thrown in Comfy-Org/ComfyUI.","triggerScenarios":"Thrown at comfy_api_nodes/nodes_ideogram.py:309 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Resize the mask so it matches the image dimensions."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}