Width & Height
Scale a resolution without doing the math yourself
- target width
- target height
- original width
- original height
- scale
- formatted
This one's not going to blow your mind, and that's fine - it's a calculator. You give it a width, a height, and a multiplier, and it hands back the scaled numbers so you don't have to do the arithmetic in your head every time you want a workflow "20% bigger." It ships in ShinChven's Custom Nodes Package, a small personal pack of exactly three dimension-math nodes, and this is the pixel-first one of the three.
How it works
Multiply width by scale, multiply height by scale, done. There's no image sampling, no model involved - it's arithmetic wearing a node, so you can wire it straight into your graph instead of running the numbers on a phone calculator and typing them into an Empty Latent Image by hand. The extra outputs beyond the scaled result exist so the rest of your graph doesn't have to reroute back to the original values or the scale you used - this node becomes the one place that resolution logic lives.
The inputs and outputs that matter
Three inputs, and you'll set all three:
- width, height (INT, default 512, range 8–16384, step 8) - your starting resolution. Usually piped in from a loaded image's actual size, sometimes just typed because you're planning ahead.
- scale (FLOAT, default 1) - the multiplier. 2 doubles it, 0.5 halves it, 1.25 nudges it up a quarter. This is the dial you'll actually touch.
Six outputs: target width / target height are the scaled result - wire these into your Empty Latent Image or a resize node. original width / original height pass the source values straight through, handy if something downstream still wants to reference the un-scaled size. scale is a pass-through too, and formatted is a string version of the result, likely meant for a filename or an on-canvas label rather than anything you'd feed back into math.
How it fits a workflow
Typical placement: right after you know your source size, feeding into whatever needs the scaled version - a resize node, or Empty Latent Image if you're setting up a fresh generation at "1.5x my usual size." Because width and height snap to steps of 8 in the UI, your starting numbers are already VAE-friendly; whether the scaled result stays on that grid depends on your multiplier. 512 × 1.5 = 768, clean. Odd multipliers can drift off it, and most models want dimensions divisible by 8 - Flux wants 64 - or you risk a crop or artifacts at the VAE step.
How to install it
Via ComfyUI Manager: search "ShinChven's Custom Nodes Package", install, restart. By hand:
cd ComfyUI/custom_nodes
git clone https://github.com/ShinChven/sc-comfy-nodes
then restart ComfyUI to pick it up. The README doesn't call out any extra pip packages or model downloads, and there aren't any - it's pure Python, so installing it is genuinely just the clone.
Common issues & troubleshooting
Node's not showing up after you cloned it. You skipped the restart - ComfyUI only scans custom_nodes on launch.
A downloaded workflow says this node is missing, even though you're sure you installed it. "Width & Height" isn't a unique name - several bigger packs (WAS Node Suite, rgthree, Efficiency Nodes) ship their own resolution-math nodes, and ComfyUI Manager can resolve a same-named node to the wrong pack. Check which pack actually got installed.
The scaled number looks rounded oddly. Scale is a float, the outputs are INT, so rounding happens somewhere internally. If you need an exact pixel count - matching another image precisely - don't scale by ratio, compute the target size directly instead.
This is a tiny, low-traffic pack built by one person, and there's no real community thread about it worth searching for - if something's actually broken, a GitHub issue on the repo is faster than hunting for a forum post that doesn't exist.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| width | INT | 5128–16384 | — |
| height | INT | 5128–16384 | — |
| scale | FLOAT | 1.00 | — |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| target width | INT | — |
| target height | INT | — |
| original width | INT | — |
| original height | INT | — |
| scale | FLOAT | — |
| formatted | STRING | — |