Image Resize (Swwan) · 旧版兼容
The deprecated KJNodes resize, kept alive for old workflows
- image
- get_image_size
- IMAGE
- width
- height
What this node actually is
This is ImageResizeKJ from KJNodes, reimplemented inside ComfyUI_Swwan and parked in the Swwan/Legacy drawer. The node's own description says it outright: "DEPRECATED! Due to ComfyUI frontend changes, this node should no longer be used." The author kept it so your two-year-old workflow doesn't explode with a red missing-node box, and pointed new work at ImageResizeKJv2Alternative (sold in the menu as Resize Image (Swwan)).
So: reach for it when you're reviving an old graph. Don't reach for it when you're building a new one - you'd be signing up for a node the author himself tells you to replace.
How it works
Take an IMAGE tensor, decide a target width and height, and hand it to ComfyUI's own common_upscale. That's the whole thing. The interesting part is how the target gets decided, because three inputs fight over it:
width/heightset it directly, and0means "keep this axis as-is." Set width 1024 and height 0 and you get 1024 wide with the original height.- With
keep_proportionon, the pair is treated as a bounding box: the node takesmin(width/W, height/H), so the image scales to fit inside your numbers, aspect preserved, no padding, and the larger axis lands short of the target. That surprises people who expect "fit to 1024×1024" to mean exactly 1024×1024. divisible_bythen floors both dimensions down to a multiple. Leave it at 2. For SDXL/Flux/anything latent-based you want 8, 16 or 64, because an off-grid resolution is how you get a hard error or a mushy edge three nodes down the line.
Two optional inputs matter. get_image_size takes a second image and copies its dimensions, overriding width/height entirely - that's your "resize the batch to match this reference frame" wire, and note it also disables keep_proportion and divisible_by while it's connected. And crop is a single-choice enum of disabled / center / 0, where the author's tooltip explains the 0: the new frontend reordered widgets, so old workflows' crop value lands here as 0, and 0 is silently remapped to center. The output is IMAGE plus the width and height integers that actually came out - handy for feeding an empty latent or a filename template, since they're post-rounding values, not the ones you typed.
Install
It ships in the pack; there's nothing separate to fetch.
cd ComfyUI/custom_nodes
git clone https://github.com/aining2022/ComfyUI_Swwan
cd ComfyUI_Swwan
python -m pip install -r requirements.txt
Then restart ComfyUI and hard-refresh the browser tab. Requirements are numpy, Pillow, opencv-python, scipy and scikit-image - torch and torchvision come from your existing ComfyUI environment, and the pack installs no CUDA wheels and downloads no models.
Common issues
Your old workflow still shows a missing node. Expected. The node ID is SwwanImageResizeKJ, not KJNodes' ImageResizeKJ, and since version 1.0.0 the pack deliberately registers no conflict aliases - 56 KJNodes overlaps were renamed to Swwan-prefixed IDs precisely so the two packs can't fight over a socket name. The bundle ships a migration script for exactly this:
python scripts/migrate_workflow.py old.json --dry-run
python scripts/migrate_workflow.py old.json --swwan-node-id 12 --swwan-node-id 35 --comfyui-root /path/to/ComfyUI
ComfyUI Manager warns about a conflict with KJNodes. That warning is about overlapping names, not a broken install - Community reports on this pack cluster almost entirely around conflict noise rather than these nodes themselves; the pack's own checklist points at scripts/check_coinstall.py for checking registration ownership. If KJNodes is installed and working, you don't need this node at all.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| width | INT | 5120–16384 | — |
| height | INT | 5120–16384 | — |
| upscale_method | COMBO | 5 options: nearest-exact, bilinear, area, bicubic, lanczos | |
| keep_proportion | BOOLEAN | false | — |
| divisible_by | INT | 20–512 | — |
| get_image_sizeopt | IMAGE | — | |
| cropopt | COMBO | 0 will do the default center crop, this is a workaround for the widget order changing with the new frontend, as in old workflows the value of this widget becomes 0 automatically |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |
| width | INT | — |
| height | INT | — |