Nodes/ComfyUI-ArchAi3d-Qwen/๐Ÿงฎ Smart Tile Calculator V5.1 (Vectorized)
ComfyUI Node

๐Ÿงฎ Smart Tile Calculator V5.1 (Vectorized)

The tile calculator that got fast enough to search everything

By amir84ferdosยทCreated 11 months agoยทUpdated 5 months agoยท 70
๐Ÿงฎ Smart Tile Calculator V5.1 (Vectorized)
  • image
  • upscaled_image
  • tile_width
  • tile_height
  • overlap
  • output_width
  • output_height
  • tiles_x
  • tiles_y
  • total_tiles
  • upscale
  • efficiency
  • debug_info
  • efficiency_plot
โ—„upscale2.0โ–บ
โ—„upscale_methodlanczosโ–บ
โ—„tile_aspect_ratioautoโ–บ
โ—„target_tile_mp1.0โ–บ
โ—„padding_pixels64โ–บ
โ—„optimize_efficiencytrueโ–บ
โ—„mp_tolerance0.05โ–บ
โ—„aspect_freedom0.0โ–บ
โ—„upscale_tolerance0.05โ–บ
โ—„generate_plotfalseโ–บ

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.

CategoryArchAi3d/Upscaling/Smart Tile

Inputs (11)

NameTypeDefaultDescription
imageIMAGEโ€”
upscaleFLOAT2.01โ€“8Upscale factor (e.g. 2.0 = 2x upscale)
upscale_methodCOMBOlanczosInterpolation method for upscaling
tile_aspect_ratioCOMBOautoTile aspect ratio. 'auto' matches image orientation.
target_tile_mpFLOAT1.00.25โ€“4Target Megapixels per tile (e.g. 1.0 = ~1024x1024)
padding_pixelsINT640โ€“512Minimum overlap between tiles for blending
optimize_efficiencyBOOLEANtrueSearch for tile size that maximizes efficiency (vectorized)
mp_toleranceFLOAT0.050โ€“1How much tile MP can deviate from target. 0=exact, 0.5=ยฑ50%
aspect_freedomFLOAT0.00โ€“2Aspect ratio deviation. 0=closest 64-aligned match, 0.5=ยฑ50%, 1.0=ยฑ100%
upscale_toleranceFLOAT0.050โ€“1Allow output size to vary for better tile fit. 0=exact, 0.05=ยฑ5%, 1.0=ยฑ100%
generate_plotBOOLEANfalseGenerate efficiency heatmap (vectorized, instant)

Outputs (13)

NameTypeDescription
upscaled_imageIMAGEโ€”
tile_widthINTโ€”
tile_heightINTโ€”
overlapINTโ€”
output_widthINTโ€”
output_heightINTโ€”
tiles_xINTโ€”
tiles_yINTโ€”
total_tilesINTโ€”
upscaleFLOATโ€”
efficiencyFLOATโ€”
debug_infoSTRINGโ€”
efficiency_plotIMAGEโ€”