aboutsummaryrefslogtreecommitdiff
path: root/modules/shared.py
diff options
context:
space:
mode:
authorAUTOMATIC <16777216c@gmail.com>2022-10-08 13:38:57 +0300
committerAUTOMATIC <16777216c@gmail.com>2022-10-08 13:38:57 +0300
commit706d5944a075a6523ea7f00165d630efc085ca22 (patch)
tree0c995ce428ea62c98fd1677b05fd52c830448acb /modules/shared.py
parent87db6f01cc6b118fe0c82c36c6686d72d060c417 (diff)
let user choose his own prompt token count limit
Diffstat (limited to 'modules/shared.py')
-rw-r--r--modules/shared.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/modules/shared.py b/modules/shared.py
index 879d8424..864e772c 100644
--- a/modules/shared.py
+++ b/modules/shared.py
@@ -118,8 +118,8 @@ prompt_styles = modules.styles.StyleDatabase(styles_filename)
interrogator = modules.interrogate.InterrogateModels("interrogate")
face_restorers = []
-# This was moved to webui.py with the other model "setup" calls.
-# modules.sd_models.list_models()
+
+vanilla_max_prompt_tokens = 77
def realesrgan_models_names():
@@ -221,6 +221,7 @@ options_templates.update(options_section(('sd', "Stable Diffusion"), {
"use_old_emphasis_implementation": OptionInfo(False, "Use old emphasis implementation. Can be useful to reproduce old seeds."),
"enable_batch_seeds": OptionInfo(True, "Make K-diffusion samplers produce same images in a batch as when making a single image"),
"filter_nsfw": OptionInfo(False, "Filter NSFW content"),
+ "max_prompt_tokens": OptionInfo(vanilla_max_prompt_tokens, f"Max prompt token count. Two tokens are reserved for for start and end. Default is {vanilla_max_prompt_tokens}. Setting this to a different value will result in different pictures for same seed.", gr.Number, {"precision": 0}),
"random_artist_categories": OptionInfo([], "Allowed categories for random artists selection when using the Roll button", gr.CheckboxGroup, {"choices": artist_db.categories()}),
}))