ComfyUI Node

Power Res

Named resolutions, an empty latent, and two ints you didn't know you wanted

By Cornmeister·Created 8 months ago·Updated 8 months ago· 0
Power Res
    • LATENT
    • WIDTH
    • HEIGHT
    presetSD 512 Square
    manual_overridefalse
    width512
    height512
    batch_size1

    Power Res is an Empty Latent Image that remembers the resolutions you care about. Where the stock node makes you type 832 × 1216 every time, this one gives you a dropdown of named presets - "SD Portrait 640x896", "SDXL Landscape 1152x896" - and creates the matching empty latent. But the real reason to use it isn't the dropdown. It's that it also outputs the width and height as plain integers, so the rest of your graph (and your save-node metadata) can know what it's about to generate.

    How it works

    The preset list isn't hardcoded - it's loaded from JSON files in the pack's presets/ directory (sd.json and sdxl.json ship with it). Pick a preset and the node reads its width and height. Turn on manual_override and it ignores the preset, using the width and height fields instead. Either way the dimensions get snapped to a multiple of 8 (minimum 64), because that's the grid diffusion latents actually live on, and it builds the latent with torch.zeros([batch, 4, h//8, w//8]) - an empty 4-channel latent at one-eighth the pixel dimensions, which is exactly what an SD/SDXL-generation KSampler expects to start from.

    The WIDTH/HEIGHT outputs are the differentiator. Resolution info is normally implicit in the latent and invisible to your graph; here it's first-class data. You can feed it into the Power Save Image node's width/height fields so your metadata records the real generation size, or use it in any math/conditioning node that needs to know the target resolution. It's the difference between a node that makes a latent and a node that keeps the rest of your workflow honest.

    Inputs that matter

    • preset - the dropdown. Ships with six SD resolutions (512² up through 896×640) and five SDXL ones (1024², 832×1216, 1216×832, 896×1152, 1152×896). The SDXL list is the sane default set for modern models.
    • manual_override - flip to bypass the preset and type your own.
    • width / height - 64 to 8192, step 8. Only read when override is on.
    • batch_size - 1 to 64, default 1. More slots = more images from one latent.

    Outputs: LATENT → your KSampler; WIDTH and HEIGHT (INT) → metadata or wherever you need numbers.

    Install

    It's part of the CornmeisterNL PowerPack:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Cornmeister/ComfyUI-CornmeisterNL-PowerPack.git
    

    Restart ComfyUI, or use ComfyUI Manager and search "CornmeisterNL PowerPack". Just requests and Pillow as dependencies - nothing heavy, no model downloads.

    Where people get burned

    • Your custom resolution isn't in the list. Fine - that's what manual_override is for, and you can also add your own presets/whatever.json files inside the pack folder (format: {"Name": [width, height]}), which the node picks up on restart.
    • It's an SD/SDXL-style 4-channel latent. If you're on a 16-channel architecture (Flux and friends), the shape differs from what those models' dedicated empty-latent nodes emit. For the SDXL lineage it's exactly right; on newer stacks, check whether your sampler is happy with it before making it your default.
    • "This is just Empty Latent Image with a dropdown." Mostly true, and the dropdown plus the int outputs are precisely the point. If you never need the numbers and never want presets, you don't need this node. If you're wiring metadata or aspect-ratio math, you do.

    It's a utility node, and it knows it. Not flashy - just the resolution management your workflow was doing by hand anyway, plus the two ints that quietly make everything downstream smarter.

    Category⚡ CornmeisterNL/PowerPack/Latent

    Inputs (5)

    NameTypeDefaultDescription
    presetCOMBOSD 512 Square11 options: SD 512 Square, SD 768 Square, SD Portrait 512x768, SD Landscape 768x512, SD Portrait 640x896, SD Landscape 896x640, +5
    manual_overrideBOOLEANfalse
    widthINT51264–8192
    heightINT51264–8192
    batch_sizeINT11–64

    Outputs (3)

    NameTypeDescription
    LATENTLATENT
    WIDTHINT
    HEIGHTINT