Nodes/ComfyUI-Magic-Assistant/📐 分辨率输出器 Magic Resolution Output
ComfyUI Node

📐 分辨率输出器 Magic Resolution Output

One dropdown that sets your resolution and hands you an empty latent to match

By shigjfg·Created 8 months ago·Updated 11 days ago· 37
📐 分辨率输出器 Magic Resolution Output
    • width
    • height
    • latent
    dim_preset
    width_px512
    height_px512
    batch_size1

    Every workflow has that moment where you need the width and height in three different places - an Empty Latent, a resolution note, a crop - and you're typing 1024 over and over, praying they stay in sync. Magic Resolution is the value node that ends that: pick a preset from one dropdown and it outputs the width, the height, and a ready-made empty latent in one shot. It's the "one source, many consumers" pattern from the node-plumbing playbook, applied to resolution.

    The preset dropdown is the headline feature, and it covers the usual suspects: SDXL's full set of aspect ratios (1024×1024, 1152×896, 1216×832, 1344×768, and the verticals), a couple of 2K options (1024×1536 and its swap), and SD1.5's 512×512. There's also a preset management window so you can add and delete your own resolutions, and the preset data is shared with the pack's Magic Resolution Resize node - set your list once, both nodes see it. The V1.2.5 changelog even added double-click-to-edit on a preset name, which is the small thing that makes preset lists feel maintained instead of abandoned.

    Inputs and outputs

    • dim_preset - the resolution dropdown; choosing one fills the width/height fields
    • width_px, height_px - the actual values used (INT, 64–8192). The preset just fills these; edit them directly for anything custom
    • batch_size - how many copies of the latent to make (1–64)

    Outputs are width (INT), height (INT), and latent (LATENT). The latent is created at width/8 × height/8 with 4 channels and your batch size - the standard empty-latent shape the VAE expects. So you can wire the width/height into a resolution-dependent node while feeding the latent straight into a sampler.

    What to know before you trust it

    The latent is an empty latent. It sets the canvas the sampler will fill; it doesn't carry any image content. For txt2img that's exactly what you want - pick SDXL_1024x1024, wire the latent to the sampler, done. The one thing to keep straight: the width/height outputs are in pixels (the real values), while the latent is the downscaled-by-8 version. They're meant to be used for different things, and mixing them up is the classic error - if you connect the latent to something expecting pixel dimensions, everything downstream computes wrong.

    Also note the V1.1.3 design decision: the preset directly fills the input fields, the one-click swap button exchanges width and height, and the outputs always use whatever is currently in the fields. That's a simplification that makes the node predictable - what you see in the boxes is what you get out, no hidden state.

    Installing

    It's part of the Magic-Assistant pack:

    cd ComfyUI/custom_nodes/
    git clone https://github.com/shigjfg/ComfyUI-Magic-Assistant.git
    cd ComfyUI-Magic-Assistant && pip install -r requirements.txt
    

    Restart and it's under "✨ Magic Assistant". No models, no heavy dependencies - this is pure plumbing, so it runs anywhere ComfyUI does.

    Category✨ Magic Assistant

    Inputs (4)

    NameTypeDefaultDescription
    dim_presetCOMBO18 options: SDXL_1024x1024, SDXL_1152x896, SDXL_896x1152, SDXL_1216x832, SDXL_832x1216, SDXL_1344x768, +12
    width_pxINT51264–8192
    height_pxINT51264–8192
    batch_sizeINT11–64

    Outputs (3)

    NameTypeDescription
    widthINT
    heightINT
    latentLATENT