Nodes/ComfyUI_KubaNodes/kubakub regions from id renders
ComfyUI Node

kubakub regions from id renders

Turn ID renders of your 3D model into named regions, so every element of the building can get its own prompt. Reads a folder (from Houdini, kubakub scene render ...) with ids_<pass>.png + ids_<pass>.txt legends ('<name> rgb r g b') and optional full-res mask_<name>.exr/png. One pass gives the regions (elements), the other passes tag them (zone, level, bay). Object masks overlap; the ID map decides what is in front. Split parts are numbered windows_01, windows_02 ... in reading order.

By kubakubkub·Created 15 days ago·Updated 3 days ago· 9
kubakub regions from id renders
  • matrix
  • scope
  • regions
  • preview
  • reference
  • regions_json
  • report
◄folder►
◄regions_passelements►
◄tag_passes*►
◄overlapid_map►
◄split_parts*►
◄min_region_area400►
◄merge_small_regionstrue►
◄legend_colorsauto►
Categorykubakub/3d/from renders

Inputs (10)

NameTypeDefaultDescription
folderSTRINGFolder with the ID maps, legends and masks (png/ subfolder too).
regions_passSTRINGelementsThe pass whose names become regions (ids_<pass>.txt).
tag_passesSTRING*Passes whose names tag the regions they cover by half or more (names or wildcards, e.g. 'zone level bay'); empty = none.
overlapCOMBOid_mapid_map: what the camera sees wins (depth order learned from the ID map; hidden elements vanish). smaller_wins: a smaller mask is always in front (brings hidden details like a recessed clock back).
split_partsSTRING*Names (wildcards) whose separate parts become separate regions (windows_01..). Empty = one region per name.
min_region_areaINT4000–100000000Parts smaller than this (pixels) are merged into a neighbour or dropped.
merge_small_regionsBOOLEANtrueOn: merge small parts into the neighbour with the longest shared border. Off: drop them.
legend_colorsCOMBOautoHow the ID map's pixels relate to the legend (renderers write linear legends, 8 bit PNGs are sRGB). auto picks the better match.
matrixoptIMAGESets the output size (masks are resized to it) and is the preview background. Without: the size of the mask files.
scopeoptMASKPixels outside this mask are never part of a region.

Outputs (5)

NameTypeDescription
regionsKUBA_REGIONSLabel map + region table for the kubakub region nodes.
previewIMAGEOne colour per group, region borders and ids over the matrix or the reference render.
referenceIMAGEThe clay / beauty render of the folder (tone mapped), black if none.
regions_jsonSTRINGThe region table as text (names, groups, tags, passes, notes).
reportSTRINGRegions per group, the passes found, the reference render used, and notes.