alpertunga-bile / prompt-generator-comfyui

Custom AI prompt generator node for the ComfyUI
MIT License
72 stars 8 forks source link

[BUG] ComfyUI Standalone Requirements Issues - ModuleNotFoundError: No module named 'optimum' & More #2

Closed Kinglord closed 11 months ago

Kinglord commented 11 months ago

Describe the bug I'm running the latest version of ComfyUI Standalone (pulled today) and cannot get this plugin to load properly, and it will always display IMPORT FAILED

To Reproduce Steps to reproduce the behavior:

  1. Install the latest comfyUI standalone
  2. Git pull latest prompt-generator-comfyui
  3. Launch comfy UI
  4. Observe server output and IMPORT FAILED message

Screenshots image

Operating System

Python Version 3.10.9

Kinglord commented 11 months ago

UPDATE

I was able to manually install optimum and get past the above error. However, now it keeps trying to install onnxruntime-gpu which I'm guessing does not work before it fails to find another module? I installed onnxruntime-gpu manually as well but it does not seem to work, maybe I need a specific version, I installed 1.15.1 - I feel like maybe there's just a missing requirements.txt file in the repo?

image

Kinglord commented 11 months ago

Alright, I see now where you are trying to use your init to check and install packages but it's not working right with the standalone version of ComfyUI as far as I can tell. I don't know why it's still trying to install the onnxruntime-gpu after I've installed it manually and verified it's in my site packages unless there's some version issue? Also looking at the init I'm guessing it might not like the version of transformers I have installed? I'm worried about how it's going to interact with all my other custom nodes if it needs a very particular transformers install, but I guess I won't know until I can get it working :D

alpertunga-bile commented 11 months ago

Hello, thanks for reporting. Sorry for the struggle that you go through. I test the node with manual installations so I don't check with the portable version. I tried the portable version and fixed some issues so please pull the latest version of this repository first.

For the installation issue, I did these steps and it is working right now:

  1. Download the latest portable version.
  2. Unzip the folder and get into ComfyUI_windows_portable folder.
  3. Open cmd in ComfyUI_windows_portable folder. Install the requirements manually. Execute these commands step by step
    .\python_embeded\python.exe -s -m pip install transformers
    .\python_embeded\python.exe -s -m pip install accelerate
    .\python_embeded\python.exe -s -m pip install optimum
    .\python_embeded\python.exe -s -m pip install optimum[onnxruntime-gpu]
  4. Run the run_nvidia_gpu.bat file

So the other questions: Q: I don't know why it's still trying to install the onnxruntime-gpu A: I don't know why it is trying to install the onnxruntime-gpu actually. I am checking if the packages are downloaded but just this package is not verified, I don't know why.

Q: Also looking at the init I'm guessing it might not like the version of transformers I have installed? A: When I was writing this project I encountered with issues about the transformers package and had to install the development build. I thought it is necessary but it seems after the transformers package updates, it is fixed. Actually, the line you see at the init file is not working because ComfyUI is installing the transformers package before executing the init file so it is just checking if it is installed and skipping it. (I changed it to stable version in the new commit)

EDIT 1: Checked the generation with node and it is working right now. (commit hash => 02e4fb7)

Kinglord commented 11 months ago

Thanks for the help and updates! I got everything to load after running through things and finding one custom node that was breaking it for me, I'll raise a bug with that project because it's some kind of protobuf loading issue with roop based projects as far as I can tell. Now I just need to build or find a LLM model to use! :D

If you care this is project/custom node ppl should avoid right now (broke it for me, apparently venvs are OK but it breaks standalone installs) - https://github.com/Gourieff/comfyui-reactor-node