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

Depth Feature βš‘πŸ…‘πŸ…žπŸ…£πŸ…˜

Turn a depth map into a signal you can drive an effect with

By ryanontheinsideΒ·Created 2 years agoΒ·Updated 5 months agoΒ· 852
Depth Feature βš‘πŸ…‘πŸ…žπŸ…£πŸ…˜
  • depth_maps
  • FEATURE
β—„extraction_methodβ–Ύβ–Ί
β—„frame_rate30.0β–Ί
β—„width512β–Ί
β—„height512β–Ί

Third of the pack's core "Feature" trio alongside brightness and color, and the one most tied to the pack's particular strength - spatial, 3D-aware effects. It reads a depth map (the grayscale, near-is-white/far-is-black kind you'd normally feed a ControlNet) and turns whatever aspect of its geometry you pick into a FEATURE signal, ready to drive another node's parameter.

How it works

Feed it depth maps and pick an extraction_method; the tooltip spells out all seven clearly. mean_depth is overall scene depth (higher when things are further away), depth_variance is how much depth varies across the frame (high for complex 3D scenes, low for flat ones), depth_range is the distance between the closest and farthest points, gradient_magnitude measures how sharply depth changes - spiking on edges and steep surfaces - and foreground_ratio/midground_ratio/background_ratio each give the percentage of the scene sitting in that depth layer. A scene with a subject close to camera and a blurred-out background reads high on foreground_ratio; a flat, distant landscape shot reads low on depth_variance.

The depth maps themselves come from whatever depth estimator you're already using upstream - MiDaS, Depth Anything, whichever preprocessor is already in your ControlNet chain works here too, since this node just consumes standard depth-map images.

The inputs and outputs that matter

  • depth_maps (IMAGE, required) - "Input depth maps to analyze," per the tooltip.
  • extraction_method - mean_depth, depth_variance, depth_range, gradient_magnitude, foreground_ratio, midground_ratio, or background_ratio.
  • frame_rate (default 30, range 1–120) - frame rate of the input video.
  • width / height (default 512, range 64–4096) - resolution the feature is computed at.

Output: a single FEATURE, the per-frame depth-derived curve - wire it into DepthShapeModifier's strength, an emitter modulator, or anywhere else in the pack that accepts a FEATURE.

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. This node itself doesn't download a model - it just analyzes whatever depth maps you hand it - but you'll need a depth estimator earlier in the graph to produce those in the first place.

Common issues & troubleshooting

The extracted feature looks noisy or unstable. Depth map quality feeds through directly here - a flickery or low-resolution depth estimate produces a flickery, noisy feature curve no matter which extraction_method you pick. Fix the depth estimation upstream first (a steadier model, or a video-native one) before assuming this node is misbehaving.

Wrong choice of extraction method for the effect you want. mean_depth and depth_range describe the scene's overall geometry, while gradient_magnitude reacts to edges and sudden depth changes - if you want something that spikes on cuts or complex framing rather than smooth camera moves, gradient is the one to reach for, not the mean.

Signal timing looks off relative to your footage. Confirm frame_rate matches your actual video's frame rate - same failure mode as the pack's other Feature-source nodes.

CategoryRyanOnTheInside/FlexFeatures/Sources

Inputs (5)

NameTypeDefaultDescription
extraction_methodCOMBOChoose how to analyze the depth information: - mean_depth: Overall depth of the scene - higher when objects are further away - depth_variance: How much depth varies in the scene - higher for complex 3D scenes - depth_range: Distance between closest and farthest points - gradient_magnitude: How sharply depth changes - high for edges and steep surfaces - foreground_ratio: Percentage of scene in the front layer - midground_ratio: Percentage of scene in the middle layer - background_ratio: Percentage of scene in the back layer
frame_rateFLOAT30.01–120Frame rate of the video (1.0 to 120.0 fps)
widthINT51264–4096Width of the output feature (64 to 4096)
heightINT51264–4096Height of the output feature (64 to 4096)
depth_mapsIMAGEInput depth maps to analyze

Outputs (1)

NameTypeDescription
FEATUREFEATUREβ€”