Nodes/ComfyUI-BFSNodes/BFS Shot Repack
ComfyUI Node

BFS Shot Repack

Change one piece of a shot without losing the plan

By alisson-anjos·Created 7 months ago·Updated about 10 hours ago· 129
BFS Shot Repack
  • shot
  • guide_frames
  • refs
  • shot
◄prompt—►

The return path of the Unpack → edit → Repack sandwich

A shot is more than its pieces: it carries timing, cut positions, length, index, mask config, audio and continuity settings - and if you want to feed an edited reference into the render, you must hand the shot back to the loop with everything else intact. That's this node.

Type it out and it's obvious: BFS Shot Unpack opens a shot, you process one of its parts, this node puts the part back and passes the shot on unchanged. BFS Shot H3 Conditioning and BFS Shot H3 Duet both take a shot, so repacking is how you inject anything that the planner couldn't have known about at plan time.

The most useful thing it does

The ref_image input, honestly. The scenario everyone hits: the reference picture has a background, and the duet pulls the generated room toward that background. So you wire the shot's reference out of Unpack, run it through background removal, and feed the cleaned version into ref_image here. The shot keeps its timing and cuts, and shot i still lines up with guide i when the list is paired by index.

Same trick for prompt: a text node or an LLM pass writes the per-shot prompt after the plan was made, and this puts it in. And guide_frames for anything you want to do to the frames themselves - a retime, a deflicker, a mask-prep pass. Replacement guide frames are resized to the shot's generation size and padded or trimmed to its length, so you don't have to hit the exact geometry.

The same logic applies to ref_image_2, the second reference slot (your full-body photo, say).

What it deliberately will not do

Timing, cuts and audio are unchanged. That's the contract, and it's a good one: the join trusts those fields to rebuild your original timeline, so a node that could quietly rewrite them would be a footgun. If you want a different length or a different split, change the plan.

Unconnected inputs keep the shot's original values, which makes this node safe to leave half-wired - but also means a broken connection upstream is invisible. If your edited reference doesn't show up in the result, the failure is upstream of here.

Inputs and outputs

Required: shot - the same object that came out of Unpack. Optional: guide_frames, ref_image, ref_image_2, prompt. Output: shot, a single non-list value you connect into the conditioning or duet node.

Because the whole thing is one wire in and one wire out, it slots into a list-driven graph without any special handling - the same node runs once per shot because the list reaches it, exactly like every other node downstream of the planner.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/alisson-anjos/ComfyUI-BFSNodes
cd ComfyUI-BFSNodes && pip install -r requirements.txt

Restart afterwards, and reload the browser tab - the shot loop's planner panel is frontend code and a stale tab can leave you with half the feature set.

The one mistake

Repacking a shot from a different shot than the one you unpacked. Nothing catches it: the object carries its own index and timing, so the loop will happily generate shot 3's footage with shot 5's reference and cut it into slot 3. Keep the wires straight, and when a result lands in the wrong place, that's the first thing to check.

CategoryBFS/shot loop

Inputs (4)

NameTypeDefaultDescription
shotBFS_SHOT—
guide_framesoptIMAGEReplacement guide frames. Resized to the shot's generation size; padded or trimmed to its length.
refsoptIMAGEReplacement reference pictures: BFS Shot Unpack's refs list after any processing (e.g. background removed), one image per picture, in order.
promptoptSTRINGReplacement prompt.

Outputs (1)

NameTypeDescription
shotBFS_SHOT—