XB-BOX - 📐 批量缩放图像
Scale up to nine images at once with one shared setting
- image1
- 图像1
- 图像2
- 图像3
- 图像4
- 图像5
- 图像6
- 图像7
- 图像8
- 图像9
XB_ImageScale is a batch wrapper around ComfyUI's stock ImageScale, and the pitch is in the name: instead of dropping one ImageScale per image, you feed it up to nine images and it resizes them all with the same method, width, height, and crop settings. Set it once, apply to everything, and all nine come out the back door in lockstep.
This is one of those quiet utility nodes you don't appreciate until a workflow hands you a batch of frames or a grid of reference images that all need identical treatment. Feeding nine separate ImageScale nodes nine copies of the same settings is how you introduce drift - someone changes one and not the other eight. This node makes that impossible by construction.
How it works
The inputs are the stock ImageScale ones, all shared across the batch:
- upscale_method -
nearest-exact,bilinear,area,bicubic,lanczos. The usual tradeoffs apply: lanczos for the sharpest downscale, bicubic for general use, nearest for pixel art. The pack's other image/video nodes default to these same choices, so pick one and it's consistent everywhere. - width / height - up to 16384. The twist worth knowing: if you set either one to 0, the node computes it to preserve the aspect ratio. Width 0 + height 512 scales every image to 512 tall, whatever the original shape.
- crop -
disabledorcenter. When you force exact dimensions that don't match the source aspect ratio, this decides whether to stretch or center-crop.
The "up to nine" part comes from the dynamic-port trick: connect a second image to the image2 slot and it appears; keep adding up to the nine-lane ceiling. Each image is resized independently with the shared settings - no cross-image blending, no assumptions about matching dimensions on the way in.
The outputs
Nine outputs, labeled 图像1 through 图像9. Here's the honest part: the node always returns nine, and unconnected slots are filled by repeating the first result. That means if you only feed three images, outputs 4–9 are copies of image 1. It's a convenience (downstream batch nodes often want a fixed count) and a trap (grab the wrong output and you'll wonder why everything's identical). Always wire by matching the input index.
Install
Standard XB_ToolBox install: ComfyUI Manager → search XB_ToolBox, or git clone https://github.com/wjluoxiao/XB_ToolBox.git into custom_nodes, restart. No dependencies, no models - pure torch ops over ComfyUI's own common_upscale.
The usual gotcha is expecting it to do something smarter than it does. It's a batch tool, not a resizer with model-based upscaling - feeding it 512px images and asking for 2048 will give you a soft upscale, not a detail-restoring one. If you want AI upscaling (ESRGAN, SUPIR-style), you pair this with an upscaler model node after it, or reach for the dedicated upscaling packs. For simple, consistent, batch resize - the actual job - it's hard to beat.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| upscale_method | COMBO | 5 options: nearest-exact, bilinear, area, bicubic, lanczos | |
| width | INT | 5120–16384 | — |
| height | INT | 5120–16384 | — |
| crop | COMBO | 2 options: disabled, center | |
| image1 | IMAGE | — |
Outputs (9)
| Name | Type | Description |
|---|---|---|
| 图像1 | IMAGE | — |
| 图像2 | IMAGE | — |
| 图像3 | IMAGE | — |
| 图像4 | IMAGE | — |
| 图像5 | IMAGE | — |
| 图像6 | IMAGE | — |
| 图像7 | IMAGE | — |
| 图像8 | IMAGE | — |
| 图像9 | IMAGE | — |