Usual disclaimers: I'm not a doctor, legal professional or financial advisor. This article is for information/education only and reflects my own opinions. It should not be taken as financial, legal or medical advice. Do your own research and never invest anything you cannot afford to lose (including your time).

1 July 2023

Unstable Diffusion?

I've been running Stable Diffusion locally now for about three weeks. It's not the fastest on this old windows box but it does run (or did). I'm not sure what's gone wrong with it right now but I am attempting some fixes so by the end of it I should have figured out what caused the issue or at least how to get it running again. The blitz option is to move the additional lora's and model checkpoints I've downloaded into a safe place and then just blitz the install folder and start again.

That seems a bit extreme though. I think it was an extension I attempted to install which has caused the problems, but once things go wrong it has a tendency to stop running the local web-server so you can't get back into the settings page and undo your recent changes.

The weird thing is while things are up and running, you can actually save your config but I couldn't find any way to revert back to that once it's borked. One thing I have noticed is in the venv folder there's a file called 'pyvenv.cfg' which stores the path to python 3.10. I dislike hard-coded paths as I've seen them cause all sorts of issues in the past, especially when the user updates something and thinks they're now running the latest version of something but actually because of a hard-coded path they might still have a vulnerability which is the reason why they upgraded a package.

If you've never installed Stable Diffusion before and want to give it a go, you will need a lot of patience as some of the downloads are 4GB+ and I also recommend this tutorial from Matt Wolfe. If you manage to kill your installation and do decide to reinstall, don't forget to move your output images first to be on the safe side. These will be in the outputs folder of your install directory. I highly recommend creating a backup folder and moving any downloaded models, Lora files and your output images into there for safe-keeping while you reinstall.I highly recommend a visit to https://civitai.com/ to enhance your S/D model collection once you have got to grips with the installation model(s). Realisian_V40 has produced some fantastic images for me. As for extensions, the first I recommend is ControlNet and there's a good video on YouTube by Olivio Sarikas which is useful to get this up and running and explores some of the things you can do with it.

And now back to troubleshooting. There are a few suggested fixes for common issues here but sadly nothing to fix the issue with my installation.This is the error it throws for me:

 building 'insightface.thirdparty.face3d.mesh.cython.mesh_core_cython' extension
  error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
  [end of output]
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for insightface
ERROR: Could not build wheels for insightface, which is required to install pyproject.toml-based projects

I've tried installing visual studio and the windows 10 & 11 sdk's as suggested by some reddit articles but so far they haven't fixed the issue. That visual studio installer download is also another lost day imho and I will probably end up removing the installation once S/D is fixed.



I'll have to come back to this tomorrow. If you are sorely missing your S/D installation like me, it's worth remembering that you can always use the online version until you get it working again.