Fixing Stable Diffusion Issues
A compilation of issues that annoyed me the most when using Stable Diffusion’s A1111 and the automatic fork by vladmandic.
1. Issues Related to VRAM (for 8GB Users)
If you’re facing VRAM-related problems:
- Use the Tiled Diffusion extension along with the
--medvram
parameter when lauching SD. You’ll find the extension under the Extensions tab. - Restart the UI after the install.
- Go to any generation tab and find the new section called “Tiled VAE”
- Enable “Tiled VAE” and adjust “Encoder Tile Size” to 960 and “Decoder Tile Size” to 64.
This setup should work well for images up to 2000x2000 pixels.
2. Dealing with Black Images
Try this:
- Launch the program with the
--no-half-vae
parameter. - For Vladimandic’s version, navigate to the Settings tab and select “Use full precision for VAE (–no-half-vae).”
3. RuntimeError
: Expected Scalar Type Float but Found Half
If you encounter this error, especially while using any embedding (textual inversion) in Vladimandic’s fork:
- Go to the Settings tab and switch to the “A1111 parser” for “Prompt attention parser.”
- Avoid using the “Full parser.”
4. Missing modules
Sometimes automatic doesn’t start right away after the initial install, some modules may be missing:
- Run the command
./webui.sh --upgrade
- If you try to install the modules by hand, keep in mind that not all of them are available through
pip install
, the CLIP module for example is not the same as “clip”. You’d have to grab it from OpenAI’s repository by running the foll>
pip install git+https://github.com/openai/CLIP.git
5. Terminating or Freezing Linux Systems
For Linux users facing system termination or freezing issues, follow these steps:
- Install the required perftools package:
sudo apt install libgoogle-perftools-dev
- Download the latest version of gperftools from here.
- Unpack the contents into a folder named “gperftools” within the Stable Diffusion root folder.
- Run the command from the root folder of Stable Diffusion:
HSA_OVERRIDE_GFX_VERSION=10.3.0 LD_PRELOAD=gperftools/usr/lib/libtcmalloc_minimal.so ./webui.sh
You might want to install earlyoom, it helps a lot with freezes like this:
sudo apt install earlyoom
Additional Tip for Linux Users: Optimizing Swap
If you’re on Linux, optimizing your swap settings might help improve performance:
# Turn off swap
sudo swapoff -a
# Create an 8GB swap file
sudo dd if=/dev/zero of=/swapfile bs=1G count=8
sudo chmod 0600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile