Anima XY Matrix (JSON List)
Turn one Anima JSON prompt into a whole artist × background sweep
- json_text
- columns
- x_labels
- y_labels
The whole point of asking an LLM for a prompt is that it gives you one JSON with every field pre-filled. The whole pain is that you want to test variations of it - this artist against that artist, this background against that one - and you don't want to re-prompt the LLM sixty times to get sixty variants. Anima XY Matrix (JSON List) is the node that does that expansion for you: one base JSON in, a cross-product list of JSONs out, each cell swapping in one value from your X list and one from your Y list.
It's built around the Anima prompt scheme (Circlestone's 2B anime model), where a prompt is eight named parts - artist, style, environment, character, series, tags, quality, count, neg - but the mechanism is generic enough that any structured JSON with named string fields works.
How it works
You give it the base json_text, pick an x_field (say artist) with an x_list (one per line, @artist1, @artist2...), and a y_field (say environment) with a y_list. It produces the row-major cross product: every Y against every X, so y0×x0, y0×x1, ..., exactly matching how XY Plot (Labels) lays out a grid. Each cell is the original JSON with the chosen fields swapped.
The json_text output is a list - the node sets OUTPUT_IS_LIST, so ComfyUI's list mapping fans it out and runs your sampler once per cell. It also hands you columns (just len(x_list)) plus x_labels and y_labels, which are meant to be fed straight into SimpleChatXYPlot so the grid you generate gets labelled for free.
Options worth knowing
auto_y_from_x_when_empty- ify_listis empty it reusesx_list, so an artist × artist matrix is a zero-extra-typing job.same_field_behavior- when X and Y are the same field,override(cell keeps Y's value) vscombine(both tags joined). Combine is the default and usually what you want for tags.pair_join/custom_join- how the two values get joined in the cell: newline, comma, space, or your own separator.diagonal_single- on the diagonal where X==Y, use the single value instead of doubling it. Keep it on.matrix_mode-full,upper_triangle, ordiagonal_only. For artist × artist you often only want the upper triangle, which is also whatXY Plotknows how to draw with a gray-masked half.
Downstream chain
json_text (list) → Prompt JSON Unpack → typed positive/negative/params → your KSampler → batch of images → XY Plot (Labels), with x_labels/y_labels from this node. That whole loop is the pack's flagship workflow and it works because this node produces both the prompts and the labels in one pass.
Installing and gotchas
cd ComfyUI/custom_nodes
git clone https://github.com/Moeblack/ComfyUI-SimpleChat
Restart, or use Manager and search "ComfyUI-SimpleChat". Only dep is aiohttp.
Two real friction points. First, the base JSON is parsed with a forgiving parser that strips ```json fences, deletes line comments (// and #), and even repairs missing commas between top-level keys - so it tolerates hand-edited slop, but feed it genuinely broken JSON and the error message is in Chinese. Second, include_environment_in_positive (default on) decides whether environment is baked into the assembled positive prompt. If you're swapping environments in an XY test and you consume positive downstream, leave it on so each cell actually reflects its Y value; turn it off when you want environment to stay out of positive and apply only through whatever consumes the JSON directly. Either way, environment itself is still set in every cell's JSON.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| json_text | STRING | — | |
| strip_code_fence | BOOLEAN | true | — |
| x_field | COMBO | artist | 9 options: artist, style, environment, character, series, tags, +3 |
| x_list | STRING | @artist1 @artist2 | — |
| y_field | COMBO | environment | 9 options: artist, style, environment, character, series, tags, +3 |
| y_list | STRING | sunset street night city | — |
| include_environment_in_positive | BOOLEAN | true | — |
| auto_y_from_x_when_empty | BOOLEAN | true | If y_list is empty, reuse x_list (useful for artist x artist matrix). |
| same_field_behavior | COMBO | combine | When x_field == y_field (e.g. artist), choose overwrite or combine. |
| pair_join | COMBO | newline | 4 options: newline, comma, space, custom |
| custom_join | STRING | \n | Used when pair_join=custom. Use \n for newline. |
| diagonal_single | BOOLEAN | true | When X==Y, use single value on diagonal (recommended). |
| matrix_mode | COMBO | full | When x_field==y_field (e.g. artist x artist), choose full matrix or run fewer cells. |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| json_text | STRING | — |
| columns | INT | — |
| x_labels | STRING | — |
| y_labels | STRING | — |