凤希AI - 图片大小统一
Force a whole frame sequence to one resolution — white-letterboxed, not stretched
- 图片序列
- 输出序列
Batch video work has an ugly prerequisite: every frame in the batch has to be the same size before a sampler will touch it. Mix 704×1280 stills with 512×512 screenshots in one sequence and you'll hit a shape mismatch error at the worst possible moment. FxAiImageUniformSize is the "make it all the same" node - it takes an image sequence and normalizes every frame to a single 输出宽度 × 输出高度, so the batch comes out uniform and ready for a video model.
The approach is "contain, don't stretch." Frames are scaled to fit inside the target canvas - the whole image always visible - and any leftover space is filled with white bars, centered. Nothing is cropped away and nothing is distorted. That's the right default for frame sequences where you don't want to lose content, and it matches the pack's other sizing nodes, which all share the same ImageSizeController under the hood.
How it works
The node builds a canvas controller at your target size with a white background, then runs each frame through crop_fill_to_canvas: scale to fit (Lanczos), center, and paste onto the white canvas. It accepts both a standard batch tensor and the pack's Python-list format, and stacks the results back into a single IMAGE output. The white background is the one opinion baked in - if you want black bars, this isn't the node for you (the batch-load node letterboxes onto black if that's your preference).
Inputs and outputs
- 输出宽度 (default 704, multiples of 32) and 输出高度 (default 1280, multiples of 8) - the target canvas.
- 图片序列 - the frames to normalize.
Output: 输出序列 - the uniformly-sized batch. Note the defaults (704×1280, a vertical 9:16-ish canvas) tell you exactly what this pack assumes you're making: vertical short-form video.
Installing it
Part of fxai-toolkit (凤希AI, MIT). Install via ComfyUI Manager (search "fxai-toolkit") or:
cd ComfyUI/custom_nodes
git clone https://github.com/fxai666/fxai-toolkit
# restart ComfyUI
No models. The pack auto-installs soundfile and psutil on first load. Chinese labels; support via the author's QQ group (775649071) and Bilibili.
Where people get burned
White bars are the thing to watch. If your source frames have wildly different aspect ratios, the letterboxing gets heavy, and white bars in video frames tend to cause flicker or halo artifacts when the frames feed into a model that then generates motion across those regions. Matching the target aspect to your source material keeps bars thin. Also, "uniform size" means exactly that - every frame comes out at the canvas size, so a batch of frames that were all the same size already will still get re-encoded through the canvas, which is a (small) quality round-trip you can skip if everything's already uniform.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| 输出宽度 | INT | 70432–8192 | — |
| 输出高度 | INT | 128032–8192 | — |
| 图片序列 | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| 输出序列 | IMAGE | — |