WASasquatch / was-node-suite-comfyui

An extensive node suite for ComfyUI with over 210 new nodes
MIT License
1.22k stars 177 forks source link

Load Images node should support path with special character. #257

Closed wutipong closed 1 year ago

wutipong commented 1 year ago

Some of the images I have is a directory with path containing [ or ] character. This is interpret by the glob.glob() function as a pattern rather than parts of the path. This results in image list being empty and cause index out of bound error.

This patch escape the path so it's not considered as a pattern.

Without this patch, the user has to enter the escaped path instead which can be tricky.

WASasquatch commented 1 year ago

Shouldn't you just escape your path, so that patterns can be used in it?

/some/path/torch\[gpu\]/images sorta deal?

wutipong commented 1 year ago

I thought that would work. However, after trying it it ... somehow the images become NoneType at another node's input.

I'm not well verse enough in Python nor the ComfyUI to know what's going on. Strangely enough that patch work just fine.

image

Oh and looks like the proper way to escape the path is to wrap [] around the [ (ie. [[]).