mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2024-12-29 19:05:05 +08:00
set default max_worker == 1, add '--max-install-thread' cmd arg
This commit is contained in:
parent
5571616aa6
commit
d267aaa519
@ -31,6 +31,7 @@ parser.add_argument("--no-half", action='store_true', help="do not switch the mo
|
|||||||
parser.add_argument("--no-half-vae", action='store_true', help="do not switch the VAE model to 16-bit floats")
|
parser.add_argument("--no-half-vae", action='store_true', help="do not switch the VAE model to 16-bit floats")
|
||||||
parser.add_argument("--no-progressbar-hiding", action='store_true', help="do not hide progressbar in gradio UI (we hide it because it slows down ML if you have hardware acceleration in browser)")
|
parser.add_argument("--no-progressbar-hiding", action='store_true', help="do not hide progressbar in gradio UI (we hide it because it slows down ML if you have hardware acceleration in browser)")
|
||||||
parser.add_argument("--max-batch-count", type=int, default=16, help="does not do anything")
|
parser.add_argument("--max-batch-count", type=int, default=16, help="does not do anything")
|
||||||
|
parser.add_argument("--max-install-thread", type=int, default=1, help="Maximum Thread number for for asynchronously install extensions. 1 = normal install. ⚠ Enabling this feature may cause unintended issues with some extensions."),
|
||||||
parser.add_argument("--embeddings-dir", type=normalized_filepath, default=os.path.join(data_path, 'embeddings'), help="embeddings directory for textual inversion (default: embeddings)")
|
parser.add_argument("--embeddings-dir", type=normalized_filepath, default=os.path.join(data_path, 'embeddings'), help="embeddings directory for textual inversion (default: embeddings)")
|
||||||
parser.add_argument("--textual-inversion-templates-dir", type=normalized_filepath, default=os.path.join(script_path, 'textual_inversion_templates'), help="directory with textual inversion templates")
|
parser.add_argument("--textual-inversion-templates-dir", type=normalized_filepath, default=os.path.join(script_path, 'textual_inversion_templates'), help="directory with textual inversion templates")
|
||||||
parser.add_argument("--hypernetwork-dir", type=normalized_filepath, default=os.path.join(models_path, 'hypernetworks'), help="hypernetwork directory")
|
parser.add_argument("--hypernetwork-dir", type=normalized_filepath, default=os.path.join(models_path, 'hypernetworks'), help="hypernetwork directory")
|
||||||
|
@ -280,12 +280,19 @@ def run_extensions_installers(settings_file):
|
|||||||
if os.path.isdir(path):
|
if os.path.isdir(path):
|
||||||
paths[dirname_extension] = path
|
paths[dirname_extension] = path
|
||||||
|
|
||||||
with ThreadPoolExecutor(max_workers=2) as executor:
|
max_workers = args.max_install_thread
|
||||||
futures = {executor.submit(run_extension_installer, path): dirname_extension for dirname_extension, path in paths.items()}
|
if max_workers == 1:
|
||||||
for future in as_completed(futures):
|
for dirname_extension, path in paths.items():
|
||||||
dirname_extension = futures[future]
|
run_extension_installer(path)
|
||||||
if future.result():
|
startup_timer.record(dirname_extension)
|
||||||
startup_timer.record(dirname_extension)
|
else:
|
||||||
|
max_workers = min(max_workers, 4)
|
||||||
|
with ThreadPoolExecutor(max_workers=max_workers) as executor:
|
||||||
|
futures = {executor.submit(run_extension_installer, path): dirname_extension for dirname_extension, path in paths.items()}
|
||||||
|
for future in as_completed(futures):
|
||||||
|
dirname_extension = futures[future]
|
||||||
|
if future.result():
|
||||||
|
startup_timer.record(dirname_extension)
|
||||||
|
|
||||||
|
|
||||||
re_requirement = re.compile(r"\s*([-_a-zA-Z0-9]+)\s*(?:==\s*([-+_.a-zA-Z0-9]+))?\s*")
|
re_requirement = re.compile(r"\s*([-_a-zA-Z0-9]+)\s*(?:==\s*([-+_.a-zA-Z0-9]+))?\s*")
|
||||||
|
Loading…
Reference in New Issue
Block a user