XY Cell Prefix (Batch)
Give every cell of your XY test its own filename
- filename_prefix
Run an XY sweep and you get a grid of images with no way to tell which file is which. XY Cell Prefix (Batch) fixes the least glamorous but most annoying part of batch testing: it builds a filename_prefix list, one entry per cell in the same row-major order as the pack's Anima XY Matrix and XY Plot (Labels), so each image saves under a name that says what it was. artist1+sunset street, artist1+night city, artist2+sunset street - you finally know which cell is which without opening every file.
How it works
You feed it the same two newline-separated label lists the XY matrix produces - x_labels and y_labels - and it cross-products them in row-major order (all X for the first Y, then the next Y, matching the image batch layout exactly). Optional bits:
joiner- default+, purely for the filename; doesn't touch your prompts.diagonal_single- on the diagonal where x==y, use the single label instead oflabel+label.base_prefix- a fixed prefix prepended to every cell (e.g.runs/v2_), handy for sorting in a folder.sanitize(default on) - strips characters that aren't safe in filenames, collapses whitespace to_, and caps at 120 chars, because artist tags love slashes and colons.matrix_mode-full,upper_triangle, ordiagonal_only, mirroring the matrix node so the count of prefixes always matches the count of images.
The output is filename_prefix as a list (OUTPUT_IS_LIST), designed to plug straight into SaveImage.filename_prefix. When ComfyUI saves each image from a batch pipeline, it walks the list, so cell N gets prefix N.
Where it fits
It sits at the tail of the pack's flagship sweep: Anima XY Matrix → per-cell JSON → sampler → XY Plot for viewing, and this node feeding SaveImage so the files on disk are identifiable too. Because it only makes strings, it costs nothing to run and never touches your images - pure metadata, no pixels harmed.
Installing it
cd ComfyUI/custom_nodes
git clone https://github.com/Moeblack/ComfyUI-SimpleChat
Restart, or use Manager and search "ComfyUI-SimpleChat". Only dependency: aiohttp.
Gotchas
The prefix list is built from the labels you give it, not from what the matrix actually generated - if your matrix_mode here doesn't match the one used upstream, the filename count and the image count diverge and you get mismatched names. Keep the two nodes in the same mode. Also, diagonal_single and matrix_mode assume square label lists; if len(x) != len(y) the non-full modes silently fall back to a full grid, so don't rely on triangle modes with unequal lists. And if a cell ends up with an empty label (blank lines are skipped), you get the literal fallback name cell - check your label lists for stray empties.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| x_labels | STRING | — | |
| y_labels | STRING | — | |
| joineropt | STRING | + | — |
| diagonal_singleopt | BOOLEAN | true | — |
| base_prefixopt | STRING | — | |
| sanitizeopt | BOOLEAN | true | — |
| matrix_modeopt | COMBO | full | 3 options: full, upper_triangle, diagonal_only |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| filename_prefix | STRING | — |