1
0
Fork 0
onnx-web/api/launch.ps1

28 lines
969 B
PowerShell
Raw Permalink Normal View History

2023-07-13 03:26:59 +00:00
& onnx_env\Scripts\Activate.ps1
echo "Downloading and converting models to ONNX format..."
IF ($Env:ONNX_WEB_EXTRA_MODELS -eq "") {$Env:ONNX_WEB_EXTRA_MODELS="..\models\extras.json"}
python -m onnx_web.convert `
--sources `
--diffusion `
--upscaling `
--correction `
--extras=$Env:ONNX_WEB_EXTRA_MODELS `
--token=$Env:HF_TOKEN $Env:ONNX_WEB_EXTRA_ARGS
if (!(Test-Path -path .\gui\index.html -PathType Leaf)) {
echo "Downloading latest web UI files from Github..."
Invoke-WebRequest "https://raw.githubusercontent.com/ssube/onnx-web/gh-pages/v0.11.0/index.html" -OutFile .\gui\index.html
Invoke-WebRequest "https://raw.githubusercontent.com/ssube/onnx-web/gh-pages/v0.11.0/config.json" -OutFile .\gui\config.json
Invoke-WebRequest "https://raw.githubusercontent.com/ssube/onnx-web/gh-pages/v0.11.0/bundle/main.js" -OutFile .\gui\bundle\main.js
}
2023-07-13 03:26:59 +00:00
echo "Launching API server..."
waitress-serve `
--host=0.0.0.0 `
--port=5000 `
--call `
onnx_web.main:run
pause