๐งฎ Smart Tile Calculator V5.1 (Vectorized)
The tile calculator that got fast enough to search everything
- image
- upscaled_image
- tile_width
- tile_height
- overlap
- output_width
- output_height
- tiles_x
- tiles_y
- total_tiles
- upscale
- efficiency
- debug_info
- efficiency_plot
The earlier calculators search a few hundred tile candidates in Python loops - workable, but you feel the ~500ms. The V5 "Vectorized" calculator rewrote that search in NumPy matrix operations, and suddenly it's evaluating five thousand candidates in about five milliseconds. When a search is that cheap, the node can afford to be picky, which is the entire philosophy here: align everything to 64 pixels, respect your chosen tile aspect, and only then maximize efficiency.
It's the newest calculator in the "Smart Tile" subsystem of ComfyUI-ArchAi3d-Qwen (Amir Ferdos's pack). The version history in the source is unusually honest about the bumps along the way - V5.1 fixed a bug where efficiency could display above 100%, V5.2 fixed aspect-ratio selection being ignored when optimization was on, V5.4 fixed a coverage bug where the overlap could shrink the grid below image size. The fixes landed; what you get today is the stable end of that line.
Inputs
Same shape as V3/V4, with tighter defaults:
- upscale (1โ8), upscale_method, tile_aspect_ratio - as before.
- target_tile_mp - target megapixels per tile (1.0 โ 1024ยฒ).
- padding_pixels - minimum blend overlap.
- optimize_efficiency - search for the least-waste tile size.
- mp_tolerance (default 0.05), aspect_freedom (default 0), upscale_tolerance (default 0.05) - the interesting change: V5 defaults are much tighter than V3's, because the vectorized search can find a good fit without bending the rules. Start there, loosen only if the grid refuses to align.
- generate_plot - the instant vectorized heatmap.
Outputs: upscaled_image, tile_width, tile_height, overlap, output_width, output_height, tiles_x, tiles_y, total_tiles, upscale, efficiency, debug_info, efficiency_plot (IMAGE, when generate_plot is on).
Installing
cd ComfyUI/custom_nodes
git clone https://github.com/amir84ferdos/ComfyUI-ArchAi3d-Qwen.git
cd ComfyUI-ArchAi3d-Qwen
pip install -r requirements.txt
Or ComfyUI Manager โ "ArchAi3d Qwen". generate_plot wants matplotlib; the rest is pure numpy. No model downloads. Free for personal use; commercial work needs the paid license.
The honest take
Between the calculators, this is the one I'd reach for with a Flux or Qwen model: the 64-alignment, the tight defaults, and the speed all point the same direction, and the vectorized search is simply more thorough than its predecessors' loops. Its outputs feed the same downstream chain - Smart Tile SEGS, Conditioning, Detailer, Merger. If you're on an older SD model and targeting Ultimate SD Upscale directly, V1 still has the edge with its USDU-specific outputs. Otherwise, V5 is the calculator.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | โ | |
| upscale | FLOAT | 2.01โ8 | Upscale factor (e.g. 2.0 = 2x upscale) |
| upscale_method | COMBO | lanczos | Interpolation method for upscaling |
| tile_aspect_ratio | COMBO | auto | Tile aspect ratio. 'auto' matches image orientation. |
| target_tile_mp | FLOAT | 1.00.25โ4 | Target Megapixels per tile (e.g. 1.0 = ~1024x1024) |
| padding_pixels | INT | 640โ512 | Minimum overlap between tiles for blending |
| optimize_efficiency | BOOLEAN | true | Search for tile size that maximizes efficiency (vectorized) |
| mp_tolerance | FLOAT | 0.050โ1 | How much tile MP can deviate from target. 0=exact, 0.5=ยฑ50% |
| aspect_freedom | FLOAT | 0.00โ2 | Aspect ratio deviation. 0=closest 64-aligned match, 0.5=ยฑ50%, 1.0=ยฑ100% |
| upscale_tolerance | FLOAT | 0.050โ1 | Allow output size to vary for better tile fit. 0=exact, 0.05=ยฑ5%, 1.0=ยฑ100% |
| generate_plot | BOOLEAN | false | Generate efficiency heatmap (vectorized, instant) |
Outputs (13)
| Name | Type | Description |
|---|---|---|
| upscaled_image | IMAGE | โ |
| tile_width | INT | โ |
| tile_height | INT | โ |
| overlap | INT | โ |
| output_width | INT | โ |
| output_height | INT | โ |
| tiles_x | INT | โ |
| tiles_y | INT | โ |
| total_tiles | INT | โ |
| upscale | FLOAT | โ |
| efficiency | FLOAT | โ |
| debug_info | STRING | โ |
| efficiency_plot | IMAGE | โ |