Boyo Overlap Switch
Why Your First Video Chunk Has No Overlap (and This Node Fixes It)
- overlap
Infinite video generation has a dumb-but-real problem: the first chunk has nothing to blend with. Overlap makes sense between chunk two and chunk one - you regenerate a few shared frames so the transition is smooth. On chunk zero there's no previous footage, so an overlap there just means you're asking the model to loop back into a void. BoyoOverlapSwitch is a three-input, one-output node that exists purely to stop that.
It takes a counter, a first_overlap (default 0 - nothing to overlap on pass zero), and a subsequent_overlap (default 13 - your blend value for every later pass). If the counter is 0 you get the first value; otherwise you get the second. That's the entire mechanism, and it's exactly the shape of the problem.
How it works
if counter == 0: return first_overlap
else: return subsequent_overlap
You wire the loop counter from your while/for loop (the pack's Boyo For Loop, or any counter node) into counter, and pipe the overlap output into whatever sampler or video-stitch node consumes an overlap value. The default of 13 isn't magic - it matches the 13-frame trims the pack's Boyo Video Length Calculator uses at chunk junctions, so the two nodes line up if you use them together.
Where it fits
This is squarely a Wan/LTX-style chunked-video workflow node. The typical setup is: a loop generates a ~94-frame chunk per pass with 13 overlapping frames at the front, BoyoOverlapSwitch hands the sampler 0 overlap on the first pass so it starts clean, then 13 on every pass after so chunks blend. Feed the result into Boyo Video Cutter afterward to strip the overlap frames, and you get one seamless long video instead of a pile of jittery segments.
If you're not looping video, you don't need this. If you are, the first thing you'll notice hand-rolling it is a seam on pass one - this node prevents the whole class of bug.
Installing it
Part of the Boyonodes pack (DragonDiffusionbyBoyo):
cd ComfyUI/custom_nodes
git clone https://github.com/DragonDiffusionbyBoyo/Boyonodes
Restart ComfyUI, or install "Boyonodes" via ComfyUI Manager. No extra dependencies for this node - it's a conditional compare on integers.
Gotchas
- It keys on
counter == 0exactly. If your loop counter starts at 1 instead of 0, the first pass will incorrectly get the overlap value. Match it to your loop's first iteration index. subsequent_overlapis a global value for all later passes. If you want a ramp (growing overlap per chunk), this node won't do it - use something with a schedule.
Small, obvious, and quietly essential once you're building chunked video loops. Grab it, set first_overlap to 0, forget it exists.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| counter | INT | 00–999999 | — |
| first_overlap | INT | 00–100 | — |
| subsequent_overlap | INT | 130–100 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| overlap | INT | — |