wolfgirl.cafe

Fixing Stable Diffusion Issues

Featured Image

A compilation of issues that annoyed me the most when using Stable Diffusion’s A1111 and the automatic fork by vladmandic.

If you’re facing VRAM-related problems:

  1. Use the Tiled Diffusion extension along with the --medvram parameter when lauching SD. You’ll find the extension under the Extensions tab.
  2. Restart the UI after the install.
  3. Go to any generation tab and find the new section called “Tiled VAE”
  4. 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:

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:

4. Missing modules

Sometimes automatic doesn’t start right away after the initial install, some modules may be missing:

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:

  1. Install the required perftools package: sudo apt install libgoogle-perftools-dev
  2. Download the latest version of gperftools from here.
  3. Unpack the contents into a folder named “gperftools” within the Stable Diffusion root folder.
  4. 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