Nodes/ComfyUI-KrakenTools/πŸ¦‘ Kraken Flux Empty Latent Image
ComfyUI Node

πŸ¦‘ Kraken Flux Empty Latent Image

Flux's Empty Latent Image Is Lying to You β€” This One Does the Math

By krakenunboundΒ·Created about a year agoΒ·Updated 9 months agoΒ· 3
πŸ¦‘ Kraken Flux 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β–Ί

    If you've ever wired Flux into the stock Empty Latent Image node and wondered why your img2img chain came out smeared, here's the thing nobody tells beginners: that default node hands you a 4-channel latent, and Flux's autoencoder doesn't work in 4 channels. Flux runs 16 channels at an 8Γ— downscale per side - four times as much information per unit of latent as SDXL. Feed it the wrong shape and your encode/decode cycles get noisy instead of subtly wrong. That mismatch is exactly what this node exists to fix.

    πŸ¦‘ Kraken Flux Empty Latent Image builds the latent the way Flux actually expects and, more usefully, does the resolution math you were doing on a calculator. This is the front of the KrakenTools workflow: pick a megapixel and an aspect ratio, and it returns a latent plus the resolution and preset strings the pack's other two nodes read.

    How it works

    You pick a megapixel (how much total canvas you want) and a preset (the aspect ratio). It computes width and height so the area matches - a 1.0 MP 2:3 (Classic Portrait) lands at roughly 832Γ—1216 - then rounds both to a model-friendly multiple. The divisible_by field handles that: Auto uses 64 for canvases over 1.5 MP, 32 for over 0.75 MP, 16 below. Flux is finicky about non-multiples-of-8, so this saves you the silent tile-in-your-generation problem.

    The latent it returns is [batch, 16, h//8, w//8] - the 16 channels and the 8Γ— factor are Flux's VAE geometry, not a guess. It also renders a little preview image showing the intended canvas size, so you can see the box before you burn a sampling pass.

    The inputs that matter

    • megapixel - the total canvas budget (0.5 to 3.0, or Custom to type raw WΓ—H).
    • preset - 64 choices. Plain ratios (2:3 Classic Portrait, 16:9 Panorama) scale with your megapixel; the Screen: and Video: presets (like iPhone Wallpaper - 1170x2532 or KlingAI Wide - 1344x768) are fixed sizes that ignore the megapixel field.
    • divisible_by - leave it on Auto until you know why you need something else.
    • batch_size - number of latents, for when you're generating variations.

    Skip use_custom_aspect unless you need a ratio no preset covers. You get five outputs, but the two that matter downstream are resolution (a "736 x 1344" string) and preset_out (a "736x1344" string) - those feed KrakenUpscaleTileCalc and KrakenResolutionHelper so the whole chain agrees on the target. latent goes into your sampler as usual, and width_out/height_out are there for any node that wants plain integers.

    Installing it

    Through ComfyUI Manager, search Kraken Tools (or ComfyUI-KrakenTools). Or by hand:

    cd /path/to/ComfyUI/custom_nodes
    git clone https://github.com/krakenunbound/ComfyUI-KrakenTools
    

    Restart ComfyUI. That's it - no requirements.txt, no model downloads, nothing beyond the torch/numpy/Pillow ComfyUI already ships. The whole pack is MIT-licensed and small enough to read in one sitting.

    Common gotchas

    • Don't expect exact dimensions from the presets. They're aspect-driven and snap to the divisible grid - at 1.0 MP, 2:3 gives you ~832Γ—1216, not 736Γ—1344. That's fine; the pack's design is "close enough for sampling, exact at the end," which is what KrakenResolutionHelper is for.
    • The Screen:/Video: presets don't scale with megapixel. If you pick one of those, megapixel is ignored - the listed WΓ—H is what you get.
    • This is a young, small pack (first release late 2025, by "The Kraken" on X/YouTube). Don't expect a big community or a wiki - the source is the documentation.

    One thing I'll say for it: it's the rare "empty latent" node that thinks in canvas area instead of raw pixels, which is exactly how Flux users actually talk about resolution.

    Categorykraken/latent

    Inputs (8)

    NameTypeDefaultDescription
    megapixelCOMBO1.012 options: 0.5, 0.75, 1.0, 1.25, 1.5, 1.75, +6
    presetCOMBOCustom64 options: Custom, 1:1 (Perfect Square), 2:1 (Panorama Landscape), 2:3 (Classic Portrait), 3:4 (Golden Ratio), 3:5 (Elegant Vertical), +58
    use_custom_aspectBOOLEANfalseβ€”
    custom_aspectSTRING1:1β€”
    widthINT102464–4096β€”
    heightINT102464–4096β€”
    divisible_byCOMBOAuto7 options: Auto, 8, 16, 32, 64, 128, +1
    batch_sizeINT11–64β€”

    Outputs (5)

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