Nodes/MagoNodes/WAN Tiled Sampler (Model Patch)
ComfyUI Node

WAN Tiled Sampler (Model Patch)

The same WAN tiling, no sampler attached — a model patch that plays nice with any KSampler

By MagoStudio·Created 4 months ago·Updated 17 days ago· 6
WAN Tiled Sampler (Model Patch)
  • model
  • MODEL
tiles_h2
tiles_w2
overlap_h25
overlap_w25
scale_schedule
bypass_tilingfalse
reference_latent_fulltrue
debugfalse

WanTiledSampler and this node do the same thing - per-step MultiDiffusion spatial tiling plus multiscale coarse-to-fine scheduling for WAN 2.1 / 2.2 - but they wear different hats. The all-in-one sampler replaces KSamplerAdvanced outright. WanTiledSamplerPatch is the MODEL → MODEL version: same tiling and scale controls, no sampler settings at all. You drop it between your model and any vanilla sampler - KSampler, KSamplerAdvanced, SamplerCustom, whatever you already have wired - and it just patches the model.

The patch shape isn't a compromise; it's the better fit for a couple of real setups. Most importantly, WAN 2.2's high/low-noise two-sampler split. In that architecture the high-noise model handles motion and composition, the low-noise model refines detail, and each runs through its own sampler. With this patch you put one on each model and the per-pass step indices resolve automatically - the wrapper maps the incoming sigma to the nearest entry in the sampler's sigma schedule to recover a 0-based step index, local to each pass. No fiddling with step offsets across two samplers.

How it works

It installs a wrapper on the model's model_function_wrapper slot, which ComfyUI calls for every model evaluation - every sigma step, cond and uncond. Each call splits the latent into overlapping spatial tiles, runs the model per tile at a training-distribution token count, and blends the predictions back with trapezoidal windows. Because blending happens at every step, all tiles share one denoising trajectory, so content never diverges. Temporal frames are never split, so causal attention stays intact.

The same I2V caveat applies as the sampler version: tiling alone handles spatial token count, but I2V motion drifts per tile over time. That's what the scale_schedule input fixes - while the scheduled resolution is below 100%, the whole frame runs downscaled in one pass so global motion is decided coherently, then full-res tiling kicks in for detail.

Tile geometry is resolved lazily on the first model call and cached per resolution, since the patch node never sees the latent ahead of time. That's also why it composes so cleanly: it needs no knowledge of the sampler's steps, scheduler, denoise, or start_step.

The inputs that matter

  • tiles_h / tiles_w - spatial tiles, default 2×2; 1 disables an axis.
  • overlap_h / overlap_w - overlap as a percentage of tile size (0–50%), default 25. Same guidance as the sampler: 25% is the sweet spot for moderate cross-tile motion.
  • scale_schedule - the multiscale plan, e.g. {0:50, 15:100} for I2V. Empty = always full-res tiling.
  • bypass_tiling - skip tiling (unless a schedule is set).
  • reference_latent_full - keep on for I2V: full reference frame passed to every tile as global context.
  • debug - prints tile layout, blend sanity check, and per-step decisions to the console.

Output is a MODEL, ready to plug into whatever sampler and guider you're already using.

Installing

Ships in MagoStudio/ComfyUI-MagoNodes: ComfyUI Manager → search "ComfyUI-MagoNodes", or

cd ComfyUI/custom_nodes
git clone https://github.com/MagoStudio/ComfyUI-MagoNodes

Restart ComfyUI. No extra dependencies.

The gotcha

Apply this patch last in a chain of model patches. It needs the model_function_wrapper slot - an existing wrapper is chained through, but a later patch that overwrites the slot without chaining drops your tiling silently. If tiling mysteriously stops, reorder your patch chain. And for distilled WAN, remember cfg = 1 - the patch doesn't touch sampler settings, but your KSampler should.

CategoryMago Nodes/Sampling

Inputs (9)

NameTypeDefaultDescription
modelMODEL
tiles_hINT21–8Number of spatial tiles along the height axis. Set 1 to disable.
tiles_wINT21–8Number of spatial tiles along the width axis. Set 1 to disable.
overlap_hINT250–50Overlap between height tiles, % of tile height (0–50%).
overlap_wINT250–50Overlap between width tiles, % of tile width (0–50%).
scale_scheduleoptSTRINGMultiscale (coarse-to-fine) schedule, step → resolution %. e.g. {0:25, 10:50, 20:100} runs the WHOLE frame downscaled to 25% for steps 0–9, 50% for 10–19, then full-res from 20 (held until next key). While scale < 100% the frame runs in one pass (no tiling) so global motion stays coherent — the I2V fix. Step indices are local to each sampler pass. Empty = always 100%.
bypass_tilingoptBOOLEANfalseSkip tiling (unless a scale_schedule is set).
reference_latent_fulloptBOOLEANtruePass the full reference frame to every tile (I2V global context) instead of cropping it to the tile region. Keep on for I2V.
debugoptBOOLEANfalsePrint tile layout, blend-weight sanity check, and per-step scale/tile decisions to the console.

Outputs (1)

NameTypeDescription
MODELMODEL