Inserts matching keyword(s) to the prompt automatically. Update this extension to get the latest model+keyword mappings.
Go to file
ChunKoo Park 3f9c9c0fe5 use custom-mappings.txt instead of model-keyword-user.txt (updating through webui overwrote model-keyword-user.txt) 2023-01-17 15:52:41 +09:00
scripts use custom-mappings.txt instead of model-keyword-user.txt (updating through webui overwrote model-keyword-user.txt) 2023-01-17 15:52:41 +09:00
.gitignore use custom-mappings.txt instead of model-keyword-user.txt (updating through webui overwrote model-keyword-user.txt) 2023-01-17 15:52:41 +09:00
LICENSE Create LICENSE 2022-12-01 12:34:02 +09:00
README.md use custom-mappings.txt instead of model-keyword-user.txt (updating through webui overwrote model-keyword-user.txt) 2023-01-17 15:52:41 +09:00
model-keyword-user.txt use custom-mappings.txt instead of model-keyword-user.txt (updating through webui overwrote model-keyword-user.txt) 2023-01-17 15:52:41 +09:00
model-keyword.txt Update model-keyword.txt 2023-01-17 06:00:18 +00:00

README.md

model-keyword

Automatic1111 WEBUI extension to autofill keyword for custom stable diffusion models.

model-keyword-github.webm

Installation

Copy the url of the repository ( https://github.com/mix1009/model-keyword ) into the extension tab and press "Install"

Screenshot 2022-12-01 at 12 14 25 PM

From "Extensions/Installed" tab press "Apply and restart UI". Screenshot 2022-12-01 at 12 18 43 PM

Usage

From txt2img, img2img tab, "Model Keyword" section is added. Model keyword extension is enabled by default. Click Model Keyword or triangle to reveal options.

reveal

When generating image, the extension will try to figure out which model is used and insert matching keyword to the prompt: model-keyword-usage

Keyword placement

Screenshot 2022-12-01 at 12 26 41 PM

Multiple keywords

Screenshot 2022-12-01 at 12 27 00 PM
  1. keyword1, keyword2 - use all keywords separated by comma
  2. random - choose one random keyword
  3. iterate - iterate through each keyword for each image generation
    • If sd-dynamic-prompts extension is installed, iterate will not work properly. Please disable Dynamic Prompts.
    • Alternatively, you can rename model-keyword to sd-model-keyword in the extensions folder. It will change the order of the extension and fix the bug.
  4. keyword1 - use first keyword
  5. keyword2 - use second keyword (if it exists)

Add Custom Mappings

custom-mapping
  • Click "Set Keyword for Model" without filling 'Keyword' field -> outputs model name and model_hash in result.
  • Fill keyword(trigger word) or keywords separated by pipe character |.
  • Click "Set Keyword for Model" to save mapping. Mappings are saved in custom-mappings.txt
  • If previous mapping is found, it overwrites the mapping.
  • To delete an entry, edit custom-mappings.txt in extensions/model-keyword.
  • do NOT edit model-keyword.txt . It can be overwritten or cause conflict while upgrading.
  • hash value for model has been changed in webui(2023-01-14), this extension uses old hash value. Old hash value is no longer displayed in webui.