stable-diffusion-webui-forge icon indicating copy to clipboard operation
stable-diffusion-webui-forge copied to clipboard

[Bug]: No xformers with default webui-user.bat

Open aolko opened this issue 5 months ago • 10 comments

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
  • [X] The issue has been reported before but has not been fixed yet

What happened?

On launch with default webui-user.bat (empty vars) it complains about ModuleNotFoundError: import of xformers halted; None in sys.modules

Steps to reproduce the problem

  1. git pull
  2. make sure the webui-user.bat's vars are empty:
set PYTHON=
set GIT=
set VENV_DIR=
set COMMANDLINE_ARGS=
  1. launch

What should have happened?

Normal launch

What browsers do you use to access the UI ?

Google Chrome, Other

Sysinfo

sysinfo-2024-02-09-16-13.json

Console logs

Microsoft Windows [Version 10.0.22621.3007]
(c) Корпорация Майкрософт (Microsoft Corporation). Все права защищены.

D:\Programs\PinokioAI\api\sd-webui-forge.git\sd-webui-forge>webui-user.bat
venv "D:\Programs\PinokioAI\api\sd-webui-forge.git\sd-webui-forge\venv\Scripts\Python.exe"
Python 3.10.13 | packaged by Anaconda, Inc. | (main, Sep 11 2023, 13:24:38) [MSC v.1916 64 bit (AMD64)]
Version: f0.0.10-latest-86-ged60a998
Commit hash: ed60a9982690f85b6e14e3f891ae481a045b94d0
Launching Web UI with arguments: 
Total VRAM 6144 MB, total RAM 32718 MB
WARNING:xformers:A matching Triton is not available, some optimizations will not be enabled.
Error caught was: No module named 'triton'
xformers version: 0.0.23.post1
Set vram state to: NORMAL_VRAM
Device: cuda:0 NVIDIA GeForce GTX 1060 6GB : native
VAE dtype: torch.float32
Traceback (most recent call last):
  File "D:\Programs\PinokioAI\api\sd-webui-forge.git\sd-webui-forge\launch.py", line 48, in <module>
    main()
  File "D:\Programs\PinokioAI\api\sd-webui-forge.git\sd-webui-forge\launch.py", line 44, in main
    start()
  File "D:\Programs\PinokioAI\api\sd-webui-forge.git\sd-webui-forge\modules\launch_utils.py", line 508, in start
    import webui
  File "D:\Programs\PinokioAI\api\sd-webui-forge.git\sd-webui-forge\webui.py", line 19, in <module>
    initialize.imports()
  File "D:\Programs\PinokioAI\api\sd-webui-forge.git\sd-webui-forge\modules\initialize.py", line 53, in imports
    from modules import processing, gradio_extensons, ui  # noqa: F401
  File "D:\Programs\PinokioAI\api\sd-webui-forge.git\sd-webui-forge\modules\processing.py", line 18, in <module>
    import modules.sd_hijack
  File "D:\Programs\PinokioAI\api\sd-webui-forge.git\sd-webui-forge\modules\sd_hijack.py", line 5, in <module>
    from modules import devices, sd_hijack_optimizations, shared, script_callbacks, errors, sd_unet, patches
  File "D:\Programs\PinokioAI\api\sd-webui-forge.git\sd-webui-forge\modules\sd_hijack_optimizations.py", line 13, in <module>
    from modules.hypernetworks import hypernetwork
  File "D:\Programs\PinokioAI\api\sd-webui-forge.git\sd-webui-forge\modules\hypernetworks\hypernetwork.py", line 13, in <module>
    from modules import devices, sd_models, shared, sd_samplers, hashes, sd_hijack_checkpoint, errors
  File "D:\Programs\PinokioAI\api\sd-webui-forge.git\sd-webui-forge\modules\sd_models.py", line 20, in <module>
    from modules_forge import forge_loader
  File "D:\Programs\PinokioAI\api\sd-webui-forge.git\sd-webui-forge\modules_forge\forge_loader.py", line 5, in <module>
    from ldm_patched.modules import model_detection
  File "D:\Programs\PinokioAI\api\sd-webui-forge.git\sd-webui-forge\ldm_patched\modules\model_detection.py", line 1, in <module>
    import ldm_patched.modules.supported_models
  File "D:\Programs\PinokioAI\api\sd-webui-forge.git\sd-webui-forge\ldm_patched\modules\supported_models.py", line 2, in <module>
    from . import model_base
  File "D:\Programs\PinokioAI\api\sd-webui-forge.git\sd-webui-forge\ldm_patched\modules\model_base.py", line 2, in <module>
    from ldm_patched.ldm.modules.diffusionmodules.openaimodel import UNetModel, Timestep
  File "D:\Programs\PinokioAI\api\sd-webui-forge.git\sd-webui-forge\ldm_patched\ldm\modules\diffusionmodules\openaimodel.py", line 15, in <module>
    from ..attention import SpatialTransformer, SpatialVideoTransformer, default
  File "D:\Programs\PinokioAI\api\sd-webui-forge.git\sd-webui-forge\ldm_patched\ldm\modules\attention.py", line 14, in <module>
    import xformers
ModuleNotFoundError: import of xformers halted; None in sys.modules
Для продолжения нажмите любую клавишу . . . 

Additional information

also see: #147

The readme explicitly states not to modify the file

Forge backend removes all WebUI's codes related to resource management and reworked everything. All previous CMD flags like medvram, lowvram, medvram-sdxl, precision full, no half, no half vae, attention_xxx, upcast unet, ... are all REMOVED. Adding these flags will not cause error but they will not do anything now. We highly encourage Forge users to remove all cmd flags and let Forge to decide how to load models.

aolko avatar Feb 09 '24 16:02 aolko

pip uninstall xformers?

lllyasviel avatar Feb 09 '24 23:02 lllyasviel

pip uninstall xformers?

no, --xformers

aolko avatar Feb 09 '24 23:02 aolko

pip uninstall xformers?

no, --xformers

@aolko There is no need to install xformers (see #150 ).

EtienneDosSantos avatar Feb 10 '24 11:02 EtienneDosSantos

Alright, tried suggested actions, so far forge works.

aolko avatar Feb 10 '24 23:02 aolko

freshly downloaded forge works without any argument,adding the --xformers argument to test and then trying to remove it is what causes the bug for me,tried every sugestion here and doesnt work, --disable-xformers used to work but with recent update no longer works

tunak222 avatar Feb 13 '24 02:02 tunak222

freshly downloaded forge works without any argument,adding the --xformers argument to test and then trying to remove it is what causes the bug for me,tried every sugestion here and doesnt work, --disable-xformers used to work but with recent update no longer works

You don't need xformers in forge. It's not faster.

EtienneDosSantos avatar Feb 13 '24 09:02 EtienneDosSantos

freshly downloaded forge works without any argument,adding the --xformers argument to test and then trying to remove it is what causes the bug for me,tried every sugestion here and doesnt work, --disable-xformers used to work but with recent update no longer works

You don't need xformers in forge. It's not faster.

i dont think you understood what i said so ill try to say it more clearly, "if you enable --xformers once for whatever reason and then u try to disable it,you wont be able to"

tunak222 avatar Feb 13 '24 11:02 tunak222

I'm having the same issue. I HAVE to include --xformers otherwise forge will not load at all. Tried to uninstall xformers, but it says it is not installed. Doesn't matter if I leave the arguments blank or --disable-xformers, I get:

Traceback (most recent call last): File "C:\AI\stable-diffusion-webui-forge\launch.py", line 51, in main() File "C:\AI\stable-diffusion-webui-forge\launch.py", line 47, in main start() File "C:\AI\stable-diffusion-webui-forge\modules\launch_utils.py", line 541, in start import webui File "C:\AI\stable-diffusion-webui-forge\webui.py", line 19, in initialize.imports() File "C:\AI\stable-diffusion-webui-forge\modules\initialize.py", line 53, in imports from modules import processing, gradio_extensons, ui # noqa: F401 File "C:\AI\stable-diffusion-webui-forge\modules\processing.py", line 18, in import modules.sd_hijack File "C:\AI\stable-diffusion-webui-forge\modules\sd_hijack.py", line 5, in from modules import devices, sd_hijack_optimizations, shared, script_callbacks, errors, sd_unet, patches File "C:\AI\stable-diffusion-webui-forge\modules\sd_hijack_optimizations.py", line 13, in from modules.hypernetworks import hypernetwork File "C:\AI\stable-diffusion-webui-forge\modules\hypernetworks\hypernetwork.py", line 13, in from modules import devices, sd_models, shared, sd_samplers, hashes, sd_hijack_checkpoint, errors File "C:\AI\stable-diffusion-webui-forge\modules\sd_models.py", line 20, in from modules_forge import forge_loader File "C:\AI\stable-diffusion-webui-forge\modules_forge\forge_loader.py", line 5, in from ldm_patched.modules import model_detection File "C:\AI\stable-diffusion-webui-forge\ldm_patched\modules\model_detection.py", line 5, in import ldm_patched.modules.supported_models File "C:\AI\stable-diffusion-webui-forge\ldm_patched\modules\supported_models.py", line 5, in from . import model_base File "C:\AI\stable-diffusion-webui-forge\ldm_patched\modules\model_base.py", line 6, in from ldm_patched.ldm.modules.diffusionmodules.openaimodel import UNetModel, Timestep File "C:\AI\stable-diffusion-webui-forge\ldm_patched\ldm\modules\diffusionmodules\openaimodel.py", line 22, in from ..attention import SpatialTransformer, SpatialVideoTransformer, default File "C:\AI\stable-diffusion-webui-forge\ldm_patched\ldm\modules\attention.py", line 21, in import xformers ModuleNotFoundError: import of xformers halted; None in sys.modules

warbirdphotog avatar Feb 13 '24 11:02 warbirdphotog

WARNING:xformers:A matching Triton is not available, some optimizations will not be enabled. Error caught was: No module named 'triton' xformers version: 0.0.23.post1 Set vram state to: NORMAL_VRAM Device: cuda:0 NVIDIA GeForce RTX 3060 : native

howto fix ???

pathtanan avatar Feb 14 '24 05:02 pathtanan

WARNING:xformers:A matching Triton is not available, some optimizations will not be enabled. Error caught was: No module named 'triton' xformers version: 0.0.23.post1 Set vram state to: NORMAL_VRAM Device: cuda:0 NVIDIA GeForce RTX 3060 : native

howto fix ???

it's normal, just ignore it

  • https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/7115
  • https://github.com/invoke-ai/InvokeAI/issues/3878
  • https://www.reddit.com/r/StableDiffusion/comments/13c8dao/kohya_what_is_a_triton_and_why_dont_i_have_one/

aolko avatar Feb 14 '24 06:02 aolko

freshly downloaded forge works without any argument,adding the --xformers argument to test and then trying to remove it is what causes the bug for me,tried every sugestion here and doesnt work, --disable-xformers used to work but with recent update no longer works

You don't need xformers in forge. It's not faster.

i dont think you understood what i said so ill try to say it more clearly, "if you enable --xformers once for whatever reason and then u try to disable it,you wont be able to"

so i would have to reinstall forge?

dipstik avatar Feb 29 '24 03:02 dipstik

I'm closing this since the original issue OP reported seems to have been resolved. Feel free to re-open if that's not the case.

catboxanon avatar Feb 29 '24 08:02 catboxanon