Nodes/Comfyui_TTP_Toolset/TTP Smart Tile Stack Order
ComfyUI Node Runs on cloud

TTP Smart Tile Stack Order

The manual override when auto-ranking isn't enough

By TTPlanetPig·Created 2 years ago·Updated about a month ago· 1,030
TTP Smart Tile Stack Order
  • tile_set
  • tile_set
  • order_json
  • summary
tile_orderT1,T3,T2
top_orderfirst_on_top
composite_modereplace_tile
replace_tile_shapekeep

Semantic Rank does a good job of guessing which tiles should sit on top based on content - faces above backgrounds, small detail tiles above big context ones. But sometimes you just know better than the heuristic, and you want to type out "T1, then T3, then T2, everything else behind" and have it stick. That's this node: a blunt, explicit override for tile draw order.

What it actually does

You give it a comma-separated list of tile names in tile_order - the README's own example is T1,T3,T2 - and it puts exactly those tiles at the front of the stack, in that order, while every tile you didn't list stays behind them. It's a deliberately simple mechanism: no scoring, no heuristics, just "these tiles, this order, on top." The pack's own guidance is to place it after your final Semantic Rank pass, so your manual call is what actually wins rather than getting reshuffled by the automatic ranking that runs afterward.

Two things it deliberately doesn't touch: the tiles you list keep their own blend and mask feathering settings from earlier in the pipeline. This node changes draw order and (depending on composite_mode) how hard a tile replaces what's under it - it's not a second pass at how soft the edges look.

The inputs that matter

tile_set is the tile set to reorder. tile_order is your explicit list - get the tile names right or they simply won't match anything, which fails silently rather than erroring. top_order decides how your list itself is read: first_on_top (the default) means the first name you typed ends up frontmost; last_on_top flips that. composite_mode controls how the listed tiles interact with what's beneath them once they're on top: replace_tile (default) hard-replaces the canvas under them, keep leaves the existing compositing behavior alone and only changes draw order. replace_tile_shape only matters when composite_mode=replace_tile: keep (default) doesn't change the replace shape, mask_first uses the tile's object mask when one exists (and hardens the mask's interior the way an inpaint stitch does, so only the edge actually blends), and tile_box_first ignores any mask and replaces the tile's full rectangular box regardless.

Outputs: tile_set goes on to Loop Source or straight to Assemble. order_json is the resolved ordering as data, and summary is the plain-text version - check it after running this node to confirm your tile names actually matched something.

Installing it

ComfyUI Manager: search "Comfyui_TTP_Toolset". Manual clone:

cd ComfyUI/custom_nodes
git clone https://github.com/TTPlanetPig/Comfyui_TTP_Toolset

then restart. Stack Order is pure ordering logic on the tile set's metadata - no models, nothing to download beyond the pack itself.

Where people get tripped up

The most common failure is a typo in tile_order - tile names have to match exactly what Interactive Crop (or whatever node last renamed them) actually assigned, and a mismatch just silently does nothing rather than throwing an error. Always check summary after running this node rather than assuming your list took effect. If you're using replace_tile_shape=mask_first and getting a harder edge than you expected, remember that mode intentionally hardens the mask's interior - that's not a bug, it's the same "stitch" behavior the inpainting side of the ecosystem uses to avoid a soft double-blend at the seam; switch to tile_box_first if you actually wanted the full rectangular tile replaced instead. And if you placed this node before a final Semantic Rank pass instead of after, don't be surprised when the auto-ranking quietly undoes your manual order - the README's ordering advice (Stack Order last) exists for exactly that reason.

CategoryTTP/Smart Tile

Inputs (5)

NameTypeDefaultDescription
tile_setTTP_SMART_TILE_SET
tile_orderSTRINGT1,T3,T2
top_orderCOMBOfirst_on_top2 options: first_on_top, last_on_top
composite_modeCOMBOreplace_tile2 options: replace_tile, keep
replace_tile_shapeCOMBOkeep3 options: keep, mask_first, tile_box_first

Outputs (3)

NameTypeDescription
tile_setTTP_SMART_TILE_SET
order_jsonSTRING
summarySTRING