Nodes/ComfyUI-mnemic-nodes/πŸ“ Resolution Image Size Selector
ComfyUI Node

πŸ“ Resolution Image Size Selector

Presets for every model, plus a latent, in one node

By MNeMoNiCuZΒ·Created 3 years agoΒ·Updated 23 days agoΒ· 105
πŸ“ Resolution Image Size Selector
  • image (optional)
  • width
  • height
  • latent
β—„presetCustomβ–Ί
β—„preset_userNoneβ–Ί
β—„custom_width512β–Ί
β—„custom_height512β–Ί
β—„multiply1.00β–Ί
β—„swap_width_and_heightfalseβ–Ί
β—„image_min_length0β–Ί
β—„image_max_length0β–Ί
β—„snap_to_nearestfalseβ–Ί
β—„snap_resolution0β–Ί
β—„batch_size1β–Ί

The node for not doing aspect-ratio math by hand every time you switch checkpoints. It ships 107 built-in presets covering the current model lineup - SDXL, Z-Image, and the rest - plus your own saved favorites, and it hands back a ready-made blank latent so you can skip EmptyLatentImage entirely. The preset list being kept current enough to include Z-Image is a decent signal this pack gets maintained as new model families show up, not left frozen at whatever was popular when it was first written.

How it works

There's a strict, stated priority order for where the final resolution comes from: an input image beats a user preset, which beats the built-in preset, which beats typing custom numbers (only actually used when preset is set to Custom). Whichever source wins, you can still adjust the result afterward with multiply (scale the whole resolution up or down; negative values flip width and height) and swap_width_and_height.

The inputs and outputs that matter

  • preset - 107 choices, default Custom. Pick by name (e.g. "SDXL: [Square] 1024x1024 1:1") instead of memorizing numbers per model family.
  • preset_user - your own saved favorites, overrides preset when set to anything other than None.
  • custom_width / custom_height - only used when preset is exactly Custom.
  • multiply and swap_width_and_height - post-adjustments applied after the base resolution is chosen.
  • image (optional) - when connected, its size drives the resolution instead of any preset, with image_min_length/image_max_length available to clamp the short/long side, and snap_to_nearest + snap_resolution to round to a clean multiple.
  • batch_size (optional) - how many latents to generate.

Outputs: width, height, and latent - a blank latent already sized and ready for your sampler.

How to install it

Via ComfyUI Manager: search ComfyUI-mnemic-nodes, install, restart. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/MNeMoNiCuZ/ComfyUI-mnemic-nodes

Restart ComfyUI. No model downloads or extra dependencies.

Common issues & troubleshooting

Typed custom numbers get ignored. custom_width/custom_height only apply when preset is set to exactly Custom - if a built-in preset is still selected, your custom numbers sit there unused while the preset's resolution wins. This is the single most common "why is my resolution wrong" moment with this node.

An image connection is overriding everything. Per the stated priority order, a wired image input always beats your preset or custom choice, no exceptions. A stray or leftover image connection from earlier graph edits is an easy thing to forget about and a common source of unexpected resolutions.

Odd results with multiply set negative. That's documented, working-as-intended behavior - a negative multiplier deliberately flips width and height rather than just producing negative dimensions, which is a fast way to rotate a resolution 90 degrees without touching swap_width_and_height separately.

Category⚑ MNeMiC Nodes

Inputs (12)

NameTypeDefaultDescription
presetCOMBOCustomSelect a model-specific resolution preset or use custom dimensions
preset_userCOMBONoneUser-defined preset selection (overrides main preset when selected)
custom_widthINT51264–16384Custom width (Only used with Custom preset)
custom_heightINT51264–16384Custom height (Only used with Custom preset)
multiplyFLOAT1.00Multiplier for the final resolution. Negative values will flip the dimensions.
swap_width_and_heightBOOLEANfalseSwap width and height dimensions
image (optional)optIMAGEPriority order for resolution selection: 1. Input Image 2. User Preset 3. Preset 4. Custom Values (when preset is set to 'Custom')
image_min_lengthoptINT00–16384When image is provided, ensures the shortest side is at least this length (0 = ignore)
image_max_lengthoptINT00–16384When image is provided, ensures the longest side is at most this length (0 = ignore)
snap_to_nearestoptBOOLEANfalseWhen enabled, dimensions will be adjusted to the nearest multiple of snap_resolution
snap_resolutionoptINT00–16384Snap dimensions to multiples of this value (0 = no snapping)
batch_sizeoptINT11–64Number of latent images to generate in batch

Outputs (3)

NameTypeDescription
widthINTThe final scaled width in pixels.
heightINTThe final scaled height in pixels.
latentLATENTThe final scaled latent.