Stable Diffusion WebUI Installation Errors & Solutions Summary

1. Python-related errors

Error 1: Python version is not correct

cmd>>>
This Python version (3.x.x) is unsupported.

Solution

Stable Diffusion WebUI recommends Python 3.10.x.

1)Uninstall existing Python

2).Download and install Python 3.10.

3).Re-run after installation

2. Error related to virtual environment (venv)

Error 2: venv virtual environment problem

cmd>>>
AttributeError: module 'importlib._bootstrap' has no attribute ‘ SourceFileeloder’

Solution

!) Delete existing venv and re-create it

cmd>>>
rm -rf venv
python -m venv venv

2) Reinstall

cmd>>>
venv\Scripts\activate # (Windows)
source venv/bin/activate # (Linux/Mac)
pip install -r requirements.txt

3. Torch/PyTorch related errors

Error 3: PyTorch not installed or version error

cmd>>>
No module named 'torch'

Solution

Reinstall PyTorch.

  • CUDA 11.8 (NVIDIA GPU):

cmd>>>
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118

  • CUDA 12:

cmd>>>
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121

  • If you don't have a GPU (CPU only):

cmd>>>
pip install torch torchvision torchaudio

Check the installation:

py>
import torch
print(torch.__version__)
print(torch.cuda.is_available()) # If True, GPU is available

4. Errors related to xformers (speed optimization package)

Error 4: Problem installing xformers

cmd>>>
No module named 'xformers'

Solution

Install xformers manually.

cmd>>>
pip install xformers

  • Check installation:

py>
import xformers
print("xformers installed successfully")

5. CUDA related errors

Error 5: CUDA related execution error

cmd>>>
torch.cuda.OutOfMemoryError: CUDA out of memory.

Solution

1) Add an option to save VRAM when running

cmd>>>
python launch.py ​​--medvram --disable-nan-check

2) In more severe cases:

cmd>>>
python launch.py ​​--lowvram

3) If that doesn't work, add the --opt-sdp-attention option

6. WebUI execution error

Error 6: Port conflict while running WebUI

cmd>>>
OSError: [Errno 98] Address already in use

Solution

1) Check running processes

  • Windows: netstat -ano | findstr :7860
  • Linux: lsof -i :7860

2) End the process

  • Windows: taskkill /PID [PID] /F
  • Linux: kill -9 [PID]

3) Use a different port when running WebUI:

cmd>>>
python launch.py ​​--port 7870

7. Model download error

Error 7: Checkpoint model is missing or corrupted

cmd>>>
ERROR: Model not found: model.ckpt

Solution

1. Download the model directly

Save to the models/Stable-diffusion folder

8. Requirements installation error

Error 8: Requirements.txt installation error

cmd>>>
ERROR: Could not find a version that satisfies the requirement

Solution

1) update the package to the latest version

cmd>>>
pip install --upgrade pip setuptools wheel

2) Install requirements again

cmd>>>
pip install -r requirements.txt

9. Black screen or no UI after execution

Error 9: UI not visible after execution

Solution

1) Check the correct URL

  • Check if you accessed http://127.0.0.1:7860 after execution

2) Delete browser cache and try again

  • Chrome: Ctrl + Shift + R

3) Run on a different port

cmd>>>
python launch.py ​​--port 8000

10. Update error

Error 10: git pull problem during update

cmd>>>
error: Your local changes to the following files would be overwritten

Solution

1) Revert the changed files to the original and update

cmd>>>
git reset --hard
git pull

2) If that doesn't work, update manually

cmd>>>
rm -rf stable-diffusion-webui

11.Couldn't launch python, exit code 9009

Error 11 :

Couldn't launch python

exit code: 9009

Solution

When I open the webui-user.bat I got this error

'CALL C:\python\python.exe -c "import sys; print(sys.executable)"' is not recognized as an internal or external command, operable program or batch file. Creating venv in directory venv using python Unable to create venv in directory venv

exit code: 9009

stderr: '-m' is not recognized as an internal or external command, operable program or batch file.

Launch unsuccessful. Exiting. Press any key to continue . . .

Is there anything wrong when I install python or anything else?

Uninstall Python, install it again, don't forget to check the "PATH" box when installing, then when editing the .bat, write this:

Here's an example:

set PYTHON=C:\Users\You\AppData\Local\Programs\Python\Python310\python.exe

반응형
LIST

A very specific error!

The "Torch is not able to use GPU" error in Table Diffusion can be frustrating. Here are some steps you can try to resolve the issue:

1. Check your CUDA version and Torch installation

Make sure that: * Your CUDA version matches the one required by PyTorch (usually specified in requirements.txt or setup.py). You can check your CUDA version using nvcc --version. * You have installed the correct version of PyTorch (pip install torch torchvision) and its dependencies.

2. Verify GPU availability

Run:

 

command

nvidia-smi




to ensure that your system recognizes a compatible NVIDIA GPU. If you don't see any GPUs listed, it might be due to a driver issue or an incompatible CUDA version.

3. Update PyTorch with the correct backend

Try running:

python
 

This will attempt to use your GPU for computations.

4. Check Table Diffusion code

Review the setup.py or requirements.txt file of the project you're working on, and ensure that: * The correct PyTorch version is specified. * There are no conflicting dependencies (e.g., multiple versions of Torch).

5. Try a different CUDA device

If your system has multiple GPUs, try running with a specific GPU index using torch.device("cuda:1" if torch.cuda.is_available() else "cpu"). This can help identify whether the issue is related to a particular GPU.

6. Reinstall PyTorch and dependencies

As a last resort: * Uninstall PyTorch (pip uninstall torch torchvision) * Remove any cached packages (pip cache purge or pip install --force-reinstall) * Install PyTorch again with the correct version (pip install torch torchvision==<version>)

If none of these steps resolve the issue, please provide more details about your environment (OS, CUDA version, Torch version), and I'll be happy to help you investigate further!


반응형
LIST

+ Recent posts