Width/Height Literal (Image Saver)
A size source that steps in 8s, so the metadata matches
- size
An integer source tuned for image dimensions. It's an Int Literal that steps in multiples of 8 and tops out at 16384 - which is exactly what latent-space dimensions want, since the VAE downsamples by 8. You use it so a single width (or height) value drives your Empty Latent, your sampler chain, and the size fields in your Image Saver metadata, keeping the recorded dimensions honest without any hand-typing.
Small node, but the step-of-8 constraint is a genuinely thoughtful touch - it quietly stops you from picking a size the latent grid can't represent.
How it works
You set a size and it outputs that number as an INT, constrained to multiples of 8. Wire it wherever a dimension goes: the width or height input of an Empty Latent Image, and the corresponding width / height field on an Image Saver or Image Saver Metadata node. One node per axis (one for width, one for height), each feeding both the latent and the metadata, and your saved size can't drift from the size you actually generated at.
Worth pairing with a bit of model sense: each model family has a native resolution it was trained on and behaves best near. SD 1.5 wants around 512 on the short side; SDXL, Flux and most modern models want roughly 1024. Wander far below native and you get incoherent duplicated limbs; far above and you get seams and repetition. Set size to a sensible per-axis value for your model and let the node keep it on the 8-grid.
The inputs and outputs that matter
- size - an integer from 0 to 16384, in steps of 8 (default 512).
The single output is an INT labelled size - route it to a latent dimension and to the saver's matching field.
Installing it
ComfyUI Manager: search ComfyUI Image Saver, install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/alexopus/ComfyUI-Image-Saver
cd ComfyUI-Image-Saver
pip install -r requirements.txt
Restart, hard-refresh. No downloads.
Where people get tripped up
The step-of-8 rule is a feature, not a limitation - dimensions that aren't multiples of 8 make the latent math unhappy, so let the node keep you on the grid. If you need a whole number that isn't a dimension, grab Int Literal instead; this one is shaped for sizes.
And the usual pack refrain: the value only stays consistent if you feed it to both the generation side and the metadata side. If your width lives only in the Empty Latent node, the saver still has to be told separately, which is the copy-paste error these literals exist to kill. One size node per axis, wired to both - that's the pattern.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| size | INT | 5120–16384 | size as integer (in steps of 8) |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| size | INT | size (INT) |