NO8D Ref Tile Prepare
Nobody wants to look at a 3072-pixel reference
- tile
- reference
- width
- height
There's a quiet mismatch in every reference-based tiled upscale: you generate at tile resolution, but the reference picture the model looks at wants to be much smaller than that. Hand it a 3072-pixel tile as a visual reference and you've made the encoder's job worse and your workflow slower for nothing. NO8D Ref Tile Prepare is the tiny node that fixes the ratio.
What it's doing in the chain
The sequence in this pack is split → prepare → condition → sample → decode → align → colour match → stitch. Split gives you a raw tile and a target canvas size. Prepare turns that raw tile into the two different things the H3 Image conditioning node needs at once: a downscaled visual reference and an integer width/height pair for the canvas you're about to sample.
That's the trick of the node. It looks like an image resizer; it's really a unit converter between "the pixels I have" and "the pixels I'm generating."
How it works
The math is short and worth knowing, because every weird number you see downstream comes out of it. Take the tile, find its short side, and scale so the short side lands on your vision_size (unless you picked tile). Round those dimensions to the nearest multiple of 32. Then - importantly - only apply it if it's a shrink. This thing refuses to upscale a reference; if your calculation would make it bigger, it hands back the original. Finish with a final pad-up to the next multiple of 32 in each axis so the numbers are VAE-friendly.
Worth saying out loud: when the author rebuilt this from goohai's original script, keeping the short-side ladder, the shrink-only rule and the 32-alignment was the point. They're not cosmetic. Bicubic on the way down, nearest-neighbour on the way up in Split - different tools for opposite jobs.
The inputs and outputs
Two inputs, both required. tile is the image - and it takes exactly one frame. Hand it a batch and it rejects it, because it's designed to be called once per tile by ComfyUI's list semantics. vision_size is the one you actually think about: tile, 1024, 1280, 1536, 1792 or 2048, defaulting to 1024. tile means "leave the resolution alone, just do the 32-alignment." The numbers mean "short side becomes this many pixels."
The example workflow ships with 1024, which tracks the author's own reference settings and is the sane starting point: enough detail for the model to know what it's looking at, not enough to swamp the vision encoder.
Three outputs:
reference- the prepared image. Wire it into the H3 conditioning node'simages.image_0and intoVAEEncode. Both. It's the same picture doing two jobs: the vision-side reference and the source for the reference latent.widthandheight- integers, and here's the one that catches people.
These are not the dimensions of the image on the reference output. They're the original tile dimensions rounded up to a multiple of 32 - the raw sampling size. The author's workflow doc is blunt about this: don't substitute the downscaled reference dimensions for these, because they're what the conditioning node uses to build the canvas and the latent. Mix them up and you'll sample a shrunken picture, then wonder why Align is stretching every tile back up and the stitch looks soft.
Install
Same pack, same two-step: ComfyUI Manager search for "ComfyUI-NO8D-controls", or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/no8d/ComfyUI-NO8D-controls.git
python -m pip install -r ComfyUI-NO8D-controls/requirements.txt
Windows portable users need the embedded interpreter:
python_embeded\python.exe -m pip install -r ComfyUI\custom_nodes\ComfyUI-NO8D-controls\requirements.txt
Restart ComfyUI and hard-refresh the tab. There's no frontend build. The node lives under the NO8D/H3 category, not with the prompt-library stuff you'll see screenshotted in the README - the README predates this batch and doesn't document the H3 nodes at all. The only written documentation is docs/tiled-reference-upscale.md in the repo, and it's in Chinese. That's the honest state of things for a node that shipped in pack version 1.6.0.
Common snags
Feeding it a batch. "received an invalid image" usually means you gave it more than one frame, or a mask, or something that isn't an RGB image tensor. In a normal Split→Prepare chain ComfyUI's list execution handles this for you; it only bites when you wire it up by hand from a batch loader.
Leaving the VAE socket on the conditioning node empty. Not a Prepare bug, but the single most common wiring failure in this workflow: the H3 conditioning node has its own VAE input, and in this pipeline it must stay unconnected - the VAE work happens in the separate VAEEncode node fed from reference. Connect it and you get a second, differently-sized reference path fighting the one the pack carefully sized for you.
Expecting it to sharpen. It's a downscaler. A 1024 short-side reference of a soft source is still a soft source, and the detail is supposed to come from the model at sample time, which is the entire premise of generation-based upscaling as opposed to ESRGAN-style interpolation (see our upscaling notes).
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| tile | IMAGE | — | |
| vision_size | COMBO | 1024 | 6 options: tile, 1024, 1280, 1536, 1792, 2048 |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| reference | IMAGE | — |
| width | INT | — |
| height | INT | — |