AUTOMATIC1111/stable-diffusion-webui · error · ValueError
Unknown variations delimiter {variations_delimiter}
Error message
Unknown variations delimiter {variations_delimiter} What it means
Companion check in Prompt Matrix run(): variations_delimiter must be exactly 'comma' or 'space' (the ui() Radio choices). The delimiter decides whether generated prompt-matrix variations are joined with ', ' or ' ', and anything else would silently change semantics, so it fails fast.
Source
Thrown at scripts/prompt_matrix.py:65
with gr.Column():
put_at_start = gr.Checkbox(label='Put variable parts at start of prompt', value=False, elem_id=self.elem_id("put_at_start"))
different_seeds = gr.Checkbox(label='Use different seed for each picture', value=False, elem_id=self.elem_id("different_seeds"))
with gr.Column():
prompt_type = gr.Radio(["positive", "negative"], label="Select prompt", elem_id=self.elem_id("prompt_type"), value="positive")
variations_delimiter = gr.Radio(["comma", "space"], label="Select joining char", elem_id=self.elem_id("variations_delimiter"), value="comma")
with gr.Column():
margin_size = gr.Slider(label="Grid margins (px)", minimum=0, maximum=500, value=0, step=2, elem_id=self.elem_id("margin_size"))
return [put_at_start, different_seeds, prompt_type, variations_delimiter, margin_size]
def run(self, p, put_at_start, different_seeds, prompt_type, variations_delimiter, margin_size):
modules.processing.fix_seed(p)
# Raise error if promp type is not positive or negative
if prompt_type not in ["positive", "negative"]:
raise ValueError(f"Unknown prompt type {prompt_type}")
# Raise error if variations delimiter is not comma or space
if variations_delimiter not in ["comma", "space"]:
raise ValueError(f"Unknown variations delimiter {variations_delimiter}")
prompt = p.prompt if prompt_type == "positive" else p.negative_prompt
original_prompt = prompt[0] if type(prompt) == list else prompt
positive_prompt = p.prompt[0] if type(p.prompt) == list else p.prompt
delimiter = ", " if variations_delimiter == "comma" else " "
all_prompts = []
prompt_matrix_parts = original_prompt.split("|")
combination_count = 2 ** (len(prompt_matrix_parts) - 1)
for combination_num in range(combination_count):
selected_prompts = [text.strip().strip(',') for n, text in enumerate(prompt_matrix_parts[1:]) if combination_num & (1 << n)]
if put_at_start:
selected_prompts = selected_prompts + [prompt_matrix_parts[0]]
else:
selected_prompts = [prompt_matrix_parts[0]] + selected_prompts
View on GitHub (pinned to 82a973c043)
Solutions
- Use exactly 'comma' or 'space' in the delimiter slot
- Verify the full 5-element arg order [put_at_start, different_seeds, prompt_type, variations_delimiter, margin_size] against the script's ui()
- Add a client-side whitelist check before submitting the job
Example fix
# before args = [False, False, 'positive', ',', 0] # after args = [False, False, 'positive', 'comma', 0]
Defensive patterns
Strategy: type-guard
Validate before calling
ALLOWED_DELIMITERS = {'comma', 'space'}
def delimiter_valid(d) -> bool:
return d in ALLOWED_DELIMITERS Type guard
def is_delimiter(v) -> bool:
return v in ('comma', 'space') Prevention
- Use the enum words 'comma'/'space', not ',' or ' '
- Pin the script arg order against the installed script's ui() signature
- Validate all enum-like script args in one place before dispatch
When it happens
Trigger: API payload script args where the delimiter slot holds an unexpected string ('Comma', ',', ' '), usually because positional args are shifted by one, or a client hardcoding ',' instead of the enum word.
Common situations: Positional-arg misalignment in /sdapi/v1 alwayson_scripts args; clients written against a different script version whose arg list gained/lost a parameter.
Related errors
- Unknown prompt type {prompt_type}
- Sampler not found
- Invalid encoded image
- always on script {alwayson_script_name} not found
- Cannot have a selectable script in the always on scripts par
AI-assisted analysis of AUTOMATIC1111/stable-diffusion-webui@82a973c043 (2026-08-14).
Data as JSON: /api/errors/23f2188b42b402d7.
Report an issue: GitHub.