Dynamic Prompting: How to Use Wildcards in Stable Diffusion (A1111)

Updated
Dynamic Prompting: How to Use Wildcards in Stable Diffusion (A1111)
Learn how to enhance your prompts with wildcards in Stable Diffusion (A1111). Discover step-by-step how to implement and use wildcards for dynamic and creative prompts.

1. Introduction Wildcards Stable Diffusion

Wildcards in Stable Diffusion (A1111) are like collections of ideas stored in text files. These ideas can cover a wide range of things, such as body shapes, ethnicities, clothing styles, backgrounds, and lighting conditions, among others. When you use a wildcard in your prompt, it randomly selects one of these ideas from a specific text file. This adds an element of surprise and variety to your text generation, making each image output unique and interesting. As we explore the exciting possibilities of wildcards, let's ensure we have everything installed to make full use of this dynamic feature.

2. Requirement: Wildcards Extension

Before diving into the fascinating realm of wildcards and unleashing their creative potential in Stable Diffusion, let's ensure we have the vital wildcards extension in place. Below, you'll find our checklist of essentials.

Requirement 1: Wildcards Extension

  • Navigate to the "Extensions" tab within Stable Diffusion.
  • Click on the subtab "Available".
  • Click on "Load from" button.
  • Search for "Wildcards" and Click on "Install" on the first result.

dynamic-prompting-how-to-use-wildcards-in-stable-diffusion-a1111-wildcards-extension-download.webp

Once you've finished installing the extension, navigate to the "Installed" tab, and select "Apply and restart UI". Additionally, I highly recommend performing a full restart of your Stable Diffusion to ensure a seamless experience and minimize the risk of any errors.

Installation Verification

When the Web UI has restarted let's begin by verifying the correct installation of our extension. Check if a new folder named "\stable-diffusion-webui\extensions\stable-diffusion-webui-wildcards" has been created. The presence of this folder confirms the successful installation.

Stable Diffusion in the Cloud⚡️Run Automatic1111 in your browser in under 90 seconds
20% bonus on first deposit

3. Creating Your First Wildcard

Next, let's start by creating our very first wildcard. Open a basic text file using Notepad, which you can find by searching "Notepad" in the Windows search bar. This will give us a blank text file to create our wildcard. Keep in mind that a wildcard is essentially a list or collection of ideas that can be randomized within the prompt at a later time.

First Wildcard Collection

Let's start by deciding what we want to create a wildcard for. It could be a collection of clothing styles, hairstyles, body shapes, backgrounds, or anything else you can think of. For this example, we'll create a collection of sundresses. Let's ask ChatGPT for a list of sundresses and copy them into your newly created text file like this:

dynamic-prompting-how-to-use-wildcards-in-stable-diffusion-a1111-first-wildcard-sundress.webp

File location Wilcard Text File

After we've successfully filled in our text file, it's time to save it with an appropriate name. In this case, we'll name it "sundress.txt". It's important to choose an easy and relevant name that matches the content of the file, as we'll use this name in the prompt later. When saving the file, make sure to place it inside the following folder: "stable-diffusion-webui\extensions\stable-diffusion-webui-wildcards\wildcards".

dynamic-prompting-how-to-use-wildcards-in-stable-diffusion-a1111-file_location_wildcard.webp

Now that we have successfully created our wildcard and placed it in the correct folder, we can proceed to the Stable Diffusion Web UI and integrate the newly created wildcard into our workflow. Let's move on.

4. Implementing Wildcards in Your Workflow

Using wildcards requires a specific syntax within the prompt. To randomly select a line from our file, we need to use the following syntax inside our prompt section: __sundress__. This syntax allows Stable Diffusion to grab a random entry from the file named "sundress.txt" in the wildcards directory. So make sure to use the name of the text file (in our case, "sundress") and enclose it in double underscores within the prompt.

Example Prompt & Settings

So let's see the our sundress wildcard in action and give you an example. We will use the following settings:

  • Positive Prompt: 30 year old woman, wearing a __sundress__, (upper body portrait:1.2), (front view:1.4), wild flowers in background, close-up, spotlight, natural shadows
  • Negative Prompt: worst quality, low quality, lowres, monochrome, greyscale, bad anatomy, deformed, disfigured, mutation hands, mutation fingers, extra fingers, missing fingers, watermark
  • Sampling Steps: 30
  • Sampler: DPM++ 2M Karras
  • CFG scale: 6
  • Size: 432x768 (9:16 ratio)
  • Model: Photon

Example Image Outputs

dynamic-prompting-how-to-use-wildcards-in-stable-diffusion-a1111-wildcard-examples-nextdiffusion.webp

Stable Diffusion in the Cloud⚡️Run Automatic1111 in your browser in under 90 seconds

5. TIPS: Combining Wildcards

Take your prompt variations to the next level by combining multiple wildcards in a single prompt. Create separate text files for various elements such as clothing styles, hairstyles, body shapes, and more. Then, incorporate multiple wildcard names into your prompt (e.g., __sundress__, __hair_style__, __background__). This allows Stable Diffusion to randomly select from each wildcard, resulting in even greater diversity and creativity in your generated image output.

Experiment with different combinations and find what works best for your specific project or creative vision. Have fun exploring the endless possibilities that alternating and combining wildcards offer!

6. Conclusion

You're now equipped with the knowledge to use wildcards in Stable Diffusion (A1111) effectively. By using the correct naming syntax in prompts, you can inject diversity into your outputs effortlessly. Whether experimenting with prompts or generating batches of images, wildcards offer endless creative possibilities. Embrace this newfound tool and enjoy exploring the depths of text generation!

Frequently Asked Questions

Wildcards in Stable Diffusion (A1111) are collections of ideas stored in text files. These ideas can encompass various elements such as clothing styles, hairstyles, body shapes, backgrounds, and more. When integrated into prompts, wildcards add randomness and variety to text generation.

Yes, wildcards can be combined in prompts to introduce even greater diversity into image generation. Users can create multiple text files for different elements and incorporate multiple wildcard names in their prompts. By rotating between different wildcard names or using multiple wildcards in a single prompt, users can create rich and varied outputs tailored to their specific needs and preferences.

character creation tool card

AI Image Generation Tool

Create Your AI Images in Seconds!

News & Updates