Image Batch Test Pattern (Swwan)
The numbered-frame trick for debugging batch order
- IMAGE
Batch order is invisible. That's the whole problem this node exists for.
You shuffle a batch, reverse it, interleave it, slice a range out of it, or fold five branches through Image Batch Multi - and then you hand it to Video Combine, and what you get back is either right or subtly wrong in a way that takes three renders to spot. Image Batch Test Pattern replaces "an image" with "an image that has its own index printed on it," so the preview tells you the truth immediately.
What it generates
Inputs, all required: batch_size (INT, default 1, 1–255), start_from (INT, default 0, 0–255), text_x and text_y (INT, default 256, pixel offsets for the text), width and height (INT, default 512, minimum 16), font (an enum drawn from the pack's own fonts folder), and font_size (INT, default 255, 8–4096).
One output: IMAGE.
It builds batch_size black frames, each with a sequential number drawn on it starting at start_from, then stacks them into a batch. The text colour is randomised per frame - that's deliberate, not a bug, and it's genuinely handy: two adjacent frames that look identical except for the number will still be distinguishable at a glance when one is cyan and the other is orange.
start_from is the setting doing the real work. Set it to 100 and you can prove that a batch node preserved absolute indices; set it to 0 and you've got a plain 0..N-1 ladder for reading ordering.
The workflows this unsticks
- Ordering through a batch chain. Feed the pattern into Reverse Image Batch, then Get Image Range From Batch, then Image Grid Composite 2x2. Now you can see exactly which tile index became which output frame, instead of reasoning about it.
- Video Combine timing. A numbered sequence with known
batch_sizeand a known fps tells you what the container actually did with frame count and duration. - Grid round-trips. Generate a 3×3 pattern through Image Concat Multi in
gridmode, then push it through Image Grid to Batch and confirm the tiles come back in reading order. This is the fastest way I know to find out that you hadcolumnsset to something other than what you thought. - Does my branch run at all? A pattern frame on a dead branch is a visible black hole in a grid rather than a mystery.
Details worth knowing
The font dropdown is populated from the pack's own font directory, which it registers with ComfyUI as swwan_fonts at import time. The sample list the pack ships is FreeMono.ttf, FreeMonoBoldOblique.otf and a third entry, and the historical TTNorms-Black.otf value has been remapped to FreeMono because that font could not be redistributed. If you drop your own .ttf or .otf into ComfyUI/custom_nodes/ComfyUI_Swwan/fonts/, restart, and it appears in the list - same folder the Add Label node reads from.
The text is drawn at text_x, text_y in pixels, so at the default font_size=255 you generally want to nudge those to keep the number inside the frame, or raise width/height.
Install
Nothing here needs a model, a GPU, or an API key - it's PIL drawing text on a canvas.
cd /path/to/ComfyUI/custom_nodes
git clone https://github.com/aining2022/ComfyUI_Swwan.git
cd ComfyUI_Swwan
python -m pip install -r requirements.txt
Windows portable:
.\python_embeded\python.exe -m pip install .\ComfyUI\custom_nodes\ComfyUI_Swwan\requirements.txt
Restart ComfyUI, force-refresh the browser, and search Swwan; the node lives under Swwan/Advanced/IO and the display name carries the (Swwan) suffix so you can tell it apart from KJNodes' original.
One caveat if you keep both packs installed: this is one of the nodes the 1.0.0 release re-ID'd to stop collisions with KJNodes, and the pack explicitly does not register alias names. An old workflow will show a missing node until you migrate it (python scripts/migrate_workflow.py old.json --dry-run from the repo root). That's the trade the author made, and it's the right one - but it does mean old graphs need the migration pass rather than just working.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| batch_size | INT | 11–255 | — |
| start_from | INT | 00–255 | — |
| text_x | INT | 2560–4096 | — |
| text_y | INT | 2560–4096 | — |
| width | INT | 51216–4096 | — |
| height | INT | 51216–4096 | — |
| font | COMBO | 3 options: FreeMono.ttf, FreeMonoBoldOblique.otf, TTNorms-Black.otf | |
| font_size | INT | 2558–4096 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |