lllyasviel / stable-diffusion-webui-forge

GNU Affero General Public License v3.0
8.06k stars 789 forks source link

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

Closed aolko closed 7 months ago

aolko commented 8 months ago

Checklist

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=
  3. 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.

lllyasviel commented 8 months ago

pip uninstall xformers?

aolko commented 8 months ago

pip uninstall xformers?

no, --xformers

IndigoDosSantos commented 8 months ago

pip uninstall xformers?

no, --xformers

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

aolko commented 8 months ago

Alright, tried suggested actions, so far forge works.

tunak222 commented 8 months ago

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

IndigoDosSantos commented 8 months ago

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.

tunak222 commented 8 months ago

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"

warbirdphotog commented 8 months ago

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

pathtanan commented 8 months ago

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 ???

aolko commented 8 months ago

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

dipstik commented 7 months ago

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?

catboxanon commented 7 months ago

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.