SDupscaleTiledSize
Stop guessing UltimateSDUpscale's tile size
- image
- output_image
- upscale_by
- tiled_width
- tiled_height
A calculator, not an upscaler
Here's the situation this node exists for: you've got the classic tiled upscale workflow wired up - the ComfyUI port of UltimateSDUpscale chained after your KSampler, ControlNet Tile if you're being careful - and the node is asking you for a tiled_width and tiled_height. You set them by vibes, or you copy whatever numbers the YouTube thumbnail used, and either you blow up your VRAM with tiles that are too big or you render four hundred overlapping micro-tiles and wait twenty minutes.
SDupscaleTiledSize is the fix for that. It's not an upscaler at all - it's a tiny math node that reads your image's dimensions, applies your upscale factor, and hands you back the tile size that keeps each tile under a sane cap. You feed its numbers into UltimateSDUpscale and stop guessing. The pack's whole premise, per the README, is "assist in determining reasonable input values for tiled_width/tiled_height." That's the entire job, and it does it in about twenty lines.
How the math works
The node takes your image, computes width × upscale_by and height × upscale_by, and then decides whether that target fits in a single tile. If it does, tiled_width/tiled_height are just the upscaled dimensions - one tile, whole image. If a side would blow past your tiled_block, it splits that side into enough chunks that each chunk stays under the cap. Both numbers get rounded up to a multiple of 16, which keeps things friendly for the model and VAE. That's it. No models, no weights, no VRAM graph - pure integer arithmetic on the image shape.
Two details worth knowing. The upscale_by you feed in gets silently capped at 4.0, so ask for 5x and you'll get a upscale_by output of 4.0 - that's the value you wire forward, not what you typed. And because the two dimensions are sized independently, you can legitimately get rectangular tiles (say 1536×1152). That's fine; UltimateSDUpscale handles them.
The inputs that matter
Three inputs, and really two of them do anything:
tiled_block- the cap on any single tile dimension, default 1536. This is the VRAM knob. On a 6GB card, drop it toward 1024; on a 12GB+ card you can usually run 2048 and enjoy fewer, bigger tiles. Lower = safer, more tiles, slower and more seams. Higher = faster and cleaner, until you OOM.upscale_by- your target factor, 0.5–4.0. This is the same factor you'd otherwise type into UltimateSDUpscale yourself.image- any IMAGE tensor. Its dimensions are the only thing used; the image itself comes back untouched.
Wiring it up
The node has four outputs, and the first one is a bit of a trick: output_image is just your input passed through unchanged. It's there so you can route the image to UltimateSDUpscale's image input in the same wire run. The real outputs are upscale_by, tiled_width, and tiled_height - plug those three into the matching inputs on the UltimateSDUpscale node and you're done. Note that this pack ships only the helper: you still need the UltimateSDUpscale node itself installed separately (ssgrl's ComfyUI_UltimateSDUpscale) or there's nothing to plug into.
Install
Trivial, and there's nothing heavy about it - no dependencies beyond what ComfyUI already ships (the code just uses torch and PIL, and there's no requirements.txt). Install via ComfyUI Manager by searching "SDupcaleTiledSize", or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/Windecay/ComfyUI-SDupcaleTiledSize
Restart ComfyUI. That's the whole install - no model downloads, no extra pip packages, nothing to update when you upgrade ComfyUI.
Gotchas
- The pack name is misspelled - "SDupcale," missing the s. Search the Manager for that, not "SDupscale," or you'll wonder why nothing comes up.
- This isn't the upscaler. First-time users occasionally wire this node in expecting it to do the tiling. It just computes numbers.
- The cap. If your output comes out smaller than you asked for, you hit the 4.0 ceiling - check the
upscale_byoutput, not your input widget. - If the tiled pass OOMs, the first thing to try is lowering
tiled_blockbefore you touch the upscale factor. That's exactly the case this node was built to make painless.
For a thin utility, it's surprisingly nice: one wire change and the fiddliest number in the whole upscale workflow stops being a guess.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| tiled_block | INT | 1536512–2048 | — |
| upscale_by | FLOAT | 1.00.5–4 | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| output_image | IMAGE | — |
| upscale_by | FLOAT | — |
| tiled_width | INT | — |
| tiled_height | INT | — |