Anima Image Scale By Multiple
Resize that actually lands on 32-multiples
- image
- image
- width
- height
- applied_scale
Any ComfyUI veteran has been burned by the off-by-a-few-pixels resize: you upscale 1.5x, get 1536x864, feed it to a node that demands 32-multiples, and it silently snaps or errors. Anima Image Scale By Multiple exists to kill that class of bug. It scales an image by the nearest valid ratio that preserves the source aspect ratio and lands both output dimensions on your chosen multiple - 8, 16, 32, or 64. For Anima and its optimization nodes, the answer is 32.
Why 32 matters
Anima is a DiT, and a lot of the optimization tooling around it - latent-friendly resizes, the pack's own Highres stage, Spectrum sampler paths - wants latent dimensions that divide cleanly. The pack's Highres defaults literally use this node's settings: scale 1.5x, multiple 32, max long edge 2560. So when you see "32-multiple" demanded by an Anima workflow, it's not superstition; it's the latent size staying sampler-safe. This node gives you that guarantee with a real ratio, not a dumb snap.
The inputs that matter
image- the image to upscale.scale_by- the requested ratio (default 1.5). The node uses the nearest ratio that satisfies the multiple constraint, so the actual applied scale may differ slightly - that's whatapplied_scalereports.multiple- 8, 16, 32, or 64. This is the one you set for Anima work: 32.upscale_method- interpolation:nearest-exact,bilinear,area,bicubic(default), orlanczos. Bicubic is the safe default for latent-stage work; lanczos for pixel work where you want crispness.max_long_edge- a cap on the output's long edge (0 disables it, default). Set it when you want, say, 1.5x but never above 2560 on the long side.
The outputs worth using
image- the scaled result.widthandheight- the final valid dimensions. Wire these to latent-size inputs or a display node if you're building adaptive graphs.applied_scale- the ratio actually applied. Because the nearest valid ratio can be 1.49 instead of your requested 1.5, this is how you know what really happened. If a workflow ever seems to ignore yourscale_by, check this - it didn't ignore you, it just couldn't hit the multiple exactly.
How it fits
The canonical spot is between a decoded first pass and a second-stage sampler: upscale with this node, then use the width/height outputs (or its image) to drive the Highres pass at a guaranteed-valid size. It's also the right tool before any optimization node that asserts 32-multiple inputs - KJNodes-style attention patchers, tiled VAEs, that whole family.
Install and gotchas
Pack install:
cd ComfyUI/custom_nodes
git clone https://github.com/n0va39/ComfyUI-EasyUseAnima
cd ComfyUI-EasyUseAnima && pip install -r requirements.txt
Restart ComfyUI; Manager: "ComfyUI EasyUse Anima".
The gotcha is the trade between scale_by fidelity and the multiple constraint - the tighter your multiple (64), the further the applied ratio can drift from what you asked. If exact scale matters more than multiples, don't use this node; if multiples matter (they do for Anima), the drift is the point. And remember max_long_edge interacts: with both set, the node picks the nearest valid ratio that also respects the cap.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | Input image to upscale. | |
| scale_by | FLOAT | 1.500.01–8 | Requested image scale ratio. The node uses the nearest valid ratio for the selected multiple. |
| upscale_method | COMBO | bicubic | Interpolation method used for resizing. |
| multiple | COMBO | 32 | Output width and height must be multiples of this value. |
| max_long_edge | INT | 00–16384 | Maximum output long edge. Set 0 to disable this limit. |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | Scaled image using the nearest valid ratio. |
| width | INT | Final valid image width. |
| height | INT | Final valid image height. |
| applied_scale | FLOAT | Actual scale ratio applied to the image. |