返回顶部
r

runninghub-comfyuiRunningHub工作流

Execute RunningHub ComfyUI workflows via API. Use when you need to run ComfyUI workflows on RunningHub cloud platform, submit tasks, query status, and retrieve results.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
176
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

runninghub-comfyui

RunningHub ComfyUI 工作流运行器

该技能提供通过API在RunningHub云平台上执行ComfyUI工作流的工具。

前置条件

  1. 1. RunningHub账户 - 在 https://www.runninghub.ai/?inviteCode=kol01-rh124 注册
  2. API访问权限 - 基础会员及以上(免费用户无法使用API)
  3. API密钥 - 从API控制台获取32位API密钥
  4. 工作流ID - 工作流必须至少手动成功运行过一次

获取API密钥

  1. 1. 登录RunningHub
  2. 点击右上角头像
  3. 进入API控制台
  4. 复制您的API密钥(请妥善保管!)

获取工作流ID

  1. 1. 打开目标工作流页面
  2. 从URL中获取ID:https://www.runninghub.ai/#/workflow/WORKFLOW_ID
  3. 示例:ID为 1987728214757978114

设置API密钥

选项1:保存到配置文件(推荐)

bash
cd /root/.openclaw/workspace/skills/runninghub-comfyui
python3 scripts/runninghubclient.py --save-key YOURAPI_KEY

API密钥将保存到 config.json,并在后续运行时自动加载。

选项2:环境变量

bash
export RUNNINGHUBAPIKEY=YOURAPIKEY

选项3:命令行(每次运行)

bash
python3 scripts/runninghubclient.py --api-key YOURAPI_KEY ...

使用方法

提交工作流任务(默认配置)

对于使用默认配置的工作流:

bash
cd /root/.openclaw/workspace/skills/runninghub-comfyui

python3 scripts/runninghub_client.py \
--workflow-id 1987728214757978114 \
--action submit

使用自定义图片运行工作流(新功能!)

上传图片并使用该图片运行工作流:

bash
python3 scripts/runninghub_client.py \
--workflow-id 1987728214757978114 \
--action run-with-image \
--image /path/to/your/image.png \
--node-id 107 \
--field-name image

参数说明:

  • - --image:本地图片文件路径
  • --node-id:图片输入的节点ID(默认:107)
  • --field-name:图片输入的字段名(默认:image)

查询任务状态

bash
python3 scripts/runninghub_client.py \
--task-id TASK_ID \
--action query

等待任务完成

bash
python3 scripts/runninghub_client.py \
--task-id TASK_ID \
--action wait \
--poll-interval 5 \
--max-attempts 60

Python API 使用方法

python
from runninghubclient import RunningHubClient, loadconfig, getapikey

从配置获取API密钥

apikey = getapi_key()

初始化客户端

client = RunningHubClient(api_key)

上传图片并获取URL

imageurl = client.uploadimage(/path/to/image.png) print(f图片URL: {image_url})

使用自定义图片提交工作流

result = client.submitworkflowwith_image( workflow_id=1987728214757978114, node_id=107, field_name=image, imageurl=imageurl )

task_id = result[taskId]

等待任务完成

finalresult = client.waitforcompletion(taskid)

获取输出URL

if final_result.get(status) == SUCCESS: for item in final_result.get(results, []): print(f输出: {item.get(url)})

API 参考

RunningHubClient 类

init(api_key: str)

使用您的API密钥初始化客户端。

uploadimage(imagepath: str) -> Optional[str]

将图片文件上传到RunningHub并获取URL。

返回值:

  • - 成功时返回图片URL
  • 失败时返回 None

submitworkflow(workflowid: str, nodeinfolist: Optional[list]) -> Dict

提交工作流任务进行执行。

参数说明:

  • - workflowid:RunningHub中的工作流ID
  • nodeinfo_list:节点配置列表(可选)

重要提示: 在nodeinfolist中使用 fieldValue(而非 value):

