Nodes/ComfyUI_Fill-Nodes/FL Parallax Depth Sources
ComfyUI Node

FL Parallax Depth Sources

Give the parallax node something to bump into

By filliptm·Created 3 years ago·Updated a day ago· 638
FL Parallax Depth Sources
  • layer_stack
  • depth_analysis_images
resolution518

FL Layered Parallax moves flat cutouts around. That's most of the 2.5D effect, and for a lot of footage it's enough. What it can't do is make a surface look three-dimensional - the background plate stays a flat card, so a dolly move reads as the whole scene sliding rather than the camera moving through it. Depth relief fixes that: it bends the background (and optionally the artwork) along a depth map so the surface itself has height.

FL Parallax Depth Sources is the setup node for that. It doesn't estimate depth - read that again, because it's the usual assumption. It takes your stack and prepares the images you'll send to a depth estimator, correctly arranged and pre-composited.

What it actually does

Feed it a layer_stack and a working resolution, and it flattens each layer's alpha over a mid-grey background, resizes everything to a common size, and returns the whole thing as one IMAGE batch: background first, then each cutout in stack order - unchanged order, which matters downstream.

The grey-flattening is the quiet part. A transparent cutout's RGB is meaningless where alpha is zero, and depth estimators will happily invent a landscape out of that garbage. Compositing over 0.5 grey gives the estimator something neutral to read outside the subject. Then you run that batch through whatever depth model you like - Depth Anything V2 Large is still the working default for this kind of job, and the same "white means near" convention you'll see in every depth workflow holds here.

resolution (default 518, min 126, max 1024, stepped in 14s) is the longest side of the prepared images. 518 is the native-ish size for the common depth models and the right default. The 14-pixel stepping is because the node snaps to a stride-compatible size internally - pick from the presets and don't fight it.

Wiring

Output is a single depth_analysis_images batch. Send it through your depth estimation nodes, and bring the resulting depth batch back into FL Layered Parallax's depth_maps input. The node's tooltip is explicit about the contract: one background map, or a depth batch from FL Parallax Depth Sources in unchanged stack order. White means near. Don't shuffle the batch, don't drop the background map, don't invert unless you know your estimator's convention is the other way round - and if it is, the parallax node has a depth_invert toggle, so you don't have to do it in the image.

Then turn on relief in the parallax node: relief_scope (off, background, or background + artwork), relief_strength (0–0.5), relief_anchor, plus depth_invert and depth_smoothing (0–16, a blur on the depth map that stops every stray pixel becoming a spike).

Install

cd ComfyUI/custom_nodes
git clone https://github.com/filliptm/ComfyUI_Fill-Nodes

Restart ComfyUI. This node is pure torch - the depth model is yours to choose and install separately. Fill-Nodes' dependency list is long, but nothing here needs it.

Where people get burned

Stills only, for now. The node raises a clear error if a layer carries more than one frame: "Parallax depth analysis currently supports still-image layers only." So does the parallax node's relief path, and it raises its own version of the same complaint. Depth-driven relief is a still-image feature in this pack. Animate with the plain layered path.

Artwork relief needs the whole batch. If you pick background + artwork relief with a single depth map, you get an error telling you to use the complete depth batch from this node. That's the point - one map per plate, background first.

The relief budget is tight. relief_strength is capped at 0.5 and the camera push has to stay in front of every relieved surface. Push too hard and you get told to reduce the push or the relief, which is much better than a render full of smeared geometry.

Depth is not a magic 3D upgrade. Relief bends surfaces; it doesn't make things round. If you want a real sense of volume, the honest answer is more layers at real depths, with relief as the finishing touch on the background.

CategoryFill Nodes/VFX

Inputs (2)

NameTypeDefaultDescription
layer_stackFL_PARALLAX_STACK
resolutionINT518126–1024

Outputs (1)

NameTypeDescription
depth_analysis_imagesIMAGE