Nodes/RyanOnTheInside/Flex Image Depth Warp βš‘πŸ…‘πŸ…žπŸ…£πŸ…˜
ComfyUI Node

Flex Image Depth Warp βš‘πŸ…‘πŸ…žπŸ…£πŸ…˜

Push pixels along a depth map, driven by whatever signal you want

By ryanontheinsideΒ·Created 2 years agoΒ·Updated 5 months agoΒ· 852
Flex Image Depth Warp βš‘πŸ…‘πŸ…žπŸ…£πŸ…˜
  • images
  • depth_map
  • opt_feature
  • IMAGE
β—„strength1.00β–Ί
β—„feature_threshold0.00β–Ί
β—„feature_paramβ–Ύβ–Ί
β—„feature_moderelativeβ–Ί
β—„warp_strength0.10β–Ί

This node takes a depth map and uses it to distort the image it's paired with - pushing pixels around based on how near or far the depth map says they are. On its own that's a still, one-shot warp. Wire it up to a Feature signal (audio, time, motion, whatever) and the warp strength pulses with that signal frame by frame, which is the whole point of the "Flex" family in this pack: every FlexImage* node can either run as a plain effect or be driven live by an external signal.

The Flex Feature system, briefly

Any Flex node has two halves: the effect itself, and an optional modulation layer. You plug a Feature output (from something like AudioFeatureExtractor or TimeFeatureNode) into opt_feature, tell the node which of its own parameters to modulate via feature_param, and it varies that parameter frame-by-frame according to the feature's value. Leave opt_feature unplugged and the node just runs at its static slider values - the modulation system is opt-in, not required.

Inputs and outputs that matter

  • images and depth_map - your frame sequence and its depth map (from any depth estimator node; this pack doesn't generate depth maps itself).
  • warp_strength (-10 to 10, default 0.1) - how hard pixels get pushed. The range looks huge but useful values are usually small; this is much more sensitive than it looks.
  • strength (0-1) - overall effect strength, a global multiplier.
  • feature_param - only one real choice here besides None: warp_strength. That's the single parameter this node lets a Feature drive.
  • feature_mode (relative/absolute) and feature_threshold - how the feature value maps onto the warp: relative offsets around your slider value, absolute scales from zero up to it; threshold gates the effect off below a certain feature value.
  • opt_feature (optional, FEATURE type) - the modulation input, described above.

Output is a single IMAGE.

Where this fits, and what it isn't

The KB's depth-estimation notes are worth knowing here: depth-based parallax/warp has a structural limit - a depth map only describes the original camera view, so pushing pixels around reveals areas with no real pixel data behind them. Community consensus on the dedicated tool for this (DepthFlow) puts it bluntly: "the motion needs to be subtle because it has its limitations and if you push it too far the image starts tearing." That applies here too - this node isn't doing anything magic that avoids the problem, it's the same technique, just wired into this pack's Feature system instead of DepthFlow's own animation curves.

Installing it

ComfyUI Manager: search RyanOnTheInside, install, restart. Manual:

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

Restart. You'll need a depth map source separately - a depth preprocessor pack, not this one.

Where people get burned

Cranking warp_strength toward its Β±10 extremes turns the image to mush fast; start around 0.05-0.5 and work up. If depth_map doesn't match images in resolution or content, expect misaligned warping - generate the depth map from the same frames you're feeding in here. And if you're chasing a subtle "living, breathing" look rather than an obvious distortion, keep the modulated range narrow (small feature_threshold, modest warp_strength) - this effect gets ugly fast once it's visible as a warp rather than felt as motion.

CategoryRyanOnTheInside/FlexFeatures/Targets/Images

Inputs (8)

NameTypeDefaultDescription
strengthFLOAT1.000–1Overall strength of the effect (0.0 to 1.0) Higher values create more dramatic changes, while lower values are more subtle.
feature_thresholdFLOAT0.000–1Minimum feature value to trigger the effect (0.0 to 1.0) Only applies the effect when the feature value exceeds this threshold. Lower values make the effect more sensitive, higher values make it more selective.
feature_paramCOMBOChoose which parameter to modulate: - warp_strength: Dynamically adjust depth-based distortion - None: No parameter modulation
feature_modeCOMBOrelativeHow to apply the feature modulation: - relative: Changes are centered around the original value - absolute: Changes scale directly from zero to the maximum
imagesIMAGEInput image sequence to be processed (IMAGE type)
warp_strengthFLOAT0.10-10–10Strength of the warping effect (-10.0 to 10.0)
depth_mapIMAGEDepth map for warping the image
opt_featureoptFEATUREOptional feature input for modulation Connect any feature node here to control the effect. Features can come from audio, motion, color, or other sources.

Outputs (1)

NameTypeDescription
IMAGEIMAGEβ€”