AUTOMATIC1111 / stable-diffusion-webui

Stable Diffusion web UI
GNU Affero General Public License v3.0
139.52k stars 26.45k forks source link

[Bug]: crash when using sdxl loras #15175

Open TongfanWeitf opened 6 months ago

TongfanWeitf commented 6 months ago

Checklist

What happened?

if i use sdxl loras, webui will crash.

Steps to reproduce the problem

1.run webui. 2.run a txt2img with sdxl model and lora 3.crash

What should have happened?

successfully return the img

What browsers do you use to access the UI ?

Microsoft Edge

Sysinfo

sysinfo-2024-03-07-18-39.json

Console logs

Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug  1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Version: v1.8.0
Commit hash: bef51aed032c0aaa5cfd80445bc4cf0d85b408b5
Launching Web UI with arguments: --xformers --no-half-vae --no-half --medvram-sdxl
Loading weights [67ab2fd8ec] from D:\ai\webui\models\Stable-diffusion\ponyDiffusionV6XL_v6StartWithThisOne.safetensors
Creating model from config: D:\ai\webui\repositories\generative-models\configs\inference\sd_xl_base.yaml
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Startup time: 16.4s (prepare environment: 3.4s, import torch: 5.9s, import gradio: 0.6s, setup paths: 0.8s, initialize shared: 3.2s, other imports: 0.6s, load scripts: 0.8s, create ui: 0.5s, gradio launch: 0.6s).
Loading VAE weights specified in settings: D:\ai\webui\models\VAE\sdxl_vae.safetensors
Applying attention optimization: xformers... done.
Model loaded in 20.6s (load weights from disk: 0.7s, create model: 1.9s, apply weights to model: 7.4s, apply float(): 4.6s, load VAE: 0.7s, calculate empty prompt: 5.3s).
100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:25<00:00,  1.28s/it]
Total progress: 100%|██████████████████████████████████████████████████████████████████| 20/20 [00:27<00:00,  1.40s/it]
  0%|                                                                                           | 0/20 [00:00<?, ?it/s] 请按任意键继续. . .
//the first bar is without lora and the second one is with lora. it crashed so no error messages. the chinese at the end means "press any key to continue..."

Additional information

it is weird, beacuse I can run sdxl with loras before. In some day I suddently cant load sdxl models (pytorch allocated 10.6G which is much more than before), so I add --medvram-sdxl. Now I can load sdxl models, but I still cant use loras.

God-damnit-all commented 2 months ago

There haven't been any commits to the master branch since May 28, 2024. Last update on a branch was 4 days ago.

Yes, that's correct, and yet my webui got the updates when running with the git pull command.

Sounds like there might've been a dependency change. Could you list the output of dir /b (Windows) / ls -A1 --group-directories-first (Linux) in your venv's Libs/site-packages folder?

nailz420 commented 2 months ago

I upgraded from 8 to 16 VRAM and removed the medvram-sdxl flag from the launcher command. I run git pull on every launch. I can still reproduce the memory issue with or without loras by running 1 batch gens (batch size 4-8) on them on different models.

aearone commented 2 months ago

There haven't been any commits to the master branch since May 28, 2024. Last update on a branch was 4 days ago.

Yes, that's correct, and yet my webui got the updates when running with the git pull command.

Sounds like there might've been a dependency change. Could you list the output of dir /b (Windows) / ls -A1 --group-directories-first (Linux) in your venv's Libs/site-packages folder?

