patriciogonzalezvivo / comfyui_glslnodes

GLSL node for ComfyUI
GNU General Public License v3.0
162 stars 11 forks source link

Errors running some examples in Windows 11 #10

Closed moebiussurfing closed 1 month ago

moebiussurfing commented 1 month ago

Hey @patriciogonzalezvivo , this looks Super!!

I cloned the repo into 'ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui_glslnodes'

then i loaded some examples (types.json, depth_of_field.json...) but I am getting some errors. I tried to update missing custom nodes in the manager and placed some source image too...

Here some screens:

Screenshot 2024-08-11 235236

Screenshot 2024-08-11 235420

Screenshot 2024-08-11 235343

Any idea? Thanks

moebiussurfing commented 1 month ago

This screen shows the errors for the example 'raymarch_to_image.json' after downloading all the models manually and placing an image... image

moebiussurfing commented 1 month ago

should I need to install lygia too in some way?

patriciogonzalezvivo commented 1 month ago

No need to install lygia, dependencies get fetch from https://lygia.xyz For the errors seems like package moderngl was not install correctly, or there is something preventing to load a GL context through it. Can you research what version is install?

moebiussurfing commented 1 month ago

It seems that the moderngl version is 5.11.0

I realized that I don't have python installed globally on my system,

but ComfyUI uses his own python from: ComfyUI_windows_portable\python_embeded> .\python.exe

PS D:\_AI\ComfyUI_windows_portable\python_embeded> .\python.exe --version
Python 3.11.6
PS D:\_AI\ComfyUI_windows_portable\python_embeded> .\python.exe
Python 3.11.6 (tags/v3.11.6:8b6ee5b, Oct  2 2023, 14:57:12) [MSC v.1935 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import moderngl
>>> print(moderngl.__version__)
5.11.0

Maybe I need to update the moderngl version...

patriciogonzalezvivo commented 1 month ago

If it's not that, I would google around and find out if it needs a a specific backend, like Linux does. https://github.com/patriciogonzalezvivo/comfyui_glslnodes/blob/main/glsl_utils.py#L6

Unfortunately, I don't have windows, so I'm a bit out of source with this specific issue

moebiussurfing commented 1 month ago

I reinstalled moderngl using pip but 5.11.0 is the last one...

I just tried adding wgl to glsl_utils.py because it seems a typical backend but does not work. Maybe we need to install manually wgl with pip and import at the top too...

I also found some references to GLFW or Pyglet for context but it is far beyond my knowledge

GL_BACKENDS = {
    "Linux": "egl",
     "Windows": "wgl",    # Use WGL on Windows (typical backend)
}
patriciogonzalezvivo commented 1 month ago

Maybe this helps https://github.com/patriciogonzalezvivo/comfyui_glslnodes/issues/4

moebiussurfing commented 1 month ago

Thanks! It worked!

After doing: PS D:\_AI\ComfyUI_windows_portable\python_embeded> .\Scripts\pip.exe install glcontext

Not sure if required too but I also did: PS D:\_AI\ComfyUI_windows_portable\python_embeded> .\Scripts\pip.exe install PyOpenGL PyOpenGL_accelerate moderngl PS D:\_AI\ComfyUI_windows_portable\python_embeded> .\Scripts\pip.exe install pyglet

That was running Powershell as administrator.