carefree0910 / carefree-creator

AI magics meet Infinite draw board.
https://creator.nolibox.com/guest
MIT License
2.13k stars 216 forks source link

Apple Silicon support? #12

Open banagale opened 1 year ago

banagale commented 1 year ago

Does your project run on Apple Silicon hardware? I wasn't sure if the hardware requirements rule out particular configurations.

I looked at your installation instructions and here in issues but didn't see mention of AS / M1 etc.

carefree0910 commented 1 year ago

It should be able to install, but whether it can run or not is actually depending on PyTorch, not this project, because I'm just running PyTorch models and hope for the best 😆.

Someone kindly enough on HN has already tried the following commands and succeeded in installing:

git clone https://github.com/carefree0910/carefree-creator
cd carefree-creator
pip3 install carefree-client carefree-learn carefree-cv ftfy regex lmdb albumentations kafka-python redis[hiredis] cos-python-sdk-v5 uvicorn torchvision
python3 -m uvicorn apis.interface:app --host 0.0.0.0 --port 8123
all4five commented 1 year ago

I'm trying to install it right now.

git clone https://github.com/carefree0910/carefree-creator
cd carefree-creator
pip3 install carefree-client carefree-learn carefree-cv ftfy regex lmdb albumentations kafka-python redis[hiredis] cos-python-sdk-v5 uvicorn torchvision
python3 -m uvicorn apis.interface:app --host 0.0.0.0 --port 8123

Did not work but … this :

git clone https://github.com/carefree0910/carefree-creator
cd carefree-creator
pip3 install carefree-client carefree-learn
pip3 install lmdb
pip3 install albumentations
pip3 install kafka-python 
pip3 install redis
pip3 install cos-python-sdk-v5 
pip3 install uvicorn
pip3 install torchvision
python3 -m uvicorn apis.interface:app --host 0.0.0.0 --port 8123

…somehow did. Be aware I had to switch "pip3 install redis[hiredis]" to "pip3 install redis"

Currently it's downloading: clip.large: 1.71GB [09:12, 3.09MB/s]
kl.f8: 405MB [01:57, 3.45MB/s]
ldm.sd:

Can you tell me where these are installed? I couldn't find them in the carefree-creator folder.

Update:

it failed sadly

 python3 -m uvicorn apis.interface:app --host 0.0.0.0 --port 8123
/Users/XXXXXX/miniconda3/lib/python3.9/site-packages/torchvision/io/image.py:13: UserWarning: Failed to load image Python extension: dlopen(/Users/XXXXXX/miniconda3/lib/python3.9/site-packages/torchvision/image.so, 0x0006): Symbol not found: (__ZN2at4_ops19empty_memory_format4callEN3c108ArrayRefINS2_6SymIntEEENS2_8optionalINS2_10ScalarTypeEEENS6_INS2_6LayoutEEENS6_INS2_6DeviceEEENS6_IbEENS6_INS2_12MemoryFormatEEE)
  Referenced from: '/Users/XXXXXX/miniconda3/lib/python3.9/site-packages/torchvision/image.so'
  Expected in: '/Users/XXXXXX/miniconda3/lib/python3.9/site-packages/torch/lib/libtorch_cpu.dylib'
  warn(f"Failed to load image Python extension: {e}")
carefree0910 commented 1 year ago

@all4five Hi! The models are downloaded at ~/.cache/carefree-learn/models.

And your error message indicates that there's something wrong with the pytorch installation... 😣

I had tried to install this project on my m1 mac, and it turns out that I can only use CPU to generate images, which usually takes minutes to get a 512*512 one. 🤣

So maybe a better option for m1 users is to use the Google Colab! 😉

TreeZhou commented 1 year ago

I run the project with ‘cfcreator serve --save_gpu_ram’,but it still emit error with 'AssertionError: Torch not compiled with CUDA enabled'. like the picture below. Can you help me ?

image image
carefree0910 commented 1 year ago

Ah, my bad, i should actually introduce a flag called --cpu for mac. 🤣 let me develop it for a while, and i'll notify you once i finished! 😉 @TreeZhou

carefree0910 commented 1 year ago

@TreeZhou Hi! Now you can play this project on mac with --cpu flag:

cfcreator serve --cpu

But it will be REALLY slow to generate an image (~12s/it on my m1, which means it will take 3min33s to generate an image with 20 steps. 🤣)