TheLastBen / fast-stable-diffusion

fast-stable-diffusion + DreamBooth
MIT License
7.49k stars 1.3k forks source link

Google Colab Error #2913

Open Bob85111 opened 3 weeks ago

Bob85111 commented 3 weeks ago

Received the following error. Looks like somebody updated something, and now the code doesn't work anymore. Any ideas on how to fix it? Seems like this happens ever three or four months

WARNING[XFORMERS]: xFormers can't load C++/CUDA extensions. xFormers was built for: PyTorch 2.3.0+cu121 with CUDA 1201 (you have 2.4.0+cu121) Python 3.10.14 (you have 3.10.12) 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 ControlNet preprocessor location: /content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd-webui-controlnet/annotator/downloads ** Error loading script: controlnet.py Traceback (most recent call last): File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/scripts.py", line 515, in load_scripts script_module = script_loading.load_module(scriptfile.path) File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/script_loading.py", line 13, in load_module module_spec.loader.exec_module(module) File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/controlnet.py", line 16, in import scripts.preprocessor as preprocessor_init # noqa File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/preprocessor/init.py", line 9, in from .mobile_sam import File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/preprocessor/mobile_sam.py", line 1, in from annotator.mobile_sam import SamDetector_Aux File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd-webui-controlnet/annotator/mobile_sam/init.py", line 12, in from controlnet_aux import SamDetector ModuleNotFoundError: No module named 'controlnet_aux'

HaikenEdge commented 3 weeks ago

Can confirm this error, kinda. My version is this:

WARNING[XFORMERS]: xFormers can't load C++/CUDA extensions. xFormers was built for: PyTorch 2.3.0+cu121 with CUDA 1201 (you have 2.4.0+cu121) Python 3.10.14 (you have 3.10.12) 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

Not going to try a bunch of malware being pushed by bots.

mdlieber99 commented 3 weeks ago

Same error here when trying to use dream booth:

WARNING[XFORMERS]: xFormers can't load C++/CUDA extensions. xFormers was built for: PyTorch 2.3.0+cu121 with CUDA 1201 (you have 2.4.0+cu121) Python 3.10.14 (you have 3.10.12) 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 Traceback (most recent call last): File "/content/diffusers/examples/dreambooth/train_dreambooth.py", line 803, in main() File "/content/diffusers/examples/dreambooth/train_dreambooth.py", line 519, in main unet.enable_xformers_memory_efficient_attention()

morningbowlai commented 3 weeks ago

Same issues here. Last time I had an issue like this, it got cleared up within a couple days. I tried to install that through the extension tab, but didn't fix anything,

danixen2 commented 3 weeks ago

A quick fix to generate images and ignore this error is to remove --xformers at the end of the code line of the Start Stable-Diffusion tab.

Example:

try: model if os.path.isfile(model): !python /content/gdrive/$mainpth/sd/stable-diffusion-w$blsaphemy/webui.py $share --api --disable-safe-unpickle --enable-insecure-extension-access --no-download-sd-model --no-half-vae --ckpt "$model" $auth --disable-console-progressbars --skip-version-check $ckptdir else: !python /content/gdrive/$mainpth/sd/stable-diffusion-w$blsaphemy/webui.py $share --api --disable-safe-unpickle --enable-insecure-extension-access --no-download-sd-model --no-half-vae --ckpt-dir "$model" $auth --disable-console-progressbars --skip-version-check except: !python /content/gdrive/$mainpth/sd/stable-diffusion-w$blsaphemy/webui.py $share --api --disable-safe-unpickle --enable-insecure-extension-access --no-download-sd-model --no-half-vae $auth --disable-console-progressbars --skip-version-check $ckptdir

jalva00T commented 3 weeks ago

Found from a discussion back in march that you can replace --xformers with --opt-sdp-attention. The interface loaded but its stuck trying to load the last prompt i had used.

aifantasyglam commented 3 weeks ago

to solve the issue run this: !pip3 install -U xformers --index-url https://download.pytorch.org/whl/cu121

Azura-13 commented 3 weeks ago

Thank you aifantasyglam, that's perfect =)

BlessedDuelOP commented 3 weeks ago

love you aifantasyglam

g-imconfused commented 2 weeks ago

to solve the issue run this: !pip3 install -U xformers --index-url https://download.pytorch.org/whl/cu121

one question - where should this be run? somehwhere in the Install/Update AUTOMATIC1111 repo?

thanks all!

2 - next guess, running it in the requirements cell threw no errors after either cell, and UI is running back to normal - all good!

here's where i inserted it, in case it matters. this is the end of the code in the Requirements cell:

else: %env LD_PRELOAD=/content/gdrive/$mainpth/sd/libtcmalloc/libtcmalloc_minimal.so.4

inserted line

!pip3 install -U xformers --index-url https://download.pytorch.org/whl/cu121

