Nodes/ComfyUI-ArchAi3d-Qwen/๐Ÿงฎ Smart Tile Calculator V4 (Heatmap)
ComfyUI Node

๐Ÿงฎ Smart Tile Calculator V4 (Heatmap)

Tile math, now with a heatmap you'll look at once

By amir84ferdosยทCreated 11 months agoยทUpdated 5 months agoยท 70
๐Ÿงฎ Smart Tile Calculator V4 (Heatmap)
  • 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.5โ–บ
โ—„aspect_freedom1.0โ–บ
โ—„upscale_tolerance0.00โ–บ
โ—„generate_plotfalseโ–บ

The V4 calculator is the same Flux-aware tile-math node as V3, plus one output: an efficiency heatmap. That might sound like fluff until you're staring at a tiled upscale wondering why it used a 5ร—3 grid that leaves a ragged strip at the bottom. The heatmap shows you, at a glance, where the wasted pixels are - and then you adjust the tolerances until the sweet spot moves.

It's the middle sibling in the calculator family inside ComfyUI-ArchAi3d-Qwen's "Smart Tile" subsystem (Amir Ferdos's pack - the tiling pipeline the README doesn't document). The whole point of the family is that tile-size selection is a search problem, and V4 is the version that lets you see the search space.

How it works

The mechanism is identical to V3 - same inputs, same two-phase search over tile sizes, aspect ratios and upscale factors, with 64-pixel alignment for transformer models like Flux and Qwen. The difference is generate_plot. Flip it on and the node builds a matplotlib heatmap of efficiency across the tile-size space and hands it back as an IMAGE (efficiency_plot). The bright spot is your efficient region; if your current config lands in the mush, you'll see exactly which tolerance to loosen.

That's also the honest caveat: matplotlib isn't installed with ComfyUI by default, so this one node has a real dependency. pip install matplotlib - or leave generate_plot off and it's just V3 with an extra output doing nothing.

Inputs

The full list matches V3: image, upscale (1โ€“8), upscale_method, tile_aspect_ratio, target_tile_mp, padding_pixels, optimize_efficiency, mp_tolerance, aspect_freedom, upscale_tolerance - plus generate_plot (default off).

Outputs: upscaled_image, tile_width, tile_height, overlap, output_width, output_height, tiles_x, tiles_y, total_tiles, upscale, efficiency, debug_info, and efficiency_plot (IMAGE, only meaningful 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
pip install matplotlib   # only needed for generate_plot

Or ComfyUI Manager โ†’ "ArchAi3d Qwen". No model downloads. Free for personal use; commercial use needs a license.

The honest take

The heatmap is a genuinely good debugging idea - efficiency is a 2D landscape and the tool renders it as one - but realistically you'll flip generate_plot on, confirm the grid is efficient, and never look at it again. If you'd rather not install matplotlib for that, V3 is the same node minus the plot, and V5 is the same search vectorized and instant. Pick V4 when you're optimizing a pipeline and want the visual; the other two when you just want the numbers.

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 (less wasted pixels)
mp_toleranceFLOAT0.50โ€“1.5How much tile MP can deviate from target. 0=exact, 0.5=ยฑ50%, 1.0=ยฑ100%
aspect_freedomFLOAT1.00โ€“2How much aspect ratio can change. 0=exact, 0.5=ยฑ50%, 1.0=any aspect
upscale_toleranceFLOAT0.000โ€“0.2Allow output size to vary for better tile fit. 0=exact, 0.05=ยฑ5%, 0.1=ยฑ10%
generate_plotBOOLEANfalseGenerate efficiency heatmap visualization (requires matplotlib)

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โ€”