Can Cryptomatte control ComfyUI edits?
Yes, after you extract the chosen Cryptomatte IDs into a grayscale mask. Use object IDs for discrete elements and material IDs for shared finishes, then pass the exported mask into an inpainting or compositing graph. Check edge coverage and reflected or transparent surfaces because the matte is precise, not omniscient.
The client asks for warmer brick, not a new facade. A hurried mask catches most of the wall, half a window frame and a thin ribbon of sky. ComfyUI follows instructions with the literal charm of a subcontractor handed the wrong drawing.
This week's community advice was sound: export depth, line art and cryptomatte data with the source render. Depth protects spatial order. Cryptomatte answers a different question: exactly which named object or material may this pass touch?
What does Cryptomatte actually preserve?
Cryptomatte stores selection identities in render channels. The Blender 5.2 manual describes object, material and asset passes, with multiple contributors retained at a pixel. That matters at antialiased edges, motion blur and transparency, where a flat ID color can become a jagged little lie.
Chaos documents the same basic purpose for V-Ray's Cryptomatte render element: accurate mattes encoded in a multichannel OpenEXR, selectable by names or attributes. Its documentation also states a critical limit. Cryptomatte cannot be propagated through reflections or refractions. A glass curtain wall and the building reflected in it remain compositing problems, not checkbox problems.
ComfyUI does not need the encoded IDs themselves for a basic edit. It needs the extracted result: a mask with the same pixel dimensions as the image. The encoded EXR is the master selection record. The grayscale file is the delivery copy.
Object IDs beat a hand-painted facade
Pick the identity level before rendering. Object IDs suit doors, roofs, furniture and other discrete assemblies. Material IDs suit a finish repeated across several meshes. Asset or hierarchy groupings can collect related parts, although naming discipline determines whether that grouping is useful.
| Selection basis | Good use | Common trap |
|---|---|---|
| Object | One canopy, stair or furniture family | Hundreds of unnamed duplicates |
| Material | All panels using one facade finish | The same material reused on elements that should stay fixed |
| Asset or hierarchy | A grouped planting or entourage set | Parenting chosen for modeling convenience, not edit scope |
The naming pass is not clerical polish. It is the edit contract. “Material.004” tells the reviewer nothing; “facade_brick_option_b” states both location and intent. If a material appears on a planter and the main elevation, splitting it before render is cheaper than explaining why the planter changed later.
This is the mask equivalent of our native depth-pass method. Ask the scene for known information before asking an image model to infer it. Inferred segmentation is useful when the scene file is gone. It is an odd first choice when the model is open beside you.
How do you move the matte into ComfyUI?
Render the beauty image and Cryptomatte element at identical dimensions. Save the multichannel EXR with metadata intact. In Blender's compositor, V-Ray VFB, Nuke, Fusion or another Cryptomatte-aware application, pick the named objects or materials and export their combined selection as a grayscale image.
Keep that conversion outside the generative graph unless the installed ComfyUI nodes have a documented Cryptomatte reader. Custom-node packages change quickly. A plain mask is portable, visible and easy to archive.
White commonly marks the editable region and black protects the rest, but verify the node's convention. Official ComfyUI documentation for its GPT Image inpainting workflow says white areas are replaced and requires the mask and image to have the same size. Other node packs may invert that meaning. Run a cheap flat-color or low-step test before spending a full render.
If the mask arrives soft, do not automatically threshold it. ComfyUI's documented ThresholdMask node converts values above a chosen level to white and the rest to black. That can be useful for a hard graphic boundary. It can also throw away fractional edge coverage that Cryptomatte worked to preserve.
Where should the mask be softened?
Inspect the extracted matte over white, black and a loud color. Look at rooflines, thin mullions, foliage, furniture legs and glazing. A clean mask should follow the source coverage without a bright or dark fringe. The right feather width depends on resolution and the operation, not on a favorite integer saved in a node.
For a material variation, a narrow transition may be enough. A generative replacement can need more context around the selection so the model can rebuild contact shadows and junctions. Expand the working mask for generation, then composite the result through a stricter final matte. That separates model context from final permission.
Our ComfyUI change budget applies here. The generative mask says where the model may propose pixels. The final composite mask says which proposed pixels survive. Those are different powers and deserve different files.
What can still go wrong with a perfect ID?
Reflections are the obvious gap. Select a red chair and its reflection in glazing may remain red after the chair becomes blue. Refraction creates the inverse problem: a surface visible through glass may not be included as expected. Render a separate pass or repair those regions deliberately.
Shared materials are another trap. One concrete material assigned across slabs, walls and paving makes a convenient model and a disastrous edit selector. Object-based mattes can rescue the operation, but the incident says something useful about scene organization.
Occlusion also limits what any screen-space mask can do. The matte contains visible contributions at this camera, not the concealed geometry behind them. If ComfyUI removes a foreground tree, the mask cannot reveal the correct facade behind it. That is an inpainting guess unless another render supplies the hidden surface.
Finally, a precise selection cannot protect geometry inside the selected region. Asking for “warmer brick” may still bend joints or redraw openings. Pair the matte with the geometry hallucination checklist, and compare the edited crop with the source.
What should the job record contain?
Save the source scene revision, camera, beauty render, multichannel EXR, extracted mask and workflow JSON. Record the selected names, inversion state, any expansion or feather, and the node that consumed the mask. Add a contact sheet with the mask over contrasting backgrounds.
Keep the master EXR even if the immediate job uses a PNG mask. A later correction may need another object from the same render, and reopening a properly named Cryptomatte file is far cleaner than excavating an old selection with a brush.
Our take: prompting should not decide the address
Prompts describe an edit. They are poor cadastral maps. Let the renderer identify the parcel, let ComfyUI work inside it, and let the final composite enforce the boundary.
Name the wall first. Then change its mind.