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.
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)
| Name | Type | Default | Description |
|---|---|---|---|
| folder | STRING | Folder with the ID maps, legends and masks (png/ subfolder too). | |
| regions_pass | STRING | elements | The pass whose names become regions (ids_<pass>.txt). |
| tag_passes | STRING | * | Passes whose names tag the regions they cover by half or more (names or wildcards, e.g. 'zone level bay'); empty = none. |
| overlap | COMBO | id_map | id_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_parts | STRING | * | Names (wildcards) whose separate parts become separate regions (windows_01..). Empty = one region per name. |
| min_region_area | INT | 4000–100000000 | Parts smaller than this (pixels) are merged into a neighbour or dropped. |
| merge_small_regions | BOOLEAN | true | On: merge small parts into the neighbour with the longest shared border. Off: drop them. |
| legend_colors | COMBO | auto | How the ID map's pixels relate to the legend (renderers write linear legends, 8 bit PNGs are sRGB). auto picks the better match. |
| matrixopt | IMAGE | Sets the output size (masks are resized to it) and is the preview background. Without: the size of the mask files. | |
| scopeopt | MASK | Pixels outside this mask are never part of a region. |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| regions | KUBA_REGIONS | Label map + region table for the kubakub region nodes. |
| preview | IMAGE | One colour per group, region borders and ids over the matrix or the reference render. |
| reference | IMAGE | The clay / beauty render of the folder (tone mapped), black if none. |
| regions_json | STRING | The region table as text (names, groups, tags, passes, notes). |
| report | STRING | Regions per group, the passes found, the reference render used, and notes. |