Sogni: Learn
Visit Sogni.ai
  • 👋Welcome to Sogni
  • Learn
    • ❓FAQs
    • 😍Basics
      • Prompts
        • Dynamic Prompts
        • Prompt Length Token Limits
      • Switching Processing
      • Generating Batches
      • Generation Seed
      • Inference Steps
      • Guidance Scale
      • RealTime Generation (MacOS)
      • Guide Image
      • ControlNet
        • Preprocessors
        • ControlNet Models
      • Canvas
      • Masks
      • Creating Animations & Videos
    • 🤓Advanced
      • Preview Count
      • Upscaling Images
      • Schedulers
      • Processing
        • On-Device
          • Optimizing Memory
        • Supernet
      • Safe Content Filter
    • 🤖Models
      • About AI Models
      • Model Types
      • Available Models
      • Importing Stable Diffusion Models
      • Model Storage & Deleting Models
      • About Switching Models on Supernet
    • Telegram AI Sticker Bot
  • Tutorials
    • 🎥Video Tutorials
    • 🎓Guides
      • Controlling the Output
      • How to Transfer a Face From One Image to Another
      • How to generate Photorealistic Faces
      • How to Transform a Simple Sketch into Stunning Images
      • How to Create Subject-Steady Animations with Dynamic Backgrounds
      • How to use multiple ControlNets to generate a Single Image
      • How to generate larger batches of images (more than 16 at a time)
      • ▶️How to use Mask Tool
      • ▶️How to Mix Images
      • ▶️How to Extend Images with Canvas
  • Testnet
    • 💫About the Sogni Testnet
      • 💫Joining the Sogni Testnet
      • ⭐Spark Points
    • About Sogni Supernet
  • Sogni Studio Pro
    • Sogni Studio vs Sogni Studio Pro
    • ⬇️Installing Sogni Studio Pro
    • 🔒Why It's Safe to Download Sogni Studio Pro
    • ✅Updating Sogni Studio Pro
    • Account & Wallet
      • Supernet Generation Costs
    • 🐝Worker Mode
    • 🚧How to Recover Your Password
    • 🦊How to Add Your Sogni Wallet to MetaMask
  • Sogni Pocket
    • 📲Downloading Sogni Pocket
  • SOGNI FAST WORKER
    • 🐝About Sogni Fast Worker
    • ⬇️Running Sogni Fast Worker Locally
    • ⬇️Running Sogni Fast Worker Remotely
    • ❓Fast Worker FAQ
    • 🧠Sogni Fast Worker Advanced Configuration
  • Rewards
    • 🙋Account Creation & Verification Reward
    • 🌟Daily Boost Reward
    • 🌟Referral Reward
Powered by GitBook
On this page

Was this helpful?

  1. Learn
  2. Basics
  3. Prompts

Dynamic Prompts

Powerful prompt templating syntax to vary prompt text between Batch Generations

PreviousPromptsNextPrompt Length Token Limits

Last updated 2 months ago

Was this helpful?

Prompt: A portrait of a woman {blonde|black} hair holding an {apple|orange}

When requesting images from Sogni’s Relaxed and Fast Supernet you may leverage an advanced text variation syntax {} to outline different prompt text for each image requested from your single prompt, as seen in the example above.

This advanced syntax is called Dynamic Prompts and is a popular advanced "prompt templating" feature for professional AI Artists. It has been popularized by and each of these Dynamic Prompt Samplers: Combination Prompts, Cyclical Prompts, and Random Prompts are available for your prompts using Sogni Supernet.

Combination Prompts

The most basic and popular "Prompt Variant Sampler" is the Combination Prompt. To leverage this feature in the text of your prompt all you have to do is put 2 or more text fragments inside of curly braces {} within your prompt. The words or phrases need to be separated by a | (Pipe) character. The curly brace can be around your entire prompt to completely change prompts for each image or just a small portion of the text.

For example a prompt for “A woman with {black|blonde} hair” will generate 2 prompts:

