Comfy-Org / Comfy-Org/ComfyUI

Add an option to define the IDs used in the API workflow

Open
#4,547 3 comments 1 reaction 0 assignees View on GitHub
Feature
Dominant language
Python
Stars
133k
Forks
15.7k
Avg merge
1d 6h
Merged PRs (30d)
155

Description

### Feature Idea

Exporting a workflow for using it with the API assigns a numeric ID to each node, which appears to come from the order in which it was created. This makes it difficult to change parts of the workflow later, for example to assign a new prompt. Manually replacing the numbers with custom strings works fine with the API as the numeric IDs are also exported as strings, but the next time the workflow is exported it will have numeric node IDs again.

I suggest adding an optional field to define an ID to be used when exporting to the API, so that one can define IDs such as "prompt", "negative-prompt", "sampler", etc. to later use, for example, `nodes["prompt"]["inputs"]["text"]` for setting a prompt instead of `nodes["7"]["inputs"]["text"]`.

### Existing Solutions

- Identifying the nodes and using replace all in the exported workflow.
- Filtering nodes based on the `nodes[i]["_meta"]["title"]` property.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.