Depth Relief Increase - Vathography
Making a Depth Map Look Carved Instead of Flat
- depth
- depth
A correct depth map can still look boring. The geometry is right, and yet the face has no cheekbones, the carving has no bite, and the whole thing reads as a grey gradient someone poured into a mould. That's not a modelling failure - it's a contrast one. Most of a scene's depth is spread over a huge range, sky to foreground, so the small relief you actually care about occupies a sliver of the 0..1 ramp.
Depth Relief Increase - Vathography is local contrast for depth maps. It widens the small stuff - folds, faces, carved detail - while compressing the big jumps between objects, without smearing edges. It's a finishing step, not a depth estimator: you run it on a map you already like.
The mechanism
It's a Local Laplacian filter, the Paris/Aubry family of edge-aware remaps, with alpha 0.5 and beta 0.4 baked in. Differences below the current scale threshold get boosted, differences above it get squeezed toward the threshold rather than blown up, and because the whole thing works on a Laplacian pyramid, hard edges stay hard. Then the result is stretched min-to-max back into 0..1.
The one knob is level, 1 to 6, which sets that threshold: 0.015, 0.03, 0.05, 0.07, 0.09, 0.11 in the units of a 0..1 picture. Higher level means more of your depth range gets classed as "small relief" and pushed. Sample spacing is the threshold divided by 48, which is why a low level is the slow one - smaller threshold, denser sampling, more pyramid reconstructions.
There's a second trick that matters for artwork: the filter normally rescales everything, which lifts your blacks and pulls your whites down, so a print comes out with milky shadows. This node anchors them instead - it finds the input's own black and white pixels, remaps the output linearly so those land where they started, and clips the halo that spills past either end. Blacks in stay blacks out. It logs how many pixels it anchored on and how much halo got clipped, handy when a level is clearly too aggressive.
And it respects colour encoding. An EXR is linear, so it gets pushed through the sRGB curve, filtered, then converted back to linear on the way out. A PNG is already display values, so it's filtered as-is. Pipelines that skip this are why relief filters so often look applied in the wrong space.
Inputs and outputs
- depth - a grey image: either the Blender add-on's export, or a raw depth map from Marigold V2 Tiled Depth. Colour images are refused with a message telling you the channel spread, which saves you from a very confusing result.
- input - which of those you loaded. Three choices:
Blender export, EXR (linear),Blender export, PNG (sRGB), orRaw depth map. Pick the one that matches the file. Feeding a linear EXR while claiming it's a PNG applies the wrong curve, and the relief lands in the wrong depth bands. - level - 1 to 6, default 1. Start at 1 or 2. The author warns that high levels show terraces on smooth slopes, and that's exactly what a threshold that wide does to a slow gradient.
One output, depth, same size and same encoding as the input - linear EXR in, linear EXR out; sRGB PNG in, sRGB PNG out. Unlike the tiled depth node, this one is happy to chew through a batch.
Install
Same pack, so if you already have the depth node you already have this:
cd ComfyUI/custom_nodes
git clone https://github.com/vathography/ComfyUI-Marigold-V2-Tiled-Depth-Vathography
pip install -r ComfyUI-Marigold-V2-Tiled-Depth-Vathography/requirements.txt
Or search Marigold V2 Tiled Depth Vathography in ComfyUI Manager. Restart after. No models to download for this node - it's pure math, and it's the reason the pack's 1.2.0 release exists.
Saving without wrecking the result
This is where the node quietly gets misused. The output has to be saved without a gamma round-trip or an 8-bit squash, or you lose the whole point:
- EXR in →
Save Image (Advanced), formatexr,input_color_spaceset tolinear. - PNG in →
Save Image (Advanced), formatpng,bit_depth16-bit.
An 8-bit PNG will band the smooth slopes, which then looks like the filter's fault.
Common issues
The real trap is the input dropdown, not the math. The other one is memory: the filter's working set is roughly 48 bytes per pixel, about twelve float32 copies of the map, so a 24 MP image wants a little over a gigabyte of VRAM. On a card already holding a model, that's enough to OOM - the error tells you the figure. A completely flat map is rejected outright, because there's no relief to increase; that usually means you fed it a mask or a solid-colour frame rather than depth.
Use it last. Shape the map in Blender first, then load the export here, then save. Running it before you sculpt just means sculpting against boosted contrast.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| depth | IMAGE | The Blender add-on's export (PNG or EXR) or a raw depth map. A colour export works too: the relief follows its colour ramp and the colours stay on the ramp. | |
| input | COMBO | Blender export, EXR (linear) | What is loaded. 'Blender export, EXR (linear)': the add-on's EXR. 'Blender export, PNG (sRGB)': the add-on's PNG (8 or 16-bit). Both are processed as they look in Blender, with blacks and whites kept. 'Raw depth map': a 0..1 depth map straight from Marigold V2 Tiled Depth - Vathography, stretched to 0..1 afterwards. |
| level | INT | 11–6 | Strength, 1 = subtle … 6 = strongest. Each level widens the depth range treated as 'small relief' (1: 0.015, 2: 0.03, 3: 0.05, 4: 0.07, 5: 0.09, 6: 0.11, in the values of a 0..1 picture; the input is expected in 0..1). High levels can show terraces on smooth slopes. Lower levels take longer (more samples). |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| depth | IMAGE | The picture with its relief increased, same size. An EXR input comes out linear: save it with Save Image (Advanced) as exr with input_color_space 'linear'. A PNG input comes out sRGB: save it as png, bit_depth 16-bit. A raw depth map comes out stretched to 0..1. |