mirror of
https://github.com/Sygil-Dev/sygil-webui.git
synced 2024-12-14 22:13:41 +03:00
Allows passing args to webui.sh and webui.cmd (#1385)
This change helps with starting the stable horde bridge, without having to change the relauncher.py every time. It also allows one to start multiple bridges (for multiple GPUs) by passing the `-n` argument to the .cmd/.sh
This commit is contained in:
parent
481c4d83cd
commit
bb8850b9dd
@ -36,13 +36,18 @@ share = False
|
||||
|
||||
# Generate tiling images
|
||||
tiling = False
|
||||
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
|
||||
parser.add_argument('-n', '--horde_name', action="store", required=False, type=str, help="The server name for the Horde. It will be shown to the world and there can be only one.")
|
||||
args = parser.parse_args()
|
||||
# Enter other `--arguments` you wish to use - Must be entered as a `--argument ` syntax
|
||||
additional_arguments = ""
|
||||
if args.horde_name:
|
||||
additional_arguments += f' --horde_name {args.horde_name}'
|
||||
|
||||
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
|
||||
parser.add_argument('-n', '--horde_name', action="store", required=False, type=str, help="The server name for the Horde. It will be shown to the world and there can be only one.")
|
||||
parser.add_argument('--bridge', action="store_true", required=False, default=True, help="When specified, start the stable horde bridge instead of the webui.")
|
||||
args = parser.parse_args()
|
||||
|
||||
if args.bridge:
|
||||
additional_arguments += f' --bridge'
|
||||
if args.horde_name:
|
||||
additional_arguments += f' --horde_name "{args.horde_name}"'
|
||||
|
||||
|
||||
|
||||
|
6
webui.sh
6
webui.sh
@ -162,7 +162,7 @@ launch_webui () {
|
||||
select yn in "Streamlit" "Gradio"; do
|
||||
case $yn in
|
||||
Streamlit ) printf "\nStarting Stable Diffusion WebUI: Streamlit Interface. Please Wait...\n"; python -m streamlit run scripts/webui_streamlit.py; break;;
|
||||
Gradio ) printf "\nStarting Stable Diffusion WebUI: Gradio Interface. Please Wait...\n"; python scripts/relauncher.py $@; break;;
|
||||
Gradio ) printf "\nStarting Stable Diffusion WebUI: Gradio Interface. Please Wait...\n"; python scripts/relauncher.py "$@"; break;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
@ -177,8 +177,8 @@ start_initialization () {
|
||||
echo "Your model file does not exist! Place it in 'models/ldm/stable-diffusion-v1' with the name 'model.ckpt'."
|
||||
exit 1
|
||||
fi
|
||||
launch_webui
|
||||
launch_webui "$@"
|
||||
|
||||
}
|
||||
|
||||
start_initialization
|
||||
start_initialization "$@"
|
Loading…
Reference in New Issue
Block a user