santa hat
deerdeer nosedeer glow
Sign In

Automatically generating great looking random images using dynamic prompts


Coming up with original concepts for character designs - or really, in general, but that's another topic - is really hard, but something that can help is using templating and randomization. Instead of defining the exact character features that we would like to receive, we instead define a set of possible options that get chosen at random. To do this, we can leverage the dynamic prompt extension for AUTOMATIC1111's SD Webui.

Before proceeding, I would recommend doing the following (optional): Go to Settings > Dynamic Prompts and enable the options "Ignore whitespace in prompts" and "Save template to metadata". That way, your full template will be preserved in your generated file.

Using this extension, we can define randomized parts of our prompt by surrounding the given section in curly brackets {...}, while separating each possible choice using a pipe character | .

For example, if we want to use a random hair color, hairstyle and eye color, we can write something like this:

{white|grey|black|brown|blonde|pink|red|green|blue|orange|purple|aqua} hair, {short|medium|long} hair, {ponytail|side ponytail|high ponytail|twintails|braid|twin braids|straight hair|hair bun|hair bun, double bun}, {white|grey|black|brown|yellow|pink|red|green|blue|orange|purple|aqua|amber} eyes

Now, as you can probably imagine, if we try to take this to the extreme, our prompt will probably look pretty... yuck. Luckily, this extension provides a mechanism to avoid exactly that: wildcards. These are simple .txt files that just have one possible selection written out per line. Since I already made something like that a while ago, I won't repeat myself, and instead advise visiting, where I also gave a short explanation on how to install them. Feel free to fork that repository, add your own changes, and open a pull request. Note: If you don't use git, you can click the green "Code" button close to the top and choose "Download ZIP".

Oh, and last but not least: The generation parameters for the cover image grid were as follows:

1girl, high quality, best quality, masterpiece, highres, absurdres, simple background, white background, detailed, looking at viewer, close-up, portrait, head only, face only, straight-on, parted lips, blush, cute,
{white|grey|black|brown|blonde|pink|red|green|blue|orange|purple|aqua} hair, {short|medium|long} hair, {ponytail|side ponytail|high ponytail|twintails|braid|twin braids|straight hair|hair bun|hair bun, double bun}, {white|grey|black|brown|yellow|pink|red|green|blue|orange|purple|aqua|amber} eyes
Negative prompt: 1boy, low quality, worst quality, lowres, blurry, jpeg artifacts, 3d, cgi
Steps: 40, Sampler: Euler a, CFG scale: 9, Seed: 1707103224, Size: 768x768, Model hash: 54ef3e3610, Model: meinamix_meinaV11, Denoising strength: 0.55, Clip skip: 2, Hires upscale: 1.334, Hires steps: 15, Hires upscaler: R-ESRGAN 4x+ Anime6B, Version: v1.5.2