XY Plot: Split Data (lab)
Turning a whole XY plot run into numbers you can actually use
- xy_plot_data
- current_page
- total_pages
- complete
The ComfyLab XY Plot system hides a lot of machinery inside a single XY_PLOT_DATA blob that the Queue node pushes to the Render node. That's great for the renderer, but useless if you're trying to do something with the state of the run - like stamping the current page number into a filename, or firing a node only when the whole batch is done. That's exactly what XY Plot: Split Data (lab) is for: it unpacks that blob into plain, wireable values.
What it does
The node has exactly one required input, xy_plot_data, and it's the custom XY_PLOT_DATA type that only comes out of XY Plot: Queue (lab). If you're not running the ComfyLab Queue → ... → Render flow, this node has nothing to feed it and there's no point adding it.
On the other side it gives you three outputs:
current_page(INT) - which page is being processed right now. Note it comes out 1-indexed, so the first page is1, not0.total_pages(INT) - how many pages the whole run has.complete(BOOLEAN) - whether processing is finished.
Internally it's about as dumb as a node gets: it reads the queue data struct and hands back current_page + 1, total_pages, and the completion flag. All the cleverness is upstream in the Queue node.
Why you'd bother
The README's own example is the best one: customizing the filename when saving. Wire current_page and total_pages into the filename_prefix of your Save Image node and every image tells you where it lived in the grid - page-2-of-5, for instance. The alternative is squinting at a grid of 20 nearly-identical images trying to remember which combo produced which cell.
complete is the more interesting one. Because the queue auto-runs, you can't just put a "final pass" node after the KSampler - it'll execute on every cell. But with complete you can gate a node (any of the switch/if nodes you already have installed) so a post-processing or save-collation step only runs on the last image. Combined with pagination in the Queue node, this is how you make a "render everything, then do one finishing step" workflow.
Installing it
It ships in the ComfyLab Pack, so you get it with the whole bundle. Through ComfyUI Manager, search for ComfyLab Pack and install. Manual install from your ComfyUI directory:
cd custom_nodes
git clone https://github.com/bugltd/ComfyLab-Pack.git
cd ComfyLab-Pack
pip install -r requirements.txt
# restart ComfyUI
The pack's deps are light - jsonschema, json5, pyyaml, webcolors, opencv-python - and there are no model files to download. opencv-python is the chunky one on first install.
Gotchas
The two things that trip people up: current_page being 1-indexed while a lot of ComfyUI internals are 0-indexed, and the fact that this node only makes sense inside the XY Plot flow. It's a helper, not a standalone tool - if you drag it in expecting it to do something on its own, it'll just sit there red, waiting for an XY_PLOT_DATA connection it's never going to get.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| xy_plot_data | XY_PLOT_DATA | data sent by the queue, to indicate the cuttent state of processing |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| current_page | INT | current page |
| total_pages | INT | total number of pages |
| complete | BOOLEAN | is processing complete? (BOOLEAN) |