python
nodeinfolist = [
{
nodeId: 107,
fieldName: image,
fieldValue: https://... # ✅ 使用 fieldValue,而非 value
}
]

返回值:
json
{
taskId: TASK_ID,
status: RUNNING,
clientId: CLIENT_ID
}

submitworkflowwithimage(workflowid: str, nodeid: str, fieldname: str, image_url: str) -> Dict

提交带有图片输入的工作流(便捷方法)。

示例:
python
result = client.submitworkflowwith_image(
1987728214757978114, # workflow_id
107, # node_id
image, # field_name
https://... # image_url
)

querytask(taskid: str) -> Dict

查询已提交任务的状态。

返回值:
json
{
status: RUNNING|SUCCESS|FAILED,
results: [
{url: https://..., filename: ...}
]
}

waitforcompletion(taskid: str, pollinterval: int, max_attempts: int) -> Dict

通过轮询状态等待任务完成。

图片上传

接口地址: POST /openapi/v2/media/upload/binary

请求头:

  • - Authorization: Bearer

请求体:

  • - 包含文件字段的多部分表单数据

响应:
json
{
code: 0,
msg: success,
data: {
type: image,
download_url: https://...,
fileName: openapi/...,
size: 3490
}
}

使用自定义输入提交工作流

接口地址: POST /openapi/v2/run/workflow/{workflow_id}

请求头:

  • - Authorization: Bearer
  • Content-Type: application/json

请求体:
json
{
apiKey: your-api-key,
workflowId: 1987728214757978114,
addMetadata: true,
nodeInfoList: [
{
nodeId: 107,
fieldName: image,
fieldValue: https://... // ✅ 使用 fieldValue,而非 value
}
],
instanceType: default,
usePersonalQueue: false
}

重要提示: 节点输入值请使用 fieldValue 而非 value!

重要说明

  1. 1. 使用 fieldValue 而非 value:通过API传递节点输入值时,始终使用 fieldValue:
json {nodeId: 107, fieldName: image, fieldValue: ...} // ✅ 正确 {nodeId: 107, fieldName: image, value: ...} // ❌ 错误
  1. 2. 速率限制:基础会员有并发限制(通常一次只能执行1个任务)
  1. 3. 错误421:API队列限制已满 - 请等待之前的任务完成
  1. 4. 身份验证:使用 Authorization: Bearer 请求头
  1. 5. API接口地址
- 提交:POST /openapi/v2/run/workflow/{workflow_id} - 查询:POST /openapi/v2/query - 上传:POST /openapi/v2/media/upload/binary

故障排除

无效的节点信息(错误803)

  • - 检查是否使用了 fieldValue 而非 value
  • 确认nodeId和fieldName与工作流配置匹配
  • 使用工作流的 getJsonApiFormat 接口检查可用节点

API队列限制已满(错误421)

  • - 等待2-3分钟后重试
  • 在RunningHub网页控制台检查正在运行的任务
  • 如有需要,在网页控制台取消任务

TOKEN_INVALID(错误412)

  • - 确认您的API密钥正确(32位字符)
  • 检查您的会员状态是否有效
  • 尝试在控制台重新生成API密钥

任务卡在RUNNING状态

  • - 大型工作流可能需要几分钟时间
  • 在RunningHub网页控制台查看实际进度
-

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 photo-retouching-1776081797 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 photo-retouching-1776081797 技能

通过命令行安装

skillhub install photo-retouching-1776081797

下载

⬇ 下载 runninghub-comfyui v1.0.0(免费)

文件大小: 12.67 KB | 发布时间: 2026-4-15 13:53

v1.0.0 最新 2026-4-15 13:53
Initial release of RunningHub ComfyUI workflow runner skill.

- Run ComfyUI workflows on the RunningHub cloud via API.
- Supports uploading images as workflow inputs.
- Includes CLI and Python API usage instructions.
- Enables submitting tasks, querying status, and downloading results.
- Provides troubleshooting tips and API endpoint references.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部