XB-BOX - 🎞️ MSR 多图合成帧序列
Four images in, one frame sequence out — MSR for short dramas
- img_1
- img_2
- img_3
- img_4
- background
- output
"MSR" here is multi-image synthetic frame sequence, and the job is exactly what it sounds like: you have a handful of still images - say, four panels from a storyboard - and you want a single frame sequence that holds each one on screen long enough to drive an image-to-video or start/end-frame generation. XB_MSR rescales your images to a target resolution, repeats them across a chosen frame count, and hands you one IMAGE batch.
This is a workhorse for short-drama pipelines. The typical use is: your storyboard slicer cut a 4-grid or 9-grid layout into individual panels, and now each panel needs to become a video segment. Feed the four panels in, set width/height, pick a frame_count, and out comes a pre-timed sequence where each image holds for the right number of frames. From there it goes into an i2v node or a video model's start-frame slot.
How it works
The implementation is pure PyTorch, which is worth saying because it means zero external deps and nothing to break. It:
- Collects whatever of
img_1…img_4andbackgroundare actually connected (at least one is required or it raises "至少需要连接一张图片输入"). - Rescales every image to your
width×heightusing ComfyUI'scommon_upscale, honoring thescale_method(lanczos is default) andcrop_mode(centerordisabled). - Distributes
frame_countacross the images - each image getsframe_count // len(images)repeats, and any remainder goes to the first images - then concatenates them into one tensor.
The output output is a single IMAGE batch of exactly frame_count frames. It's a sequence, not a video file; wire it into your video generation or save it with a video encoder downstream.
The inputs that matter
- width / height - target resolution (default 736×1280, stepped in 32s - video-friendly).
- frame_count - 17, 25, 33, or 41. Note these are all
1+8Ncounts: LTX and Wan want frame counts that land on that grid, so the four choices aren't arbitrary. - scale_method / crop_mode - how images get stretched to fit.
lanczos+centeris the safe default; switch toareaif you're downscaling and want to avoid aliasing. - img_1..4, background - the source stills. All optional, but you need at least one connected.
Where it fits
Two common patterns. Pattern one: storyboard panels → MSR → i2v, so each storyboard beat becomes its own clip with the right pacing. Pattern two: start/end-frame video - put your start frame in img_1 and end frame in img_2, set frame_count to your clip length, and you've built the frame sequence a first-last-frame video node can interpolate between.
A note on the remainder logic: if you connect 4 images with frame_count 17, the first image gets 5 repeats and the rest get 4. That's usually fine for pacing, but if you need strict equal distribution, use a frame_count divisible by your image count (17 won't split evenly across 4; 25 will give you one extra on the first).
Install & gotchas
cd ComfyUI/custom_nodes
git clone https://github.com/WJLUOXIAO/XB_ToolBox.git
# or: ComfyUI Manager → "XB_ToolBox"
No extra deps - this is one of the genuinely plug-and-play nodes in the pack. The main way to misuse it is expecting it to animate between images; it doesn't interpolate, it holds. The motion comes from whatever i2v model you feed the sequence into. And if you feed it images of mismatched aspect ratios, center crop will happily chop the edges - that's the crop mode's job, so pick disabled if you'd rather it letterbox.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| width | INT | 73632–8192 | — |
| height | INT | 128032–8192 | — |
| frame_count | COMBO | 17 | 4 options: 17, 25, 33, 41 |
| scale_method | COMBO | lanczos | 5 options: lanczos, bilinear, bicubic, nearest-exact, area |
| crop_mode | COMBO | center | 2 options: center, disabled |
| img_1opt | IMAGE | — | |
| img_2opt | IMAGE | — | |
| img_3opt | IMAGE | — | |
| img_4opt | IMAGE | — | |
| backgroundopt | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| output | IMAGE | — |