Resolution Scale /noEmbryo
The math node for latent upscaling that stays a multiple of 4
- image
- Width
- Height
- Scale Factor
- Original Width
- Original Height
Every hires-fix workflow in ComfyUI eventually needs the same thing: a target resolution that scales your image up without breaking the model's expectations. You can compute it with a handful of math nodes, but you'll always be doing the same dance - multiply, round, check whether it's divisible by 8 or 16 - and honestly, most people skip the rounding and wonder why the second pass produces artifacts. Resolution Scale is the noEmbryo pack's one-box answer: feed it a base size and a scale factor, and it hands back clean, properly-rounded dimensions you can plug straight into an Empty Latent Image node.
It doesn't upscale anything itself. It's a calculator for the rest of your graph, and that's exactly what it should be.
How it works
Give it width, height, and scale_factor, and the node returns Width and Height as the scaled dimensions (multiplied, then floored to integers), plus Scale Factor and the Original Width / Original Height it worked from. Wire Width and Height into an Empty Latent Image for a hires pass, or into an image scaler for a pixel-space upscale.
The interesting behavior is what happens when you connect an image to the optional input. Now the node can derive one dimension from the other: set width to 0 and it computes the width from your height and the image's aspect ratio; set height to 0 and it does the reverse. Either way, the result is snapped to a multiple of 4 - which is what keeps the latent dimensions friendly to the model's VAE. That's the whole trick this node exists for, and it's genuinely useful.
Inputs and outputs
- width, height - base dimensions (defaults 512 each). With an image connected, 0 means "derive from the other side."
- scale_factor - the multiplier, 0.1 to 8.0 (default 2.0). At 2.0, 512×512 becomes 1024×1024.
- image (optional) - an IMAGE input that lets the node read the source dimensions.
Outputs: Width, Height (scaled), Scale Factor (passed through), Original Width, Original Height.
The trap
If you connect an image and leave both width and height nonzero, the node silently uses the image's native dimensions and ignores what you typed. It's not a bug - that's the documented intent - but it bites people who hook an image up expecting their numbers to win. If you want your own dimensions, leave the image input empty.
Also note the multiple-of-4 rounding only kicks in when you're deriving one dimension from the other (a 0 involved). Plain width × factor multiplication gets floored but not snapped, so 512×2.5 gives you exactly 1280 and you're responsible for whether that's latent-friendly.
Install
ComfyUI Manager → search "noEmbryo", or:
cd ComfyUI/custom_nodes
git clone https://github.com/noembryo/ComfyUI-noEmbryo.git
Restart and it shows up under Add node > noEmbryo. No models, no dependencies - like everything in this pack, it's a few lines of pure Python.
For a hires-fix setup it's the rare utility node you'll actually keep in the graph permanently: deterministic, predictable, and it saves you the three-node math pile every other workflow drags around.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| width | INT | 512 | — |
| height | INT | 512 | — |
| scale_factor | FLOAT | 2.00.1–8 | — |
| imageopt | IMAGE | — |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| Width | INT | — |
| Height | INT | — |
| Scale Factor | FLOAT | — |
| Original Width | INT | — |
| Original Height | INT | — |