VNCCS Factory Mask
Select one object out of a 3D scene render, no hand-painting required
- capture
- mask
- metadata
You rendered a VNCCS 3D Factory scene and now you need to edit just the red chair in it - not the floor under it, not the wall behind it. With a flat 2D image you'd be opening Photoshop and painting a selection by hand. VNCCS Factory Mask is the version of that problem that already solved itself: it turns the Factory Render's object_id capture into a mask for exactly the geometry you name, down to the individual object.
It's a small node, but it's the one that makes scene-aware editing practical. Without per-object masks you're back to guessing boundaries from a screenshot. With them, you can route one object's pixels to an inpaint, a region refiner, or a whole separate branch - which is exactly the "conditioning capture" pipeline the 3D Factory docs describe.
How it knows what to select
The trick is upstream. When Factory Render captures the scene, every entity is drawn with a unique 24-bit ID encoded in its RGB - so the object_id image already knows, per pixel, which object/wall/room it belongs to. Factory Mask just decodes that map and keeps the pixels whose IDs you asked for. White in the output means selected foreground; black is everything else.
You select by entity key, not by guessing: object:<id>, wall:<id>, room:<id> - comma- or newline-separated in the multiline entities box. The reliable source of those keys is the camera_metadata JSON from Factory Render, or the "Get selection keys for Mask" option in the 3D Factory's Export tab, which lists the keys for whatever you've currently selected in the scene.
The inputs that matter
- capture - feed it the
captureoutput from a VNCCS Factory Render node. That's the only input worth a second glance; everything else is a knob. - entities - the list of keys above. Here's the trap that gets everyone once: an empty field selects all foreground geometry, not nothing. If you type nothing expecting an empty mask, you get a white matte of the entire scene.
- invert - flips the selection. Combine with an empty
entitiesto grab background and sky instead. - grow_pixels - dilate (positive) or erode (negative) the mask, ±64 px. Handy for fattening a selection so an inpaint doesn't leave a thin unedited seam.
- feather_pixels - Gaussian blur the edge, up to 64 px, for soft mattes.
Outputs
Two outputs, both lists aligned with Factory Render's camera order:
- mask (
MASK) - one mask per captured view (current view, then saved cameras). - metadata (
STRING) - JSON per mask recording the shot, the sorted entity keys, invert/grow/feather values, andforeground: 1.
Because the lists share Factory Render's ordering, mask[i] matches rgb[i] from the same render. Wire them as a pair and you've got the classic setup for "regenerate only this object, keeping the rest of the scene."
Installing it
Factory Mask is part of AHEKOT/ComfyUI_VNCCS_Utils - there's no standalone install. Via ComfyUI Manager, search "VNCCS Utils" and Install, then restart. Or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/AHEKOT/ComfyUI_VNCCS_Utils.git
cd ComfyUI_VNCCS_Utils
pip install -r requirements.txt
Same caveat as the rest of the pack: that requirements.txt installs a lot (av, kornia, transformers, opencv…), because VNCCS Utils bundles several full workspaces. Factory Mask needs no model files of its own - just a Factory Render capture to chew on, which means the VNCCS 3D Factory workspace has to have been run first. It's not a node a random passerby reaches for; it's a node you reach for once you're living inside the 3D Factory.
Common snags
- "Unknown capture entities: …" - you pasted a key that isn't in this capture's
entity_ids. Copy keys from the matching capture'scamera_metadataor the Factory's own "Get selection keys" list; entity IDs are per-capture, and a stale key from an old render won't resolve. - Mask came out fully white - empty
entitiesfield means "all geometry." If you meant one object, type its key. - Mask and image don't line up - resolution comes from the capture (set in Factory Render), and the list order is shared, so an
rgbandmaskfrom different renders will drift. Use one capture's outputs together.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| capture | VNCCS_FACTORY_CAPTURE | — | |
| entities | STRING | Comma/newline-separated entity keys from camera_metadata, e.g. object:<id>, wall:<id>, room:<id>. Empty selects all. | |
| invert | BOOLEAN | false | — |
| grow_pixels | INT | 0-64–64 | Positive dilates; negative erodes. |
| feather_pixels | FLOAT | 0.000–64 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| mask | MASK | — |
| metadata | STRING | — |