Prompt 1: A woman with black hair Prompt 2: A woman with blonde hair

If you then request a batch of 4 images, image 1 will use Prompt 1 and image 2 will use Prompt 2.

When you have more images requested than prompt combinations generated then the next set of images will loop back to the start of your combinations. So Image 3 will use Prompt 1, and image 4 will use Prompt 2.

You can add spaces inside the curly brace options to make the prompt more readable for yourself and those spaces will be ignored. So these 2 examples will produce the same images:

“A woman with {black|blonde} hair” “A woman with { black | blonde } hair”

There is no limit to the number of options you can include in the curly braces and you may include multiple curly brace combinations in your prompt. The only limiting factor is the overall prompt box character limit as well as being sure to request a minimum number of batch images to meet the number of variations you are requesting. For example this prompt: {man|woman} holding a {dog|cat} in the {winter|summer}

will generate 2 x 2 x 2 = 8 prompt variations so you should hit 9 on the image count tab bar.

man holding a dog in the winter man holding a dog in the summer man holding a cat in the winter man holding a cat in the summer woman holding a dog in the winter woman holding a dog in the summer woman holding a cat in the winter woman holding a cat in the summer man holding a dog in the winter <- image 9 cycles back to the first prompt

More advanced Dynamic Prompt Samplers

Cyclical Prompts

You can also convert your Combination Prompt into a "Cyclical" sampling prompt by simply adding a ~ (tilda) character after your opening curly brace. Cyclical iterates every pair of { option 1 | option 2 | ... } combinations in your prompt at the same time. The pattern is repeated until the image count requested is reached.

For example 4 Images requested for: I {~love|hate} {~New York|Chicago} Will generate prompts: I love New York I hate Chicago I love New York I hate Chicago Random Prompts

You may also convert your Combination Prompt into a Random Prompt by simply putting an @ after your opening curly brace. This picks 1 option at random from the list of options instead of incrementing them sequentially. As chance is random, you may get the same random option multiple times.

For example 4 images requested for: I {@love|hate|enjoy|miss} New York May generate I enjoy New York I miss New York I enjoy New York I hate New York

Weighted Random Prompts

When using "Random" sampling you may also add weights to each option in your curly braces to control their relative frequency. To do this, add a double colon :: followed by the weight before the option. The weights are relative and do not have to add up to 1. If you omit a weight, it is assumed to be 1.

For example a prompt of: I {@75::love|25::hate} New York Will have a 75% chance of generating "I love New York" and a 25% chance of generating "I hate New York" for each image requested.

You can mix and match sampling methods like using a combination sampler and a random sampler together in the same prompt. For example 4 Images requested for: I {love|hate|enjoy|miss} {@75::New York|25::Chicago} May generate I love New York I hate Chicago I enjoy New York I miss New York The weighted random feature is particularly powerful. A common use case is to be able to add variable scarcity based traits when generating 10,000 NFT characters.

You may use this feature in any or all of the prompt fields: Prompt, Style, Avoid / Negative Prompt.

One additional tip:

If you want the composition and other elements of the images generated from your prompt variations to stay as similar as possible be sure to use a “fixed seed”. This means locking the Seed number so it doesn’t change between generations. You can also explore using Guide Image and Controlnet features with this feature.

Note: The final images displayed in your Sogni App from a Combination Prompt batch image request may not appear in the prompt order outlined above since image jobs are done by several worker machines in parallel and are displayed to you in the order they are completed and downloaded by your machine.


Need help? Ask in our Discord!

▶️ Tutorial video:

For any questions regarding the use of Sogni, tips, suggestions, bugs, sharing art, discussing AI and life, or simply hanging out... Join our Discord community! ✨

😍
Sogni AI Prompt Engineering: Your Guide to Stunning Results
Join Sogni Discord
SD Dynamic Prompts
Using the Random “@” option in your prompt to randomize subjects, places, styles and/or moods before narrowing in on your desired concept