F:\stable-diffusion-webui\venv\Lib\site-packages>dir /b
accelerate
accelerate-0.21.0.dist-info
aenum
aenum-3.1.15.dist-info
aiofiles
aiofiles-23.2.1.dist-info
aiohttp
aiohttp-3.9.5.dist-info
aiosignal
aiosignal-1.3.1.dist-info
altair
altair-5.3.0.dist-info
antlr4
antlr4_python3_runtime-4.9.3-py3.10.egg-info
anyio
anyio-3.7.1.dist-info
async_timeout
async_timeout-4.0.3.dist-info
attr
attrs
attrs-23.2.0.dist-info
blendmodes
blendmodes-2022.dist-info
certifi
certifi-2024.7.4.dist-info
CHANGELOG.md
charset_normalizer
charset_normalizer-3.3.2.dist-info
cleanfid
clean_fid-0.1.35.dist-info
click
click-8.1.7.dist-info
clip
clip-1.0-py3.10.egg-info
colorama
colorama-0.4.6.dist-info
contourpy
contourpy-1.2.1.dist-info
cv2
cycler
cycler-0.12.1.dist-info
dateutil
deprecation-2.1.0.dist-info
deprecation.py
diskcache
diskcache-5.6.3.dist-info
distutils-precedence.pth
einops
einops-0.4.1.dist-info
exceptiongroup
exceptiongroup-1.2.1.dist-info
facexlib
facexlib-0.3.0.dist-info
fastapi
fastapi-0.94.0.dist-info
ffmpy-0.3.2-py3.10.egg-info
ffmpy.py
filelock
filelock-3.15.4.dist-info
filterpy
filterpy-1.4.5-py3.10.egg-info
fontTools
fonttools-4.53.1.dist-info
frozenlist
frozenlist-1.4.1.dist-info
fsspec
fsspec-2024.6.1.dist-info
ftfy
ftfy-6.2.0.dist-info
functorch
git
gitdb
gitdb-4.0.11.dist-info
GitPython-3.1.32.dist-info
google
gradio
gradio-3.41.2.dist-info
gradio_client
gradio_client-0.5.0.dist-info
h11
h11-0.12.0.dist-info
httpcore
httpcore-0.15.0.dist-info
httpx
httpx-0.24.1.dist-info
huggingface_hub
huggingface_hub-0.23.4.dist-info
idna
idna-3.7.dist-info
imageio
imageio-2.34.2.dist-info
importlib_resources
importlib_resources-6.4.0.dist-info
inflection
inflection-0.5.1.dist-info
inflection.py
isympy.py
jinja2
jinja2-3.1.4.dist-info
jsonmerge
jsonmerge-1.8.0-py3.10.egg-info
jsonschema
jsonschema-4.23.0.dist-info
jsonschema_specifications
jsonschema_specifications-2023.12.1.dist-info
kiwisolver
kiwisolver-1.4.5.dist-info
kornia
kornia-0.6.7.dist-info
lark
lark-1.1.2.dist-info
lazy_loader
lazy_loader-0.4.dist-info
lightning_fabric
lightning_utilities
lightning_utilities-0.11.3.post0.dist-info
llvmlite
llvmlite-0.43.0.dist-info
markupsafe
MarkupSafe-2.1.5.dist-info
matplotlib
matplotlib-3.9.1.dist-info
matplotlib.libs
mpl_toolkits
mpmath
mpmath-1.3.0.dist-info
multidict
multidict-6.0.5.dist-info
multipart
networkx
networkx-3.3.dist-info
numba
numba-0.60.0.dist-info
numpy
numpy-1.26.2-cp310-cp310-win_amd64.whl
numpy-1.26.2.dist-info
numpy.libs
nvfuser
omegaconf
omegaconf-2.2.3.dist-info
opencv_python-4.10.0.84.dist-info
open_clip
open_clip_torch-2.20.0.dist-info
orjson
orjson-3.10.6.dist-info
packaging
packaging-24.1.dist-info
pandas
pandas-2.2.2.dist-info
pandas.libs
piexif
piexif-1.1.3.dist-info
PIL
Pillow-9.5.0.dist-info
pillow_avif
pillow_avif_plugin-1.4.3.dist-info
pip
pip-22.2.1.dist-info
pkg_resources
protobuf-3.20.0-py3.10-nspkg.pth
protobuf-3.20.0.dist-info
psutil
psutil-5.9.5.dist-info
pydantic
pydantic-1.10.17.dist-info
pydevd_plugins
pydub
pydub-0.25.1.dist-info
pylab.py
pyparsing
pyparsing-3.1.2.dist-info
python_dateutil-2.9.0.post0.dist-info
python_multipart-0.0.9.dist-info
pytorch_lightning
pytorch_lightning-1.9.4.dist-info
pytz
pytz-2024.1.dist-info
pywavelets-1.6.0.dist-info
pywt
PyYAML-6.0.1.dist-info
README.md
referencing
referencing-0.35.1.dist-info
regex
regex-2024.5.15.dist-info
requests
requests-2.32.3.dist-info
resize_right
resize_right-0.0.2.dist-info
rpds
rpds_py-0.19.0.dist-info
safetensors
safetensors-0.4.2.dist-info
scikit_image-0.21.0.dist-info
scipy
scipy-1.14.0-cp310-cp310-win_amd64.whl
scipy-1.14.0.dist-info
scipy.libs
semantic_version
semantic_version-2.10.0.dist-info
sentencepiece
sentencepiece-0.2.0.dist-info
setuptools
setuptools-69.5.1.dist-info
six-1.16.0.dist-info
six.py
skimage
smmap
smmap-5.0.1.dist-info
sniffio
sniffio-1.3.1.dist-info
spandrel
spandrel-0.1.6.dist-info
starlette
starlette-0.26.1.dist-info
sympy
sympy-1.13.0.dist-info
test
tifffile
tifffile-2024.7.2.dist-info
timm
timm-1.0.7.dist-info
tlz
tokenizers
tokenizers-0.13.3.dist-info
tomesd
tomesd-0.1.3.dist-info
toolz
toolz-0.12.1.dist-info
torch
torch-2.1.2+cu121.dist-info
torchdiffeq
torchdiffeq-0.2.3.dist-info
torchgen
torchmetrics
torchmetrics-1.4.0.post0.dist-info
torchsde
torchsde-0.2.6.dist-info
torchvision
torchvision-0.16.2+cu121.dist-info
tqdm
tqdm-4.66.4.dist-info
training
trampoline
trampoline-0.1.2.dist-info
transformers
transformers-4.30.2.dist-info
typing_extensions-4.12.2.dist-info
typing_extensions.py
tzdata
tzdata-2024.1.dist-info
urllib3
urllib3-2.2.2.dist-info
uvicorn
uvicorn-0.30.1.dist-info
wcwidth
wcwidth-0.2.13.dist-info
websockets
websockets-11.0.3.dist-info
xformers
xformers-0.0.23.post1.dist-info
yaml
yarl
yarl-1.9.4.dist-info
_distutils_hack
_yaml
__pycache__

F:\stable-diffusion-webui\venv\Lib\site-packages>