Nodes/ComfyUI-HotSwitches/Hot Resolution Mode Switch
ComfyUI Node

Hot Resolution Mode Switch

Stop memorising aspect ratios, and stop wiring two Get Image Size nodes

By Bloodwolfb·Created 25 days ago·Updated 21 days ago· 1
Hot Resolution Mode Switch
  • image
  • width
  • height
◄modeResolution Selector►
◄aspect_ratio1:1 (Square)►
◄megapixels1.0►
◄multiple8►
◄width512►
◄height512►

Somebody asks "how do I use the Resolution Selector node" about once a month, and the answer is always the same: it gives you two integers, and you have to know to wire them into the width/height sockets of an Empty Latent Image. Correct node, terrible discoverability. Half the time the real question underneath is "I want the output to be the same size as the image I just dropped in," which is a different node. Hot Resolution Mode Switch covers both, plus the manual-numbers case, with a dropdown deciding which is live.

Three nodes wearing a trench coat

The mode dropdown is the whole idea:

Resolution Selector - pick an aspect ratio and a target megapixel count and it does the maths, using the same formula and the same ratio list as ComfyUI's core node. Manual Resolution - type width and height yourself, because sometimes you know exactly what you want. From Image - plug an image into the image input and it outputs that image's dimensions, which folds a Get Image Size node and two wires into the same box.

Only the controls for the mode you're in are shown; the frontend hides the rest.

The maths, and the one setting people get wrong

Bucketed mode works like this: target pixels = megapixels × 1024², scale = √(pixels / (ratio_w × ratio_h)), then each side is rounded to the nearest multiple. At the default multiple of 8, 1MP square gives you 1024×1024 and 1MP 16:9 gives 1368×768. Set multiple to 64 and 1MP 4:3 gives you 1152×896 - an actual SDXL trained ratio, not an approximation - and 2MP 16:9 gives 1920×1088, the size most Flux-era video workflows land on.

So: if you're on Flux or anything else that wants dimensions divisible by 64, set multiple to 64 before you start. The field runs 8 to 128 in steps of 4, so 64 is easy to hit, and the default of 8 will quietly hand you pixel counts a Flux workflow doesn't want.

Why care? Because resolution is the most reliable way to ruin a generation. SDXL wants its trained ratios or you get stretched bodies; Flux wants that multiple of 64; the 2026 models mostly take anything in a 1MP–2MP band and degrade softly rather than glitching.

The inputs and outputs that matter

  • mode - the dropdown above. Promote it to a subgraph input and a whole family of workflows becomes one reusable subgraph.
  • aspect_ratio - eight options, from 1:1 (Square) through 16:9 (Widescreen) and 21:9 (Ultrawide) to the photo and portrait ratios.
  • megapixels - 0.1 to 16. 1.0 is roughly 1024×1024 square; 2.0 is the safe upper end for most current models.
  • multiple - the rounding step, discussed above. 64 for Flux.
  • width / height - 64 to 16384, only read in Manual Resolution mode.
  • image - optional IMAGE socket, only read in From Image mode.

Outputs are just width and height as INTs. Wire them into an Empty Latent Image's width/height. If the node you're targeting has those as widgets rather than sockets, right-click the widget and Convert widget to input first - that's the step people miss, and it's why "I set the resolution and nothing changed" happens. The numbers went nowhere.

Two things worth knowing. Hidden controls are hidden, not reset - flip back to Manual Resolution and your old width and height are still there. And the image socket is never hidden, because hiding a socket drops whatever is wired into it. It's lazy, though: the chain feeding it only executes in From Image mode, so you can leave it wired permanently and pay nothing.

Installing it

Manager: open ComfyUI Manager → Install via Git URL → paste the repo → restart. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/Bloodwolfb/ComfyUI-HotSwitches.git

No Python dependencies. The one requirement is a current ComfyUI build - both nodes in this pack use the newer comfy_api.latest authoring API and ship no legacy NODE_CLASS_MAPPINGS entry, so on an old install they don't appear at all.

Where people get burned

"Hot Resolution Mode Switch: mode is 'From Image' but nothing is connected to the image input." The node's own error, and clear enough - you flipped the mode with an empty socket, or your Load Image is bypassed.

The maths looks off. Check multiple before blaming the formula: 16:9 at 1MP is 1368×768 at multiple 8 and 1344×768 at 64. Neither is wrong, they're rounded to different steps.

The chain feeding image doesn't run in the other modes. It's pruned the moment you leave From Image, which is free speed - but you also can't drop a Preview onto that chain and expect it to fire while you're in Resolution Selector mode.

CategoryHotComfy/Switches

Inputs (7)

NameTypeDefaultDescription
modeCOMBOResolution SelectorWhich mechanic drives the output width/height.
aspect_ratioCOMBO1:1 (Square)The aspect ratio for the bucketed dimensions.
megapixelsFLOAT1.00.1–16Target total megapixels. 1.0 MP ≈ 1024x1024 for square.
multipleINT88–128Nearest multiple of the result to round the bucketed resolution to.
widthINT51264–16384Manual width. Used when mode is Manual Resolution.
heightINT51264–16384Manual height. Used when mode is Manual Resolution.
imageoptIMAGEImage to read the size from. Used when mode is From Image; ignored (and not evaluated) otherwise.

Outputs (2)

NameTypeDescription
widthINTSelected width in pixels.
heightINTSelected height in pixels.