Nodes/RyanOnTheInside/Depth Shape Modifier βš‘πŸ…‘πŸ…žπŸ…£πŸ…˜
ComfyUI Node

Depth Shape Modifier βš‘πŸ…‘πŸ…žπŸ…£πŸ…˜

Sculpt a bulge or dip into a depth map, masked

By ryanontheinsideΒ·Created 2 years agoΒ·Updated 5 months agoΒ· 852
Depth Shape Modifier βš‘πŸ…‘πŸ…žπŸ…£πŸ…˜
  • depth_map
  • mask
  • IMAGE
β—„gradient_steepness2.0β–Ί
β—„depth_min0.00β–Ί
β—„depth_max1.00β–Ί
β—„strength1.00β–Ί

This is the node behind the pack author's own "Depth Chamber" workflow, and it's a genuinely fun trick: instead of only using a depth map for ControlNet conditioning, you reach in and sculpt it. Pick a masked region and this node injects a spherical gradient into it - pushing that area to read as bulging forward or receding backward in Z-space - before you feed the modified depth map into your ControlNet pipeline. The author's own description for it, from a Reddit demo of this exact node, was "depth injection" - you're literally injecting fake geometry into a real depth estimate.

How it works

Feed it a depth_map and a mask marking the region to sculpt. Inside that masked area, the node blends in a spherical gradient shape whose steepness is set by gradient_steepness - low values give a gentle, wide dome; high values give a sharp, tight bulge. depth_min/depth_max clamp the range of depth values the modification can push the masked area into, and strength is the overall blend intensity between the original depth map and the injected shape. The practical effect: an object that was flat in your depth estimate can be made to look like it protrudes or recedes, and since the output is still a standard depth map, it flows straight into whatever ControlNet or 3D-effect chain was already consuming depth maps in your workflow.

The inputs and outputs that matter

  • depth_map (IMAGE, required) - "Input depth map to be modified," per the tooltip.
  • mask (MASK, required) - "Mask defining areas to apply the shape modification."
  • gradient_steepness (default 2, range 0.1–10) - controls the steepness of the injected spherical gradient.
  • depth_min / depth_max (default 0 / 1, range 0–1) - the depth-value range the modified area is clamped to.
  • strength (default 1, range 0–1) - overall strength of the modification, i.e. how much of the original depth shows through versus the injected shape.

Output: a single IMAGE - the modified depth map, same format as the input.

For finer control over exactly how the injected shape blends with the original - linear crossfade vs. Photoshop-style blend modes - the pack also ships DepthShapeModifierPrecise, which adds a composite_method choice on top of this same core idea.

How to install it

Via ComfyUI Manager: search "RyanOnTheInside," install, restart. By hand:

cd ComfyUI/custom_nodes
git clone https://github.com/ryanontheinside/ComfyUI_RyanOnTheInside.git
cd ComfyUI_RyanOnTheInside
pip install -r requirements.txt

then restart. No model download for this node - it's geometry math on a depth map and mask you already have, running on the pack's opencv-python/scikit-image dependencies.

Common issues & troubleshooting

The modification barely shows up. Check strength first - at low values the original depth map dominates and the injected shape is nearly invisible. Also confirm your mask is actually covering where you expect; a wrong or empty mask means nothing gets modified regardless of the other settings.

The bulge looks like a hard, obviously-fake blob instead of blending in. Try lowering gradient_steepness for a softer, wider gradient, and check depth_min/depth_max aren't clamped to a range that clashes badly with the surrounding depth values - a sharp jump at the mask boundary is usually a range or steepness mismatch, not a bug.

Result looks fine in isolation but breaks your ControlNet output. Remember this node changes the depth map, not the source image - if your downstream ControlNet strength is high, an aggressive depth injection will visibly reshape the generation to match the new (fake) geometry. That's expected; dial back strength here or your ControlNet weight if it's overpowering the rest of the prompt.

Depth quality upstream is already noisy. As with any node in this pack that touches depth, garbage in, garbage out - a shaky or low-res depth estimate will make the injected shape look inconsistent frame to frame in a video sequence, independent of anything you set here.

CategoryRyanOnTheInside/DepthModifiers

Inputs (6)

NameTypeDefaultDescription
depth_mapIMAGEInput depth map to be modified
maskMASKMask defining areas to apply the shape modification
gradient_steepnessFLOAT2.00.1–10Controls the steepness of the spherical gradient (0.1 to 10.0)
depth_minFLOAT0.000–1Minimum depth value for modified areas (0.0 to 1.0)
depth_maxFLOAT1.000–1Maximum depth value for modified areas (0.0 to 1.0)
strengthFLOAT1.000–1Overall strength of the modification (0.0 to 1.0)

Outputs (1)

NameTypeDescription
IMAGEIMAGEβ€”