Nodes/ComfyUI_Fill-Nodes/FL Layered Parallax
ComfyUI Node

FL Layered Parallax

2.5D camera moves without the melted-depth look

By filliptm·Created 3 years ago·Updated a day ago· 638
FL Layered Parallax
  • background
  • layers
  • layer_stack
  • depth_maps
  • parallax
  • locked_composite
  • depth_preview
width640
height360
motionbursts
travel_x0.35
travel_y0.035
push_in0.06
background_depth12.00
overscan1.12
deviceauto
frames0
layer_fitcover
relief_scopeoff
relief_strength0.20
relief_anchor0.50
depth_invertfalse
depth_smoothing2

Depth-map parallax has one failure everybody hits: push the camera and the model reveals scenery that was never in your picture. The depth map only knows the original viewpoint, so the pixels behind your subject simply don't exist. FL Layered Parallax dodges that by not using a depth map at all. You give it a background plate and a stack of cutouts, you tell it how far away each one is, and it flies a virtual camera through real layers. Nothing has to be invented because everything was always there. The blurry background moves less than the foreground - that's the whole illusion.

The trade is obvious and worth saying plainly: you have to supply separated layers. If what you have is one flat photo and a depth map, go use a depth-based node. If you have a matted subject, a mid-ground, and a background - or you're about to generate them - this produces a much cleaner result than melting a depth map.

What you feed it

background is the opaque distant plate, and it's optional only if a layer_stack is supplying one. layers is an autogrow input of FL_PARALLAX_LAYER sockets (layer_, up to 100) - the cutouts. depth_maps is an optional IMAGE batch: one background map, or a full batch from FL Parallax Depth Sources in unchanged stack order, white meaning near. Any of those can come from a stack built by FL Parallax Stack From RGBA Batch or the poster pipeline.

Then the camera. width and height are your output canvas (640×360 default - small, because these are usually upscaled or fed to a video model). motion picks the path: bursts, glide, loop or locked. travel_x and travel_y are the excursion in output widths at depth 1 - actual displacement divides by layer depth, which is why distant things crawl. push_in is forward dolly travel in depth units, and zero disables the dolly entirely. background_depth sets how far away the plate sits; it has to be greater than every cutout depth or the node tells you so.

overscan (default 1.12) is the honest one: extra background coverage, with border extension beyond the source and no generated hidden scenery. So the edges of your background get stretched rather than hallucinated. If you need the canvas filled edge-to-edge with real content, either shoot your background wider or use more overscan and accept soft edges.

Outputs

Three. parallax is the animation - the frames you wanted. locked_composite is the same compositing with the camera held still, which is quietly the most useful thing in this node: a perfectly registered flat composite of all your layers, no parallax, which you can sanity-check before committing to a render. depth_preview is a depth visualisation so you can see whether your ordering is sane.

Install

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

Restart. This is one of the heavier packs in terms of pip dependencies - OpenGL and GLFW for the shader nodes, librosa for audio analysis, ReportLab and PyMuPDF for PDF, plus the API clients - and on Linux the pack's helper script installs libgl1-mesa-glx and freeglut3-dev for the OpenGL half. Layered Parallax itself is torch-only and needs no downloads.

Where people get burned

Frame counts. Animated layers must all have the same length; single stills get held for the whole clip, which is fine. Two videos of different lengths and you get an error telling you to trim or resample. Do the trimming upstream.

Camera deeper than your geometry. Background depth must exceed every layer depth, and the camera push has to stay in front of every layer - including under relief, where the check gets tighter. Overshooting push_in gives you a clear error rather than a broken render, which is a kindness.

Resolution mismatches. layer_fit (cover/contain) decides what happens when a cutout's aspect doesn't match the canvas. contain preserves the whole cutout; cover fills and crops. Background always covers.

Where the quality actually comes from. Not the settings - the cutouts. A soft matte on the foreground layer is what ruins these renders. If your edges look like they were cut with a machete, that's where to spend the effort, not on travel_x.

CategoryFill Nodes/VFX

Inputs (20)

NameTypeDefaultDescription
widthINT64064–4096
heightINT36064–4096
motionCOMBObursts4 options: bursts, glide, loop, locked
travel_xFLOAT0.35-2–2Camera excursion in output widths at depth 1. Actual displacement divides by layer depth.
travel_yFLOAT0.035-2–2
push_inFLOAT0.06-0.2–0.2Forward camera travel in depth units; zero disables dolly scaling.
background_depthFLOAT12.000.25–100
overscanFLOAT1.121–2Extra background coverage. Border extension is used beyond the source; no generated hidden scenery.
deviceCOMBOauto2 options: auto, cpu
backgroundoptIMAGEOpaque distant plate. Optional when a poster layer stack supplies the background.
layersoptCOMFY_AUTOGROW_V3
framesoptINT00–4096Output frames for still-image plates. Zero uses the source video length. Animated plates must match this length.
layer_stackoptFL_PARALLAX_STACKDynamic poster layers, including their background. Stack background takes precedence over the separate image input.
layer_fitoptCOMBOcoverCover fills the output aspect ratio; contain preserves the whole cutout when source and output shapes differ. Background always covers the canvas.
depth_mapsoptIMAGEOne background map, or a depth batch from FL Parallax Depth Sources in unchanged stack order. White means near.
relief_scopeoptCOMBOoff3 options: off, background, background + artwork
relief_strengthoptFLOAT0.200–0.5
relief_anchoroptFLOAT0.500–1
depth_invertoptBOOLEANfalse
depth_smoothingoptINT20–16

Outputs (3)

NameTypeDescription
parallaxIMAGE
locked_compositeIMAGE
depth_previewIMAGE