hiddenswitch / ComfyUI

A powerful and modular stable diffusion GUI with a graph/nodes interface.
GNU General Public License v3.0
39 stars 11 forks source link

The `main.py` check is not strict enough #20

Closed Chaoses-Ib closed 3 months ago

Chaoses-Ib commented 3 months ago

Expected Behavior

Importing comfyui from user's main.py works fine.

Actual Behavior

Using main.py will make comfyui change the base path to the root of comfyui, not the current directory. This can lead to confusion, e.g. https://github.com/Chaoses-Ib/ComfyScript/issues/65

https://github.com/hiddenswitch/ComfyUI/blob/3e91f98aa22fb620f339e0602f059bfa1fb5bf6d/comfy/cmd/folder_paths.py#L83-L84

Steps to Reproduce

I only have the code to reproduce in ComfyScript:

main.py:

from comfy_script.runtime import load
load("comfyui")
from comfy_script.runtime.nodes import Checkpoints

print(list(Checkpoints))
# No models from the `models` folder in the working directory

Debug Logs

N/A

Other

No response

doctorpangloss commented 3 months ago

i am addressing this now. the painful part of upstream is that it has a bunch of statics everywhere. I will replace them with contextvars in a later update, but a patch to make this not occur will happen shortly.