chrisgoringe / cg-image-picker

198 stars 13 forks source link

Absolute paths in js #108

Closed chrisgoringe closed 6 days ago

chrisgoringe commented 1 month ago

https://github.com/chrisgoringe/cg-image-picker/issues/89#issuecomment-2153585947

chrisgoringe commented 1 month ago

Original comment:

https://github.com/chrisgoringe/cg-image-picker/blob/6242c01fa64136991512b0596600ea9b8050828e/js/image_chooser_messaging.js#L13 https://github.com/chrisgoringe/cg-image-picker/blob/6242c01fa64136991512b0596600ea9b8050828e/js/image_chooser_preview.js#L20

There are some urls with absolute paths in the js code. It can't work with comfyui accessed with a path prefix.

If I remember well, there was yet another 404 error in my console - /scripts/widgets.js? I'm not sure now.

chrisgoringe commented 1 month ago

api.fetchApi("/image_chooser_message" is the standard idiom throughout Comfy; fetchApi takes care of the path (see api.js lines 15-24).

The preview one will be fixed in the next push (later today I hope).

rsl8 commented 1 month ago

Thanks for the reply and the explanation about api.fetchApi. I've created a PR to push the issue forward but feel free to close it if you have a ready to push patch in a local branch.