SetImageSize
One place to set width and height, wired everywhere
- width
- height
This is about as simple as a node gets, and it's genuinely handy for exactly that reason. SetImageSize is two number boxes - width and height - that output those two values as integers. Its whole job is to be the single source of truth for your canvas dimensions, so instead of typing 1024 into five different nodes and hoping they stay in sync, you set it once here and fan the outputs out to everything that needs a resolution.
It comes from RES4LYF (by ClownsharkBatwing), a pack far better known for its flow-matching samplers and schedulers - but it bundles small workflow-plumbing utilities like this one too. The node's own description is refreshingly literal: "Generate a pair of integers for image sizes."
Why you'd bother
Because resolution ends up referenced in more places than you'd think - the empty latent, a resize node, a crop, a conditioning that wants target dimensions, an upscale-by-pixels calc. When those are all hard-typed independently, changing your output size means hunting them down one by one, and missing one gives you a subtly broken graph. A single SetImageSize node upstream turns "change the resolution everywhere" into "change two numbers." It's the same instinct as a constants node in code: name the value once, reference it many times.
It's also just convenient for A/B'ing aspect ratios - swap 1024×1024 for 832×1216 in one spot and the whole graph follows.
The inputs and outputs
- width (default 1024) - the width, as an integer.
- height (default 1024) - the height.
The outputs are, unsurprisingly, width (INT) and height (INT). Wire them into any node that takes integer dimensions - most commonly an Empty Latent Image, a resize/upscale node, or a conditioning that wants a target width and height. There's no image passing through it and no processing; it's a value source.
Installing it
ComfyUI Manager: search RES4LYF, install, restart. Or from a terminal: cd ComfyUI/custom_nodes && git clone https://github.com/ClownsharkBatwing/RES4LYF, then cd RES4LYF && pip install -r requirements.txt if you're on a venv (portable ComfyUI uses its embedded pip). Restart, hard-refresh with F5. Nothing to download.
Where people get burned
- Expecting it to resize an image. It doesn't touch pixels - it only emits two numbers. If you want to actually scale an image, feed these outputs into a resize node; SetImageSize just supplies the target.
- Off-grid values. Latent models work in multiples of 8 (often 16 or 64 for the newest architectures). Odd dimensions can error or get silently rounded downstream. Stick to clean multiples.
- Model-native resolutions. Push a checkpoint far outside the sizes it was trained on and you get duplicated limbs and repeated patterns. This node makes changing size easy; it doesn't make every size a good idea.
- Won't load. It's the RES4LYF node - the pack has to be installed. (It's a common enough name that another pack's version might be what a workflow actually wants; if in doubt, install RES4LYF.)
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| width | INT | 10241–10000 | — |
| height | INT | 10241–10000 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| width | INT | — |
| height | INT | — |