TheLastBen / fast-stable-diffusion

fast-stable-diffusion + DreamBooth
MIT License
7.52k stars 1.31k forks source link

Collab error - not working any more since today #2681

Open MajorGruberth opened 10 months ago

MajorGruberth commented 10 months ago

"WARNING[XFORMERS]: xFormers can't load C++/CUDA extensions. xFormers was built for: PyTorch 2.1.0+cu118 with CUDA 1106 (you have 2.1.0+cu121) Python 3.9.16 (you have 3.10.12) Please reinstall xformers (see https://github.com/facebookresearch/xformers#installing-xformers)"

I would really like to work without interruptions like that. What does it mean? What do I have to do? For month I worked without much problems and suddenly this. How can I fix it? I am paying for Colab. What else can I do? Really p**!!

DeAiArt commented 10 months ago

Same here

D-usk commented 10 months ago

Probably a Python update. We might add manually a update with the old version of Python and Pytorch tho (https://download.pytorch.org/whl/cu118). I tried with a new environnement, but I get an error :(

MajorGruberth commented 10 months ago

I tried the camenduru implementation - but that's another complete disaster

DeAiArt commented 10 months ago

I tried this:

!pip install lmdb !pip install torch==2.0.1+cu118 torchvision==0.15.2+cu118 torchaudio==2.0.2 torchtext==0.15.2+cpu torchdata==0.6.1 --index-url https://download.pytorch.org/whl/cu118

was a tip from an old post from October. But it doesn't help either....

MajorGruberth commented 10 months ago

thanks for cheering me up :)

MajorGruberth commented 10 months ago

