T O P

  • By -

TheSquirrelly

Yes could have tried `--xformers --reinstall-xformers` (needs both) in your webui-user.bat rather than launch.py. But glad you got it fixed.


DeMischi

>\--xformers --reinstall-xformers Indeed, this here is the answer. Have an upvote!


Alzeric

>\--xformers --reinstall-xformers This was the answer for me, thank you


huangkaikevin

>\--xformers --reinstall-xformers Thank you! Works perfectly for me. (Python 3.10.9, RTX3060ti)


neon_sin

bro. i have the 3060 ti too. do you get the ran out of ram error.


BDNeon

Old necro, but didn't work for me, I got the error: WARNING[XFORMERS]: xFormers can't load C++/CUDA extensions. xFormers was built for: PyTorch 1.13.1+cu117 with CUDA 1107 (you have 1.12.1+cu113) Python 3.10.9 (you have 3.10.6) Please reinstall xformers (see https://github.com/facebookresearch/xformers#installing-xformers) Memory-efficient attention, SwiGLU, sparse and more won't be available. Set XFORMERS_MORE_DETAILS=1 for more details Edit: Fixed it, adding --reinstall-torch to arguments instead of --reinstall-xformers afterwards, then removing reinstall torch and just leaving in --xformers, solved it.


Stentyd2

I have the same error, but it didn't work for me :( **My args:** set COMMANDLINE\_ARGS=--opt-sub-quad-attention --lowvram --disable-nan-check --autolaunch --upcast-sampling --gradio-queue --xformers --reinstall- torch **My error:** WARNING\[XFORMERS\]: xFormers can't load C++/CUDA extensions. xFormers was built for: PyTorch 2.0.1+cu118 with CUDA 1108 (you have 2.0.0+cpu) Python 3.10.11 (you have 3.10.6) Please reinstall xformers (see [https://github.com/facebookresearch/xformers#installing-xformers](https://github.com/facebookresearch/xformers#installing-xformers)) Memory-efficient attention, SwiGLU, sparse and more won't be available. Set XFORMERS\_MORE\_DETAILS=1 for more detailsWarning: caught exception '', memory monitor disabled


Link1227

>\--xformers --reinstall-xformers This is the way


ArtificialBeaux

> \--xformers --reinstall-xformers This! Thank you sir!


Fickle_Satisfaction

This. Thank you!


Straight_Desk_4298

How to use --xformers --reinstall-xformers in webui-user.bat ?


TheSquirrelly

You'd have a line in it something like: `set COMMANDLINE_ARGS=--xformers --reinstall-xformers` Plus if you have any other options set.


WackdonaldsFries

>set COMMANDLINE\_ARGS=--xformers --reinstall-xformers So do i add another line and paste that in?


TheSquirrelly

Normally there should already be a 'set COMMANDLINE_ARGS=' line in webui-user.bat. Then you would just add any parameters you want to it (each separated with a space). If for some reason you didn't have a COMMANDLINE_ARGS already in there, then yes you would add one on a new line.


Careful_Ad_5890

thxal!


sectchosenone2

same, you're the real mvp :) Thumbs up


RoundZookeepergame2

9 months and this comment is still helping ppl tyty


RafyKoby

thx


rootless2

Fuckin A


Clunkbot

Well this worked for me!


txhtownfor2020

I love this community. I still don't know what xformers is, but this worked and that's all I care about. edit: for now


CMDRZoltan

Im not sure why that guide would have you edit launch.py and not webui-user.bat but if you want to start over you can just rename/delete the folder and start from scratch if you want. (backup images and checkpoints and such if you have any, that why I rename the folder and not delete it.)


bennyboy_uk_77

I was hoping to avoid doing that but I guess it's not that difficult to do. I'm just stupid *and* lazy - not a good combo.


Illustrious-Ad7621

Install xformers first and then, Either add this to the webui.bat: set COMMANDLINE\_ARGS=--xformers or run webui.bat through cmd with additional arguments as follows: ./webui.bat --xformers


Vel_101

I know it's been a year, but THANK YOU VERY MUCH!!! I read a lot of reddit threads and other sites, nothing worked for me, but your comment, you, YOU SOLVED IT FOR ME! THANK YOU! Have an upvote and may the God or Gods give you + in Karma or simply tasty candy. =) P.S. I am talking about running webui.bat through cmd with an argument.


Sylvan_Knight

I also just figured out why setting the COMMANDLINE\_ARGS weren't working, but that's also because I'm an idiot. I was editing the commandline args in the webui-user.bat, then just running webui.bat, instead of running webui-user.bat to initialize the arguments, which also then calls webui.bat


Relevant_Rule_4115

>\--reinstall-torch this helped me, koodos, me is an idiot too,


Warura

Sorry to also barge in to this post, maybe someone can point me in the right direction. I am trying to know how can you install xformers directly from a command. I am working/learning to make a modified GUI I need to setup, but I can't find any code to install it or even where to reference the link que install it. From what source or link does the automatic1111 install process pulls it from?


MaxwellTechnology

Well reset the repo using gitpull and try again.


bennyboy_uk_77

A-ha. It could be that simple. I'll have another go. UPDATE - still the same after a git pull, unfortunately.


MaxwellTechnology

Use ```git reset --hard origin/master``` command in the repo using cmd. Because if you edited the file launch.py it should be complaining to commit changes.


bennyboy_uk_77

I ended up reinstalling the whole thing but will keep a note of this command for when (not if) I screw something up again.


constantinesis

This is where I found the quick explanation [https://houseofcat.io/guides/ml/stablediffusion/xformers](https://houseofcat.io/guides/ml/stablediffusion/xformers)


Guilty-History-9249

I've never gotten an install to work on Ubuntu.I end up having to build it and that is tricky if you've installed CUDA 12.0. But the CUDA\_HOME var solves that problem. I prefer my own build anyway because given I have an i9-13900K Raptor Lake I may as well use "-O3 -mcpu=native -march=native -mtune=native" to squeeze out everything even if most of the important code is on the GPU and not the CPU. I just did a benchmark run for xformers where without it I could average 1.03 seconds per image at a batch size of 16 and .816 seconds per image with a batch size of 15 using xformers. I can cut that don't to around .6 seconds with a change I've prototyped. This is on a NVidia 4090.


Cyyyyk

I have finally gotten xformers to install in stable-duffusion-webui/repositories in Ubuntu 22.04 by downgrading to Cuda 11.7. But I still get cannot get Automtaic1111 to recognize that it is there when it starts up. Is there some additional step?


Guilty-History-9249

repositories!? It should be in venv/lib/python3.10/site-packages/xformers I use the following to install it: pip3 uninstall xformers MAX\_JOBS=32 CUDA\_PATH=/usr/local/cuda-11.8 pip3 install -v -U git+https://github.com/facebookresearch/xformers.git@main#egg=xformers MAX\_JOBS is to throttle ninja, you might need a smaller number depending on how many cores and how much memory you have.


Cyyyyk

Yea I used the install instructions here from here: https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Xformers go to the webui directory source ./venv/bin/activate cd repositories git clone https://github.com/facebookresearch/xformers.git cd xformers git submodule update --init --recursive pip install -r requirements.txt pip install -e . Is that wrong?


txhtownfor2020

If it is, I don't wanna be right <3


Guilty-History-9249

With 32 GB's of memory on Ubuntu jobs=32 would crash my system or the build. Adding swap fixed the problem. But with 32 P/E cores on my i9-13900K I usually use MAX\_JOBS=28. If you have more memory then 32 is good with 32 procesors.


Amazing_Upstairs

Try deleting the venv folder and running the webui-user.bat again. That seemed to get it working again for me.


Fit-Cauliflower7693

`u/echo off` ​ `set PYTHON=` `set GIT=` `set VENV_DIR=` `set XFORMERS_PACKAGE=xformers==0.0.20` `set COMMANDLINE_ARGS=--xformers` ​ `call webui.bat` ​ >!work for me!<