Nodes/Comfyui_TTP_Toolset/TTP Smart Tile Loop Source
ComfyUI Node Runs on cloud

TTP Smart Tile Loop Source

The node that hands your sampler one tile at a time

By TTPlanetPig·Created 2 years ago·Updated about a month ago· 1,030
TTP Smart Tile Loop Source
  • tile_set
  • clip
  • image
  • tile_task
  • index
  • count
  • done
  • status
  • prompt
  • negative
  • caption
  • label
  • prompt_tag
  • positive_conditioning
  • negative_conditioning
session_iddefault
restart_request0
loop_request0

This is the node that makes Smart Tile 2.0 actually usable instead of a nightmare of copy-pasted sampler chains. Give it a tile set with four tiles or forty, and it dispenses them one at a time - same sampler, same VAE Encode/Decode, run repeatedly - instead of you wiring up a separate img2img branch for every tile by hand.

What it's doing

Smart Tile's whole pitch is object-aware tiling: instead of a fixed grid that might slice a face in half, you build (or auto-detect) variable-size tiles around the things that actually need detail - face, hands, text, foreground objects - while the background stays as one big tile. That only works in practice if running four or sixteen of those tiles through img2img doesn't mean duplicating your entire sampler graph. So Loop Source and its partner Loop Collect turn the tile set into a queue: Loop Source pops the current tile out, you sample it, Loop Collect files the result back in and moves the pointer forward, and you re-queue the same graph until it's done. It's the same crop-process-stitch shape the wider ecosystem uses for masked inpainting, just running over a whole set of tiles instead of a single mask.

Inputs and outputs that matter

tile_set is the layout coming from Interactive Crop (optionally passed through the QwenVL prompt builder, Prompt Override, or Semantic Rank first). session_id is a plain string, default "default" - give two independent loops running in the same workflow different session IDs so their tile pointers don't collide. restart_request and loop_request are the loop's counters rather than triggers: bump loop_request each time you re-queue to actually advance to the next tile, and bump restart_request to reset back to tile zero without disturbing anything else about the run.

Wire the optional clip input if you want the node to encode prompts for you - connect your CLIP loader and Loop Source will hand you positive_conditioning and negative_conditioning directly, so you skip a separate CLIPTextEncode per tile.

Outputs worth knowing: image is the current tile's pixels, straight into your VAE Encode. tile_task has to go to Loop Collect so it knows which tile this run belongs to - don't skip wiring it. index/count tell you where you are in the loop, done flags when you're past the last tile, and status is a plain-text progress readout. prompt, negative, caption, label, and prompt_tag are the per-tile text fields - whatever QwenVL Prompt Set Builder or Prompt Override wrote onto this tile earlier in the chain comes back out here, ready to feed your text encoder.

Installing it

ComfyUI Manager: search "Comfyui_TTP_Toolset", install, restart. Or manually:

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

One clone gets the entire pack, Loop Source included - there's no separate download for this node, and it needs no model weights of its own. (If you're planning to use the QwenVL auto-prompting path upstream of it, that's a separate model file - see that node's article.)

Where people get tripped up

If your tile keeps repeating instead of advancing, you almost certainly forgot to bump loop_request before re-queuing - a lot of people expect the loop to advance automatically the way a Python for loop would, but this pattern only moves forward because you told it to. If two tile sets seem to be interfering with each other, check session_id on both Loop Source nodes - a shared default session across two loops is the classic way to scramble which tile goes where. And if prompt comes back empty, that just means nothing upstream ever wrote a prompt onto the tile set - run it through Prompt Override or the QwenVL builder first, or feed your own text encoder off the tile's label instead.

CategoryTTP/Smart Tile

Inputs (5)

NameTypeDefaultDescription
tile_setTTP_SMART_TILE_SET
session_idSTRINGdefault
restart_requestINT00–2147483647
loop_requestINT00–2147483647
clipoptCLIP

Outputs (13)

NameTypeDescription
imageIMAGE
tile_taskTTP_SMART_TILE_TASK
indexINT
countINT
doneBOOLEAN
statusSTRING
promptSTRING
negativeSTRING
captionSTRING
labelSTRING
prompt_tagSTRING
positive_conditioningCONDITIONING
negative_conditioningCONDITIONING