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

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

The depth-injection node with blend-mode control

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

Same core trick as DepthShapeModifier - inject a spherical gradient into a masked region of a depth map, to make something look like it bulges or recedes - but with one more knob: how the injected shape actually combines with the depth values already there. If the plain version's blend felt too flat or too abrupt for your scene, this is the version you reach for instead.

How it works

Everything about the shape injection itself works the same as the standard node: mask picks the region, gradient_steepness controls how sharp the spherical gradient is, depth_min/depth_max clamp the value range, strength sets overall intensity. The addition is composite_method, which changes how that injected gradient combines with the original depth values instead of always doing a simple linear crossfade. You get standard image-compositing blend modes - add, subtract, multiply, divide, screen, overlay - plus two the pack built specifically for depth work: linear (the straightforward crossfade, same behavior as the plain node) and depth_aware (compositing that accounts for the surrounding depth context rather than blending blindly), and protrude, a bespoke mode presumably tuned for pushing the masked region forward rather than blending it in either direction. Which one looks "right" depends heavily on your specific depth map and mask, so this is a genuinely trial-and-error field - start with linear to match the plain node's behavior, then try depth_aware or protrude if the result looks too flat or too abrupt.

The inputs and outputs that matter

  • depth_map (IMAGE, required) - "Input depth map to be modified."
  • mask (MASK, required) - "Mask defining areas to apply the shape modification."
  • gradient_steepness (default 2, range 0.1–10) - steepness of the injected spherical gradient.
  • depth_min / depth_max (default 0 / 1, range 0–1) - clamped depth-value range for the modified area.
  • strength (default 1, range 0–1) - overall modification strength.
  • composite_method - how the shape composites with the original: linear, depth_aware, add, subtract, multiply, divide, screen, overlay, or protrude.

Output: a single IMAGE, the modified depth map.

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 - pure image math on a depth map and mask you already have.

Common issues & troubleshooting

Not sure which composite_method to pick. There's no universally "correct" answer here - it depends on your source depth map. Start with linear (identical behavior to the plain DepthShapeModifier), and only reach for the photoshop-style blend modes or protrude if that default result looks too abrupt or too washed out for your scene.

Result looks worse than the plain node, not better. Some of the blend modes (multiply, screen, divide especially) can produce harsher transitions than a simple linear crossfade depending on the surrounding depth values - if precise control is turning into a mess, it's fine to drop back to DepthShapeModifier for the simpler, more predictable version.

Edges of the masked region still look hard. composite_method changes how values combine, not whether the mask itself is feathered - if you're seeing a visible seam at the mask boundary, that's a mask-softness problem to fix upstream, not something composite_method alone will smooth out.

Depth map is noisy going in. As always with depth work in this pack: a shaky upstream depth estimate makes every composite mode look worse. Fix the source depth quality first before spending time tuning this node's blend setting.

CategoryRyanOnTheInside/DepthModifiers

Inputs (7)

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)
composite_methodCOMBOMethod for compositing the modified depth ('linear', 'depth_aware', 'add', 'subtract', 'multiply', 'divide', 'screen', 'overlay', 'protrude')

Outputs (1)

NameTypeDescription
IMAGEIMAGEβ€”