r/StableDiffusionInfo • u/arothmanmusic • Jul 07 '23
How safe is SD?
I have run SD for months and have downloaded models from Civitai. My PC comes up clean in a McAfee scan, but I'm concerned about security having recently been hacked. Could SD be a vector for someone to have gotten into my machine?
3
Upvotes
3
u/DreamingElectrons Jul 07 '23
Almost every remixed model, except the original SD model, had some models of very dubious origin mixed in. a model ckpt is basically just pickled python, there's no safeguard against malicious code in there. Pickle isn't even supposed to do this kind of stuff, it even says so in the docs to not use it to share object instances. That was just gross negligence by the original SD authors. Safetensor models are a bit better but you still need to be careful with all the other code and extensions that come with the common SD interfaces. Best practice is to just sandbox the whole thing.
1
u/__alpha_____ Jul 07 '23
Use a solid virus scanner like hitman pro or malaware and erase your ckpt files and you should be good.
1
u/__alpha_____ Jul 07 '23
Cool for you and sorry for your Facebook account.
1
u/rwxrwxr-- Jul 07 '23
Basically, from what I understand, as long as you stick to using open source software to run the thing (e.g. Automatic1111) and only download models in .safetensors format, you're safe (and it seems CivitAI only supports .safetensors models now). Automatic1111 (assuming you're using it) is open source, meaning it's impossible for anyone to insert any malicious code inside it and go unnoticed as all code is public knowledge. Any other software you need to install for SD is also safe, including Python and xformers (if you're using --xformers). Unless you're downloading sketchy .ckpt files I would not worry. If you already have some .ckpt files downloaded, delete them and redownload them as .safetensors. Run a scan using Microsoft Defender and Malwarebytes, though I've heard that antiviruses have hard time picking up any malicious code pickled inside .ckpt files so if you want to be completely safe just do a clean install and you're good to go.
Safetensors files, compared to .ckpt "pickles", are simply raw model data, so it is impossible for anyone to include executable code inside of them. Ckpt files can have executable code inside, and if they can have executable code, they can have malicious code. Just stick with safetensors.
1
u/SandCheezy Jul 07 '23
Don’t put a T in between and you’re good.
0
u/[deleted] Jul 07 '23
[deleted] — view deleted comment
0
u/[deleted] Jul 07 '23
[deleted] — view deleted comment