AUTOMATIC1111 / stable-diffusion-webui

Stable Diffusion web UI
GNU Affero General Public License v3.0
131.7k stars 25.27k forks source link

Initial model download integrity #15602

Open w-e-w opened 4 weeks ago

w-e-w commented 4 weeks ago

Description

Initial model download integrity

recently they seems to be several instances of for whatever reason the "default auto downlaod model" when no model is found being corrupted on download

the file we download by default is v1-5-pruned-emaonly.safetensors page url https://huggingface.co/runwayml/stable-diffusion-v1-5/blob/main/v1-5-pruned-emaonly.safetensors sha256: 6ce0161689b3853acaa03779ec93eafe75a02f4ced659bee03f50797806fa2fa

issue post of corrupted models

As corrupted model could have serious consequences causing webui to enter a "unable to switch model loop" it makes sense to check for the Integrity of the file


the download_url_to_file utility we used to download the model will automatically delete the model if the hash does not match

in these cases users can either retry downloading the model by restarting web UI download the models manually or possibly install model downloader extensions to help them download other models

clarification there is no risk of user files be accidentally deleted the Integrity check it's only performed on the model that is currently being downloaded

Checklist: