I lost the dopamine to keep this up a year ago. I'm able to pick it up again now, but I'm not sure it's worth doing after over a year of new tools. In any case, if anyone can find some benefit from this old code and prompt tags, I encourage doing so.
PromptGen is a flexible UI script to help create and expand on prompts for generative AI art models, such as Stable Diffusion and MidJourney. Get inspired, and create. Multi-platform, and completely independent.
Acquire the latest version by git cloning the repository, or download directly. For additional info and guides, see the wiki pages. Also see the changelog to see what updates have been made to help know when to re-acquire files.
Input bracketed names of lists in the phrase dictionary to get a random selection, and use the special keywords [listadj], [liststy], and [listqual] to get a list of random visual adjectives, styles, and image quality tokens. Fill in random phrases to add some flavor to your prompts, or come up with new ones entirely.
Want your own keywords and lists? It's super easy, barely an inconvenience.
Use the sliders to instantly change the amount of random phrases picked from [listadj], [liststy], and [listqual] for your needs and to adjust to how different models respond.
A variety of basic default templates are provided for inspiration, and to show off how the inputs work.
Get prompts generated in command-line format for Automatic1111 and InvokeAI to easily queue up lists of prompts to be generated with Stable Diffusion, and with logs to import from text file.
Save whatever you type in the template box to conveniently access in the dropdown later, text and keywords and all.
Don't want certain phrases in your outputs, but don't want to delete them completely? Add them to the blacklist, and they'll be automatically yoinked out without affecting the random selections (as long as you don't blacklist every single word in the lists!)
Some planned features include:
- A completely new, sleeker, customizable UI
- Settings / state saving
- New, and more specific phrase lists and categories
- Importing and conversion between UI Stable Diffusion implementations' prompt syntax
- Realtime customizable list-keywords with sliders
To run this script all you need is:
- Python3 installed on your system
That's it. You'll also need a web browser, but presumably, you already have one if you're reading this. To install Python3 if you haven't already, pick a version for your OS, and run the provided installer.
With Python3 out-of-the-way, open up a terminal / command prompt window, and type pip install gradio
And now you're ready to run the script whenever you please. All you'll have to do is access the script with a single command,
python path/to/promptgen.py
:
It's best to keep the script and its dependent files in a folder that you can access easily. That'll make it easier to cd to the directory, or simply just drag-and-drop the script into the CLI.
Here are examples of images generated using prompts generated from the provided default templates, and with no negative prompts:
battered hiker in a wondrous cave, gloomy, mysterious, incredible, vector art, chiaroscuro, thick lines, wavy, volumetric lighting, studio quality, sharp focus, detailed
Model: Roboetic's Mix
angelic human woman with a glass, dystopian, breathtaking, stunning, amazing, slow motion, high contrast, portrait, clean lines, highres, 8k, detailed, realistic
Model: Roboetic's Mix
A fair elf hideout, warm, amazing, otherworldly, cyberpunk, slow motion, hard edge, precise lineart, tonemapping, trending on artstation, professional, hyperdetailed, sharp focus
Model: Dreamlike Diffusion
futuristic explorer walking on an abandoned planet, lush, post-apocalyptic, tonal colors, ink, portrait, realistic, UHD, trending on artstation, highres
Model: DreamShaper v3.3
glowing futuristic military spaceship flying in front of a celestial moon in outer space, quiet, cozy, pretty, stunning, anime, splatter paint style, linocut, vintage, professional, raytracing, studio quality, UHD
Model: Roboetic's Mix
floral rowboat in the Caribbean Sea, magnificent, ominous, breathtaking, terrifying, cyberpunk, digital painting, sun rays, color page, realistic, HQ, professional, raytracing
Model: Elldreth's Stolen Dreams
Many thanks to:
- junglerally, for being instrumental in brainstorming new ideas and contributing new features, such as the groundwork for the UI that helped move this project along much faster.
- javi22020, whose prompt generator was the base for the original iteration of this script. We wouldn't be here without that inspiration base.