← 返回
未分类 Key

rh-skill

RunningHub AI 智能调用。Use when user wants to generate images, videos, or audio content.
RunningHub AI 智能调用,用于生成图像、视频或音频内容。
airix315 airix315 来源
未分类 clawhub v1.0.0 1 版本 100000 Key: 需要
★ 0
Stars
📥 351
下载
💾 0
安装
1
版本
#latest

概述

RHMCP Skill - OpenClaw 专用

概述

RHMCP 的 OpenClaw Skill 包装层,提供智能决策和 Agent 指引。

前置条件

  1. 安装 RHMCP:git clone https://github.com/AIRix315/RHMCP.git && cd RHMCP && npm install && npm run build
  2. 配置 OpenClaw MCP(见 README.md)
  3. 创建 RHMCP 配置:service.json.env

Agent 决策树

场景 → APP 映射

用户请求
    │
    ├─ "生成图片" / "文生图" / "画画"
    │       └─► rh_execute_app({ alias: "qwen-text-to-image", params: { text: "描述" } })
    │
    ├─ "修改图片" / "改图" / "图生图"
    │       └─► rh_execute_app({ alias: "qwen-image-to-image", params: { image: "URL", prompt: "描述" } })
    │
    └─ "更多APP"
            └─► rh_list_apps() 查看所有可用APP

参数映射

文生图 (qwen-text-to-image)

参数必填默认值说明
--------------------------
text-提示词
width1024图片宽度
height1024图片高度

图生图 (qwen-image-to-image)

参数必填默认值说明
-----------------------------
image-输入图片URL
prompt-修改提示词

轮询策略

长时间任务使用异步模式:

APP 类型首次等待轮询间隔最大等待
--------------------------------
图生视频3 分钟1 分钟15 分钟
数字人2 分钟30 秒10 分钟
文生图10 秒5 秒5 分钟
// 提交异步任务
const { taskId } = await rh_execute_app({
  alias: "image-to-video",
  params: { image: "https://..." },
  mode: "async",
});

// 轮询查询
await sleep(180000); // 3分钟
while (true) {
  const status = await rh_query_task({ taskId });
  if (status.status === "SUCCESS") return status.data;
  if (status.status === "FAILED") throw new Error(status.msg);
  await sleep(60000); // 1分钟
}

存储策略

步骤位置存储模式原因
-----------------------------------
中间步骤noneURL 直接传递
最终输出none返回 URL,用户保存
用户要求network用户明确要求保存
// 中间步骤:URL 直接传递
const img = await rh_execute_app({
  alias: "qwen-text-to-image",
  params: { text: "一只猫" },
});

// 后续步骤:使用 URL
const video = await rh_execute_app({
  alias: "image-to-video",
  params: { image: img.outputs[0].originalUrl, motion: "转身" },
});

链式工作流

// 步骤1:文生图
const img = await rh_execute_app({
  alias: "qwen-text-to-image",
  params: { text: "一个女孩在樱花树下" },
});

// 步骤2:图生视频
const video = await rh_execute_app({
  alias: "image-to-video",
  params: {
    image: img.outputs[0].originalUrl,
    motion: "樱花飘落,女孩转身微笑",
  },
});

return { videoUrl: video.outputs[0].originalUrl };

失败重试

const fallbacks = ["sdxl-text-to-image", "flux-text-to-image"];
for (const alias of fallbacks) {
  try {
    return await rh_execute_app({ alias, params });
  } catch (e) {
    continue; // 尝试下一个
  }
}
throw new Error("所有备选 APP 均失败");

错误码速查

错误码含义处理方式
-----------------------------
0成功正常返回结果
804排队中等待后轮询
805任务失败调整提示词重试
813执行中继续等待
421并发限制等待 5 秒后重试

工具清单

工具用途
--------------------------------
rh_list_apps列出所有可用APP
rh_get_app_info获取APP参数详情
rh_execute_app执行APP任务
rh_query_task查询任务状态
rh_upload_media上传媒体文件

推荐模板

模板ID名称尺寸适用场景
--------------------------------------------
anime-portrait动漫人像1024×1024角色生成
landscape-wide风景横图1920×1080风景创作
portrait-vertical人像竖图768×1024人物肖像
// 使用模板
const templates = require("./references/templates.json");
const t = templates.templates["anime-portrait"];
rh_execute_app({ alias: t.alias, params: { ...t.params, text: "用户描述" } });

故障排除

问题原因解决方案
------------------------------------------------------------------
"未找到 alias"APP 未配置运行 rhmcp --update-apps
"apiKey 是必填项"未配置 API Key.env 设置 RUNNINGHUB_API_KEY
"任务超时"执行时间过长使用 mode: "async"

License

MIT-0

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-03 11:20 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

design-media

UI/UX Pro Max

xobi667
提供 UI/UX 设计智能与实现指导,帮助打造精美界面。适用于 UI 设计、UX 流程、信息架构、视觉风格、设计系统/标记、组件规格、文案/微文案、无障碍及前端 UI(HTML/CSS/JS、React、Next.js、Vue、Svelte
★ 230 📥 49,143
design-media

Openai Whisper

steipete
使用 Whisper CLI 进行本地语音转文字(无需 API 密钥)
★ 335 📥 94,869
ai-agent

RHSkill

airix315
直接调用RunningHub AI平台,支持文生图、图生图、视频生成等,具备智能存储判断和链式工作流功能。
★ 0 📥 490