๐ Resize Image
Exact dimensions, or keep the aspect ratio with a zero
- image
- IMAGE
There's no shortage of resize nodes in ComfyUI, core included, so what does this one add? Mostly convenience: you punch in a width and a height and it resizes to exactly that, no math required. The one trick worth knowing - and it's genuinely useful, not just a gimmick - is that leaving either width or height at 0 tells it to keep the aspect ratio and derive that dimension from the other one. So if you only care that the output is 1024px wide and don't want to hand-calculate the matching height, set width to 1024 and height to 0, and it figures out the rest.
How it works
It's a straightforward resample: give it an image and the target size, get back an image at that size. Nothing fancier under the hood than that. Where it earns its keep is in workflows where you're constantly resizing to fit different targets - matching a source image to a checkpoint's native resolution, prepping a batch of reference images to a consistent size before an IPAdapter or ControlNet stage, that kind of thing - and you don't want to reach for a calculator every time the source dimensions change.
The inputs and outputs that matter
image(IMAGE) - the image to resize.width(INT, default 256) - target width. Set to 0 to derive it from height and preserve aspect ratio.height(INT, default 256) - target height. Same deal in the other direction.- Output:
IMAGE- the resized image. The node is also flagged as an output node in ComfyUI, meaning it'll execute even without anything wired downstream - handy if you just want to preview the result, though you'll still want a Save Image or Preview Image node if you actually want to keep or view it in the standard way.
How to install it
Via ComfyUI Manager: search Bjornulf_custom_nodes, install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/justUmen/Bjornulf_custom_nodes
cd Bjornulf_custom_nodes && pip install -r requirements.txt
then restart ComfyUI. This node has no dependency of its own beyond basic image handling - but you're pulling in the whole 170-node pack regardless, and requirements.txt covers everything from Ollama to FFmpeg, so the install is heavier than what this one node alone needs.
Common issues & troubleshooting
Both width and height at 0. There's nothing to derive the aspect ratio from if you zero out both dimensions - set at least one of them to a real number, or you're just asking the node to guess.
Distorted output when you meant to keep proportions. If your image looks stretched or squashed, you almost certainly typed a real number into both width and height instead of leaving one at 0. That's the whole point of the zero convention - use it instead of hand-computing the matching dimension, and you avoid this entirely.
Unexpected behavior after a pack update. The README describes Bjornulf_custom_nodes as "very active development, work in progress," with a long changelog of breaking changes across its many nodes. If resizing behaves differently after updating the pack, check the changelog before assuming your graph is wrong.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | โ | |
| width | INT | 256 | โ |
| height | INT | 256 | โ |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | โ |