XmYx / ainodes-engine

GNU Lesser General Public License v2.1
256 stars 15 forks source link

Mac Install #24

Closed lfarrell20 closed 1 year ago

lfarrell20 commented 1 year ago

From what I've seen I'm super excited about this and eager to try it out. I'm stuck using a Mac, so I was happy to see the mac install.

Following the instructions, I am running into an issue on the step: pip install -r requirements_mac.txt

There doesn't seem to be any file by that name. When I run from the non "_mac" version it installs fine, but I run into the error: ModuleNotFoundError: No module named ‘PyQt6.Qsci’

A disclaimer. This is my first time posting anything on github and I'm a designer first, so I'm not the most fluent in the terminal. I'm guess this is most likely user error somewhere along the line.

XmYx commented 1 year ago

Hi, please go into your custom_nodes/ainodes_engine_base_nodes folder and run:

git checkout mac

I had to move mac efforts to a branch, as they caused a bit of instability in the windows side of things. In this version, Kandinksy will work, and you may be able to load SD with v1-inference.yaml (but not -fp-16.yaml). Please let me know here about the bugs you find, and we'll go through them one by one making sure they either work on mac, or not available : )

jjannone commented 1 year ago

Hi - having the same issue, and git checkout mac did not work:

error: pathspec 'mac' did not match any file(s) known to git

XmYx commented 1 year ago

https://github.com/XmYx/ainodes_engine_base_nodes/tree/mac

Sorry, pushed again.

M1kep commented 1 year ago

I'm seeing the same error:

❯ cd custom_nodes/ainodes_engine_base_nodes
❯ git rev-parse --abbrev-ref HEAD
mac
❯ git rev-parse HEAD
1cb2c0ce1d42f97c920332a1c432df4cd669c1f7
❯ cd ..
❯ cd ..
❯ pip install -r requirements.txt
❯ pip list
Package             Version
------------------- --------
certifi             2023.5.7
charset-normalizer  2.1.1
filelock            3.12.2
idna                3.4
Jinja2              3.1.2
MarkupSafe          2.1.3
mpmath              1.3.0
networkx            3.1
numpy               1.25.0
packaging           23.1
Pillow              9.5.0
pip                 23.1.2
PyQt6               6.5.1
PyQt6-3D            6.5.0
PyQt6-3D-Qt6        6.5.1
PyQt6-Qt6           6.5.1
PyQt6-sip           13.5.1
PyQt6-WebEngine     6.5.0
PyQt6-WebEngine-Qt6 6.5.1
pyqtgraph           0.13.3
PyYAML              6.0
QtPy                2.3.1
requests            2.28.1
setuptools          67.7.2
sympy               1.12
torch               2.0.1
torchvision         0.15.2
tqdm                4.65.0
typing_extensions   4.6.3
urllib3             1.26.16
wheel               0.40.0
❯ python main.py
Start aiNodes, please wait. 2023-06-20 18:11:38.214625
Using HF Cache in app dir
Importing from custom_nodes/ainodes_engine_base_nodes
===== 2023.06.20 18:06:40 =====
Traceback (most recent call last):
  File "/Users/<user>/Code/ML/ainodes-engine/main.py", line 126, in <module>
    import_nodes_from_subdirectories(folder_path)
  File "/Users/<user>/Code/ML/ainodes-engine/ainodes_frontend/base/import_utils.py", line 54, in import_nodes_from_subdirectories
    import_nodes_from_directory(subdir_path)
  File "/Users/<user>/Code/ML/ainodes-engine/ainodes_frontend/base/import_utils.py", line 43, in import_nodes_from_directory
    module = importlib.import_module(f"{dir}.{module_name}")
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/<user>/.local/share/rtx/installs/python/3.11.4/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/Users/<user>/Code/ML/ainodes-engine/custom_nodes/ainodes_engine_base_nodes/exec_nodes/code_editor_node.py", line 7, in <module>
    from PyQt6.Qsci import QsciScintilla, QsciLexerPython
ModuleNotFoundError: No module named 'PyQt6.Qsci'
lfarrell20 commented 1 year ago

I went through the process again after checking out the mac branch. Though I still ran into the issue were there was no requirments_mac.txt file.

Altering the command to simply reference the requirements.txt, while still on the mac branch, I was able to installed without any errors being thrown. However, once I tried to actually run the app I have the same error as M1kep posted above.

/exec_nodes/code_editor_node.py", line 7, in <module>
    from PyQt6.Qsci import QsciScintilla, QsciLexerPython
ModuleNotFoundError: No module named 'PyQt6.Qsci'

Appreciate all your help in this!

aldorr commented 1 year ago

I ended up copying requirements.txt > requirements_mac.txt and changing the content gradually to match Mac version numbers. This is what I came up with (and is working so far):

opencv-contrib-python==4.7.0.72
scikit-image>=0.19
ffmpeg-python==0.1.7
tensorboard
torch
torchvision
openai==0.27.6
git+https://github.com/XmYx/Kandinsky-2.git
git+https://github.com/openai/CLIP.git
tensorflow
tb_nightly
#transformers==4.27.0
diffusers[torch]>=0.16.1
imageio[ffmpeg]
##diffusers==0.14.0
einops==0.6.0
omegaconf==2.3.0
accelerate>=0.20.3
open-clip-torch==2.16.0
safetensors>=0.3.0
pytorch_lightning>=2.0.0
aiohttp>=3.8.4
scipy>=1.9.1
torchdiffeq>=0.2.3
torchsde>=0.2.5
tqdm>=4.65.0
tabulate>=0.9.0
numpy>=1.24.2
matplotlib>=3.7.1
rich>=13.3.2
basicsr>=1.3.4.9
pandas>=1.5.3
fvcore
#bitsandbytes
lark>=1.1.5
fonts
font-roboto
gdown
git+https://github.com/xinntao/Real-ESRGAN.git
neovim
python-rtmidi
lpips
qrcode
pyzbar
git+https://github.com/facebookresearch/audiocraft.git
git+https://github.com/XmYx/CodeFormerBasicSR.git
transformers>=4.29.2
PyQt6-QScintilla
pyflakes

Oh, and for some reason it was saying it couldn't find the custom_nodes module, so I copied the ai_nodes > custom_nodes, and all booted up.

Good luck!

-- M2 Pro 16GB RAM

lfarrell20 commented 1 year ago

I appreciate the solve. Since my original post I have switched to a PC running a decent Nvidia card and abandoned my need to have it on a Mac.

But I applaud you're solve above, definitely not something I would be able to figure out myself. I'm sure there are plenty of Mac users who will find this extremely helpful, so thanks for posting!

Going to close this thread on that positive note.