api-config.json 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. {
  2. "name": "jimeng-clothes-v2",
  3. "displayName": "图片换装V2",
  4. "description": "输入模特图和上装/下装图URL,智能完成虚拟换装。",
  5. "category": "jimeng",
  6. "version": "1.0.0",
  7. "endpoint": {
  8. "method": "POST",
  9. "url": "https://server.fmode.cn/api/volcengine/jimeng/getClothesV2",
  10. "headers": {
  11. "Content-Type": "application/json"
  12. }
  13. },
  14. "parameters": {
  15. "type": "object",
  16. "required": [
  17. "model",
  18. "token"
  19. ],
  20. "properties": {
  21. "model": {
  22. "type": "string",
  23. "description": "模特图URL"
  24. },
  25. "upper": {
  26. "type": "string",
  27. "description": "上装图URL(与bottom至少提供一个)"
  28. },
  29. "bottom": {
  30. "type": "string",
  31. "description": "下装图URL(与upper至少提供一个)"
  32. },
  33. "inference_config": {
  34. "type": "object",
  35. "description": "推理配置参数",
  36. "properties": {
  37. "do_sr": {
  38. "type": "boolean",
  39. "default": false
  40. },
  41. "seed": {
  42. "type": "number",
  43. "default": -1
  44. },
  45. "keep_head": {
  46. "type": "boolean",
  47. "default": true
  48. },
  49. "keep_hand": {
  50. "type": "boolean",
  51. "default": false
  52. },
  53. "keep_foot": {
  54. "type": "boolean",
  55. "default": false
  56. },
  57. "num_steps": {
  58. "type": "number",
  59. "default": 16
  60. },
  61. "keep_upper": {
  62. "type": "boolean",
  63. "default": false
  64. },
  65. "keep_lower": {
  66. "type": "boolean",
  67. "default": false
  68. },
  69. "tight_mask": {
  70. "type": "string",
  71. "default": "loose",
  72. "enum": [
  73. "tight",
  74. "loose",
  75. "bbox"
  76. ]
  77. },
  78. "p_bbox_iou_ratio": {
  79. "type": "number",
  80. "default": 0.3
  81. },
  82. "p_bbox_expand_ratio": {
  83. "type": "number",
  84. "default": 1.1
  85. },
  86. "max_process_side_length": {
  87. "type": "number",
  88. "default": 1920
  89. }
  90. }
  91. },
  92. "token": {
  93. "type": "string",
  94. "description": "认证token"
  95. }
  96. }
  97. },
  98. "response": {
  99. "type": "object",
  100. "properties": {
  101. "code": {
  102. "type": "integer"
  103. },
  104. "data": {
  105. "type": "object",
  106. "properties": {
  107. "workId": {
  108. "type": "string"
  109. }
  110. }
  111. }
  112. }
  113. },
  114. "usageExamples": [
  115. {
  116. "name": "模特换上装+下装",
  117. "input": {
  118. "model": "https://example.com/model.jpg",
  119. "upper": "https://example.com/shirt.png",
  120. "bottom": "https://example.com/pants.jpg",
  121. "inference_config": {
  122. "keep_head": true,
  123. "num_steps": 16,
  124. "tight_mask": "loose"
  125. },
  126. "token": "Bearer r:xxx"
  127. },
  128. "description": "为模特换上新的上装和下装"
  129. }
  130. ],
  131. "relatedSkills": [
  132. "jimeng-task-query",
  133. "jimeng-img-v4-goods"
  134. ],
  135. "timeout": 30000,
  136. "tokenConfig": {
  137. "type": "body",
  138. "tokenField": "token",
  139. "format": "Bearer r:{{jimengToken}}",
  140. "configFile": "~/.openclaw/voc-credentials.json",
  141. "currentToken": "r:f0333969e312a40e4703e8fe4ed1c600",
  142. "resolutionOrder": [
  143. "configFile",
  144. "currentToken"
  145. ],
  146. "onMissing": {
  147. "action": "showPaymentQR",
  148. "qrCodeUrl": "https://pwa.fmode.cn/apig-pay.html?user={{user}}&apigid={{apigid}}&fun_id=HOkkX72PMF",
  149. "paymentCheckEndpoint": "https://server.fmode.cn/api/apig/getApig",
  150. "pollingIntervalMs": 3000,
  151. "pollingTimeoutMs": 300000,
  152. "onPaymentSuccess": "retrySkillWithNewToken",
  153. "title": "扫码开通即梦AI生成服务",
  154. "message": "请扫描下方二维码完成支付,支付成功后将自动获取 Token 并继续执行。"
  155. },
  156. "onBalanceInsufficient": {
  157. "action": "showPaymentQR",
  158. "qrCodeUrl": "https://pwa.fmode.cn/apig-pay.html?user={{user}}&apigid={{apigid}}&fun_id=HOkkX72PMF",
  159. "paymentCheckEndpoint": "https://server.fmode.cn/api/apig/getApig",
  160. "pollingIntervalMs": 3000,
  161. "pollingTimeoutMs": 300000,
  162. "onPaymentSuccess": "retrySkillWithNewToken",
  163. "title": "即梦AI Token 余额不足,请扫码充值",
  164. "message": "当前 Token 余额不足,请扫描二维码充值,支付完成后将自动继续执行。"
  165. }
  166. },
  167. "errorHandling": {
  168. "balanceInsufficient": {
  169. "conditions": [
  170. {
  171. "responseField": "code",
  172. "operator": "in",
  173. "value": [
  174. -2,
  175. -3,
  176. -10,
  177. 402,
  178. 429
  179. ]
  180. },
  181. {
  182. "responseField": "msg",
  183. "operator": "contains",
  184. "value": [
  185. "余额不足",
  186. "insufficient",
  187. "balance",
  188. "quota"
  189. ]
  190. },
  191. {
  192. "responseField": "message",
  193. "operator": "contains",
  194. "value": [
  195. "余额不足",
  196. "insufficient",
  197. "balance"
  198. ]
  199. }
  200. ],
  201. "matchMode": "any",
  202. "trigger": "tokenConfig.onBalanceInsufficient"
  203. },
  204. "unauthorized": {
  205. "conditions": [
  206. {
  207. "responseField": "code",
  208. "operator": "in",
  209. "value": [
  210. 401,
  211. 403
  212. ]
  213. },
  214. {
  215. "responseField": "msg",
  216. "operator": "contains",
  217. "value": [
  218. "unauthorized",
  219. "token",
  220. "invalid",
  221. "auth"
  222. ]
  223. }
  224. ],
  225. "matchMode": "any",
  226. "trigger": "tokenConfig.onMissing"
  227. }
  228. }
  229. }