[Bug]: xformers fails to import while module fails to be detected after force reinstall download
Checklist
- [ ] The issue exists after disabling all extensions
- [X] The issue exists on a clean installation of webui
- [ ] The issue is caused by an extension, but I believe it is caused by a bug in the webui
- [X] The issue exists in the current version of the webui
- [ ] The issue has not been reported before recently
- [ ] The issue has been reported before but has not been fixed yet
What happened?
User did a clean install on my Pop_OS machine after fully updating it. After a fresh install User added xformers to my starting arguments. Xformers module failed to be detected. User applied starting arguments to reinstall xfomers.
This gererated the following unusual text code: Launching Web UI with arguments: /home/user/Programs/A1111 WebUI/stable-diffusion-webui/venv/lib/python3.10/site-packages/timm/models/layers/init.py:48: FutureWarning: Importing from timm.models.layers is deprecated, please import via timm.layers warnings.warn(f"Importing from {name} is deprecated, please import via timm.layers", FutureWarning) no module 'xformers'. Processing without... no module 'xformers'. Processing without... No module 'xformers'. Proceeding without it. Loading weights [6ce0161689] from /home/user/Programs/A1111 WebUI/stable-diffusion-webui/models/Stable-diffusion/v1-5-pruned-emaonly.safetensors Running on local URL: http://127.0.0.1:7860
There is a second outcome the prints errors in the program code but I cannot reproduce currently
Steps to reproduce the problem
1)User does a clean install on my Pop_OS machine after fully updating it. 2)After a fresh install User adds xformers to my starting arguments. 3)User applies starting arguments to reinstall xfomers.
What should have happened?
WebUI should detect and load xformers module
What browsers do you use to access the UI ?
Mozilla Firefox
Sysinfo
Console logs
################################################################
Install script for stable-diffusion + Web UI
Tested on Debian 11 (Bullseye), Fedora 34+ and openSUSE Leap 15.4 or newer.
################################################################
################################################################
Running on User user
################################################################
################################################################
Create and activate python venv
################################################################
################################################################
Launching launch.py...
################################################################
glibc version is 2.35
Check TCMalloc: libtcmalloc_minimal.so.4
libtcmalloc_minimal.so.4 is linked with libc.so,execute LD_PRELOAD=/lib/x86_64-linux-gnu/libtcmalloc_minimal.so.4
Python 3.10.12 (main, Nov 6 2024, 20:22:13) [GCC 11.4.0]
Version: v1.10.1
Commit hash: 82a973c04367123ae98bd9abdf80d9eda9b910e2
Launching Web UI with arguments:
/home/user/Programs/A1111 WebUI/stable-diffusion-webui/venv/lib/python3.10/site-packages/timm/models/layers/__init__.py:48: FutureWarning: Importing from timm.models.layers is deprecated, please import via timm.layers
warnings.warn(f"Importing from {__name__} is deprecated, please import via timm.layers", FutureWarning)
no module 'xformers'. Processing without...
no module 'xformers'. Processing without...
No module 'xformers'. Proceeding without it.
Loading weights [6ce0161689] from /home/user/Programs/A1111 WebUI/stable-diffusion-webui/models/Stable-diffusion/v1-5-pruned-emaonly.safetensors
Running on local URL: http://127.0.0.1:7860
To create a public link, set `share=True` in `launch()`.
Creating model from config: /home/user/Programs/A1111 WebUI/stable-diffusion-webui/configs/v1-inference.yaml
Startup time: 6.9s (prepare environment: 1.4s, import torch: 2.1s, import gradio: 0.5s, setup paths: 1.2s, initialize shared: 0.3s, other imports: 0.3s, load scripts: 0.4s, create ui: 0.3s, gradio launch: 0.3s).
/home/user/Programs/A1111 WebUI/stable-diffusion-webui/venv/lib/python3.10/site-packages/huggingface_hub/file_download.py:797: FutureWarning: `resume_download` is deprecated and will be removed in version 1.0.0. Downloads always resume when possible. If you want to force a new download, use `force_download=True`.
warnings.warn(
ERROR: ld.so: object '/lib/x86_64-linux-gnu/libtcmalloc_minimal.so.4' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object '/lib/x86_64-linux-gnu/libtcmalloc_minimal.so.4' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
Gtk-Message: 21:53:05.723: Failed to load module "canberra-gtk-module"
Gtk-Message: 21:53:05.724: Failed to load module "canberra-gtk-module"
Applying attention optimization: Doggettx... done.
Model loaded in 2.8s (load weights from disk: 0.4s, create model: 0.4s, apply weights to model: 1.8s, calculate empty prompt: 0.1s).
Additional information
There is a second outcome the prints errors in the programs code but I cannot reproduce this currently. I read thru it. xformers is failing to be imported as a library in one of the scripts.
You don't have xformers enabled. Add --xformers to webui-user.sh (and uncomment the line.)
See also: https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Optimizations
Sorry here's the proper terminal output.
`
################################################################ Install script for stable-diffusion + Web UI Tested on Debian 11 (Bullseye), Fedora 34+ and openSUSE Leap 15.4 or newer. ################################################################
################################################################ Running on ronnie user ################################################################
################################################################ Repo already cloned, using it as install directory ################################################################
################################################################ Create and activate python venv ################################################################
################################################################
Launching launch.py...
################################################################
glibc version is 2.35
Check TCMalloc: libtcmalloc_minimal.so.4
libtcmalloc_minimal.so.4 is linked with libc.so,execute LD_PRELOAD=/lib/x86_64-linux-gnu/libtcmalloc_minimal.so.4
Python 3.10.12 (main, Nov 6 2024, 20:22:13) [GCC 11.4.0]
Version: v1.10.1
Commit hash: 82a973c04367123ae98bd9abdf80d9eda9b910e2
ControlNet init warning: Unable to install insightface automatically. Please try run pip install insightface manually.
Launching Web UI with arguments: --medvram --xformers
no module 'xformers'. Processing without...
no module 'xformers'. Processing without...
No module 'xformers'. Proceeding without it.
*** Cannot import xformers
Traceback (most recent call last):
File "/home/ronnie/Programs/A1111 WebUI/stable-diffusion-webui/modules/sd_hijack_optimizations.py", line 160, in
[-] ADetailer initialized. version: 24.11.1, num models: 11
CivitAI Browser+: Aria2 RPC started
ControlNet preprocessor location: /home/ronnie/Programs/A1111 WebUI/stable-diffusion-webui/extensions/sd-webui-controlnet/annotator/downloads
2024-12-10 01:40:06,626 - ControlNet - INFO - ControlNet v1.1.455
Loading weights [42fb9a8ac9] from /home/ronnie/Programs/A1111 WebUI/stable-diffusion-webui/models/Stable-diffusion/Pony/Pony_OmegaPonyReal + 0.7(Pony_fennfotoPONY_v4 - Pony_vMIXVectorStylePony_v10_998947).safetensors
2024-12-10 01:40:07,287 - ControlNet - INFO - ControlNet UI callback registered.
Creating model from config: /home/ronnie/Programs/A1111 WebUI/stable-diffusion-webui/repositories/generative-models/configs/inference/sd_xl_base.yaml
/home/ronnie/Programs/A1111 WebUI/stable-diffusion-webui/venv/lib/python3.10/site-packages/huggingface_hub/file_download.py:797: FutureWarning: resume_download is deprecated and will be removed in version 1.0.0. Downloads always resume when possible. If you want to force a new download, use force_download=True.
warnings.warn(
[ERROR]: Config states /home/ronnie/Programs/A1111 WebUI/stable-diffusion-webui/config_states/civitai_subfolders.json, "created_at" does not exist
Running on local URL: http://127.0.0.1:7860
To create a public link, set share=True in launch().
IIB Database file has been successfully backed up to the backup folder.
Startup time: 14.0s (prepare environment: 2.5s, import torch: 2.8s, import gradio: 1.1s, setup paths: 1.4s, import ldm: 0.4s, initialize shared: 0.7s, other imports: 0.7s, load scripts: 2.7s, create ui: 1.2s, gradio launch: 0.6s).
ERROR: ld.so: object '/lib/x86_64-linux-gnu/libtcmalloc_minimal.so.4' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object '/lib/x86_64-linux-gnu/libtcmalloc_minimal.so.4' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
Gtk-Message: 01:40:09.074: Failed to load module "canberra-gtk-module"
Gtk-Message: 01:40:09.077: Failed to load module "canberra-gtk-module"
Applying attention optimization: Doggettx... done.
Model loaded in 6.1s (load weights from disk: 0.7s, create model: 0.9s, apply weights to model: 3.6s, calculate empty prompt: 0.7s).
`
Oh, fun fact! If I force xformers I dont get to generate anything at all apparently. I'll submit a new form later.
Try --opt-sdp-attention instead.
having this problem also. Is xformers just not used anymore? Never installs automatically on setup, any version you install afterwards just updates torch to 2.4.0 and then complains it's incompatible with everything.
pip install xformers==0.0.27.post1 --index-url https://download.pytorch.org/whl/cu121
pip install xformers==0.0.27.post1 --index-url https://download.pytorch.org/whl/cu121
i have same issue and this version of xformers not work. i have torch 2.6.0+cu116 and xformers 0.0.29.post2 (older version xformers support only torch 2.4.0) can't fix "no module 'xformers'. Processing without..." bug. and share feature doesn't work too