!pip install controlnet_aux -qq --no-deps os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' os.environ['PYTHONWARNINGS'] = 'ignore' !sed -i 's@text = _formatwarnmsg(msg)@text =\"\"@g' /usr/lib/python3.10/warnings.py

clear_output() inf('\u2714 Done','success', '50px')

@markdown ---

thanks as always!

Azura-13 commented 2 weeks ago

I put it just above [6] Download Lora

Add Code, Copy and paste.

aifantasyglam commented 2 weeks ago

to solve the issue run this: !pip3 install -U xformers --index-url https://download.pytorch.org/whl/cu121

one question - where should this be run? somehwhere in the Install/Update AUTOMATIC1111 repo?

thanks all!

  • ok decided not to be lazy and instead answer my own question since i've never played with this code much. 1- running this in my first choice, at the end of Install/Update AUTOMATIC1111 repo tossed few more errors from that cell but seemed to remove and reinstall xformers at the end. but still tossed the original error when starting SD, and choked in the UI. no luck

2 - next guess, running it in the requirements cell threw no errors after either cell, and UI is running back to normal - all good!

here's where i inserted it, in case it matters. this is the end of the code in the Requirements cell:

else: %env LD_PRELOAD=/content/gdrive/$mainpth/sd/libtcmalloc/libtcmalloc_minimal.so.4

inserted line

!pip3 install -U xformers --index-url https://download.pytorch.org/whl/cu121

!pip install controlnet_aux -qq --no-deps os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' os.environ['PYTHONWARNINGS'] = 'ignore' !sed -i 's@text = _formatwarnmsg(msg)@text =""@g' /usr/lib/python3.10/warnings.py

clear_output() inf('\u2714 Done','success', '50px')

@markdown ---

thanks as always!

I run it above this part

image

aifantasyglam commented 2 weeks ago

Everyone, I would like to take advantage of this thread and ask something

anyone knows how to solve this issue ?: https://github.com/Gourieff/sd-webui-reactor/issues/483

The-Great-Nothing commented 2 weeks ago

Same error here when trying to use dream booth:

WARNING[XFORMERS]: xFormers can't load C++/CUDA extensions. xFormers was built for: PyTorch 2.3.0+cu121 with CUDA 1201 (you have 2.4.0+cu121) Python 3.10.14 (you have 3.10.12) 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 Traceback (most recent call last): File "/content/diffusers/examples/dreambooth/train_dreambooth.py", line 803, in main() File "/content/diffusers/examples/dreambooth/train_dreambooth.py", line 519, in main unet.enable_xformers_memory_efficient_attention()

FOr Dreambooth go to "Dependencies", show code and scroll down to the bottom of the code. Modify the last lines so you get something like this (note the added xformers install):

else:
    %env LD_PRELOAD=/content/gdrive/MyDrive/sd/libtcmalloc/libtcmalloc_minimal.so.4

!pip3 install -U xformers --index-url https://download.pytorch.org/whl/cu121
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
os.environ['PYTHONWARNINGS'] = 'ignore'
!sed -i 's@raise AttributeError(f"module {module!r} has no attribute {name!r}")@@g' /usr/local/lib/python3.10/dist-packages/jax/_src/deprecations.py
aifantasyglam commented 2 weeks ago

Hi everyone, I got a new error related to the previous, does anyone know anything about it...?

image

mdlieber99 commented 2 weeks ago

hmm, now the start up on the colab page is fine (with the extra line of code from aifantasyglam - thank you!). but now when I try to open the public url I get a '504 gateway time-out' error

g-imconfused commented 2 weeks ago

Yep, gradio is down this morning.

On Wed, Aug 28, 2024, 5:41 AM mdlieber99 @.***> wrote:

hmm, now the start up on the colab page is fine (with the extra line of code from aifantasyglam - thank you!). but now when I try to open the public url I get a '504 gateway time-out' error

— Reply to this email directly, view it on GitHub https://github.com/TheLastBen/fast-stable-diffusion/issues/2913#issuecomment-2315212829, or unsubscribe https://github.com/notifications/unsubscribe-auth/BKWECTGID3EYKAXMOK2GRJ3ZTXANVAVCNFSM6AAAAABNEPL6Z6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMJVGIYTEOBSHE . You are receiving this because you commented.Message ID: @.***>

g-imconfused commented 2 weeks ago

gradio back online now

HappyRobotLtd commented 2 weeks ago

Same issue here - Automatic 1111 was working fine in Colab on my MacBook Pro M1 until a few days ago and now this exact same xformers error which will launch the SD UI but delivers an error message when trying to generate anything.

Is there a simple fix for this that doesn't involve using the Terminal on a Mac that won't screw things up further?

(I can of course install SD in my local machine but it's very slow and eats up drive space and it doesn't require xformers to run properly.)