Nodes/S42 CutFlow/🎬 S42 CutFlow Layer Composer
ComfyUI Node

🎬 S42 CutFlow Layer Composer

The Compositor That Replaces Your Second Program

By GeekyGhost·Created 6 months ago·Updated 4 months ago· 3
🎬 S42 CutFlow Layer Composer
  • bg_image
  • bg_mask
  • fill_image
  • fill_mask
  • fx_image
  • fx_mask
  • fg_image
  • fg_mask
  • overlay_image
  • overlay_mask
  • composited
  • alpha_mask
output_width1024
output_height576
bg_fill_color#000000
output_formatrgb
bg_opacity1.00
bg_blendnormal
fill_opacity1.00
fill_blendnormal
fx_opacity0.80
fx_blendscreen
fg_opacity1.00
fg_blendnormal
fg_fit_modefit
fg_positioncenter
fg_custom_w512
fg_custom_h512
fg_custom_x0
fg_custom_y0
overlay_opacity0.50
overlay_blendscreen

The single biggest reason people leave ComfyUI mid-project is compositing - stacking a subject on a background, grading it into the light, adding a grain pass on top. That's a second program's job, and it usually is. S42CF_LayerComposer is the S42 CutFlow node that drags the job back into the graph: a five-layer, alpha-aware compositor with 14 blend modes and a foreground layer that has real placement controls. It's the most ambitious node in this pack, and it's where the "edit everything in ComfyUI" thesis actually gets proven.

The layer stack (bottom to top)

  • Background - stretched to fill. Your base video, color, or gradient.
  • Fill - stretched to fill. Color washes, secondary backgrounds.
  • FX - stretched to fill, screen blend by default. Particles, visualizers, procedural effects.
  • Foreground - the one with full placement controls (fit mode, position anchors, custom pixel placement). This is where your background-removed subject goes.
  • Overlay - stretched to fill, above everything. Watermarks, grain, borders, vignettes.

Each layer has its own optional IMAGE input, MASK input, opacity, and blend mode. The 14 blend modes are normal, multiply, screen, overlay, hard_light, soft_light, dodge, burn, darken, lighten, difference, exclusion, add, subtract - the standard kit. screen for additive glow, multiply for shadows, overlay for grain. If you know Photoshop blend modes, you already know these.

Canvas controls: output_width/output_height (1024×576 default), bg_fill_color for what shows through transparent areas, and output_format - rgb for standard output or rgba if you need the alpha channel for a downstream matte.

Outputs are composited (the IMAGE) and alpha_mask (a MASK) - note this node does not have the info string most CutFlow nodes carry. If your graph expects an info wire, it won't be here.

The workflow this was built for

The pack's flagship compositing example: load a subject video, run it through the Background Remover (BiRefNet or chroma key), then feed the subject + its mask into the foreground layer, a background plate into the background layer, a grain clip into the overlay - and out comes a finished composite. The alpha_mask output is the piece that makes it compositor-grade: you can route it onward for further masking work.

For a beginner, resist the urge to wire all five layers on day one. Start with background + foreground + a mask, get that sitting right, then add the FX and overlay layers. The foreground's fg_fit_mode (fill/fit/original/custom) and fg_position anchors (nine spots) are the controls that actually get you a subject placed where you want it; fg_custom_w/h/x/y is the pixel-precise escape hatch when anchors aren't enough.

Install

ComfyUI Manager → search "S42 CutFlow" → Install → restart. Or:

cd ComfyUI/custom_nodes/
git clone https://github.com/GeekyGhost/S42-CutFlow.git
pip install -r S42-CutFlow/requirements.txt

Restart fully; console prints [S42 CutFlow] Loaded 53 total nodes. The compositor itself is CPU-only. The only mandatory pack dependency is OpenCV (opencv-python-headless in requirements.txt; README troubleshooting says opencv-python for the "No module named 'cv2'" error). If you want the AI background removal this pairs with, that's the expanded Background Remover node and it does pull in transformers/HuggingFace models on first use (~400MB) - optional, and not needed for the composer itself.

One honest caveat: this is an expanded node in a pack Geeky Ghost explicitly calls a work-in-progress being groomed for LTX Desktop. It's genuinely capable, but it's the kind of node where a version bump can move a parameter. Save your working workflow JSON, and check the changelog when you update.

CategoryS42 CutFlow/Expanded

Inputs (30)

NameTypeDefaultDescription
output_widthINT102464–8192Canvas width in pixels.
output_heightINT57664–8192Canvas height in pixels.
bg_fill_colorSTRING#000000Canvas fill color (hex). Visible through transparent areas.
output_formatCOMBOrgb'rgb' = 3-channel standard. 'rgba' = includes alpha as 4th channel.
bg_imageoptIMAGEBottom layer. Stretched to fill canvas.
bg_maskoptMASKBackground mask.
bg_opacityoptFLOAT1.000–1Background opacity.
bg_blendoptCOMBOnormalBackground blend mode.
fill_imageoptIMAGEFill layer above background. Stretched to fill. Good for gradients or solid colors.
fill_maskoptMASKFill layer mask.
fill_opacityoptFLOAT1.000–1Fill layer opacity.
fill_blendoptCOMBOnormalFill layer blend mode.
fx_imageoptIMAGEEffects layer. Stretched to fill. Connect particles, visualizers, procedural FX.
fx_maskoptMASKFX mask.
fx_opacityoptFLOAT0.800–1FX layer opacity.
fx_blendoptCOMBOscreenFX blend mode. 'screen' ideal for glow/light FX.
fg_imageoptIMAGEForeground subject layer. Has full placement controls.
fg_maskoptMASKForeground alpha mask. Connect from Background Remover.
fg_opacityoptFLOAT1.000–1Foreground opacity.
fg_blendoptCOMBOnormalForeground blend mode.
fg_fit_modeoptCOMBOfitHow foreground is scaled: fill = stretch to canvas. fit = scale to fit (letterboxed). fit_width/fit_height = match one dimension. original = source pixel size. custom = manual w/h/x/y.
fg_positionoptCOMBOcenterForeground anchor position. Ignored in 'fill' and 'custom' modes.
fg_custom_woptINT5121–8192Custom foreground width (px). Only for 'custom' fit_mode.
fg_custom_hoptINT5121–8192Custom foreground height (px).
fg_custom_xoptINT0-8192–8192Custom foreground X position (px from left).
fg_custom_yoptINT0-8192–8192Custom foreground Y position (px from top).
overlay_imageoptIMAGETop overlay layer (above everything). Stretched to fill. Watermarks, borders, grain.
overlay_maskoptMASKOverlay mask.
overlay_opacityoptFLOAT0.500–1Overlay opacity.
overlay_blendoptCOMBOscreenOverlay blend mode.

Outputs (2)

NameTypeDescription
compositedIMAGE
alpha_maskMASK