Nodes/ComfyUI-BFSNodes/BFS Setting Picture (place, person in static)
ComfyUI Node

BFS Setting Picture (place, person in static)

Your clip's room with the person scrubbed off it

By alisson-anjos·Created 8 months ago·Updated 4 days ago· 134
BFS Setting Picture (place, person in static)
  • images
  • setting
◄position0.50►
◄subjectperson►

If you've done a character swap in a duet render and the new face showed up in front of your reference photo's backdrop instead of the room you filmed in, this is the countermeasure. It takes one frame of your source clip, cuts the performer out with SAM 3, and paints the hole with black-and-white TV static. What's left is the place - full detail, right light, right framing - with no usable person in it.

Why it exists

The duet trick is training-free split-screen: you pin the source clip beside the video in the same canvas behind a noise mask, H3 reads those pinned latents like its own condition rows and generates the video next to them in sync - new identity from <Picture n> references, motion and camera from the clip. The panel is cropped off before decoding.

The leak is that the model also reads the place out of your character reference. Swap the person in the same room in the same clothes and you get the reference photo's kitchen behind the new face. The pack's own test notes say it plainly: with a pinned panel plus a body-swap LoRA guide, the panel pulled the background toward the reference's backdrop. This node is the other half of the fix - give the model an honest picture of the actual set, and separately tell it where the body is.

Precondition: H3's local weights are licence-locked out of the US, EU, UK and South Korea, outputs included.

How it works, mechanically

You feed it a clip (or a single frame) and it takes exactly one frame from it. position is a fraction of the clip, not a frame number - internally it's round((frames - 1) * position) clamped to 0–1, so 0.5 on a 10-frame clip gives you frame 4. That frame is downscaled to a 640px max side and sent through ComfyUI's core SAM 3 nodes with your subject text as the prompt, matching up to 8 objects.

The mask comes back up to full resolution, grows 3% of the short side, then gets filled with a 2×2-pixel-block black-and-white noise pattern. The seed is fixed, so the same input always gives the same grain. One frame out.

That static is doing prompt work, not just hiding a face: the picture becomes the last <Picture n> reference and the H3 node appends a line saying <Picture n> shows the setting in full detail and the noise patch is where the subject stands.

The inputs that matter

  • images - your source clip, batch or a single still. Only one frame of it is ever used.
  • position - default 0.5 (the middle). Pick a frame where the room is well lit and the person is clearly visible, because both jobs depend on it.
  • subject - default "person", and it's a text prompt for SAM 3, so man, woman, dog, the person in the red jacket all work. With two similar people in frame, plain person covers up to 8 objects, which is probably what you want here.

One output: setting (IMAGE, one frame). On the all-in-one duet nodes it goes into the setting input. It's a place reference - don't wire it into a normal reference slot and expect identity work out of it.

If you write your own prompt, {setting} expands to that <Picture n> tag wherever you put it; otherwise the sentence is appended to subject_definitions. The shot-loop variant builds its setting picture from its own setting_ref options and a mask, so you don't hand it an image there.

Installing it

It ships in ComfyUI-BFSNodes, so Manager → search ComfyUI-BFSNodes, or:

cd ComfyUI/custom_nodes
git clone https://github.com/alisson-anjos/ComfyUI-BFSNodes.git
cd ComfyUI-BFSNodes
pip install -r requirements.txt   # torch, numpy, Pillow, safetensors, librosa, opencv-python, scenedetect

Restart ComfyUI. Two things before your first run: the node uses ComfyUI's core SAM 3 nodes (comfy_extras.nodes_sam3), so it wants a reasonably current ComfyUI, and on first execution it downloads the official sam3.1_multiplex_fp16.safetensors (1.7 GB, from Comfy-Org/sam3.1) into models/checkpoints by itself. It prints progress.

InsightFace - the optional dependency the README warns about - isn't needed here. One aside: SAM 3 isn't Apache-licensed like SAM 2 was, and Meta's SAM License is revocable. Only matters if you're shipping a product around it.

Where people get burned

The static covers nothing. SAM 3 matches on text, so if the word doesn't land on anything in the frame you picked, you get no mask - no static, no scrubbing. Your "setting picture" is then just the raw frame with the performer still in it, and the model will copy that face. Blur, a tiny subject in a wide shot, someone half out of frame: all of it makes the match worse, so slide position to a close, clear frame and keep a Preview Image node on the output for the first few runs.

Layer it in too early. Get the swap working, then add this. It corrects one specific failure, and combining it with a panel and a guide is the stack the author's own tests flagged as pulling toward the reference.

CategoryBFS/MiniMax H3

Inputs (3)

NameTypeDefaultDescription
imagesIMAGEThe source clip (or one frame).
positionFLOAT0.500–1Which frame: 0 = first, 0.5 = middle, 1 = last.
subjectSTRINGpersonWhat SAM 3 covers with static (e.g. person, man, dog).

Outputs (1)

NameTypeDescription
settingIMAGE—