I'm giving up for tonight. Thing is: I want to pay for a valuable product. I have no unpaid apps on my computer nor my phone. I just need stuff that works. But SD is more and more like my experiences in coding in the late 80s of the last century: might work, might not. Dall-E is not flexible enough for me. Midnight Journet e.a. same. ComfyUI doesn't have a proper notebook and takes some time to get adjust. SD Next doesn't care about cloud computing (and not about MacOs anyway). So: even I would spend some $$ for an undisturbed uncluttered workflow: I CANT'T :-(

HaikenEdge commented 10 months ago

Can confirm, stopped working between when I left for work and when I came back. Same error.

aegia13 commented 10 months ago

In my environment, I added the following code to the beginning of the notebook and ran it, and StableDiffusion ran as before. I also made some modifications to the October Tips: [https://github.com/TheLastBen/fast-stable-diffusion/issues/2615]

!pip install lmdb !pip install torch==2.1.0+cu118 torchvision==0.16.0+cu118 torchaudio==2.1.0 torchtext==0.16.0+cpu torchdata==0.7.0 --index-url https://download.pytorch.org/whl/cu118

DeAiArt commented 10 months ago

In my environment, I added the following code to the beginning of the notebook and ran it, and StableDiffusion ran as before. I also made some modifications to the October Tips: [https://github.com/[/issues/2615](https://github.com/TheLastBen/fast-stable-diffusion/issues/2615)]

!pip install lmdb !pip install torch==2.1.0+cu118 torchvision==0.16.0+cu118 torchaudio==2.1.0 torchtext==0.16.0+cpu torchdata==0.7.0 --index-url https://download.pytorch.org/whl/cu118

You are my personal hero. But you always have to run the script again when you have finished the runtime.

jppetersen10 commented 10 months ago

@aegia13 you are officially the internet first on this one. Havent used my SD colab for a month, been googling this issue for two hours no luck. Finally realized to try here, you'd posted the fix less than 30min earlier. Total gratitude here.

Gelazer commented 10 months ago

@aegia13

Ok, somebody buy this man a beer! Cheers :)

yanfma123 commented 10 months ago

sorry to say when i use highres.fix,it could not work either...

Traceback (most recent call last):
  File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/call_queue.py", line 57, in f
    res = list(func(*args, **kwargs))
  File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/call_queue.py", line 36, in f
    res = func(*args, **kwargs)
  File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/txt2img.py", line 55, in txt2img
    processed = processing.process_images(p)
  File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/processing.py", line 732, in process_images
    res = process_images_inner(p)
  File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/batch_hijack.py", line 42, in processing_process_images_hijack
    return getattr(processing, '__controlnet_original_process_images_inner')(p, *args, **kwargs)
  File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/processing.py", line 867, in process_images_inner
    samples_ddim = p.sample(conditioning=p.c, unconditional_conditioning=p.uc, seeds=p.seeds, subseeds=p.subseeds, subseed_strength=p.subseed_strength, prompts=p.prompts)
  File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/processing.py", line 1156, in sample
    return self.sample_hr_pass(samples, decoded_samples, seeds, subseeds, subseed_strength, prompts)
  File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/processing.py", line 1242, in sample_hr_pass
    samples = self.sampler.sample_img2img(self, samples, noise, self.hr_c, self.hr_uc, steps=self.hr_second_pass_steps or self.steps, image_conditioning=image_conditioning)
  File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/sd_samplers_kdiffusion.py", line 145, in sample_img2img
    sigma_sched = sigmas[steps - t_enc - 1:]
TypeError: slice indices must be integers or None or have an __index__ method
Talionic commented 10 months ago

I'm also having this problem today

DeAiArt commented 10 months ago

sorry to say when i use highres.fix,it could not work either...

Traceback (most recent call last):
  File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/call_queue.py", line 57, in f
    res = list(func(*args, **kwargs))
  File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/call_queue.py", line 36, in f
    res = func(*args, **kwargs)
  File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/txt2img.py", line 55, in txt2img
    processed = processing.process_images(p)
  File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/processing.py", line 732, in process_images
    res = process_images_inner(p)
  File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/batch_hijack.py", line 42, in processing_process_images_hijack
    return getattr(processing, '__controlnet_original_process_images_inner')(p, *args, **kwargs)
  File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/processing.py", line 867, in process_images_inner
    samples_ddim = p.sample(conditioning=p.c, unconditional_conditioning=p.uc, seeds=p.seeds, subseeds=p.subseeds, subseed_strength=p.subseed_strength, prompts=p.prompts)
  File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/processing.py", line 1156, in sample
    return self.sample_hr_pass(samples, decoded_samples, seeds, subseeds, subseed_strength, prompts)
  File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/processing.py", line 1242, in sample_hr_pass
    samples = self.sampler.sample_img2img(self, samples, noise, self.hr_c, self.hr_uc, steps=self.hr_second_pass_steps or self.steps, image_conditioning=image_conditioning)
  File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/sd_samplers_kdiffusion.py", line 145, in sample_img2img
    sigma_sched = sigmas[steps - t_enc - 1:]
TypeError: slice indices must be integers or None or have an __index__ method

Hires.fix work's fine for me

gimpycpu commented 10 months ago

!pip install lmdb !pip install torch==2.1.0+cu118 torchvision==0.16.0+cu118 torchaudio==2.1.0 torchtext==0.16.0+cpu torchdata==0.7.0 --index-url https://download.pytorch.org/whl/cu118

sadly it doesnt work today for some reason, getting some cuda setup failed error

Saranmt commented 10 months ago

I added this in the requirements section, and it's working for me (it's a fix from Xela for his notebook apparently this is an error caused by colab env updates)

!pip install https://download.pytorch.org/whl/cu121/xformers-0.0.22.post4-cp310-cp310-manylinux2014_x86_64.whl#sha256=7075114dbf698b609b599f0d35032c0b2f9a389751e8bbf4dd3c628376b0dd9c

yashveer08 commented 10 months ago

Tried all the above approaches, still getting the error, for CUDA setup.

CUDA SETUP: Setup Failed!

@Saranmt @HaikenEdge @bladewolf74 @TheLastBen anyone came up with any solution?

Screenshot 2023-12-15 at 5 16 46 PM
Saranmt commented 10 months ago

Not sure if this helps, but this is my current working Requirements section, tho I have to erase runtime, refresh and run from scratch all cells on each batch I run, so it's not the best fix, I'd say a temporary one:

#@markdown # Requirements

print('Installing requirements...')

with capture.capture_output() as cap:
  %cd /content/
  !wget -q -i https://raw.githubusercontent.com/TheLastBen/fast-stable-diffusion/main/Dependencies/A1111.txt
  !dpkg -i *.deb
  if not os.path.exists('/content/gdrive/'+mainpth+'/sd/stablediffusiond'): #restore later
    !tar -C /content/gdrive/$mainpth --zstd -xf sd_mrep.tar.zst
  !tar -C / --zstd -xf gcolabdeps.tar.zst
  !rm *.deb | rm *.zst | rm *.txt
  if not os.path.exists('gdrive/'+mainpth+'/sd/libtcmalloc/libtcmalloc_minimal.so.4'):
    %env CXXFLAGS=-std=c++14
    !wget -q https://github.com/gperftools/gperftools/releases/download/gperftools-2.5/gperftools-2.5.tar.gz && tar zxf gperftools-2.5.tar.gz && mv gperftools-2.5 gperftools
    !wget -q https://github.com/TheLastBen/fast-stable-diffusion/raw/main/AUTOMATIC1111_files/Patch
    %cd /content/gperftools
    !patch -p1 < /content/Patch
    !./configure --enable-minimal --enable-libunwind --enable-frame-pointers --enable-dynamic-sized-delete-support --enable-sized-delete --enable-emergency-malloc; make -j4
    !mkdir -p /content/gdrive/$mainpth/sd/libtcmalloc && cp .libs/libtcmalloc*.so* /content/gdrive/$mainpth/sd/libtcmalloc
    %env LD_PRELOAD=/content/gdrive/$mainpth/sd/libtcmalloc/libtcmalloc_minimal.so.4
    %cd /content
    !rm *.tar.gz Patch && rm -r /content/gperftools
  else:
    %env LD_PRELOAD=/content/gdrive/$mainpth/sd/libtcmalloc/libtcmalloc_minimal.so.4

  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
  !pip install open-clip-torch==2.20.0 -qq --no-deps
  !pip install fastapi==0.94.0 gradio==3.41.2 -qq
  !pip install lmdb
  !pip install torch==2.1.0+cu118 torchvision==0.16.0+cu118 torchaudio==2.1.0 torchtext==0.16.0+cpu torchdata==0.7.0 --index-url https://download.pytorch.org/whl/cu121
  !pip install https://download.pytorch.org/whl/cu121/xformers-0.0.22.post4-cp310-cp310-manylinux2014_x86_64.whl#sha256=7075114dbf698b609b599f0d35032c0b2f9a389751e8bbf4dd3c628376b0dd9c
clear_output()
inf('\u2714 Done','success', '50px')

#@markdown ---
yashveer08 commented 10 months ago

Not sure if this helps, but this is my current working Requirements section, tho I have to erase runtime, refresh and run from scratch all cells on each batch I run, so it's not the best fix, I'd say a temporary one:

#@markdown # Requirements

print('�[1;32mInstalling requirements...')

with capture.capture_output() as cap:
  %cd /content/
  !wget -q -i https://raw.githubusercontent.com/TheLastBen/fast-stable-diffusion/main/Dependencies/A1111.txt
  !dpkg -i *.deb
  if not os.path.exists('/content/gdrive/'+mainpth+'/sd/stablediffusiond'): #restore later
    !tar -C /content/gdrive/$mainpth --zstd -xf sd_mrep.tar.zst
  !tar -C / --zstd -xf gcolabdeps.tar.zst
  !rm *.deb | rm *.zst | rm *.txt
  if not os.path.exists('gdrive/'+mainpth+'/sd/libtcmalloc/libtcmalloc_minimal.so.4'):
    %env CXXFLAGS=-std=c++14
    !wget -q https://github.com/gperftools/gperftools/releases/download/gperftools-2.5/gperftools-2.5.tar.gz && tar zxf gperftools-2.5.tar.gz && mv gperftools-2.5 gperftools
    !wget -q https://github.com/TheLastBen/fast-stable-diffusion/raw/main/AUTOMATIC1111_files/Patch
    %cd /content/gperftools
    !patch -p1 < /content/Patch
    !./configure --enable-minimal --enable-libunwind --enable-frame-pointers --enable-dynamic-sized-delete-support --enable-sized-delete --enable-emergency-malloc; make -j4
    !mkdir -p /content/gdrive/$mainpth/sd/libtcmalloc && cp .libs/libtcmalloc*.so* /content/gdrive/$mainpth/sd/libtcmalloc
    %env LD_PRELOAD=/content/gdrive/$mainpth/sd/libtcmalloc/libtcmalloc_minimal.so.4
    %cd /content
    !rm *.tar.gz Patch && rm -r /content/gperftools
  else:
    %env LD_PRELOAD=/content/gdrive/$mainpth/sd/libtcmalloc/libtcmalloc_minimal.so.4

  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
  !pip install open-clip-torch==2.20.0 -qq --no-deps
  !pip install fastapi==0.94.0 gradio==3.41.2 -qq
  !pip install lmdb
  !pip install torch==2.1.0+cu118 torchvision==0.16.0+cu118 torchaudio==2.1.0 torchtext==0.16.0+cpu torchdata==0.7.0 --index-url https://download.pytorch.org/whl/cu121
  !pip install https://download.pytorch.org/whl/cu121/xformers-0.0.22.post4-cp310-cp310-manylinux2014_x86_64.whl#sha256=7075114dbf698b609b599f0d35032c0b2f9a389751e8bbf4dd3c628376b0dd9c
clear_output()
inf('\u2714 Done','success', '50px')

#@markdown ---

There is a variable mainpth that you are using. what is it?

What are the libraries or import command that you added can you highlight that.

Also what do you mean by temporary fix?

Saranmt commented 10 months ago

Not sure if this helps, but this is my current working Requirements section, tho I have to erase runtime, refresh and run from scratch all cells on each batch I run, so it's not the best fix, I'd say a temporary one:

#@markdown # Requirements

print('�[1;32mInstalling requirements...')

with capture.capture_output() as cap:
  %cd /content/
  !wget -q -i https://raw.githubusercontent.com/TheLastBen/fast-stable-diffusion/main/Dependencies/A1111.txt
  !dpkg -i *.deb
  if not os.path.exists('/content/gdrive/'+mainpth+'/sd/stablediffusiond'): #restore later
    !tar -C /content/gdrive/$mainpth --zstd -xf sd_mrep.tar.zst
  !tar -C / --zstd -xf gcolabdeps.tar.zst
  !rm *.deb | rm *.zst | rm *.txt
  if not os.path.exists('gdrive/'+mainpth+'/sd/libtcmalloc/libtcmalloc_minimal.so.4'):
    %env CXXFLAGS=-std=c++14
    !wget -q https://github.com/gperftools/gperftools/releases/download/gperftools-2.5/gperftools-2.5.tar.gz && tar zxf gperftools-2.5.tar.gz && mv gperftools-2.5 gperftools
    !wget -q https://github.com/TheLastBen/fast-stable-diffusion/raw/main/AUTOMATIC1111_files/Patch
    %cd /content/gperftools
    !patch -p1 < /content/Patch
    !./configure --enable-minimal --enable-libunwind --enable-frame-pointers --enable-dynamic-sized-delete-support --enable-sized-delete --enable-emergency-malloc; make -j4
    !mkdir -p /content/gdrive/$mainpth/sd/libtcmalloc && cp .libs/libtcmalloc*.so* /content/gdrive/$mainpth/sd/libtcmalloc
    %env LD_PRELOAD=/content/gdrive/$mainpth/sd/libtcmalloc/libtcmalloc_minimal.so.4
    %cd /content
    !rm *.tar.gz Patch && rm -r /content/gperftools
  else:
    %env LD_PRELOAD=/content/gdrive/$mainpth/sd/libtcmalloc/libtcmalloc_minimal.so.4

  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
  !pip install open-clip-torch==2.20.0 -qq --no-deps
  !pip install fastapi==0.94.0 gradio==3.41.2 -qq
  !pip install lmdb
  !pip install torch==2.1.0+cu118 torchvision==0.16.0+cu118 torchaudio==2.1.0 torchtext==0.16.0+cpu torchdata==0.7.0 --index-url https://download.pytorch.org/whl/cu121
  !pip install https://download.pytorch.org/whl/cu121/xformers-0.0.22.post4-cp310-cp310-manylinux2014_x86_64.whl#sha256=7075114dbf698b609b599f0d35032c0b2f9a389751e8bbf4dd3c628376b0dd9c
clear_output()
inf('\u2714 Done','success', '50px')

#@markdown ---

There is a variable mainpth that you are using. what is it?

What are the libraries or import command that you added can you highlight that.

Also what do you mean by temporary fix?

the main path is in the original Automatic1111 I didnt change anything and have no idea what it does, the only part I added was this: !pip install https://download.pytorch.org/whl/cu121/xformers-0.0.22.post4-cp310-cp310-manylinux2014_x86_64.whl#sha256=7075114dbf698b609b599f0d35032c0b2f9a389751e8bbf4dd3c628376b0dd9c

,,, by temporary fix , I mean this is not a good fix since I have to rerun it from scratch everytime, hopefully someone comes up with a better solution

MajorGruberth commented 10 months ago

In my environment, I added the following code to the beginning of the notebook and ran it, and StableDiffusion ran as before. I also made some modifications to the October Tips: [https://github.com/[/issues/2615](https://github.com/TheLastBen/fast-stable-diffusion/issues/2615)]

!pip install lmdb !pip install torch==2.1.0+cu118 torchvision==0.16.0+cu118 torchaudio==2.1.0 torchtext==0.16.0+cpu torchdata==0.7.0 --index-url https://download.pytorch.org/whl/cu118

after testing a while I have to say: It worked for me. Thanks aegia13, saves my day :-)

yashveer08 commented 10 months ago

ng a while I @MajorGruberth Can you share me how it worked for you? Also if you could share the colab file it would be great.

gimpycpu commented 10 months ago

In my environment, I added the following code to the beginning of the notebook and ran it, and StableDiffusion ran as before. I also made some modifications to the October Tips: [https://github.com/[/issues/2615](https://github.com/TheLastBen/fast-stable-diffusion/issues/2615)] !pip install lmdb !pip install torch==2.1.0+cu118 torchvision==0.16.0+cu118 torchaudio==2.1.0 torchtext==0.16.0+cpu torchdata==0.7.0 --index-url https://download.pytorch.org/whl/cu118

after testing a while I have to say: It worked for me. Thanks aegia13, saves my day :-)

just to clarify were you using fast-dreambooth or fast-stable_diffusion it doesnt seem to work with the former but I just want to confirm

0xlws commented 10 months ago
!pip uninstall xformers
!pip uninstall torch

!pip install xformers
!pip install torch

solves it for me in other projects as well

https://colab.research.google.com/drive/17A41komGbvrhY-0mNFd-ZuNQKNONXGdp?usp=sharing

ClaraSanders commented 10 months ago

What is worse is that is a general error. The colab version of Kohya trainer also stopped working.

yashveer08 commented 10 months ago

What is worse is that is a general error. The colab version of Kohya trainer also stopped working.

Yeah it maybe because of the colab version upgrade or some package library upgrade. But need solution if anyone comes up with.

MajorGruberth commented 10 months ago

ng a while I @MajorGruberth Can you share me how it worked for you? Also if you could share the colab file it would be great.

Certainly. I modified the first part of the notebook, "Connect Google Drive" and it looks like:


@markdown # Connect Google Drive

!pip install lmdb !pip install torch==2.1.0+cu118 torchvision==0.16.0+cu118 torchaudio==2.1.0 torchtext==0.16.0+cpu torchdata==0.7.0 --index-url https://download.pytorch.org/whl/cu118 from google.colab import drive from IPython.display import clear_output import ipywidgets as widgets import os

def inf(msg, style, wdth): inf = widgets.Button(description=msg, disabled=True, button_style=style, layout=widgets.Layout(min_width=wdth));display(inf) Shared_Drive = "" #@param {type:"string"}

@markdown - Leave empty if you're not using a shared drive

print("Connecting...") drive.mount('/content/gdrive')

if Shared_Drive!="" and os.path.exists("/content/gdrive/Shareddrives"): mainpth="Shareddrives/"+Shared_Drive else: mainpth="MyDrive"

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

@markdown ---


with other words you click "show code" and paste in:

!pip install lmdb !pip install torch==2.1.0+cu118 torchvision==0.16.0+cu118 torchaudio==2.1.0 torchtext==0.16.0+cpu torchdata==0.7.0 --index-url https://download.pytorch.org/whl/cu118

than start the notebook

0xlws commented 10 months ago

What is worse is that is a general error. The colab version of Kohya trainer also stopped working.

https://github.com/TheLastBen/fast-stable-diffusion/issues/2681#issuecomment-1857881050 , should be a (temporary) general solution

yashveer08 commented 10 months ago

What is worse is that is a general error. The colab version of Kohya trainer also stopped working.

#2681 (comment) , should be a (temporary) general solution

Just this did not worked.

It showed Exception: CUDA SETUP: Setup Failed!

Screenshot 2023-12-15 at 7 46 03 PM
benoit-roubert commented 10 months ago

I just added 'xformers' also at the end and now it works (wasn't the case without it):

@markdown # Connect Google Drive

!pip install lmdb !pip install torch==2.1.0+cu118 torchvision==0.16.0+cu118 torchaudio==2.1.0 torchtext==0.16.0+cpu torchdata==0.7.0 --index-url https://download.pytorch.org/whl/cu118 xformers

Maxpoetica commented 10 months ago

I just added 'xformers' also at the end and now it works (wasn't the case without it):

@markdown # Connect Google Drive !pip install lmdb !pip install torch==2.1.0+cu118 torchvision==0.16.0+cu118 torchaudio==2.1.0 torchtext==0.16.0+cpu torchdata==0.7.0 --index-url https://download.pytorch.org/whl/cu118 xformers

Thank you This worked!

omar3737 commented 10 months ago

is someone able to attach a working version or guide me on how to make it work? i need it working urgently please

Timoniche commented 10 months ago
image

the same problem even with

!pip install lmdb 
!pip install torch==2.1.0+cu118 torchvision==0.16.0+cu118 torchaudio==2.1.0 torchtext==0.16.0+cpu torchdata==0.7.0 --index-url https://download.pytorch.org/whl/cu118 xformers
Maxpoetica commented 10 months ago

is someone able to attach a working version or guide me on how to make it work? i need it working urgently please

Its only working for me in Auto111 I put the code right before the drive connects. In cell 1

Gelazer commented 10 months ago

IMO it's better to execute the code after the 'connect' cell, to make sure u'r in the right env. The latest TheLastBen Google Collab notebook works for me by adding the following in a (code)-cell just below it - and also executing after performing the actual connect. Credits (and another beer) to OP @aegia13 :

!pip install lmdb !pip install torch==2.1.0+cu118 torchvision==0.16+cu118 torchaudio==2.1.0 torchtext==0.16+cpu torchdata==0.7 --index-url https://download.pytorch.org/whl/cu118

Timoniche commented 10 months ago

IMO it's better to execute the code after the 'connect' cell, to make sure u'r in the right env. The latest TheLastBen Google Collab notebook works for me by adding the following in a (code)-cell just below it - and also executing after performing the actual connect. Credits (and another beer) to OP @aegia13 :

!pip install lmdb !pip install torch==2.1.0+cu118 torchvision==0.16+cu118 torchaudio==2.1.0 torchtext==0.16+cpu torchdata==0.7 --index-url https://download.pytorch.org/whl/cu118

Can you please attach here working colab session?

yashveer08 commented 10 months ago

Still facing the issue with fast-DreamBooth, tried adding the above mention import files.

it appears to be CuDA issue. @MajorGruberth any solution for this?

Screenshot 2023-12-15 at 7 46 03 PM
ookidayone commented 10 months ago

✔ Connected Startup time: 216.0s (launcher: 1.6s, import torch: 20.2s, import gradio: 2.8s, setup paths: 35.0s, import ldm: 1.1s, initialize shared: 10.8s, other imports: 54.4s, setup codeformer: 13.1s, setup gfpgan: 0.8s, list SD models: 1.3s, load scripts: 54.0s, load upscalers: 1.1s, initialize extra networks: 3.0s, create ui: 4.5s, gradio launch: 11.7s, add APIs: 0.7s). 31e35c80fc4829d14f90153f4c74cd59c90b779f6afe05a74cd6120b893f7e5b Loading weights [31e35c80fc] from /content/gdrive/MyDrive/sd/stable-diffusion-webui/models/Stable-diffusion/sd_xl_base_1.0.safetensors Creating model from config: /content/gdrive/MyDrive/sd/stablediffusion/generative-models/configs/inference/sd_xl_base.yaml Applying attention optimization: xformers... done. Model loaded in 162.9s (calculate hash: 114.6s, load weights from disk: 5.2s, create model: 7.9s, apply weights to model: 32.3s, move model to device: 0.2s, hijack: 0.7s, load textual inversion embeddings: 0.8s, calculate empty prompt: 1.1s). Error completing request Arguments: ('task(cv259kcre0rv3an)', '1girl', '', [], 20, 'DPM++ 2M Karras', 1, 1, 7, 512, 512, False, 0.7, 2, 'Latent', 0, 0, 0, 'Use same checkpoint', 'Use same sampler', '', '', [], <gradio.routes.Request object at 0x7fbba798f910>, 0, False, '', 0.8, -1, False, -1, 0, 0, 0, UiControlNetUnit(enabled=False, module='none', model='None', weight=1, image=None, resize_mode='Crop and Resize', low_vram=False, processor_res=-1, threshold_a=-1, threshold_b=-1, guidance_start=0, guidance_end=1, pixel_perfect=False, control_mode='Balanced', save_detected_map=True), UiControlNetUnit(enabled=False, module='none', model='None', weight=1, image=None, resize_mode='Crop and Resize', low_vram=False, processor_res=-1, threshold_a=-1, threshold_b=-1, guidance_start=0, guidance_end=1, pixel_perfect=False, control_mode='Balanced', save_detected_map=True), UiControlNetUnit(enabled=False, module='none', model='None', weight=1, image=None, resize_mode='Crop and Resize', low_vram=False, processor_res=-1, threshold_a=-1, threshold_b=-1, guidance_start=0, guidance_end=1, pixel_perfect=False, control_mode='Balanced', save_detected_map=True), False, False, 'positive', 'comma', 0, False, False, 'start', '', 1, '', [], 0, '', [], 0, '', [], True, False, False, False, 0, False, None, None, False, None, None, False, None, None, False, 50) {} Traceback (most recent call last): File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/call_queue.py", line 57, in f res = list(func(*args, kwargs)) File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/call_queue.py", line 36, in f res = func(*args, *kwargs) File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/txt2img.py", line 55, in txt2img processed = processing.process_images(p) File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/processing.py", line 734, in process_images res = process_images_inner(p) File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/batch_hijack.py", line 42, in processing_process_images_hijack return getattr(processing, '__controlnet_original_process_images_inner')(p, args, kwargs) File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/processing.py", line 824, in process_images_inner sd_models.reload_model_weights() # model can be changed for example by refiner File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/sd_models.py", line 750, in reload_model_weights checkpoint_info = info or select_checkpoint() File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/sd_models.py", line 224, in select_checkpoint raise FileNotFoundError(error_message) FileNotFoundError: No checkpoints found. When searching for checkpoints, looked at:

djwashout commented 10 months ago

!pip uninstall xformers !pip uninstall torch

!pip install xformers !pip install torch

Anyway to use a switch to answer Y for yes rather than having to manual enter each time?

Screenshot 2023-12-16 104550

paradoxtown commented 10 months ago

Try this https://github.com/TheLastBen/fast-stable-diffusion/issues/2615#issuecomment-1858931505

!pip install lmdb
!pip install torch==2.1.0+cu118 torchvision==0.16.0+cu118 torchaudio==2.1.0+cu118 --index-url https://download.pytorch.org/whl/cu118
ookidayone commented 10 months ago

I think google colab should return vanished units :)

WARNING: The following packages were previously imported in this runtime: [torch,torchgen] You must restart the runtime in order to use newly installed versions. s

yashveer08 commented 10 months ago

Try this #2615 (comment)

!pip install lmdb
!pip install torch==2.1.0+cu118 torchvision==0.16.0+cu118 torchaudio==2.1.0+cu118 --index-url https://download.pytorch.org/whl/cu118

Is this working on fast-DreamBooth.ipynb because it is still showing me the Exception: CUDA SETUP: Setup Failed! issue.

could you share the update colab session. @ookidayone

rinogo commented 10 months ago

This was the fix for me:

    !pip install lmdb
    !pip instal-q torch==2.0.0+cu118 torchvision==0.15.1+cu118 torchaudio==2.0.1+cu118 torchtext==0.15.1 torchdata==0.6.0 --extra-index-url https://download.pytorch.org/whl/cu118 -U
    !pip install xformers==0.0.19 triton==2.0.0 -U
    !pip install -U bitsandbytes

Here it is in the context of the Dependencies cell (copy/paste this entire code section into the Dependencies cell):

#@markdown # Dependencies

from IPython.utils import capture
import time
import os

print('Installing dependencies...')
with capture.capture_output() as cap:
    os.chdir('/content')
    !pip install -qq --no-deps accelerate==0.12.0
    !wget -q -i https://raw.githubusercontent.com/TheLastBen/fast-stable-diffusion/main/Dependencies/dbdeps.txt
    !dpkg -i *.deb
    !tar -C / --zstd -xf gcolabdeps.tar.zst
    !rm *.deb | rm *.zst | rm *.txt
    !git clone -q --depth 1 --branch main https://github.com/TheLastBen/diffusers
    !pip install gradio==3.16.2 --no-deps -qq  

    #Added from https://github.com/TheLastBen/fast-stable-diffusion/issues/2688#issuecomment-1859190039
    !pip install lmdb
    !pip instal-q torch==2.0.0+cu118 torchvision==0.15.1+cu118 torchaudio==2.0.1+cu118 torchtext==0.15.1 torchdata==0.6.0 --extra-index-url https://download.pytorch.org/whl/cu118 -U
    !pip install xformers==0.0.19 triton==2.0.0 -U
    !pip install -U bitsandbytes
    #End "Added from..."
    if not os.path.exists('gdrive/MyDrive/sd/libtcmalloc/libtcmalloc_minimal.so.4'):
        %env CXXFLAGS=-std=c++14
        !wget -q https://github.com/gperftools/gperftools/releases/download/gperftools-2.5/gperftools-2.5.tar.gz && tar zxf gperftools-2.5.tar.gz && mv gperftools-2.5 gperftools
        !wget -q https://github.com/TheLastBen/fast-stable-diffusion/raw/main/AUTOMATIC1111_files/Patch
        %cd /content/gperftools  
        !patch -p1 < /content/Patch
        !./configure --enable-minimal --enable-libunwind --enable-frame-pointers --enable-dynamic-sized-delete-support --enable-sized-delete --enable-emergency-malloc; make -j4
        !mkdir -p /content/gdrive/MyDrive/sd/libtcmalloc && cp .libs/libtcmalloc*.so* /content/gdrive/MyDrive/sd/libtcmalloc
        %env LD_PRELOAD=/content/gdrive/MyDrive/sd/libtcmalloc/libtcmalloc_minimal.so.4
        %cd /content
        !rm *.tar.gz Patch && rm -r /content/gperftools
    else:
        %env LD_PRELOAD=/content/gdrive/MyDrive/sd/libtcmalloc/libtcmalloc_minimal.so.4

    os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
    os.environ['PYTHONWARNINGS'] = 'ignore'

print('Done, proceed')
ookidayone commented 10 months ago

I'm using TheLastBen Where do you run those codes in TheLastBen? The answers on the internet are full of errors. Isn't this a prank by Google?

!pip install lmdb
!pip instal-q torch==2.0.0+cu118 torchvision==0.15.1+cu118 torchaudio==2.0.1+cu118 torchtext==0.15.1 torchdata==0.6.0 --extra-index-url https://download.pytorch.org/whl/cu118 -U
!pip install xformers==0.0.19 triton==2.0.0 -U
!pip install -U bitsandbytes
yashveer08 commented 10 months ago

This was the fix for me:

    !pip install lmdb
    !pip instal-q torch==2.0.0+cu118 torchvision==0.15.1+cu118 torchaudio==2.0.1+cu118 torchtext==0.15.1 torchdata==0.6.0 --extra-index-url https://download.pytorch.org/whl/cu118 -U
    !pip install xformers==0.0.19 triton==2.0.0 -U
    !pip install -U bitsandbytes

Here it is in the context of the Dependencies cell (copy/paste this entire code section into the Dependencies cell):

#@markdown # Dependencies

from IPython.utils import capture
import time
import os

print('�[1;32mInstalling dependencies...')
with capture.capture_output() as cap:
    os.chdir('/content')
    !pip install -qq --no-deps accelerate==0.12.0
    !wget -q -i https://raw.githubusercontent.com/TheLastBen/fast-stable-diffusion/main/Dependencies/dbdeps.txt
    !dpkg -i *.deb
    !tar -C / --zstd -xf gcolabdeps.tar.zst
    !rm *.deb | rm *.zst | rm *.txt
    !git clone -q --depth 1 --branch main https://github.com/TheLastBen/diffusers
    !pip install gradio==3.16.2 --no-deps -qq  

    #Added from https://github.com/TheLastBen/fast-stable-diffusion/issues/2688#issuecomment-1859190039
    !pip install lmdb
    !pip instal-q torch==2.0.0+cu118 torchvision==0.15.1+cu118 torchaudio==2.0.1+cu118 torchtext==0.15.1 torchdata==0.6.0 --extra-index-url https://download.pytorch.org/whl/cu118 -U
    !pip install xformers==0.0.19 triton==2.0.0 -U
    !pip install -U bitsandbytes
    #End "Added from..."
    if not os.path.exists('gdrive/MyDrive/sd/libtcmalloc/libtcmalloc_minimal.so.4'):
        %env CXXFLAGS=-std=c++14
        !wget -q https://github.com/gperftools/gperftools/releases/download/gperftools-2.5/gperftools-2.5.tar.gz && tar zxf gperftools-2.5.tar.gz && mv gperftools-2.5 gperftools
        !wget -q https://github.com/TheLastBen/fast-stable-diffusion/raw/main/AUTOMATIC1111_files/Patch
        %cd /content/gperftools  
        !patch -p1 < /content/Patch
        !./configure --enable-minimal --enable-libunwind --enable-frame-pointers --enable-dynamic-sized-delete-support --enable-sized-delete --enable-emergency-malloc; make -j4
        !mkdir -p /content/gdrive/MyDrive/sd/libtcmalloc && cp .libs/libtcmalloc*.so* /content/gdrive/MyDrive/sd/libtcmalloc
        %env LD_PRELOAD=/content/gdrive/MyDrive/sd/libtcmalloc/libtcmalloc_minimal.so.4
        %cd /content
        !rm *.tar.gz Patch && rm -r /content/gperftools
    else:
        %env LD_PRELOAD=/content/gdrive/MyDrive/sd/libtcmalloc/libtcmalloc_minimal.so.4

    os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
    os.environ['PYTHONWARNINGS'] = 'ignore'

print('�[1;32mDone, proceed')

This worked. Specifying the xformers version and triton helped in the solution. Adding the above code in dependencies worked out.

TheLastBen commented 10 months ago

fixed

djwashout commented 10 months ago

Dependencies is not a cell.... The only cells i have is Connect Google drive, install update, Requirements, Model Download/load, Download Lora, ControlNet, Start SD...

ookidayone commented 10 months ago

Thank you very much.

I solved the problem in another way. I do not use Fastben.

I am happy as long as I can create images.

I do not recommend Fastben. It is a waste of time unless the creator improves. ta

djwashout commented 10 months ago

I don't understand "fixed"

The notebook, downloaded 12-18-2023 is still giving me errors... everyone is all over the place with this.. scratching my head here... maybe the problem is with colab??

yashveer08 commented 10 months ago

Thank you very much.

I solved the problem in another way. I do not use Fastben.

I am happy as long as I can create images.

I do not recommend Fastben. It is a waste of time unless the creator improves. ta

can you share the alternate approach that you are mentioning. @ookidayone