Nodes/ComfyUI_StarNodes/⭐ Star Divisible Dimension
ComfyUI Node

⭐ Star Divisible Dimension

The two-int node that stops your VAE from throwing a fit

By Starnodes2024·Created 2 years ago·Updated a day ago· 102
⭐ Star Divisible Dimension
    • width
    • height
    width512
    height512
    divisible_by8

    Every diffusion VAE has a grid it wants your image dimensions to sit on - usually a multiple of 8, and some architectures are pickier (Flux and SD3.5's VAE want multiples of 16 or 64). Feed it 1051x705 and you'll get a latent error, a weirdly-cropped result, or a silent tile artifact. Star Divisible Dimension (StarDivisibleDimension) is the most boring node in the StarNodes pack and that's exactly why it's worth having: you give it a width and height, it rounds each to the nearest multiple of divisible_by, and hands you two clean ints.

    How it works

    Three ints in, two ints out, zero math you have to trust:

    • width / height - whatever your image, latent, or calculation produced (64 to 8192, step 8).
    • divisible_by - the divisor, default 8. Set it to 16 for Flux, 64 if you're being strict about SD3.5, or 128 for video models that demand it.

    The node rounds to the nearest multiple rather than always rounding up. That's a subtle but good choice: a 1010px width snaps to 1008 (a multiple of 8), not 1016, so you don't silently grow images that are already over your VRAM budget. Outputs are width and height as INTs, ready to wire into any empty-latent or size-driven node.

    Where it earns its keep

    The classic use is taming size-calculator nodes. Upscalers, ratio helpers, and megapixel utilities all hand you "about 1342x1000" numbers that aren't on the VAE's grid. Slap a StarDivisibleDimension between the calculator and your latent/sampler and every downstream node gets dimensions it can actually consume. It also shines in workflows that take width/height as widgets: if your template has a resolution field people will type anything into, routing it through this node means they can type 1000 and get 1000 usable instead of a VAE crash.

    The pack's Star Model Latent Upscaler and starters already enforce their own multiples of 16 internally - so if your whole graph is built from StarNodes, you may not need this at all. It's for the mix-and-match graph where third-party nodes hand you sloppy dimensions.

    The honest verdict

    This is a pure utility, the kind of node you install as part of a pack and forget exists until the day it saves you a ten-minute debugging session over a VAE shape mismatch. It's also trivially replaceable with a couple of ComfyUI math nodes - which is precisely the point of a pack like this: one box is easier to read than a math chain, and it's hard to wire wrong.

    Install

    Part of the StarNodes pack:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Starnodes2024/ComfyUI_StarNodes
    

    or ComfyUI Manager → search Starnodes, restart, find it under ⭐StarNodes/Helpers And Tools. No dependencies, no models, nothing to configure beyond the three ints. If you're building a template to share, dropping this on the resolution input is a one-node way to make your workflow robust against people typing in 33 as a width.

    Category⭐StarNodes/Helpers And Tools

    Inputs (3)

    NameTypeDefaultDescription
    widthINT51264–8192
    heightINT51264–8192
    divisible_byINT81–64

    Outputs (2)

    NameTypeDescription
    widthINT
    heightINT