talesofai/comfyui-browser

save icon does not save file to collections dir

thatguyinoz opened this issue · 5 comments

Hi
thanks for this great addon to ComfyUI

Save icon does not place a .json file ion the collections dir, therefore it cannot be synced
As a novice user i may be missing something obvious to others, but when i create a workfow, and click on the save button the workflow is not saved in the collections folder, and therefore not pushed up to the git repo .

git repo branch name
I noticed that the default branch name in github is now main not master, which broke sync initially. renaming the branch on github resolved this issue.

I am confident that the git sync process is now working
If i create a file findthis.json in the git repo and open ComfyUI-browser from the Browser Button, and click "Sync" then the file is pulled from git repo to the {ComfyUI server}/custom_nodes/comfyui-browser/collections/findthis.json location.
If I open browser and find a saved png image and click on the Save option, it is copied to the collections dir and Sync pushes it to the git repo.

Test

  1. create a workflow
  2. click on the Save button located beside the browser button
  3. edit the dialog box to change the name, click OK
  4. check collections dir
rh@aiserver:/ai/ComfyUI$ ls -la ./custom_nodes/comfyui-browser/collections
drwxrwxr-x  3 rh rh   4096 Sep  5 09:05 .
drwxrwxr-x 13 rh rh   4096 Sep  5 08:21 ..
-rw-rw-r--  1 rh rh     21 Sep  5 09:05 2024-09-05-003336_4164946695_1725498331.info
-rw-rw-r--  1 rh rh 590760 Sep  5 09:05 2024-09-05-003336_4164946695_1725498331.png
-rw-rw-r--  1 rh rh     15 Sep  5 09:00 findthis.json
drwxrwxr-x  8 rh rh   4096 Sep  5 09:07 .git
-rw-rw-r--  1 rh rh    149 Sep  5 08:57 README.md

Any pointers to what i may be doing wrong would be much appreciated

thank you

After quite a bit of debugging, eliminating my reverse proxy (Nginx), it seems that the api server is replying with Error 405

i used strace to follow process calls and see this:

recvfrom(32, "POST /api/browser/collections/wo"..., 262144, 0, NULL, NULL) = 9273
epoll_wait(29, [], 6, 0)                = 0
epoll_wait(29, [], 6, 0)                = 0
getpid()                                = 6401
sendto(32, "HTTP/1.1 405 Method Not Allowed\r"..., 186, 0, NULL, 0) = 186
sendto(32, "405: Method Not Allowed", 23, 0, NULL, 0) = 23

the ComfyUI service (python3 main.py) is running as a user, the output directory is set to the home dir of that user so full rwx permissions should be correct. (also output images all write successfully to the location)

I hope this further info is useful

thanks

I get the same error too, with the default config: 405 Method Not Allowed

Now we just need someone with coding skills to work out what is wrong :-)

Fix: #62

Thanks @Matoseb :-)