Nodes/S42 CutFlow/🖼 S42 CutFlow Picture-in-Picture
ComfyUI Node

🖼 S42 CutFlow Picture-in-Picture

The facecam bubble, done in three inputs and a color picker

By GeekyGhost·Created 6 months ago·Updated 4 months ago· 3
🖼 S42 CutFlow Picture-in-Picture
  • background
  • overlay
  • clip
  • frame_count
  • info
position_x0.75
position_y0.25
scale0.30
border_width2
border_color#FFFFFF
corner_radius0
shadow0
opacity1.00

Picture-in-picture is the reaction-video and tutorial staple: one clip overlaying another, usually a facecam bubble in the corner of a screen recording. S42CF_PictureInPicture does exactly that on standard IMAGE batches, with the polish that makes a PiP look intentional rather than slapped on - rounded corners, a border, a drop shadow, opacity control. Because it operates on ComfyUI's ordinary IMAGE type, you can PiP an AI-generated clip onto real footage or the other way around, and it plays fine with any loader/saver.

The inputs that matter

Two clip inputs - background (the main footage) and overlay (the clip that goes on top) - and then it's all placement:

  • position_x / position_y (floats, 0–1, defaults 0.75 / 0.25) - normalized center of the PiP. 0.75/0.25 is top-right, which is the facecam default; 0.5/0.5 dead center; 0.25/0.75 bottom-left. Normalized coordinates mean the same values work at any resolution, which is the right call for a tool fed by mixed sources.
  • scale (float, default 0.3) - overlay size relative to the background. 0.3 = 30% of the background's size, a reasonable facecam size; below that it gets lost, above 0.5 it starts dominating.
  • border_width (int, default 2) and border_color (hex, default #FFFFFF) - the frame around the PiP. The README's "facecam bubble" look lives here: a white border reads cleanly over most footage.
  • corner_radius (int, default 0) - rounded corners, 0 = sharp. This is the single most "polished" knob - bump it to 8–12 for the modern rounded-bubble look.
  • shadow (int, default 0) - drop shadow size; 0 disables. A small shadow (3–5) separates the bubble from busy backgrounds.
  • opacity (float, default 1) - overall opacity of the overlay.

How it works

No surprises under the hood - it composites the overlay onto the background at the normalized position and scale, with the border/corner/shadow applied as part of the overlay rendering. Everything is per-frame tensor compositing, so it's fast and deterministic, and it keeps the batch length of the background. Outputs are clip (the composited IMAGE batch), frame_count, and info.

One practical note: because both inputs are IMAGE batches, they can have different resolutions and frame counts. The compositor matches the overlay to work over the background, so it's worth keeping both clips at the same fps/length upstream - feed the overlay a frame_count-matched clip if you're building from generated footage.

Installing it

Standard S42 CutFlow install:

cd ComfyUI/custom_nodes/
git clone https://github.com/GeekyGhost/S42-CutFlow.git
pip install -r S42-CutFlow/requirements.txt   # Windows portable: python_embeded\python.exe -m pip

Or ComfyUI Manager → search S42 CutFlow → install. Restart, and it's under S42 CutFlow/Composition.

Gotchas

The honest one: the hex color picker is currently broken in this pack - the README says so plainly ("This is currently broken"). You'll get plain text inputs for hex colors instead of a visual swatch, so type #FFFFFF by hand and don't waste time hunting for the picker. Beyond that, the usual PiP traps: overlays that are much higher resolution than the background get scaled down hard (fine, but verify it looks right), and if your overlay clip is longer than the background, decide which length you want to keep and trim accordingly. For tutorial/reaction work, the recipe that works every time: scale 0.3, corner_radius 10, shadow 4, border 2 white, position_x 0.75 / position_y 0.25 - and a Quick Preview node in front while you dial it in.

CategoryS42 CutFlow/Composition

Inputs (10)

NameTypeDefaultDescription
backgroundIMAGEMain background clip.
overlayIMAGEClip to overlay as picture-in-picture.
position_xFLOAT0.750–1Horizontal center of PiP. 0=left, 0.5=center, 1=right.
position_yFLOAT0.250–1Vertical center of PiP. 0=top, 0.5=center, 1=bottom.
scaleFLOAT0.300.05–1Scale of overlay relative to background. 0.3 = 30% of background size.
border_widthINT20–20Border width around PiP window in pixels.
border_colorSTRING#FFFFFFBorder color (hex). Click the swatch to open color picker.
corner_radiusINT00–50Rounded corner radius for PiP window. 0 = sharp corners.
shadowINT00–20Drop shadow size. 0 = no shadow.
opacityFLOAT1.000–1PiP overlay opacity.

Outputs (3)

NameTypeDescription
clipIMAGE
frame_countINT
infoSTRING