disable gradio queues on demand

This commit is contained in:
Vladimir Mandic
2023-04-18 08:06:16 -04:00
parent 86783d164c
commit a975a6a03d
6 changed files with 13 additions and 5 deletions
+1
View File
@@ -46,6 +46,7 @@ parser.add_argument("--server-name", type=str, help="Sets hostname of server", d
parser.add_argument("--no-hashing", action='store_true', help="Disable sha256 hashing of checkpoints", default=False)
parser.add_argument("--no-download-sd-model", action='store_true', help="Disable download of default model even if no model is found", default=False)
parser.add_argument("--profile", action='store_true', help="Run profiler, default: %(default)s")
parser.add_argument("--disable-queue", action='store_true', help="Disable Gradio queues and force use of HTTP instead of WebSockets, default: %(default)s")
def compatibility_args(opts, args):
+2 -2
View File
@@ -170,8 +170,6 @@ class State:
state = State()
state.server_start = time.time()
prompt_styles = modules.styles.StyleDatabase('styles.csv')
interrogator = modules.interrogate.InterrogateModels("interrogate")
face_restorers = []
@@ -278,6 +276,7 @@ options_templates.update(options_section(('system-paths', "System Paths"), {
"clip_models_path": OptionInfo(os.path.join(paths.models_path, 'CLIP'), "Path to directory with CLIP model file(s)"),
"lora_dir": OptionInfo(os.path.join(paths.models_path, 'Lora'), "Path to directory with Lora network(s)"),
"lyco_dir": OptionInfo(os.path.join(paths.models_path, 'LyCORIS'), "Path to directory with LyCORIS network(s)"),
"styles_dir": OptionInfo('styles.csv', "Path to user-defined styles file"),
# "gfpgan_model": OptionInfo("", "GFPGAN model file name"),
}))
@@ -607,6 +606,7 @@ if os.path.exists(config_filename):
opts.load(config_filename)
cmd_opts = cmd_args.compatibility_args(opts, cmd_opts)
prompt_styles = modules.styles.StyleDatabase(opts.styles_dir)
settings_components = None
"""assinged from ui.py, a mapping on setting names to gradio components repsponsible for those settings"""
+1 -1
View File
@@ -89,7 +89,7 @@ def add_style(name: str, prompt: str, negative_prompt: str):
shared.prompt_styles.styles[style.name] = style
# Save all loaded prompt styles: this allows us to update the storage format in the future more easily, because we
# reserialize all styles every time we save them
shared.prompt_styles.save_styles('styles.csv')
shared.prompt_styles.save_styles(shared.opts.styles_dir)
return [gr.Dropdown.update(visible=True, choices=list(shared.prompt_styles.styles)) for _ in range(2)]