nodeInfoList) of a specified AI application (WebApp).In short: You can use this script to send local files or text to RunningHub AI applications for generation or processing, and automatically retrieve the results.
def get_nodo(webappId, Api_Key)nodeInfoList) of the AI application. Refer to RunningHub official API documentation for “Get AI Application Information Example”.def upload_file(API_KEY, file_path)def submit_task(webapp_id, node_info_list, API_KEY)def query_task_outputs(task_id, API_KEY)/task/openapi/status endpoint is no longer maintained) and retrieves the generated result. Refer to official API documentation for “Query Task Output Example”.main functionRetrieve node list → Modify node info → Submit task → Poll task status → Retrieve task result.Please enter your api_key:a0fa3e****************345171Please enter webappId:1937084629516193794Note: The WebApp link is https://www.runninghub.cn/ai-detail/1937084629516193794. The number at the end is thewebappId.
nodeInfoList, which contains all editable nodes:[
{
"nodeId": "39",
"nodeName": "LoadImage",
"fieldName": "image",
"fieldValue": "a293d89506f9c484f4ea5695f93024a80cd62ef98f4ee4543faba357536b37ec.jpg",
"fieldType": "IMAGE",
"description": "Upload Image"
},
{
"nodeId": "37",
"nodeName": "RH_ComfyFluxKontext",
"fieldName": "model",
"fieldValue": "flux-kontext-pro",
"fieldType": "LIST",
"description": "Model Selection"
},
{
"nodeId": "37",
"nodeName": "RH_ComfyFluxKontext",
"fieldName": "aspect_ratio",
"fieldValue": "match_input_image",
"fieldType": "LIST",
"description": "Output Ratio"
},
{
"nodeId": "52",
"nodeName": "RH_Translator",
"fieldName": "prompt",
"fieldValue": "Change this woman's hairstyle to short bob,",
"fieldType": "STRING",
"description": "Image Editing Text Input"
}
]nodeInfoList, the script prompts you to input the node ID and field name for modification.Please enter nodeId (type 'exit' to finish modifications):39Please enter fieldName:imageSelected node: {'nodeId': '39', 'nodeName': 'LoadImage', 'fieldName': 'image', 'fieldValue': 'a293d8...', 'fieldType': 'IMAGE', 'description': 'Upload Image'}Please enter your local IMAGE file path:D:\R.jpgUploading file...
Upload result: {'code': 0, 'msg': 'success', 'data': {'fileName': 'api/xxxx.jpg', 'fileType': 'image'}}
✅ IMAGE fieldValue updated: api/xxxx.jpgPlease enter new fieldValue (STRING):Change this man's hairstyle to short bob✅ fieldValue updated: Change this man's hairstyle to short bobPlease enter new fieldValue (LIST):fieldData to update fieldValue.✅ fieldValue updated: 1:1exit.Submitting task, please wait...
📌 Submit task response: {'code': 0, 'msg': 'success', 'data': {'taskId': '1979110509284917250', ... ,'promptTips': '{"result": true, "error": null, "outputs_to_execute": ["36"], "node_errors": {}}'}}}node_errors in promptTips is not empty, it indicates a node error.⚠️ Node error information:
node_errors{}
📝 taskId: 1979110509284917250Note: taskIdis used to query task status and retrieve results.
Note:Ifnode_errorsinpromptTipsis not empty, it indicates that there are errors in some nodes.
⏳ Task in queue...
⏳ Task running...
🎉 Generation completed!
✅ Task completed!SUCCESS → Task completedfailedReason → Task failed🎉 Generation completed!
https://rh-images.xiaoyaoyou.com/f24a6365b08fa3bc02f55cd1f63e74a7/output/ComfyUI_00001_vpvtp_1760691733.pngD:\path\to\file.jpgnodeId + fieldName + new value, type exit to finish.IMAGE → Auto upload fileSTRING → Enter text directlyLIST → Select one index value from fieldData to update fieldValueapi_key and webappIdnodeInfoListFully automate RunningHub AI application operations via Python script, without manually operating on the web — ideal for batch tasks.