Nodes/kubakub nodes/kubakub relief field (from depth)
ComfyUI Node

kubakub relief field (from depth)

A depth map is a relief panel waiting to happen — relief field (from depth)

By kubakubkub·Created about a month ago·Updated 2 days ago· 10
kubakub relief field (from depth)
  • depth
  • field
  • preview
  • height
◄panel_width_mm2400►
◄max_relief_mm120►
◄panel_bottom_mm300►
◄invertfalse►
◄gamma1.00►
◄flatten_percentile0.5►

Depth maps have had a second life for years outside ControlNet: a depth map is a height field, so it prints or mills directly as a bas-relief. The catch is that everything in the SD ecosystem hands you a 0–1 greyscale image, and a CNC shop or a foundry wants millimetres. This node is the bridge - it's the head of the kubakub relief chain, and the only place where you type a real-world dimension.

What it actually does

Take your elevation or render, run it through any depth model (Depth Anything V2 is the workhorse, Marigold if you want prettier gradients), and feed that depth map in here. You tell the node how wide the panel really is and how far the deepest point sticks out, and it hands back a height field in millimetres that every other relief node understands. From there the chain is relief field → mould prep → anti perch → check / weigh / export, and you never type a dimension twice, because the field carries its own mm-per-pixel scale.

It's worth being clear about what this is not. It is not image-to-3D. Hunyuan3D and TRELLIS give you a shape in the round with triangle-soup topology; that's the right tool for an object. A facade panel is a flat-backed plate with depth on one side, which is exactly what a height field is. The community's own phrasing of this split is in the KB: reach for depth-to-relief when you want a flat-backed relief - which is also the honest reason image-to-3D feels production-ready for printing and useless for everything else.

Inputs worth setting

depth is the image input. Only the first image of a batch is used, so don't wire in a 20-frame sequence and expect 20 panels.

panel_width_mm (default 2400) is the real width of the finished panel. The map gets stretched to it and the height follows from the aspect ratio. Get this wrong and every downstream number - the mass, the seat heights, the toolpath - is wrong.

max_relief_mm (default 120) is how far the brightest point stands off the back plate. This is your artistic call, but it has consequences: 300 mm of relief 400 mm above the ground is a bench, and the safety check will say so.

panel_bottom_mm (default 300) is where the panel's lower edge sits above the ground. It does nothing visually here; it's the datum the safety check uses to work out what a person can reach.

Then three shaping knobs. invert flips the depth for maps where near is dark - you'll know within one render if you need it. gamma bends the depth curve: below 1 lifts the mid-tones so shallow detail stays visible, above 1 pushes them back. flatten_percentile (default 0.5) clips that percentage off the darkest and brightest pixels before scaling, which is the fix for the single stray white pixel a depth model always puts in a corner and which would otherwise set your entire range.

Outputs

field is the thing you wire onward. preview is a grey picture to eyeball the result. height is the same picture as a MASK, 0 at the back and 1 at max_relief_mm - that's the one to grab if you want the relief outside this chain, as a displacement map in Blender, a depth pass for a re-diffusion, or a mask region.

Installing

ComfyUI Manager, search kubakub nodes, install, restart. Or by hand:

cd ComfyUI/custom_nodes
git clone https://github.com/kubakubkub/ComfyUI_KubaNodes
python -m pip install -r ComfyUI_KubaNodes/requirements.txt

That requirements file adds exactly one thing, opencv-python-headless, and only if you don't have an OpenCV build already. You need ComfyUI 0.37.0 or newer. You do not need Blender for this node - the whole relief group is numpy geometry, and the pack's own docs group Blender with the 3D scene nodes instead. No models are needed either; depth comes from whatever depth node you already run.

Things that bite

The relief nodes live under kubakub/3d/fabricate/relief, and the pack lets you switch whole menu groups off in kubakub.ini (3d = off, or 3d/fabricate = off). If your relief nodes have vanished from the menu, that file is the first place to look - switched-off nodes aren't loaded at all, and saved workflows show them as missing until you turn them back on.

Two others. A depth map from a model is relative, not metric, so you're choosing the depth by eye with max_relief_mm rather than measuring it - and depth models smooth fine architectural detail, so backlit window reveals often come out as gentle ramps. And per the pack's own note, every relief node after this one expects the field from this node; if you feed a raw depth image into mould prep, you'll get nothing useful, because there's no millimetre scale attached.

Categorykubakub/3d/fabricate/relief

Inputs (7)

NameTypeDefaultDescription
depthIMAGEDepth map of the relief (bright = sticks out, unless invert is on). Only the first image of a batch is used.
panel_width_mmFLOAT2400100–20000Real width of the panel in mm. The depth map is stretched to it; the panel height follows from the image aspect.
max_relief_mmFLOAT1201–1000How far the brightest point sticks out from the back, in mm.
panel_bottom_mmFLOAT3000–10000Height of the panel's lower edge above the ground, in mm. The safety check uses it to know what a person can reach.
invertBOOLEANfalseTurn the depth around: on when your depth map has near = dark.
gammaFLOAT1.000.1–4Shapes the depth curve: below 1 lifts the mid tones (more shallow detail), above 1 pushes them back. 1 = linear.
flatten_percentileFLOAT0.50–10Percent of the darkest and brightest pixels clipped before scaling, so single stray pixels from a depth model do not set the range. 0 = no clipping.

Outputs (3)

NameTypeDescription
fieldRELIEFFORGE_FIELDThe relief as heights in mm with its real size, for the other relief nodes.
previewIMAGEGrey preview of the relief (white = sticks out furthest).
heightMASKThe relief as a mask: 0 = the lowest, 1 = the highest point (the same picture as preview), to use as a depth or displacement map. Here 0 = the back and 1 = max_relief_mm.