vladmandic / automatic

SD.Next: Advanced Implementation of Stable Diffusion and other Diffusion-based generative image models
https://github.com/vladmandic/automatic
GNU Affero General Public License v3.0
5.68k stars 421 forks source link

[External] Xformers crash on Windows #104

Closed githubUser01946 closed 1 year ago

githubUser01946 commented 1 year ago

Issue Description

When I launched launch.py for the first time it showed the following popup message:

image

Platform Description

Windows 10

vladmandic commented 1 year ago

xformers need to be installed to exactly match version of torch - did you try reinstalling them?

githubUser01946 commented 1 year ago

I'm away from it at the moment. When I get back I'll start it up again and maybe it'll work?

If not how do I fix it?

On Thu, 13 Apr 2023, 5:31 pm Vladimir Mandic, @.***> wrote:

xformers need to be installed to exactly match version of torch - did you try reinstalling them?

— Reply to this email directly, view it on GitHub https://github.com/vladmandic/automatic/issues/104#issuecomment-1507259640, or unsubscribe https://github.com/notifications/unsubscribe-auth/A4ADEB43XO7PG3RITO4Q26DXBAS5TANCNFSM6AAAAAAW5BSTHU . You are receiving this because you authored the thread.Message ID: @.***>

vladmandic commented 1 year ago

try this:

venv\Scripts\activate
pip show torch
pip uninstall xformers
pip install -U xformers --no-deps
githubUser01946 commented 1 year ago

I run that in CMD via the Automatic directory?

On Thu, 13 Apr 2023, 5:42 pm Vladimir Mandic, @.***> wrote:

try this:

venv\Scripts\activate pip show torch pip uninstall xformers pip install -U xformers --no-deps

— Reply to this email directly, view it on GitHub https://github.com/vladmandic/automatic/issues/104#issuecomment-1507274299, or unsubscribe https://github.com/notifications/unsubscribe-auth/A4ADEB45TMB2HRTEULGMB5TXBAUI7ANCNFSM6AAAAAAW5BSTHU . You are receiving this because you authored the thread.Message ID: @.***>

vladmandic commented 1 year ago

CMD

yes.

githubUser01946 commented 1 year ago

I just wanted to make sure it was done in the right place.

On Thu, 13 Apr 2023, 5:48 pm Vladimir Mandic, @.***> wrote:

CMD

yes.

— Reply to this email directly, view it on GitHub https://github.com/vladmandic/automatic/issues/104#issuecomment-1507281023, or unsubscribe https://github.com/notifications/unsubscribe-auth/A4ADEBYC45C6IACRJGBHYHTXBAU6FANCNFSM6AAAAAAW5BSTHU . You are receiving this because you authored the thread.Message ID: @.***>

mykeehu commented 1 year ago

I have xformers installed in venv, but according to the System info it is not loaded, the --xformers option is not usable. Do I need to load it separately or does it use it automatically in the background?

githubUser01946 commented 1 year ago
venv\Scripts\activate

When I open CMD in D:\automatic it says The system cannot findthe path specified Also when I run the pip show torch it returns with:

D:\automatic>pip show torch WARNING: Ignoring invalid distribution -ransformers (c:\users\cpgsa\appdata\local\programs\python\python310\lib\site-packages) Name: torch Version: 1.12.1+cu113 Summary: Tensors and Dynamic neural networks in Python with strong GPU acceleration Home-page: https://pytorch.org/ Author: PyTorch Team Author-email: packages@pytorch.org License: BSD-3 Location: c:\users\githubUser01946\appdata\local\programs\python\python310\lib\site-packages Requires: typing-extensions Required-by: accelerate, basicsr, clean-fid, clip, clip-interrogator, facexlib, fairscale, gfpgan, invisible-watermark, kornia, lpips, open-clip-torch, pytorch-lightning, realesrgan, timm, torchdiffeq, torchmetrics, torchsde, torchvision, xformers

I didn't type anything incorrectly in that code block, it really says -ransformers.

githubUser01946 commented 1 year ago

image

vladmandic commented 1 year ago

your torch is obsolete. you need to uninstall it and have webui.bat install requirements correctly - see #107

and did you get git outputs as previously asked? that must work in order for anything to be ok.

and DO NOT copy files from a1111 blindly - you're just causing conflicts.

githubUser01946 commented 1 year ago

Ok so i have an update. I have moved webui-user.bat from the original automatic1111 install in the folder of yours and now it says this in cmd when I run it:

image

githubUser01946 commented 1 year ago

your torch is obsolete. you need to uninstall it and have webui.bat install requirements correctly - see #107

and did you get git outputs as previously asked? that must work in order for anything to be ok.

and DO NOT copy files from a1111 blindly - you're just causing conflicts.

I am currently doing what #107 states. As for the last thing, I thought I read somewhere that you stated webui-user.bat was fine to use. Obviously not. I have removed that 1 file as thats the only file from A1111 I had moved across.

What git things are you referring to?

githubUser01946 commented 1 year ago

Double clicked launch.py which has started py.exe that has a loads of errors but it is continuing to do things....

Said how many models were there a few more lines I didnt see then crashed out.

githubUser01946 commented 1 year ago

It is now loaded but the model doesnt seem to want to load. image

vladmandic commented 1 year ago

why are you double-clicking launch.py??? what does it say in the readme? webui.bat: If you're unsure which launcher to use, this is the one you want there is a good reason for that.

now you have tons of python libs installed in as system, user and venv and its a mess. cleaning that up is non-trivial - and cleanup is clearly needed.

easiest is to uninstall python and start from scratch and follow install procedure. and when complete, post console output here.

Centurion-Rome commented 1 year ago

I have used xformers on Windows 11 -starting webui.bat without problems. Read readme. --xformers is moved to config tab ;) but you don't need xformers, just use "sdp".

ps my "webui-user.bat":

@echo off
set COMMANDLINE_ARGS=--autolaunch --no-half-vae --medvram --no-download-sd-model --upgrade
call webui.bat
vladmandic commented 1 year ago

@Centurion-Rome i agree with what you've said, but note that he has obsolete torch 1.12 and did several different installs with and without venv, clean install is required.

Centurion-Rome commented 1 year ago

"clean install is required" yes you are right.

githubUser01946 commented 1 year ago

why are you double-clicking launch.py??? what does it say in the readme? webui.bat: If you're unsure which launcher to use, this is the one you want there is a good reason for that.

now you have tons of python libs installed in as system, user and venv and its a mess. cleaning that up is non-trivial - and cleanup is clearly needed.

easiest is to uninstall python and start from scratch and follow install procedure. and when complete, post console output here.

Maybe you should look at how you wrote the instructions instead of being rude to people who have to follow them.

Rudeness isnt the way to go.