| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262 |
- {
- "name": "jimeng-img-v4",
- "displayName": "即梦图片生成4.0",
- "description": "即梦4.0图片生成,支持文生图、图像编辑及多图组合生成,单次输入最多10张图像,支持4K超高清输出,一次性输出最多15张内容关联图像。",
- "category": "jimeng",
- "version": "1.0.0",
- "endpoint": {
- "method": "POST",
- "url": "https://server.fmode.cn/api/volcengine/jimeng/getImgV4",
- "headers": {
- "Content-Type": "application/json"
- }
- },
- "parameters": {
- "type": "object",
- "required": [
- "prompt",
- "token"
- ],
- "properties": {
- "prompt": {
- "type": "string",
- "description": "提示词,支持中文,描述期望生成的图像内容"
- },
- "image_urls": {
- "type": "array",
- "items": {
- "type": "string"
- },
- "description": "图片文件URL列表,支持0至10张图,用于多图组合编辑",
- "default": []
- },
- "sizeDate": {
- "type": "object",
- "description": "图片尺寸数据,不传则使用默认2048×2048",
- "properties": {
- "width": {
- "type": "integer",
- "description": "图片宽,推荐: 1024/2048/2304/2496/2560/4096"
- },
- "height": {
- "type": "integer",
- "description": "图片高,推荐: 1024/2048/1728/1664/1440/4096"
- }
- }
- },
- "scale": {
- "type": "number",
- "description": "文本描述影响程度,范围[0,1],默认0.5",
- "default": 0.5
- },
- "force_single": {
- "type": "boolean",
- "description": "是否强制生成单图,默认false",
- "default": false
- },
- "token": {
- "type": "string",
- "description": "认证token,格式: Bearer r:xxxxxxxx"
- }
- }
- },
- "requestTransform": {
- "template": {
- "prompt": "{{prompt}}",
- "image_urls": "{{image_urls}}",
- "sizeDate": "{{sizeDate}}",
- "scale": "{{scale}}",
- "force_single": "{{force_single}}",
- "token": "{{token}}"
- }
- },
- "response": {
- "type": "object",
- "properties": {
- "code": {
- "type": "integer",
- "description": "响应状态码,200表示成功"
- },
- "data": {
- "type": "object",
- "properties": {
- "workId": {
- "type": "string",
- "description": "任务ID,用于后续查询任务状态和获取生成结果"
- }
- }
- }
- }
- },
- "notes": "提交任务后需调用 jimeng-task-query (getDataByTask02) 轮询任务状态。生成结果存储在 ImagineWork 表的 images 字段中,URL已转存永久有效。费用: 0.22元/张。",
- "usageExamples": [
- {
- "name": "纯文生图-2K分辨率",
- "input": {
- "prompt": "帮我生成一个涵盖友情、独特、文化底蕴、科技的可爱日漫风但人物为中国人的图片",
- "sizeDate": {
- "width": 2048,
- "height": 2048
- },
- "scale": 0.6,
- "force_single": false,
- "token": "Bearer r:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
- },
- "description": "使用文本提示词生成2K分辨率的日漫风格图片"
- },
- {
- "name": "多图组合编辑",
- "input": {
- "prompt": "将模特穿上这件衣服",
- "image_urls": [
- "https://example.com/model.jpg",
- "https://example.com/clothes.png"
- ],
- "sizeDate": {
- "width": 2048,
- "height": 2048
- },
- "token": "Bearer r:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
- },
- "description": "输入模特图+衣服图,通过提示词描述编辑意图"
- }
- ],
- "relatedSkills": [
- "jimeng-task-query",
- "jimeng-text2img-v3",
- "jimeng-img2img-v3"
- ],
- "pricing": {
- "unit": "张",
- "price": 0.22,
- "currency": "CNY",
- "reference": "https://www.volcengine.com/docs/85621/1544714"
- },
- "timeout": 30000,
- "retry": {
- "maxAttempts": 2,
- "delay": 1000,
- "backoffMultiplier": 2
- },
- "tokenConfig": {
- "type": "bearer",
- "configFile": "~/.openclaw/voc-credentials.json",
- "tokenField": "vocToken",
- "resolutionOrder": [
- "configFile"
- ],
- "apigId": "Vo3ROWEvDy",
- "paymentUrlResolution": {
- "description": "动态构建充值URL:在已存在 session token 时查出用户 objectId,拼接到专属充值页面",
- "steps": [
- "1. 从 voc-credentials.json 获取当前 session token",
- "2. 调用 GET https://server.fmode.cn/parse/users/me (Header: X-Parse-Application-Id: ncloudmaster, X-Parse-Session-Token: {token})获取用户 objectId",
- "3. 拼接充值URL: https://app.fmode.cn/dev/apig-pay/?user={objectId}&apigid=Vo3ROWEvDy&fun_id=HOkkX72PMF",
- "4. 将该URL展示给用户,引导扫码支付"
- ],
- "userResolveEndpoint": "https://server.fmode.cn/parse/users/me",
- "userResolveHeaders": {
- "X-Parse-Application-Id": "ncloudmaster",
- "X-Parse-Session-Token": "{vocToken}"
- },
- "paymentBaseUrl": "https://app.fmode.cn/dev/apig-pay/",
- "paymentParams": {
- "user": "{resolvedUserId}",
- "apigid": "Vo3ROWEvDy",
- "fun_id": "HOkkX72PMF"
- },
- "balanceCheckEndpoint": "https://server.fmode.cn/api/apig/getApig"
- },
- "onMissing": {
- "action": "showPaymentQR",
- "qrCodeUrl": "https://app.fmode.cn/dev/apig-pay/?apigid=Vo3ROWEvDy&fun_id=HOkkX72PMF",
- "title": "扫码开通 VOC-AI 数据服务",
- "message": "此 Skill 需要有效的 API Token。请先打开充值页面完成登录和充值;当用户提供 session token 后,请由 OpenClaw 运行 node scripts/tools/set-voc-token.js <session-token> 写入 ~/.openclaw/voc-credentials.json 的 vocToken 字段,再重试当前 Skill。",
- "tokenSetupCommandTemplate": "node scripts/tools/set-voc-token.js {sessionToken}",
- "tokenSetupInstructions": "当用户完成登录和充值后,如果用户把 session token 发给你,请直接运行 node scripts/tools/set-voc-token.js <session-token> 写入 ~/.openclaw/voc-credentials.json,然后重试当前 Skill。"
- },
- "onBalanceInsufficient": {
- "action": "resolveUserThenShowPayment",
- "title": "VOC-AI Token 余额不足,请扫码充值",
- "message": "当前 Token 余额不足,我将为你生成专属充值链接,扫码支付后即可继续使用。"
- }
- },
- "errorHandling": {
- "balanceInsufficient": {
- "conditions": [
- {
- "responseField": "code",
- "operator": "in",
- "value": [
- -2,
- -3,
- -10,
- 402,
- 429
- ]
- },
- {
- "responseField": "msg",
- "operator": "contains",
- "value": [
- "余额不足",
- "insufficient",
- "balance",
- "quota",
- "没有开通",
- "权限或余额"
- ]
- },
- {
- "responseField": "mess",
- "operator": "contains",
- "value": [
- "余额不足",
- "insufficient",
- "balance",
- "quota",
- "没有开通",
- "权限或余额"
- ]
- },
- {
- "responseField": "message",
- "operator": "contains",
- "value": [
- "余额不足",
- "insufficient",
- "balance",
- "没有开通",
- "权限或余额"
- ]
- }
- ],
- "matchMode": "any",
- "trigger": "tokenConfig.onBalanceInsufficient"
- },
- "unauthorized": {
- "conditions": [
- {
- "responseField": "code",
- "operator": "in",
- "value": [
- 401,
- 403
- ]
- },
- {
- "responseField": "msg",
- "operator": "contains",
- "value": [
- "unauthorized",
- "token",
- "invalid",
- "auth"
- ]
- }
- ],
- "matchMode": "any",
- "trigger": "tokenConfig.onMissing"
- }
- }
- }
|