๐งฎ Smart Tile Calculator
Do the tiled-upscale math so you don't have to
- image
- scaled_image
- upscale_by
- tile_width
- tile_height
- mask_blur
- tile_padding
- seam_fix_width
- seam_fix_mask_blur
- seam_fix_padding
- tiles_x
- tiles_y
- total_tiles
- efficiency
- crop_factor
- output_width
- output_height
- debug_info
- guide_size
- bundle
The annoying part of tiled upscaling was never the sampling - it's the arithmetic. Pick a tile size too small and you're sampling four hundred tiles; too big and you OOM. The original Smart Tile Calculator is a math node that figures it out for you: it analyzes your image's dimensions, searches tile sizes and upscale factors together, and hands you a complete set of numbers you can plug straight into Ultimate SD Upscale. It's the opening move of the "Smart Tile" subsystem in ComfyUI-ArchAi3d-Qwen (Amir Ferdos's pack - the tiling half that the README doesn't document).
What it optimizes
The core tension it solves: your target upscale factor and your tile size interact. If you pick a 2x upscale and a 1024px tile, the last row and column of tiles usually overhang - and every pixel of overhang is wasted VRAM. The node runs a two-phase search:
- Phase 1: hunt for a mathematically "perfect" alignment - a tile size and upscale that divide the output cleanly (100% efficiency, zero waste).
- Phase 2: if no perfect fit exists, fall back to a near-perfect brute-force search (95%+ efficiency).
upscale_tolerance is the lever that makes this work: it's how much the actual upscale may deviate from your target (default 0.5 = ยฑ50%), because loosening the upscale constraint is what frees the tile grid to align perfectly.
Inputs that matter
- image - the source, whose aspect ratio drives everything.
- target_upscale - your desired factor (default 2).
- min_tile_mp / max_tile_mp - the megapixel range to search. The tooltip notes 2.0 MP is the sweet spot for z-image-turbo. Set min = max to force a fixed tile size.
- scaling_mode -
Proportionalscales blur/padding with tile size;Fixeduses USDU defaults. - overlap_scale - a global multiplier on overlap (0.5 = half the overlap, 1.5 = 50% more).
Outputs
Nineteen of them, but they fall into three groups. Grid geometry: tile_width, tile_height, tiles_x, tiles_y, total_tiles, overlap-related values (tile_padding, mask_blur, seam_fix_width, seam_fix_mask_blur, seam_fix_padding), which map 1:1 onto Ultimate SD Upscale's inputs. The image: scaled_image (already upscaled) and output_width/output_height. Bookkeeping: upscale_by, efficiency, crop_factor, guide_size, debug_info, and - the one to notice - bundle, a SMART_TILE_BUNDLE that carries everything to the newer Smart Tile SEGS/Conditioning/Detailer nodes so you don't wire fifteen cables.
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". Pure math - no model downloads. Free for personal use; paid license for commercial work.
The honest take
This is the oldest member of the calculator family, and its successors (V3, V4, V5, the Solver) are stricter about 64-pixel alignment, which modern transformer models like Flux and Qwen genuinely want. Use V1 if you're targeting Ultimate SD Upscale with an SD1.5/SDXL model or z-image-turbo; reach for the newer ones when the model is Flux-class. Either way, the bundle output is the upgrade path - it's how this old node talks to the rest of the Smart Tile suite.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | Input image to analyze for optimal tile/upscale calculation | |
| target_upscale | FLOAT | 2.000.5โ4 | Desired upscale factor (will be optimized within tolerance) |
| min_tile_mp | FLOAT | 1.000.5โ4 | MINIMUM tile megapixels to search. Set equal to max for fixed tile size. |
| max_tile_mp | FLOAT | 2.000.5โ4 | MAXIMUM tile megapixels (2.0 for z-image-turbo). Node searches min to max. |
| upscale_tolerance | FLOAT | 0.500โ0.75 | How much upscale can deviate from target (0.5 = ยฑ50%). More tolerance = better optimization. |
| scaling_mode | COMBO | Proportional | Proportional: scale blur/padding with tile size. Fixed: use USDU defaults |
| overlap_scale | FLOAT | 1.000.25โ2 | Global overlap multiplier: 1.0=100%, 0.5=50% less overlap, 1.5=50% more overlap |
Outputs (19)
| Name | Type | Description |
|---|---|---|
| scaled_image | IMAGE | โ |
| upscale_by | FLOAT | โ |
| tile_width | INT | โ |
| tile_height | INT | โ |
| mask_blur | INT | โ |
| tile_padding | INT | โ |
| seam_fix_width | INT | โ |
| seam_fix_mask_blur | INT | โ |
| seam_fix_padding | INT | โ |
| tiles_x | INT | โ |
| tiles_y | INT | โ |
| total_tiles | INT | โ |
| efficiency | FLOAT | โ |
| crop_factor | FLOAT | โ |
| output_width | INT | โ |
| output_height | INT | โ |
| debug_info | STRING | โ |
| guide_size | INT | โ |
| bundle | SMART_TILE_BUNDLE | โ |