Nodes/ComfyUI_Fill-Nodes/FL Parallax Layer
ComfyUI Node

FL Parallax Layer

One cutout, one depth, done

By filliptm·Created 3 years ago·Updated a day ago· 638
FL Parallax Layer
  • images
  • mask
  • layer
  • matte_check
depth4.00
scale1.00
offset_x0.00
offset_y0.00
opacity1.00

This is the small, unglamorous node that makes the parallax pipeline work. FL Parallax Layer takes one image - an RGBA cutout from a matting node, or RGB with an explicit mask - and turns it into a layer object with a depth, a scale, an offset and an opacity. That object is what FL Layered Parallax consumes.

There's no render here, no camera, nothing moves. It's a data-shaping node: your image plus your intent, in a form the renderer understands. You'll typically use several, one per element, wired into the autogrow layers input of the parallax node.

The inputs

images is the cutout. RGBA from a matting node is the expected case; RGB works too as long as you give it a mask. mask is the escape hatch: white = opaque foreground, and it overrides any embedded alpha. That's useful when you've generated a hard-edged alpha you don't trust and want to supply your own soft matte instead.

depth is the important one, and it works backwards from intuition if you're used to depth maps: smaller values mean closer, so they move faster and draw in front. Default is 4. Distance 1 is right in the camera's face, 100 is the far wall. Sorting is automatic in the renderer, so you don't have to keep your sockets in order - just label the depths honestly.

scale (0.1–4), offset_x and offset_y are placement. The offsets are fractions of the output canvas, positive right and down, so they scale with your output resolution instead of being locked to pixels. opacity fades the layer.

Outputs

layer is the FL_PARALLAX_LAYER object - only Fill-Nodes parallax inputs will accept it. matte_check is a preview image of the layer as the renderer sees it: your alpha or your mask, applied. Wire it to a preview node once and you'll never again wonder why a cutout is contributing nothing. It is almost always because the mask is inverted, or because a generator handed you a white-on-black map where the convention is the other way round.

Install

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

Restart. Part of the pack, so you inherit its long dependency list (OpenGL, audio, PDF, API clients) whether or not you touch those parts of the pack. This node is pure torch and needs no model downloads. As with everything in Fill-Nodes, use a current ComfyUI - the node is built on the newer API and won't exist at all if the pack fails to import.

How to use it well

The practical advice is about where the alpha comes from. Background removal is the most commoditised operation in this space and still not solved - hair, fur, glass and anything semi-transparent are where mattes fall apart, and a bad matte is what makes a parallax render look like a paper cutout sliding over a wallpaper. Match the tool to the failure you can tolerate: segmentation foundation models for clean subjects, matting-aware networks when there's hair, and a hand-drawn soft mask when the automated result is close but the edge is wrong.

Second: keep your depth ordering physically plausible. Depth 2, 4, 8, 12 across four layers reads as a scene. Two layers at depth 3.2 and 3.4 read as a flat image with a jitter. Real scenes thin out fast with distance, so have your near layers far apart in depth and your far layers close together.

And use matte_check. It's five seconds of preview versus a two-minute render you have to redo.

CategoryFill Nodes/VFX

Inputs (7)

NameTypeDefaultDescription
imagesIMAGERGBA from a matting node, or RGB with an explicit foreground mask.
depthFLOAT4.000.25–100Camera distance. Smaller values move faster and draw in front.
scaleFLOAT1.000.1–4
offset_xFLOAT0.00-2–2Fraction of output width. Positive moves right.
offset_yFLOAT0.00-2–2Fraction of output height. Positive moves down.
opacityFLOAT1.000–1
maskoptMASKWhite = opaque foreground. Overrides embedded alpha.

Outputs (2)

NameTypeDescription
layerFL_PARALLAX_LAYER
matte_checkIMAGE