🎬 S42 CutFlow Layer Composer
The Compositor That Replaces Your Second Program
- bg_image
- bg_mask
- fill_image
- fill_mask
- fx_image
- fx_mask
- fg_image
- fg_mask
- overlay_image
- overlay_mask
- composited
- alpha_mask
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,
screenblend 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.
Inputs (30)
| Name | Type | Default | Description |
|---|---|---|---|
| output_width | INT | 102464–8192 | Canvas width in pixels. |
| output_height | INT | 57664–8192 | Canvas height in pixels. |
| bg_fill_color | STRING | #000000 | Canvas fill color (hex). Visible through transparent areas. |
| output_format | COMBO | rgb | 'rgb' = 3-channel standard. 'rgba' = includes alpha as 4th channel. |
| bg_imageopt | IMAGE | Bottom layer. Stretched to fill canvas. | |
| bg_maskopt | MASK | Background mask. | |
| bg_opacityopt | FLOAT | 1.000–1 | Background opacity. |
| bg_blendopt | COMBO | normal | Background blend mode. |
| fill_imageopt | IMAGE | Fill layer above background. Stretched to fill. Good for gradients or solid colors. | |
| fill_maskopt | MASK | Fill layer mask. | |
| fill_opacityopt | FLOAT | 1.000–1 | Fill layer opacity. |
| fill_blendopt | COMBO | normal | Fill layer blend mode. |
| fx_imageopt | IMAGE | Effects layer. Stretched to fill. Connect particles, visualizers, procedural FX. | |
| fx_maskopt | MASK | FX mask. | |
| fx_opacityopt | FLOAT | 0.800–1 | FX layer opacity. |
| fx_blendopt | COMBO | screen | FX blend mode. 'screen' ideal for glow/light FX. |
| fg_imageopt | IMAGE | Foreground subject layer. Has full placement controls. | |
| fg_maskopt | MASK | Foreground alpha mask. Connect from Background Remover. | |
| fg_opacityopt | FLOAT | 1.000–1 | Foreground opacity. |
| fg_blendopt | COMBO | normal | Foreground blend mode. |
| fg_fit_modeopt | COMBO | fit | How 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_positionopt | COMBO | center | Foreground anchor position. Ignored in 'fill' and 'custom' modes. |
| fg_custom_wopt | INT | 5121–8192 | Custom foreground width (px). Only for 'custom' fit_mode. |
| fg_custom_hopt | INT | 5121–8192 | Custom foreground height (px). |
| fg_custom_xopt | INT | 0-8192–8192 | Custom foreground X position (px from left). |
| fg_custom_yopt | INT | 0-8192–8192 | Custom foreground Y position (px from top). |
| overlay_imageopt | IMAGE | Top overlay layer (above everything). Stretched to fill. Watermarks, borders, grain. | |
| overlay_maskopt | MASK | Overlay mask. | |
| overlay_opacityopt | FLOAT | 0.500–1 | Overlay opacity. |
| overlay_blendopt | COMBO | screen | Overlay blend mode. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| composited | IMAGE | — |
| alpha_mask | MASK | — |