nodeId, fieldName?In the workflow interface, each node has a number at the top-right corner — that is the nodeId.
Before calling the API to start a ComfyUI task, familiarize yourself with the api_format file of the workflow.
Each nodeId corresponds to an inputs section. The keys within inputs are the fieldNames.
When you modify a node’s value in the workflow, you are essentially changing the fieldValue for a given fieldName.
For example, to change the text in a text-to-image example and the random seed in KSampler, you would look for nodes with nodeId "6" and "3" in the workflow file, then search for those numbers in the JSON.
"text"."seed".Construct the nodeInfoList as follows:
"nodeInfoList": [
{
"nodeId": "6",
"fieldName": "text",
"fieldValue": "1 girl in classroom"
},
{
"nodeId": "3",
"fieldName": "seed",
"fieldValue": "1231231"
}
]
There are two approaches to providing an image for the workflow:
Maintain your own image hosting service and use the LoadImageFromUrl node.
When the workflow reaches this node, it will download the image from the specified URL.
Construct the nodeInfoList as follows:
"nodeInfoList": [
{
"nodeId": "13",
"fieldName": "image",
"fieldValue": "https://rh-images.xiaoyaoyou.com/de0db6f2564c8697b07df55a77f07be9/output/ComfyUI_00038_sffft_1742964027.png?imageMogr2/format/jpeg/ignore-error/1"
}
]
Use the Upload Resource API.
After calling the resource upload API, pass the returned fileName into the LoadImage node.
For example:
{
"code": 0,
"msg": "success",
"data": {
"fileName": "api/9d77b8530f8b3591edc5c4e8f3f55b2cf0960bb2ca35c04e32c1677687866576.png",
"fileType": "image"
}
}
"nodeInfoList": [
{
"nodeId": "14",
"fieldName": "image",
"fieldValue": "api/9d77b8530f8b3591edc5c4e8f3f55b2cf0960bb2ca35c04e32c1677687866576.png"
}
]
Currently, there is only one solution, consisting of three steps:
RHLoraLoader node.API calls will force a reset of the seed value. To keep the seed parameter constant, include the seed value within the nodeInfoList.
If a fieldName cannot be found in the API-format workflow, that means it’s a purely front-end field that only works in the browser — for example, control_after_generate in KSampler. Similarly, group-related logic is not supported via API.
In API-format workflows, a fieldValue wrapped in [] typically indicates a connection (wiring) between nodes.