ファンサイトに戻る

PROMPT GUIDE

How to Use the XYZ Plot (Compare Settings Side by Side)

When you wonder which CFG value is best or whether a tag is worth adding, comparing one image at a time takes a long time. With an XYZ plot you can generate images with different settings and gather them into one grid. This guide covers how to choose the axes and how to keep it from taking too long.

Last updated: approx. 3 min read

The short answer

The XYZ plot generates images that change one setting at a time and arranges them in a grid. Put the settings you want to vary (CFG, steps, sampler and so on) on the X and Y axes and keep the seed fixed. Prompt S/R swaps part of the prompt so you can compare tags at once too.

What is the XYZ plot?

It is a feature that generates images with settings changed step by step and arranges them in a grid.

Stable Diffusion WebUIs such as AUTOMATIC1111 and Forge have an "X/Y/Z plot" option among the scripts. Enter the settings and values to vary on the horizontal (X), vertical (Y) and depth (Z) axes, and it makes every combination and gathers them into one grid. In ComfyUI you can do similar comparisons by adding extra nodes (check the distributor notes for names and setup).

Main settings for an axisWhat you can compareExample values
SeedVariation with the same settings1, 2, 3, 4
CFG ScaleHow strongly the prompt applies4, 6, 8
StepsAmount of detail and time20, 30, 40
SamplerDifferences in how it drawsFrom the list in your interface
Prompt S/RDifferences when swapping tagssmile, crying, angry

Illustration usage rules

How do you use the XYZ plot? (steps)

Fix the seed and start with one setting on the X axis and one on the Y axis.

Steps to compare two settings with the XYZ plot

  1. Generate one image normally and decide the prompt and settings to compare
  2. Set the seed to a fixed number instead of -1 (to compare under the same conditions)
  3. Choose X/Y/Z plot from the scripts at the bottom of the screen
  4. Set X type to CFG Scale and enter values separated by commas in X values, such as 4, 6, 8
  5. Set Y type to another setting such as Steps and enter its values (Z can stay empty)
  6. Check the number of images (X times Y) before generating, then compare the finished grid

How do you compare tags with Prompt S/R?

It generates images by swapping a word in the prompt for each of the other words you list.

With Prompt S/R (Search/Replace), the first value is a word that is in the prompt, and the following values are the words to swap in. For example, if your prompt contains smile and the values are smile, crying, angry, you get three images side by side: smiling, crying and angry. If the first word is not in the prompt, nothing is swapped, so be careful.

How do you keep it from getting too heavy?

The number of images multiplies, so start with at most two axes and three or four values each.

Four values on X, four on Y and three on Z make 4 x 4 x 3 = 48 images. With a high resolution or Hires.fix still on, it takes a long time, so compare at a smaller size and remake only the settings you liked at full size afterwards.

ProblemCauseFix
Comparing shows no clear differenceThe seed is still randomFix the seed
Prompt S/R does not change the imageThe first word is not in the promptPut a word that is in the prompt first
It takes very long to finishToo many axes and values, or a large sizeTwo axes, three or four values, a smaller size
The labels in the grid are unreadableThe values are long textUse short values, or zoom into the grid
An out-of-memory error appearsToo many images per run or too high a resolutionLower the resolution or reduce the batch count

Rinka's tips

  • Comparing CFG and Steps first makes it easier to find the right settings for that model
  • Save the finished grids and they become a quick reference the next time you use the same model
  • Display names and details can differ by interface version. If you cannot find an option, check the documentation of your interface

For what CFG scale, steps and samplers mean: What Is CFG Scale? How to Choose Steps and Samplers →

For why you fix the seed value: What Is a Seed? Fixed, Random, and Reproducing the Same Image →

To compare how well an embedding works: How to Use Embeddings (Textual Inversion) →

Copy-and-paste example values

Paste them straight into the X values and Y values fields. The first is CFG, the second steps, and the third Prompt S/R (expressions).

4, 5.5, 7, 8.5
20, 28, 36
smile, light smile, closed eyes, surprised

FAQ

Frequently Asked Questions

Where is the XYZ plot?

In WebUIs such as AUTOMATIC1111 and Forge, "X/Y/Z plot" is in the script list below the generation panel. The display name can differ slightly by version.

Should I fix the seed?

Yes. With a random seed, chance differences get mixed in with the setting differences. Set a fixed number before comparing.

Prompt S/R does not work.

The first value must be a word that is actually in your current prompt, with the same spelling and spaces.

Can I use it in ComfyUI?

The default interface often has no feature with the same name, but adding extra nodes lets you make similar comparisons. Check the distributor notes for how to install them.

RINKA WORLD

Play in Rinka World

MORE

You may also like