Picklescan of model files

During getModel(), the server picklescans the model files for potential
malicious code in the pickled python objects. If a malicious file is
found, the web UI will show a big red error message, the makeImage
button will be disabled, and the user must remove the malicious file
and reload the UI page.
This commit is contained in:
JeLuF
2022-11-16 22:34:02 +01:00
parent 3555fa36aa
commit 3e18f2f09c
4 changed files with 35 additions and 1 deletions

View File

@ -156,6 +156,13 @@ else
echo conda_sd_ui_deps_installed >> ../scripts/install_status.txt
fi
if python -m picklescan --help >/dev/null 2>&1; then
echo "Picklescan is already installed."
else
echo "Picklescan not found, installing."
pip install picklescan || fail "Picklescan installation failed."
fi
mkdir -p "../models/stable-diffusion"