Nodes/ccsun_node/resize to 8
ComfyUI Node

resize to 8

Load an image already sized to what the VAE actually wants

By CC-SUN6·Created 2 years ago·Updated about a year ago· 0
resize to 8
    • IMAGE
    • MASK
    • width
    • height
    image

    If you've ever fed a random uploaded photo into an img2img workflow and gotten a cryptic tensor-size-mismatch error out of the VAE or an upscaler, this is the node that would've saved you. Stable Diffusion-family VAEs (SD1.5, SDXL, Flux - pretty much everything you're likely to be running) compress images down through a few downsampling stages that multiply out to 8x per side. That's not a soft preference, it's baked into the architecture - feed it a width or height that isn't a multiple of 8 and something downstream, sooner or later, throws a shape error. "resize to 8" exists purely to stop that from ever happening: it loads an image and snaps its dimensions to a multiple of 8 on the way in, before anything else in your graph touches it.

    How it works, and the one thing that surprises people

    Unlike the other nodes in this pack, resize to 8 isn't something you wire an image into. Look at its one required field - image - and it's a dropdown, not an input socket. It works like ComfyUI's built-in LoadImage node: drag a file onto it (or drop the file into your ComfyUI input folder) and it shows up in the list. Pick it, and the node loads the file and resizes it to the nearest multiple of 8 in the same step. If you're expecting a wire coming in from an earlier node, that's not what this does - it's meant to sit at the very start of a graph, loading a raw upload cleanly rather than fixing up something generated mid-workflow. If you need to resize something already inside your graph, you want a different node (ComfyUI's own ImageScale, for instance); this one's job is specifically "load + fix the size" in one step.

    Outputs

    Four of them, and all four are useful:

    • IMAGE - the loaded, correctly-sized image, ready to feed into a VAE encode, an img2img sampler, whatever's next.
    • MASK - comes along with the load, same as the stock LoadImage node.
    • width / height - the final dimensions as integers. Wire these straight into an EmptyLatentImage (or any node that wants explicit width/height) so the rest of your graph matches the resized image exactly, instead of you eyeballing the math yourself.

    That last part is the real value of the node over just cropping the image in an editor first: you don't have to compute the divisible-by-8 dimensions by hand, and downstream nodes that need matching latent dimensions get fed the right numbers automatically.

    Installing it

    Search ccsun_node in ComfyUI Manager and install from there, or clone it manually if it's not indexed:

    cd ComfyUI/custom_nodes
    git clone https://github.com/CC-SUN6/ccsun_node
    

    Restart ComfyUI afterward. No extra Python dependencies, no models to download - it's pure image-tensor arithmetic on load.

    Common trip-ups

    The biggest one is expecting an input wire that doesn't exist - this is a loader, not a filter, so the file has to already be sitting in ComfyUI's input directory (or dragged onto the node) before you can pick it. If your workflow generates an image mid-run and you want that resized to a multiple of 8, this node can't help - it only ever loads from disk.

    Beyond that, this is a barebones one-author utility pack with a two-line README and no real community footprint, so there's no forum thread to lean on if something's off - file a GitHub issue on the repo directly. The good news is the node itself does one small, well-defined thing, so there isn't much surface area for it to go wrong.

    Categoryccsun_node

    Inputs (1)

    NameTypeDefaultDescription
    imageCOMBO1 options: example.png

    Outputs (4)

    NameTypeDescription
    IMAGEIMAGE
    MASKMASK
    widthINT
    heightINT