seruva19 / kubin

Web-GUI for Kandinsky text-to-image diffusion models.
177 stars 18 forks source link

error when trying to generate in kandinsky 2.1 web ui #98

Closed demirklvc closed 1 year ago

demirklvc commented 1 year ago

Im getting this error when trying to generate: There is no current event loop in thread 'AnyIO worker thread'.

demirklvc commented 1 year ago

(venv) PS C:\Users\RTX01\kubin> python -c "import torch; print(torch.version)" 2.0.1+cpu (venv) PS C:\Users\RTX01\kubin> python -c "import torch; print(torch.version)" 2.0.1+cpu

result: RuntimeError: Attempting to deserialize object on a CUDA device but torch.cuda.is_available() is False. If you are running on a CPU-only machine, please use torch.load with map_location=torch.device('cpu') to map your storages to the CPU.

seruva19 commented 1 year ago

So the error is: somehow the CUDA (GPU) version of pytorch is not installed despite direct instructions. And then it tries to run app using CPU instead of GPU and expectedly fails :) Well, this is actually something that we can work with. Let's try these commands (notice the third and last line are different now):

./venv/Scripts/Activate.ps1
python -c "import torch; print(torch.__version__)"
pip install torch==2.0.0+cu118 torchvision==0.15.1+cu118 torchaudio==2.0.1 --index-url https://download.pytorch.org/whl/cu118
python -c "import torch; print(torch.__version__)"
python src/kubin.py

What are the versions output and final result?

demirklvc commented 1 year ago

okay doing now :) thanks again, love your support

demirklvc commented 1 year ago

IT WORKS!

demirklvc commented 1 year ago

thanks alot!!! <3

demirklvc commented 1 year ago

anyway to improve speed? for now, it takes around 20 seconds for one image (768x768)

seruva19 commented 1 year ago

Wait, really works? I had a lot of other ideas to test 😄

demirklvc commented 1 year ago

yes :)

seruva19 commented 1 year ago

Concerning speed: you can try diffusers version, but I am not sure if it will be faster. To enable diffusers, go to 'Settings' - ''General' and select 'diffusers'. Then press 'Apply changes' and 'Save changes'. There probably will be some speed optimizations in future, I am only starting to understand how all this stuff works ;)