A prompt cookbook worked as stable-diffusion-webui extenstions.
Watch Demo »
Explore the docs
·
Report Bug
·
Request Feature
Table of Contents
Please star the repo if you likes it :>
🐘 Good news: the extension now support webui dark theme.
Prompt Gallery works as a prompt-set library extension of stable-diffusion-webui. Stable-diffusion is an AI model which can generate illustration based on text-based prompts
The extension combined with four features:
- prompt-set library management
- preview pictures management
- select a combination of prompt-sets and generate illustration in webui
- avatar/character system
-
Install stable-diffusion-webui
-
Edit webui-user.bat (Win) or webui-user.sh (Linux) with these arguments "--api --listen --cors-allow-origins http://localhost:5173"
-
Start webui
-
Install Prompt-gallery extension in Web-UI
4.1 Inout https://github.com/dr413677671/PromptGallery-stable-diffusion-webui.git in "URL for extension's git repository"
4.2 Input "Prompt Gallery" in Local directory name
Please refer to section Customized extension ip and port (optional) if you are using customized webui ip/port.
Restart webui. You should see a initial frontpage like this.
There is no preview pictures. Prompt Gallery works like a framework. You need to create your own prompt-set library folloting by two steps:
- edit your prompt-set dictionary
- generate preview pictures for prompt-sets
Please follow the instructions below to build your own prompt-set library: Alternatively you could watch the video tutorial: View Demo
Definition of avatars.yaml:
value | negative | param |
---|---|---|
Positive prompts | Negative prompts | Other params for webui image generation |
Avatars is the charater displayed on the top of the extension. Defined your own character by editing /extensions/your-prompt-gallery-extension-name/assets/avatars.yaml
The field "value" is the prompt-set for each characters.
Teamplate:
whiteHair:
value: "1 girl, blush, White hair, Red eyes, animal ears, looking at viewer, gothic lolita, dramatic angle, very beautiful, beautiful eyes, "
negative: ""
pinkGirl:
value: "petite, 1girl, solo, pink hair, very long hair, school uniform, happy,outdoors, flower field, excited"
Prompt-sets are prompts displayed as cart boxes below.
Customized your own prompt-set by editing /extensions/your-prompt-gallery-extension-name/assets/tags.yaml
category-tier-1:
category-tier-1-1:
"prompt-set-name-1":
value: "prompt1, prompt2"
negative: "neg-prompt1, neg-prompt2"
"prompt-set-name-2"
value: "prompt1"
negative: "neg-prompt1"
category-tier-1-2:
"prompt-set-name-3":
value: "prompts"
The prompt-set are managed hierarchyly (e.g. the config below defined a tier 1 category "Figure" containes two tier two categories "Hair" and "Face")
Figure:
Hair:
"ponny-tail":
value: "ponny-tail"
negative: "lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, "
"short_hair"
value: "short_hair"
negative: "long_hair,lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, "
Face:
"smile":
value: "smile"
Background:
'':
simple background:
value: simple background
sunburst background:
value: sunburst background
Nature:
Space:
value: "space background, space,"
Startrails:
value: colorful startrails
Woods:
value: "Woods background, fantacy background,"
Additionally you could edit field "param" to customized AI model parameters (or switch models using the webui model selection tab.):
Style:
General Effect:
"General_ice_high_res":
value: "flowing ice, portrait, focus on face, complex, extremely detailed , elegant, CG, (an extremely delicate and beautiful girl), incredibly absurdres, best quality,concept art"
negative: "lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, "
param: "Steps: 30, Sampler: Euler, CFG scale: 11.5, Seed: 1058629707, Size: 512x768, Variation seed: 1692844643, Variation seed strength: 0.27, Seed resize from: 1088x512"
Background:
'':
simple background:
value: simple background
sunburst background:
value: sunburst background
Nature:
Space:
value: "space background, space,"
Startrails:
value: colorful startrails
Useful links for anime prompts:
-
Slect tab "Prompt Gallery" on top navigation bar. You should see your dined prompt-sets in prompt-gallery.
-
Select the avatar (model for demo)
-
Select multiple prompt-sets
-
Click "send WebUI"
- In a few minutes, Images geneated with teh selected prompt-sets will be downloaded in your browser
- The preview picture is missing. To add preview picture for each prompt-set, please refer to the next section.
- For newly installed exteantion, there will be no preview pictures for each prompt-set.
- Goto tab "txt2img" in webui and Select "Prompt Gallery" in "scripts"
- Upload the avatar yaml library mentioned in section "Build Avatar library".
-
Add default prompts or default negative (optional), default prompts are additional prompts that applied for each prompt-set preview picture generation
-
Select "skip exists" if you wish to skip generating preview if preview picture exists for a prompt-set
- Wait for stable-diffusion-webui generate previews automatically.
- Pick the best image for preview picture of each prompt-set.
- Reflesh the browser. You should see the preview pictures in Prompt Gallery.
- The preview pictures are stored in prompt-gallery-directory/assets/preview/. You could always inspect the pictures manually.
Sometimes you need to defined the default values for the AI model parameters.
- Change the params at the top of webui-directory/extension/prompt-gallery-extension-name/paste_this_to_webui_scripts_folder/prompt_gallery.py
BATCH_SIZE = 4
N_ITER = 2
STEPS = 30
CFG_SCALE = 11.5
WIDTH = 512
HEIGHT = 768
SAMPLER_INDEX = 1
RESTORE_FACE = 'true'
TILING = 'false'
DO_NOT_SAVE_GRID = 'false'
If you are using customized ip for webui and the extension fail to automatically detected your customized ip. Please try:
-
Search %extension-path%\assets\index.*.js, change "127.0.0.1" to your customized webui ip
-
Search %extension-path%\scripts\prompt_gallery.py change
pg_ip = "%your_webui_ip%" if shared.cmd_opts.listen else 'localhost'
pg_port = %your_webui_port%--
- Change the ip address in webui-user.bat (Win) or webui-user.sh (Linux)
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- dr413677671 - @zhihu-Calcifer - 413677671@qq.com
- Project Link: https://github.com/dr413677671/PromptGallery-stable-diffusion-webui