Resize to visible Image
The 'size not divisible by 8' fix you didn't know you needed
- image
- IMAGE
- STRING
If you've loaded a workflow, fed it an odd-sized image, and hit some variant of "dimensions not divisible by 8" (or 16, or 64) on the way into the VAE, this node is the fix. It resizes an image so its width and height are exact multiples of a number you pick, without wrecking the aspect ratio and without upscaling it. That's the entire job, and it does it cleanly.
The display name is "Resize to visible Image," which is a terrible name for what it does - there's nothing "visible" about it. It's a divisible-resize node, plain and simple. Ignore the label.
How it works
Diffusion models don't like arbitrary image sizes. The VAE and latent space work on fixed-size chunks - typically multiples of 8 for SDXL-lineage models, 16 or 32 for others - and an off-multiple image either errors out or gets silently padded into weirdness. This node makes sure your image plays by those rules.
The mechanism is straightforward: it computes a scale that fits the image within max_size (if one is set, and it only ever downscales - the 1.0 cap in the code means it never upscales a smaller image to reach the limit), then rounds the new width and height down to the nearest multiple of target. Finally it resizes with bilinear interpolation. If the image is already divisible and within limits, it passes through untouched. The aspect ratio is preserved throughout - it's a pure resize, not a crop.
The inputs that matter
image(IMAGE) - the tensor to resize.name(STRING) - a label that just passes through to the STRING output so you can keep track of what you resized.target(INT, default 32) - the divisibility factor. Default 32 is a safe all-rounder (it's a multiple of 8 and 16, so it satisfies just about every latent space), but if your workflow is strict about 64, set it to 64. Range 2–2048.max_size(INT, default 1024) - the largest dimension cap for downscaling. Default 1024 keeps big images from blowing up memory when they only need to be resized, not huge. Range 8–8192.
Outputs: IMAGE (the resized tensor) and STRING (the name you passed in). Wire the image into the VAE-encode / sampler path that was complaining, and the name anywhere you need it.
Installing it
Standard pack install: comfyui_image_embeddings by baijunty. ComfyUI Manager → search "image_embeddings" → install → restart, or:
cd ComfyUI/custom_nodes
git clone https://github.com/baijunty/comfyui_image_embeddings
No extra dependencies beyond what ComfyUI already ships.
Where people get burned
The "max_size only downscales" behavior is the thing that trips people up: set max_size to 2048 expecting to enlarge a 1024 image to 2048 and nothing happens - the image stays put, because the node never upscales. If you actually want to upscale, that's a different node's job; this one is for conforming sizes, not growing them.
Also remember it rounds down, so a 999×999 image with target 32 becomes 992×992, slightly smaller than the source - fine for feeding a latent space, surprising if you were expecting "as close to original as possible." And one honest quibble: it's bilinear-resize quality, which is fine for pre-VAE conforming but not something you'd use for final output quality - you'd pair it with a real upscaler downstream anyway.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| name | STRING | — | |
| target | INT | 322–2048 | — |
| max_size | INT | 10248–8192 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |
| STRING | STRING | — |