Nuked88 / ComfyUI-N-Sidebar

A simple sidebar for your ConfyUI!
MIT License
399 stars 21 forks source link

Confused about the Workflow library feature #57

Closed alessandroperilli closed 1 month ago

alessandroperilli commented 1 month ago

First of all, thank you for expanding the Sidebar capabilities to support both templates and workflow libraries. It's a great addition.

While the Template library works fine, I'm really struggling with the Workflow library. I have the following issues:

  1. If I do NOT specify a custom folder in the Sidebar settings, and I save a workflow, the name of the workflow is correctly stored in the settings.json, but the actual workflow is nowhere to be found in the hard drive.

To double-check, after saving the workflow, I clear the canvas and try to drag and drop one of the saved workflows from the Sidebar. Nothing happens.

What is the default location of saved workflows if no custom folder is indicated? AFAIK, no default path for workflows can be defined in ComfyUI's extra_model_paths.yaml, so I am not sure where to look, and a where command returns no results.

  1. If I DO specify a custom folder in the Sidebar settings (for example: D:\Workflows), and I restart ComfyUI as indicated, the path is ignored. Saving a new workflow doesn't generate a json file in there as I'd expect.

Notice that the ComfyUI server is on a Windows machine and I access it via macOS over a HTTPS session.

Thanks for you help.

Nuked88 commented 1 month ago

If you do not specify the folder, the sidebar will look for the workflow in the worflows folder within the ComfyUI folder (this is just a convention, because that folder usually does not exist). Do you get any errors in the console?

alessandroperilli commented 1 month ago

In fact, in my installation, I don't have any /workflow/ folder.

I see no error in the console: either when I save the workflow, or when I try to drag the workflow, or when I set a custom folder where to save the workflows, or when I restart ComfyUI and the sidebar looks for that custom folder.

Nuked88 commented 1 month ago

uhmm I am quite confused about your situation, I am really struggling to understand "If I do NOT specify a custom folder in the Sidebar settings, and I save a workflow, the name of the workflow is correctly stored in the settings.json, but the actual workflow is nowhere to be found in the hard drive.” I am not managing any “saving workflow”. are you Italian/do you speak Italian? Maybe in my native language I can understand the situation better.

alessandroperilli commented 1 month ago

I can speak Italian, yes. You can find me on Discord with the handle @perilli if it helps.

Let's try again:

  1. A custom workflow path is defined in the sidebar settings (but even if none is defined, nothing changes): D:\Workflows
  2. I have a workflow displayed on the canvas.
  3. I save the workflow with a title of my liking inside the Sidebar: XYZ
  4. I see XYZ in the list of workflows in the sidebar

At this point, I'd expect to see something like XYZ.json saved in D:\Workflows but there's nothing there. And XYZ.json is nowhere in the entire D: drive.

Looking for clues, I go see what's inside your settings.json, in ComfyUI/custom_nodes/ComfyUI-N-Sidebar/app/

What I find is this:

{ "menuctx_category": "Context Menu", "menuctx_options": [], "menuctx_subOptions": [], "menuctx_opt_callback": [], "menuctx_sub_opt_callback": [], "sb_order_type": "alphabetical", "sb_position": "left", "sb_workflowNodeMap": "{\"APW 10 EA5\":[],\"xyz\":[]}", "sb_wf_path": "d:\workflows\", "sb_zindex": "1000", "sb_ColorCustomWorkflows": "{}" }

So, the workflow name has been correctly saved in the settings: XYZ is right there. And the custom workflow path has been correctly saved: D:\Workflows.

But the actual workflow, the json file, is nowhere.

Now, I kill ComfyUI and restart it, clear the canvas, and open the sidebar again. I can still see XYZ in the list of saved workflows. Good.

At this point, if I try to drag the XYZ workflow into the canvas, nothing happens.

Nuked88 commented 1 month ago

Now I understand. There is a misunderstanding: the sidebar is not able to save a workflow. You need to use the usual SAVE button of ComfyUI. I don't know if I will implement a save feature since it would be like having two save buttons on the same interface, even if I must admit that choosing the path where to save every time is really annoying.

The + button is for adding categories, like in the Custom Category and Template panels. I will add a ToolTip to make that clear soon.

alessandroperilli commented 1 month ago

But then, if it doesn't save the workflows, what does it do?

Does it point to existing workflows (wherever they are in the disk) and allow you to organize them in categories?

Nuked88 commented 1 month ago

Yes, it allows you to rename/remove and categorize them. And to load them on the fly by dragging them to the main panel.

alessandroperilli commented 1 month ago

I see. It's confusing to depend on another system for saving (I use pythongosssss Custom Scripts for saving the workflows), and on the Sidebar for managing them. But now I understand. Thank you for taking the time to explain this to me.