WAN Tiled Sampler (Model Patch)
The same WAN tiling, no sampler attached — a model patch that plays nice with any KSampler
- model
- MODEL
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;1disables 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.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| tiles_h | INT | 21–8 | Number of spatial tiles along the height axis. Set 1 to disable. |
| tiles_w | INT | 21–8 | Number of spatial tiles along the width axis. Set 1 to disable. |
| overlap_h | INT | 250–50 | Overlap between height tiles, % of tile height (0–50%). |
| overlap_w | INT | 250–50 | Overlap between width tiles, % of tile width (0–50%). |
| scale_scheduleopt | STRING | Multiscale (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_tilingopt | BOOLEAN | false | Skip tiling (unless a scale_schedule is set). |
| reference_latent_fullopt | BOOLEAN | true | Pass the full reference frame to every tile (I2V global context) instead of cropping it to the tile region. Keep on for I2V. |
| debugopt | BOOLEAN | false | Print tile layout, blend-weight sanity check, and per-step scale/tile decisions to the console. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MODEL | MODEL | — |