Nodes/Kraken Tools/πŸ™ Kraken Empty Latent Image
ComfyUI Node

πŸ™ Kraken Empty Latent Image

Presets for phones, cinema, and social

By krakenunboundΒ·Created 8 months agoΒ·Updated 8 months agoΒ· 2
πŸ™ Kraken Empty Latent Image
    • latent
    • width_out
    • height_out
    • resolution
    • preset_out
    β—„megapixel1.0β–Ί
    β—„presetCustomβ–Ί
    β—„use_custom_aspectfalseβ–Ί
    β—„custom_aspect1:1β–Ί
    β—„width1024β–Ί
    β—„height1024β–Ί
    β—„divisible_byAutoβ–Ί
    β—„batch_size1β–Ί
    β—„enable_previewtrueβ–Ί
    β—„max_preview_size512β–Ί

    The stock Empty Latent Image gives you two numbers and a prayer. πŸ™ Kraken Empty Latent Image is what you use when you're tired of doing the "is 1080x1920 really 9:16, and what's that in a latent" arithmetic on every workflow. It's a drop-in latent creator with 39 aspect-ratio presets organized the way real humans think - phone screens, cinema ratios, Instagram, Full HD, 4K - plus megapixel-driven sizing, and it hands your chosen resolution out as strings you can wire into the rest of the Kraken pack's upscaling math.

    It's one node in Kraken Tools (krakenunbound/comfyui-kraken-tools), and it's the front end of the pack's resolution story: it computes a size, then Kraken Preset From Image and the upscale calculator pick up that same preset_out string so your resize targets and your latent agree without you typing a resolution twice.

    How it works

    You pick two things and it does the math. megapixel (0.5 to 3.0, plus Custom) is the total pixel budget; preset is the aspect ratio. The node multiplies the budget by the ratio, resolves to concrete width/height, and snaps both to divisible_by - the Auto default picks a multiple appropriate for the size, or you can force 8/16/32/64/128/256. This matters more than it sounds: SDXL models were trained around 1024-ish totals, and WAN/Flux video want latents that divide cleanly for their VAEs. A latent that's off by a pixel in either dimension is a classic source of "why is my video slightly smeared" weirdness.

    The presets are grouped the way you'll actually look for them: portrait (9:20, 9:16, 2:3, 3:4, 4:5), square, landscape (up to 16:9), cinematic (1.85:1, 2:1, 21:9, 2.39:1), plus named screen sizes (Android, iPhone, Full HD, 4K) and social slots (Instagram, YouTube, Facebook). For anything not in the list, flip use_custom_aspect and type custom_aspect like 7:5, then let width/height handle the fine detail.

    The only inputs most people touch:

    • megapixel - the total pixel budget
    • preset - the aspect ratio
    • divisible_by - the alignment multiple
    • batch_size - how many identical latents to make (1 is normal; more is for batch/video work)

    Outputs

    • latent β†’ your sampler's latent_image.
    • width_out / height_out (INT) - the resolved dimensions, for any node that needs numbers.
    • resolution (STRING) - e.g. "1024 x 1024", handy for text display.
    • preset_out (STRING) - the same resolution as a "WxH" string, designed to feed Kraken Resolution Helper / Kraken Upscale & Tile Calc in the same pack. This is the output that makes the "empty latent β†’ upscale calculator" chain work without retyping numbers.

    There's also an enable_preview optional that renders a small placeholder image preview of the canvas (cap the size with max_preview_size) - pure UI nicety, no effect on the latent.

    Install

    Standard Kraken Tools install. ComfyUI Manager β†’ search "Kraken Tools" β†’ Install β†’ restart. Manual:

    cd ComfyUI/custom_nodes
    git clone https://github.com/krakenunbound/comfyui-kraken-tools
    cd comfyui-kraken-tools
    pip install -r requirements.txt
    

    Restart and you'll find it under the Kraken category. No extra model files - this node is pure math and Pillow.

    Where people get burned

    • Megapixel + ratio = chunky dimensions. 2.5MP at 21:9 is a lot of pixels on a normal card; if you're on 8GB, don't assume the preset will "just work" at high megapixels. Drop to 1.0–1.5 for cinematic ratios.
    • Custom in megapixel means width/height take over. If you set megapixel to Custom you're now driving from the width/height sliders, and the preset is advisory. Easy to forget mid-workflow.
    • The preview is not the image. enable_preview shows a colored placeholder rectangle, not your render. People occasionally wire the wrong output to a Save node and save a blank block of color - the actual image always comes out of the sampler, not this node.

    If you generate at the same three ratios over and over, presets save you maybe ten seconds a run. If you're building upscaling chains that need resolution math flowing between nodes, preset_out is the piece that makes the whole thing coherent.

    Categorykraken/latent

    Inputs (10)

    NameTypeDefaultDescription
    megapixelCOMBO1.012 options: 0.5, 0.75, 1.0, 1.25, 1.5, 1.75, +6
    presetCOMBOCustom39 options: Custom, 9:20 (Android Vertical), Screen: Android Portrait - 1080x2400 (9:20), Screen: iPhone Portrait - 1170x2532 (9:19), 9:16 (Vertical), Screen: Full HD Portrait - 1080x1920 (9:16), +33
    use_custom_aspectBOOLEANfalseβ€”
    custom_aspectSTRING1:1β€”
    widthINT102464–4096β€”
    heightINT102464–4096β€”
    divisible_byCOMBOAuto7 options: Auto, 8, 16, 32, 64, 128, +1
    batch_sizeINT11–64β€”
    enable_previewoptBOOLEANtrueβ€”
    max_preview_sizeoptINT512128–1024β€”

    Outputs (5)

    NameTypeDescription
    latentLATENTβ€”
    width_outINTβ€”
    height_outINTβ€”
    resolutionSTRINGβ€”
    preset_outSTRINGβ€”