Dynamic Prompting | InvokeAI Documentation

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.

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