๐งฉ Smart Tile Solver V6.2 (Matrix Search)
The tile planner that brute-forces every grid so your upscale isn't wasting VRAM
- image
- upscaled_image
- tile_width
- tile_height
- overlap
- output_width
- output_height
- tiles_x
- tiles_y
- total_tiles
- latent_tile_w
- latent_tile_h
- actual_upscale
- efficiency
- debug_info
- tile_params
If you've ever tiled an upscale by hand, you know the grind: pick a tile size, watch 0.4 of a tile dangle off the edge, round up to 4 tiles, and eat the wasted VRAM. The Smart Tile Solver V6.2 is the fix for exactly that. It's the planning node in the "Smart Tile" half of the ArchAi3d pack - feed it your image, tell it how big you want the result and how much VRAM per tile you can afford, and it brute-forces every valid combination of tile size, grid layout, and overlap to find the one with the highest efficiency. The author claims 95โ100%, and honestly, the math backs it up.
How it works
The key idea is in the name: Matrix Search. Instead of picking a tile size and seeing how many fit (the old "tile-first" approach), it generates all valid tile dimensions within your megapixel tolerance, all grid configs up to 12ร12, all overlaps in your range, then evaluates ~50,000+ combinations at once using NumPy broadcasting. Coverage is tile_w * tiles_x - overlap * (tiles_x - 1), and efficiency is output pixels divided by processed pixels. It picks the argmax and upscales your image to that exact output size with the interpolation method you chose (default lanczos).
The two tolerance sliders are what give the solver room to optimize. upscale_tolerance (default 0.1) lets the output drift from your target upscale factor; mp_tolerance (default 0.3) lets tile size drift from target_mp. Crank both up if you care about VRAM efficiency more than hitting an exact resolution. divisibility matters more than it looks: 64 for Flux/Qwen-Image, 8 for SD1.5. And output_mode has three personalities - shrink_only (never exceed target), allow_grow, and force_tile_size, the last one activating the optional forced_tile_width/forced_tile_height pins.
What comes out
The upscaled_image output is the whole image upscaled to the solved output size (this is your img2img base). Everything else is the plan:
tile_width,tile_height,overlap- feed these into a USDU node's tile fieldsoutput_width,output_height,tiles_x,tiles_y,total_tileslatent_tile_w/h- tile size รท 8, handy for latent-space nodesefficiencyanddebug_info- the debug string prints the searched/valid counts and the top 10 candidates, which is genuinely useful for learning why it picked what it didtile_params- aTILE_PARAMSbundle that carries the whole plan in one wire, used by the pack's cropper and conditioning nodes
Installing it
This is one node in the bigger ComfyUI-ArchAi3d-Qwen pack by Amir Ferdos (ArchAi3d), the architect behind the Qwen-VL interior-design tooling. Install via ComfyUI Manager (search "ArchAi3d Qwen"), or:
cd ComfyUI/custom_nodes
git clone https://github.com/amir84ferdos/ComfyUI-ArchAi3d-Qwen.git
cd ComfyUI-ArchAi3d-Qwen
pip install -r requirements.txt
Then restart. The USDU/tile family only needs what ComfyUI already ships (torch, numpy, Pillow); the heavy deps in requirements.txt - sam3, opencv, timm, google-genai and friends - are for other nodes in this pack. Licensing is worth a glance: free for personal use, but commercial work requires a paid license from the author.
Where people get burned
The solver is a planner, not a sampler - it returns a clean upscaled image and a plan, and the plan is only as good as what you do with it. If you wire its output into the pack's "No Upscale" USDU variants, keep safe_guard on so mismatches between the plan and the node's tile fields error out instead of silently producing a wrong grid. Also, the target_mp default of 1.0 assumes roughly a 1024ร1024-class tile; drop it toward 0.25โ0.5 if you're on 6โ8 GB. It's a front-end node, so judge it by whether its plan gives you clean seams downstream - and it usually does.
Inputs (14)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | โ | |
| upscale_by | FLOAT | 2.01โ8 | Target upscale factor |
| upscale_tolerance | FLOAT | 0.100โ0.5 | How much output can deviate from target (ยฑ10% = 0.1). Higher = more freedom to optimize. |
| target_mp | FLOAT | 1.00.25โ4 | Target megapixels per tile (VRAM usage) |
| mp_tolerance | FLOAT | 0.300โ1 | How much tile MP can deviate from target (ยฑ30% = 0.3). Higher = more tile size options. |
| min_overlap | INT | 640โ512 | Minimum overlap between tiles for blending |
| max_overlap | INT | 25632โ512 | Maximum overlap to search |
| divisibility | COMBO | 64 | Tile alignment (64 for Flux/Qwen, 8 for SD1.5) |
| ar_constraint | COMBO | 16:9 max | Maximum aspect ratio deviation for tiles |
| upscale_method | COMBO | lanczos | Interpolation method for upscaling |
| output_mode | COMBO | shrink_only | shrink_only: Output never exceeds target. allow_grow: Can grow within tolerance. |
| aspect_lock | BOOLEAN | true | Lock output aspect ratio to match input (prevents distortion) |
| forced_tile_widthopt | INT | 00โ4096 | Force specific tile width (0 = auto). Only used when output_mode='force_tile_size' |
| forced_tile_heightopt | INT | 00โ4096 | Force specific tile height (0 = auto). Only used when output_mode='force_tile_size' |
Outputs (15)
| 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 | โ |
| latent_tile_w | INT | โ |
| latent_tile_h | INT | โ |
| actual_upscale | FLOAT | โ |
| efficiency | FLOAT | โ |
| debug_info | STRING | โ |
| tile_params | TILE_PARAMS | โ |