update user scripts

This commit is contained in:
Qing 2023-01-17 20:48:38 +08:00
parent b951b8d3ec
commit a3275fc0dc
3 changed files with 25 additions and 8 deletions

View File

@ -105,12 +105,23 @@ def start(c):
port = find_free_port() port = find_free_port()
log.info(f"Using random port: {port}") log.info(f"Using random port: {port}")
commandline_args = [
"--model", model,
"--device", device,
"--port", port,
]
if desktop: if desktop:
commandline_args.extend(["--gui", "--gui-size", "1400", "900"])
model_dir = os.environ.get('MODEL_DIR', "")
if model_dir:
commandline_args.extend(["--model-dir", model_dir])
commandline_args = ' '.join(commandline_args)
env_commandline_args = os.environ.get('COMMANDLINE_ARGS', "")
c.run( c.run(
f"lama-cleaner --model {model} --device {device} --port {port} --gui --gui-size 1400 900" f"lama-cleaner {env_commandline_args} {commandline_args}"
)
else:
c.run(
f"lama-cleaner --model {model} --device {device} --port {port}"
) )

View File

@ -12,3 +12,5 @@ set PATH=C:\Windows\System32;%PATH%
@call invoke config @call invoke config
PAUSE

View File

@ -4,4 +4,8 @@ set PATH=C:\Windows\System32;%PATH%
@call installer\Scripts\activate.bat @call installer\Scripts\activate.bat
set MODEL_DIR=
set COMMANDLINE_ARGS=
@call invoke start @call invoke start
PAUSE