ModelSurge / sd-webui-comfyui

An extension to integrate ComfyUI workflows into the Webui's pipeline
MIT License
504 stars 32 forks source link

ModuleNotFoundError #197

Closed jayododds closed 8 months ago

jayododds commented 8 months ago

Searched and can't find the workaround for this error. Macbook Pro M2 - Latest version of Automatic and comfyui. Installed comfy UI via Automatic.

Not sure if I need to install torch in the comfyUI install as well? The nightly is installed a running properly for automatic.

File "/Users/UserName/stable-diffusion-webui/extensions/sd-webui-comfyui/lib_comfyui/comfyui/pre_main.py", line 30, in from lib_comfyui.comfyui import routes_extension, queue_tracker File "/Users/UserName/stable-diffusion-webui/extensions/sd-webui-comfyui/lib_comfyui/comfyui/routes_extension.py", line 4, in from lib_comfyui.comfyui.iframe_requests import ComfyuiIFrameRequests File "/Users/UserName/stable-diffusion-webui/extensions/sd-webui-comfyui/lib_comfyui/comfyui/iframe_requests.py", line 5, in from lib_comfyui import ipc, global_state, torch_utils, external_code File "/Users/UserName/stable-diffusion-webui/extensions/sd-webui-comfyui/lib_comfyui/torch_utils.py", line 1, in import torch ModuleNotFoundError: No module named 'torch'

Noticed this in the startup as well on the most recent try

[sd-webui-comfyui] Started callback listeners for process webui [sd-webui-comfyui] Detected custom ComfyUI venv: /Users/UserName/stable-diffusion-webui/extensions/sd-webui-comfyui/ComfyUI/venv/bin/python [sd-webui-comfyui] Installing mandatory pip requirements in ComfyUI venv... Requirement already satisfied: portalocker>=2.7.0 in ./venv/lib/python3.10/site-packages (from -r /Users/UserName/stable-diffusion-webui/extensions/sd-webui-comfyui/requirements.txt (line 1)) (2.8.2) Requirement already satisfied: psutil in ./venv/lib/python3.10/site-packages (from -r /Users/UserName/stable-diffusion-webui/extensions/sd-webui-comfyui/requirements.txt (line 2)) (5.9.7)

PladsElsker commented 8 months ago

Yes, the ComfyUI install should have its own venv. I think pytorch is supposed to be installed in ComfyUI for it to work at all.

If you are having trouble installing it with our installation procedure, I would suggest trying to install it standalone, making sure it works on its own without A1111.

Once you're sure ComfyUI works on its own, you can link your installation in the settings for this extension in the Webui. After that, this extension should be able to handle the startup procedure when launching A1111.

PladsElsker commented 8 months ago

@John-WL even though the issue was unrelated - The update got it running but now I'm onto the white screen in tab issue :) Getting closer! Thanks for your efforts on this!

Okay, so the iframes work, but the ComfyUI tab does not? Can you send screenshots and/or the console output (if it changed at all)?

jayododds commented 8 months ago

Looks like this was something else - I did some fresh installs and uninstalls of dependencies and ended up with the "can't Patch" error that was fixed earlier today. That patch fixed the install and then I got the white tab issue (didn't check the iframes) so I tried the previous suggestion to switch the ICS to File System and that seems to have gotten everything working now. May as close this one off -

PladsElsker commented 8 months ago

Okay, thanks! Glad it works now :)