XB-BOX - Chunk Visualization
See your spatial and temporal chunks before you blow your VRAM budget
- Image_Input
- preview_image
Chunking is how video models run on small GPUs: you slice the video into spatial tiles and temporal chunks, process them, and stitch it back together. The problem is that chunking math is invisible - you set tile sizes and overlaps and have no idea how many batches that actually produces until the sampler either works or OOMs. XB_ChunkVisualization makes the math visible: you feed it your planned resolution, frame count, tile size, and overlap, and it renders a preview image showing exactly how your image would be carved up and how many chunks/batches that configuration creates.
It's the visualization half of XB_ToolBox's "visual learning" philosophy - the pack ships an accompanying VRAM calculator for the numbers side. This node is the picture side. If you've ever tuned tile overlap by trial and error, this is the node that turns the trial into a preview.
How it works
The node runs a simple chunk-splitting simulation (the same chunk_size/stride = chunk_size - overlap logic a real chunked sampler uses) and draws it:
- Spatial: it computes X and Y chunk boundaries across
Image_Width×Image_HeightwithSpatial_Tile_SizeandSpatial_Tile_Overlap, then draws the tiling grid on the preview image. - Temporal: it computes how
Image_Framessplits intoTemporal_Chunk_Sizechunks withTemporal_Chunk_Overlap, and shows the count. - It multiplies the three chunk counts into
total_batches- the number of discrete passes your sampler will actually run - and reports it. - If you connect an
Image_Input, it uses that image's real dimensions instead of the width/height fields, so you can preview the chunking of an actual frame.
Stat_Mode lets you isolate one axis (Spatial Only, Temporal Only, or both), and Current_Stage (Encode Stage/Decode Stage) flags which stage you're budgeting for. Available_VRAM_GB feeds the VRAM estimate it overlays, so the preview doubles as a budget check.
The inputs that matter
- Stat_Mode - which chunk axes to show.
- Available_VRAM_GB - your card's VRAM, for the estimate.
- Image_Width / Image_Height / Image_Frames - the planned output geometry (ignored if you connect
Image_Input). - Spatial_Tile_Size / Spatial_Tile_Overlap - the tile square and its overlap. Bigger overlap = more chunks per tile, more batches.
- Temporal_Chunk_Size / Temporal_Chunk_Overlap - the time-axis chunking. Note the temporal defaults (
33size /4overlap) are the classic Wan-style chunk settings.
Output: preview_image - the annotated IMAGE, which you can wire into any preview/save node to see it on screen.
Installing
Part of XB_ToolBox - ComfyUI Manager → XB_ToolBox, or
cd ComfyUI/custom_nodes
git clone https://github.com/WJLUOXIAO/XB_ToolBox.git
restart, zero extra deps. Pure visualization, no model involved.
Common issues
- Preview shows nothing - it still outputs an IMAGE, so wire it into a Preview Image node; the pack doesn't auto-preview.
- Numbers disagree with the real sampler - this is a model of the chunking, matching the common chunk-split convention, but a specific sampler (or ComfyUI's own tile VAE decode) may round differently. Treat it as a close planner, not a contract.
- Overlap ≥ chunk size - the code clamps overlap to 90% of chunk size internally, so don't be surprised if a crazy overlap setting doesn't produce the crazy count you typed.
Where this earns its place: you're about to run a 121-frame, 1024² video on 12GB and you have a knot in your stomach about whether it'll fit. Set the tile and chunk knobs, look at the total batch count, and then commit to the run. Five seconds of preview, five minutes of generation you didn't waste.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| Stat_Mode | COMBO | Spatial & Temporal | 3 options: Spatial Only, Temporal Only, Spatial & Temporal |
| Available_VRAM_GB | FLOAT | 12.00.1–128 | — |
| Image_Width | INT | 102464–8192 | — |
| Image_Height | INT | 102464–8192 | — |
| Image_Frames | INT | 11–10000 | — |
| Current_Stage | COMBO | Decode Stage | 2 options: Encode Stage, Decode Stage |
| Spatial_Tile_Size | INT | 51264–8192 | — |
| Spatial_Tile_Overlap | INT | 640–4096 | — |
| Temporal_Chunk_Size | INT | 338–10000 | — |
| Temporal_Chunk_Overlap | INT | 40–1000 | — |
| Image_Inputopt | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| preview_image | IMAGE | — |