WebUI: Force it to start at the specified port, or fail if something's already running at that port. Avoids Gradio's silent behavior of automatically starting at the next available port, which throws the system into an inconsistent state if Forge is already running (as a user choice, or as a zombie process)

This commit is contained in:
cmdr2
2025-07-18 13:36:41 +05:30
parent ec638b4343
commit ffaae89e7f

View File

@ -366,7 +366,7 @@ def get_env():
"TRANSFORMERS_CACHE": [f"{dir}/transformers-cache"],
"HF_HUB_DISABLE_SYMLINKS_WARNING": ["true"],
"COMMANDLINE_ARGS": [
f'--api --models-dir "{models_dir}" {model_path_args} --skip-torch-cuda-test --disable-gpu-warning'
f'--api --models-dir "{models_dir}" {model_path_args} --skip-torch-cuda-test --disable-gpu-warning --port {impl.WEBUI_PORT}'
],
"SKIP_VENV": ["1"],
"SD_WEBUI_RESTARTING": ["1"],