Nodes/ANIMA_BOOSTER/Anima Latent Image (BSS)
ComfyUI Node

Anima Latent Image (BSS)

The boring node that saves you an AssertionError

By BlackSnowSkill·Created 4 months ago·Updated 2 months ago· 78
Anima Latent Image (BSS)
    • latent
    • width
    • height
    preset1024×1024 (1:1 large)
    width1024
    height1024
    batch_size1

    Some nodes win by being clever. Anima Latent Image (BSS) wins by being boring - it generates an empty latent the way EmptyLatentImage does, but with the one detail that stops Anima from exploding in your face: it makes sure your dimensions are actually valid for the model.

    Anima's VAE compresses the image by 8×, and the model's spatial patch size is 2. Multiply those together and every dimension has to be a multiple of 16. Feed it something else and you get the error this node exists to prevent:

    AssertionError: H,W should be divisible by spatial_patch_size 2
    

    The stock EmptyLatentImage won't stop you from hitting that. This node will.

    How it works

    Pick a preset or type a size, and the node rounds any non-conforming dimension up to the nearest multiple of 16, logs a warning so you know it changed, then builds a zero-filled latent of the right shape. That's the whole trick, and it's exactly the right kind of trick for a model that people keep tripping over.

    The inputs

    • preset - 14 aspect-ratio presets from 512×512 (1:1) up to 1280×1024 (5:4 landscape), plus Custom. The default is 1024×1024 (1:1 large), which is a sensible place to start.
    • width / height - used when the preset is Custom. Range 64–8192, step 16. Pick anything you like; the node quietly bumps it to a valid size.
    • batch_size - 1 to 64, default 1.

    Three outputs come back: latent (the LATENT you wire into KSampler) plus width and height as plain integers. Those last two look redundant, but they're genuinely useful - you can wire them into conditioning or an upscale node and always know the actual size after rounding, instead of the size you asked for.

    Installing it

    It ships with the ANIMA_BOOSTER pack, so installation is the same as the rest:

    cd ComfyUI/custom_nodes
    git clone https://github.com/BlackSnowSkill/ANIMA_BOOSTER.git
    

    or Manager → Install via Git URL with https://github.com/BlackSnowSkill/ANIMA_BOOSTER, then restart. It shows up under BSS/AnimaBooster, right next to the loaders and the TeaCache node it pairs with. No extra dependencies - this node is pure PyTorch tensor creation.

    The one gotcha

    Rounding is silent-ish. If you ask for 1000×1000, you get 1000×1000... no wait, you get 1008×1008, because 1000 isn't a multiple of 16 and the node bumps it up. That changes your composition slightly from what you might have intended. Usually that's exactly the point - you'd rather have a valid image than a crash - but if you're trying to match a specific target resolution exactly, work in multiples of 16 in the first place and you'll never see the warning. That's also a fair argument for just using the presets, which are all pre-validated.

    It's not a node you'll ever think about once your workflow is built. But it's the difference between a workflow that runs the first time and one that starts with a tensor shape error at 2 a.m., and that's a legitimate reason to reach for it.

    CategoryBSS/AnimaBooster

    Inputs (4)

    NameTypeDefaultDescription
    presetCOMBO1024×1024 (1:1 large)14 options: Custom, 512×512 (1:1), 768×512 (3:2 landscape), 512×768 (2:3 portrait), 768×768 (1:1 medium), 1024×576 (16:9 landscape), +8
    widthINT102464–8192
    heightINT102464–8192
    batch_sizeINT11–64

    Outputs (3)

    NameTypeDescription
    latentLATENT
    widthINT
    heightINT