Nodes/comfyui-prompt-shelf/Resolution Shelf
ComfyUI Node

Resolution Shelf

Stop retyping 1344x768 — pick a resolution from a shelf instead

By timonknispel·Created 4 months ago·Updated 4 months ago· 0
Resolution Shelf
    • width
    • height
    • key
    keyFLUX.1
    resolution
    width1024
    height1024
    flip_width_heightfalse
    resolution_index

    This is the pack's workhorse. Resolution Shelf outputs width and height integers that you wire into EmptyLatentImage (or a video-empty-latent, or anything that wants dimensions), and it saves you from remembering which resolution each model family actually likes. Different families have different native sizes - SDXL wants 1024² territory, Wan 2.1 720p has its own aspect, the video models are a whole other ballgame - and the pack ships default groups for FLUX.1, SDXL / Pony XL, SD 3.5, Qwen-Image, HiDream, HunyuanImage, Wan 2.1, HunyuanVideo, LTX-Video, CogVideoX, and Illustrious. The point is you switch keys instead of retyping numbers, which is where mistakes sneak in.

    Inputs, and the ones that matter:

    • key (default FLUX.1) - the resolution group. There's an "Existing keys" dropdown so you don't have to type group names from memory.
    • resolution - dropdown of the saved resolutions for that key, plus Custom input.
    • width / height - manual values (1–16384), used when Custom input is selected. These are the escape hatch.
    • flip_width_height - swaps width and height when enabled. Portrait/landscape flip without touching your saved presets.
    • resolution_index (optional, INT) - if connected, it overrides the dropdown. 0 picks the first saved resolution, 1 the second, and so on.

    Outputs: width, height (both INT), and key (STRING, which just passes through the group name you selected so you can use it for labels or routing downstream).

    The precedence logic is worth knowing because it explains every "why did it pick that?" moment. If resolution_index is connected, it wins outright: index 0 → first saved item. If the index is larger than the list, the code clamps to the last item rather than erroring - so a loop stepping 0,1,2,3 against a three-entry shelf gives you the last one twice, silently. If no index is connected, a resolution dropdown selection pulls that entry's dimensions; Custom input leaves the manual width/height as-is. flip_width_height is applied last, after selection, so it never corrupts what's stored.

    Install is the whole pack, once, the easy way:

    cd ComfyUI/custom_nodes
    git clone https://github.com/timonknispel/comfyui-prompt-shelf
    

    Restart ComfyUI, refresh the browser, and everything sits under the Prompt Shelf category. No requirements.txt, no model downloads, nothing that can fight your environment.

    Two real-world traps. First, resolution_index connected with a stale value will silently override your dropdown - if you set an index during testing, the dropdown stops mattering until you disconnect it. Second, type a key you haven't built and the dropdown has only Custom input, so the node quietly falls back to the manual width/height widgets. That's the intended fallback, not a failure, but it does mean an empty shelf looks exactly like a working manual entry. Build your resolution groups in the Resolution Shelf Editor first, and this node becomes a one-click picker.

    CategoryPrompt Shelf

    Inputs (6)

    NameTypeDefaultDescription
    keySTRINGFLUX.1
    resolutionCOMBO4 options: Custom input, 1024 x 1024, 1344 x 768, 1216 x 832
    widthINT10241–16384
    heightINT10241–16384
    flip_width_heightBOOLEANfalse
    resolution_indexoptINT

    Outputs (3)

    NameTypeDescription
    widthINT
    heightINT
    keySTRING