Nodes/ComfyUI-Apt_Preset/sampler_DynamicTileSplit
ComfyUI Node

sampler_DynamicTileSplit

Chop a big image into overlapping tiles for tiled upscaling

By cardenluo·Created 2 years ago·Updated 17 days ago· 309
sampler_DynamicTileSplit
  • image
  • image
  • stich
  • total
upscale_model
width_factor3
height_factor3
overlap_rate0.10
use_fixed_sizefalse
tile_width512
tile_height512

This is the split half of a tiled-diffusion upscale pipeline - the same idea behind Ultimate SD Upscale and Tiled Diffusion + Tiled VAE: instead of running your sampler or upscale model over a whole 4K image at once (which either doesn't fit in VRAM or gets you a blurry, low-detail result), you carve it into a grid of overlapping tiles, process each tile individually, then stitch them back together. Overlap is what stops the seams - without it, each tile makes independent decisions right up to its own edge and you get a visible patchwork when they're glued back. This node does the carving and hands you a companion stich object that its sibling, sampler_DynamicTileMerge, needs to put everything back correctly.

How it works

Feed it an image and, optionally, an upscale_model to run first - so you can upscale-then-tile in one node rather than two. Set how many tiles you want across and down (width_factor × height_factor), or switch to use_fixed_size and specify an exact tile_width/tile_height instead of a grid count. Either way, overlap_rate controls how much adjacent tiles share, which is the parameter that actually determines seam quality downstream.

The inputs and outputs that matter

  • image (required) - the source image to tile.
  • upscale_model (required, dropdown) - an ESRGAN-style upscale model to apply before tiling, if you want the tiling to happen at a higher resolution than the input.
  • width_factor/height_factor (default 3, range 1–10) - grid dimensions: 3×3 gives you nine tiles. This is the simpler way to think about tile count if you don't care about the exact pixel size of each tile.
  • overlap_rate (default 0.1, range 0–0.95) - fraction of each tile shared with its neighbors. Too low and stitched seams show; too high and you're doing redundant compute on the same pixels multiple times. 0.1 is a reasonable middle ground to start from.
  • use_fixed_size (default false) - flip this on to specify exact tile_width/tile_height (32–4096, step 32) instead of a grid count. Useful when you need tiles to match a specific model's native resolution rather than however the grid math happens to divide your image.
  • Outputs: image (the tiles, as a batch), stich (a STICH3-typed bundle of tiling metadata - position, overlap, original dimensions - that the merge node needs), and total (tile count, handy for a progress bar or a loop counter elsewhere in your graph).

How to install it

Search ComfyUI-Apt_Preset in ComfyUI Manager, or clone it manually:

cd ComfyUI/custom_nodes
git clone https://github.com/cardenluo/ComfyUI-Apt_Preset.git

install.bat handles Windows dependencies; on Linux or Mac, read it and pip-install what it lists, or let ComfyUI Manager fill gaps on first load. If you're using the upscale_model input, you'll need an actual upscale checkpoint (a 4x-UltraSharp or similar ESRGAN-family model) in ComfyUI/models/upscale_models - this node doesn't ship one.

Common issues & troubleshooting

Seams visible after merging. That's almost always overlap_rate too low for the amount each tile's content changes between passes. Push it up (0.15–0.25 is a reasonable next step) before touching anything on the merge side.

Way more tiles than expected, and it's slow. width_factor × height_factor compounds fast - 5×5 is 25 tiles, each running through your sampler independently. If you don't need that much subdivision, drop the factors, or switch to use_fixed_size and pick a tile size that divides your image more sensibly for the detail level you actually need.

stich output won't connect to anything except sampler_DynamicTileMerge. That's expected - STICH3 is this pack's own custom type, specifically shaped for its own merge node, not a general-purpose ComfyUI type other packs will recognize.

The upscale step doesn't seem to apply. Double check upscale_model is actually wired - it's a required input on this node, so if the dropdown is on "None" or empty because no model is installed, tiling still proceeds on the original resolution.

CategoryApt_Preset/chx_ksample

Inputs (8)

NameTypeDefaultDescription
imageIMAGE
upscale_modelCOMBO1 options: None
width_factorINT31–10
height_factorINT31–10
overlap_rateFLOAT0.100–0.95
use_fixed_sizeBOOLEANfalse
tile_widthINT51232–4096
tile_heightINT51232–4096

Outputs (3)

NameTypeDescription
imageIMAGE
stichSTICH3
totalINT