# Dynamic Prompting

Dynamic prompting expands a single prompt into many prompt variations. It is useful for brainstorming, prompt exploration, and batch testing without rewriting the same prompt by hand.

## Basic syntax

Put alternatives inside braces and separate them with `|`.

```
a {red|green|blue} balloon
```

This can expand into:

```
a red balloon

a green balloon

a blue balloon
```

You can use more than one dynamic group in the same prompt:

```
a {red|green} {balloon|kite}
```

That creates a set of prompt combinations such as `a red balloon`, `a red kite`, `a green balloon`, and `a green kite`.

## Select more than one option with `$$`

Prefix a group with a number and `$$` to choose multiple distinct options from the same set.

```
portrait, {2$$rim light|fog|rain|neon reflections}
```

Possible results include:

```
portrait, rim light, fog

portrait, fog, rain

portrait, rim light, neon reflections
```

This is useful when you want controlled variety without writing every combination by hand.

## Random vs combinatorial expansion

**Combinatorial**

Walks the possible prompt combinations systematically until `Max Prompts` is reached.

**Random**

Samples prompt variations instead of enumerating every combination. A seed can make random expansion repeatable.

InvokeAI supports both modes, but where you can choose them depends on the workflow.

- In the current linear UI, dynamic prompt preview is driven from the positive prompt and currently follows the standard combinatorial expansion path.
- In node and backend contexts, random and combinatorial generation are exposed more explicitly.

## Max Prompts

`Max Prompts` limits how many expanded prompts InvokeAI will generate.

This matters because combinations grow quickly. For example:

```
a {red|green|blue} balloon in {morning mist|golden hour|rain}
```

Even this small prompt already has nine possible combinations.

## Seed Behaviour

In the current UI, the `Seed Behaviour` setting controls how seeds are reused across expanded prompts.

**Seed per Iteration**

Uses one seed per iteration, so prompt variants in the same iteration share a seed. This is useful when you want to compare prompt wording more directly.

**Seed per Image**

Uses a different seed for every generated image. This is useful when you want the widest possible variety.

## Using dynamic prompting in the linear UI

1. **Put dynamic prompt syntax in the positive prompt**  
In the current linear UI, dynamic prompt expansion is driven from the positive prompt.

2. **Open the preview**  
Use `Show Dynamic Prompts` or the prompts preview to inspect the expanded list before you generate.

3. **Set `Max Prompts`**  
Keep the expansion under control before launching a large batch.

4. **Choose the right seed behavior**  
Use `Seed per Iteration` for easier comparison, or `Seed per Image` for more variety.

5. **Generate a small batch first**  
Sanity-check the combinations before scaling up.

## Tips

- Keep each option group internally compatible.
- Be careful with multiple groups, because the number of combinations grows quickly.
- Review the expanded prompt list before launching a large batch.
- Use dynamic prompting for variation, not to avoid thinking through the base prompt.
- When one specific term needs more emphasis, use [Prompting Syntax](/content/concepts/prompt-syntax/index.html) instead of adding more dynamic groups.
