XB-BOX - Sampler Chunk Master
Seeing your video's memory footprint before it OOMs
- model
- latent_info
- model
- preview_image
Video generation on a consumer GPU is a game of not-having-enough-memory, and the people who win play it with eyes open. XB_SamplerChunkMaster is the pack's visualization-and-control node for that game: it patches your model to slice sampling into spatial tiles and temporal chunks (so a giant latent never exists in one piece), and it draws you a picture of exactly how those chunks will lay out. Two outputs, one job - make the OOM curse visible and preventable.
It's aimed squarely at Wan and LTX-class video models, which is why its patch keys (wan_tile_size, wan_frame_chunk, and the pack's rocm_optimized flag) are written into the model's options for the Wan-family sampler to read. It pairs with the pack's Wan pipeline nodes; the model it returns carries the chunking instructions downstream.
Inputs that matter
- model - your video diffusion model, straight from the loader.
- tile_size - spatial tile, default 448. Each pass samples a tile this big instead of the full frame. Lower = less VRAM, more passes.
- tile_overlap - overlap between spatial tiles, default 32, to prevent seams.
- frame_chunk_size - how many frames per temporal chunk, default 17. This is the big memory lever for video: 17 frames at a time beats 81 at once.
- frame_chunk_overlap - temporal overlap, default 4.
- rocm_optimized - on by default; the pack's "extreme memory reclamation" strategy for AMD cards. Leave it on unless you have a reason.
- stat_mode - "Full Preview" (show the full-frame context plus chunk grid) or "Chunks Only" (just the chunking diagram). Cosmetic.
- latent_info (optional) - feed your actual latent here and the preview will reflect your real width/height/frame count instead of the default 1280×720×81.
Outputs: model (the patched model → wire to your sampler) and preview_image (the chunk diagram → wire to a preview node so you can actually look at it).
Why the preview is the point
Beginners burn most of their time tuning blind. This node's entire personality is "show, don't guess": a 2D grid on the left rendering your spatial tiles and their overlap, and a temporal bar on the right showing your frame chunks stacking up. You can see at a glance whether you're asking for 8 tiles or 64, whether your overlap will seam, whether your frame chunks actually divide your clip evenly. It turns a memory problem into a diagram you can reason about.
The honest framing
The preview is real; the chunking is a model patch that the Wan sampler honors. If you're not using a Wan-family sampler that reads these keys, the patched model may just ignore them - so this node is really a companion to the pack's Wan pipeline, not a universal sampler tiler. And chunked sampling has real seams to manage: too little overlap and you'll see tile boundaries in the output; too much and you've eaten your memory savings. The defaults (448/32/17/4) are a sane start; treat tile_size and frame_chunk_size as the two dials you tune when a run OOMs.
Install: ComfyUI Manager → search XB_ToolBox, or git clone https://github.com/wjluoxiao/XB_ToolBox.git into custom_nodes, restart. It's under "XB_ToolBox/Tile_Tools". No extra pip dependencies.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| stat_mode | COMBO | Full Preview | 2 options: Full Preview, Chunks Only |
| tile_size | INT | 448128–1024 | — |
| tile_overlap | INT | 320–128 | — |
| frame_chunk_size | INT | 171–129 | — |
| frame_chunk_overlap | INT | 40–16 | — |
| rocm_optimized | BOOLEAN | true | — |
| latent_infoopt | LATENT | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| model | MODEL | — |
| preview_image | IMAGE | — |