ComfyUI icon indicating copy to clipboard operation
ComfyUI copied to clipboard

feat: pass settings items to backend on queue prompt

Open ltdrdata opened this issue 2 years ago • 4 comments

nodes can access settings value through hidden input "SETTINGS"

ltdrdata avatar Jun 01 '23 13:06 ltdrdata

Could these be set per-node from the frontend instead? I don't know how well nodes globally changing settings by merely being included in the graph will work

space-nuko avatar Jun 01 '23 17:06 space-nuko

Could these be set per-node from the frontend instead? I don't know how well nodes globally changing settings by merely being included in the graph will work

You can access whole settings through adding input to nodes like this.

"hidden": {"settings": "SETTINGS"},

If you add global settings like this on frontend, backend node can access the setting value through settings['Comfy.ShowPreview'] when the value is changed from defaultValue.

app.ui.settings.addSetting({
  id: "Comfy.ShowPreview",
  defaultValue: true,
  ...
)

ltdrdata avatar Jun 02 '23 00:06 ltdrdata

Oh okay. So this could be expanded for per-node configuration from the frontend later

space-nuko avatar Jun 02 '23 00:06 space-nuko

Yeah I'm not sure if this is the best way to solve this problem. I think nodes should also have clearly defined inputs.

comfyanonymous avatar Jun 05 '23 04:06 comfyanonymous

The concept of "Hidden inputs" as a whole seems oppositional to the design goals of ComfyUI.

mcmonkey4eva avatar Aug 14 '23 22:08 mcmonkey4eva