{ "apiVersion": "yingce.plugin/v2", "id": "image-tools", "name": "Image Tools", "version": "1.0.0", "author": "影策", "description": "图片去背景与图层拆分工具协议插件。", "permissions": [ "generation.run", "media.read" ], "configuration": { "fields": [ { "name": "apiKey", "type": "secret", "label": "WaveSpeed API Key", "required": true } ] }, "documentation": "# Image Tools\n\n影策图片工具协议插件,提供去背景和图层拆分两个异步能力。\n\n## 能力\n\n- `image-tools-remove-background`:`bria/remove-background`\n- `image-tools-layer-decomposition`:`bytedance/seedream-v5.0-pro/layer-decomposition`\n\n两个 provider 都接受统一的 `images[]` 源图输入,结果 URL 会由宿主下载并持久化。\n\n---\n\n# Image Tools Interface\n\n## Remove Background\n\n- Provider: `image-tools-remove-background`\n- Upstream: `POST /bria/remove-background`\n- Input: first image in `images[]`\n- Output: asynchronous image result\n\n## Layer Decomposition\n\n- Provider: `image-tools-layer-decomposition`\n- Upstream: `POST /bytedance/seedream-v5.0-pro/layer-decomposition`\n- Input: first image in `images[]`\n- Output: asynchronous image result list\n\n\n## Manifest 完整接口定义\n\n以下 JSON 与插件包内实际 `manifest.json` 逐字段一致,覆盖插件身份、权限、配置、鉴权、参数、校验、创建、Agent、查询、取消、结果下载、响应和 Agent 响应映射。`documentation` 字段的值就是当前完整文档;为避免文档在自身内部无限递归,JSON 中仅用等义占位文本表示正文。\n\n```json\n{\n \"apiVersion\": \"yingce.plugin/v2\",\n \"id\": \"image-tools\",\n \"name\": \"Image Tools\",\n \"version\": \"1.0.0\",\n \"author\": \"影策\",\n \"description\": \"图片去背景与图层拆分工具协议插件。\",\n \"permissions\": [\n \"generation.run\",\n \"media.read\"\n ],\n \"configuration\": {\n \"fields\": [\n {\n \"name\": \"apiKey\",\n \"type\": \"secret\",\n \"label\": \"WaveSpeed API Key\",\n \"required\": true\n }\n ]\n },\n \"documentation\": \"<当前插件的完整 documentation,由 README.md 与 docs/interface.md 拼接而成;为避免 JSON 递归,此处不重复展开正文。>\",\n \"contributes\": {\n \"providers\": [\n {\n \"id\": \"image-tools-remove-background\",\n \"label\": \"Image Tools Remove Background\",\n \"capabilities\": [\n \"image\"\n ],\n \"scopes\": [\n \"admin.system-channel\",\n \"user.custom-channel\",\n \"canvas\",\n \"creation\",\n \"agent\"\n ],\n \"baseUrl\": \"https://api.wavespeed.ai/api/v3\",\n \"requiresPublicMediaUrls\": true,\n \"auth\": {\n \"type\": \"bearer\",\n \"field\": \"apiKey\"\n },\n \"parameters\": [\n {\n \"name\": \"model\",\n \"type\": \"string\",\n \"required\": false,\n \"mapping\": \"model\",\n \"description\": \"默认 bria/remove-background。\"\n },\n {\n \"name\": \"prompt\",\n \"type\": \"string\",\n \"required\": false,\n \"mapping\": \"prompt\",\n \"description\": \"可选工具提示词。\"\n },\n {\n \"name\": \"images\",\n \"type\": \"media[]\",\n \"required\": true,\n \"mapping\": \"source image\",\n \"description\": \"源图片。\"\n },\n {\n \"name\": \"providerOptions\",\n \"type\": \"object\",\n \"required\": false,\n \"mapping\": \"provider-specific fields\",\n \"description\": \"工具扩展字段。\"\n }\n ],\n \"create\": {\n \"method\": \"POST\",\n \"path\": \"/bria/remove-background\",\n \"contentType\": \"application/json\",\n \"body\": {\n \"image\": {\n \"$first\": {\n \"$map\": {\n \"from\": {\n \"$ref\": \"request.images\"\n },\n \"as\": \"media\",\n \"in\": {\n \"$ref\": \"media.value\"\n }\n }\n }\n },\n \"prompt\": {\n \"$omitEmpty\": {\n \"$ref\": \"request.prompt\"\n }\n },\n \"output_format\": {\n \"$coalesce\": [\n {\n \"$ref\": \"request.providerOptions.image-tools-remove-background.output_format\"\n },\n \"png\"\n ]\n }\n }\n },\n \"poll\": {\n \"method\": \"GET\",\n \"path\": \"/predictions/{{taskId}}/result\"\n },\n \"response\": {\n \"taskId\": {\n \"$coalesce\": [\n {\n \"$ref\": \"response.data.id\"\n },\n {\n \"$ref\": \"response.id\"\n }\n ]\n },\n \"status\": {\n \"$coalesce\": [\n {\n \"$ref\": \"response.data.status\"\n },\n {\n \"$ref\": \"response.status\"\n },\n \"pending\"\n ]\n },\n \"message\": {\n \"$coalesce\": [\n {\n \"$ref\": \"response.data.error\"\n },\n {\n \"$ref\": \"response.data.message\"\n },\n {\n \"$ref\": \"response.error.message\"\n }\n ]\n },\n \"images\": {\n \"$ref\": \"response.data.outputs\"\n },\n \"errorPaths\": [\n \"error.code\"\n ],\n \"resultEphemeral\": true\n }\n },\n {\n \"id\": \"image-tools-layer-decomposition\",\n \"label\": \"Image Tools Layer Decomposition\",\n \"capabilities\": [\n \"image\"\n ],\n \"scopes\": [\n \"admin.system-channel\",\n \"user.custom-channel\",\n \"canvas\",\n \"creation\",\n \"agent\"\n ],\n \"baseUrl\": \"https://api.wavespeed.ai/api/v3\",\n \"requiresPublicMediaUrls\": true,\n \"auth\": {\n \"type\": \"bearer\",\n \"field\": \"apiKey\"\n },\n \"parameters\": [\n {\n \"name\": \"model\",\n \"type\": \"string\",\n \"required\": false,\n \"mapping\": \"model\",\n \"description\": \"默认 bytedance/seedream-v5.0-pro/layer-decomposition。\"\n },\n {\n \"name\": \"prompt\",\n \"type\": \"string\",\n \"required\": false,\n \"mapping\": \"prompt\",\n \"description\": \"描述需要拆分的图层。\"\n },\n {\n \"name\": \"images\",\n \"type\": \"media[]\",\n \"required\": true,\n \"mapping\": \"source image\",\n \"description\": \"源图片。\"\n },\n {\n \"name\": \"providerOptions\",\n \"type\": \"object\",\n \"required\": false,\n \"mapping\": \"provider-specific fields\",\n \"description\": \"工具扩展字段。\"\n }\n ],\n \"create\": {\n \"method\": \"POST\",\n \"path\": \"/bytedance/seedream-v5.0-pro/layer-decomposition\",\n \"contentType\": \"application/json\",\n \"body\": {\n \"image\": {\n \"$first\": {\n \"$map\": {\n \"from\": {\n \"$ref\": \"request.images\"\n },\n \"as\": \"media\",\n \"in\": {\n \"$ref\": \"media.value\"\n }\n }\n }\n },\n \"prompt\": {\n \"$omitEmpty\": {\n \"$ref\": \"request.prompt\"\n }\n }\n }\n },\n \"poll\": {\n \"method\": \"GET\",\n \"path\": \"/predictions/{{taskId}}/result\"\n },\n \"response\": {\n \"taskId\": {\n \"$coalesce\": [\n {\n \"$ref\": \"response.data.id\"\n },\n {\n \"$ref\": \"response.id\"\n }\n ]\n },\n \"status\": {\n \"$coalesce\": [\n {\n \"$ref\": \"response.data.status\"\n },\n {\n \"$ref\": \"response.status\"\n },\n \"pending\"\n ]\n },\n \"message\": {\n \"$coalesce\": [\n {\n \"$ref\": \"response.data.error\"\n },\n {\n \"$ref\": \"response.data.message\"\n },\n {\n \"$ref\": \"response.error.message\"\n }\n ]\n },\n \"images\": {\n \"$ref\": \"response.data.outputs\"\n },\n \"errorPaths\": [\n \"error.code\"\n ],\n \"resultEphemeral\": true\n }\n }\n ]\n }\n}\n```\n\n", "contributes": { "providers": [ { "id": "image-tools-remove-background", "label": "Image Tools Remove Background", "capabilities": [ "image" ], "scopes": [ "admin.system-channel", "user.custom-channel", "canvas", "creation", "agent" ], "baseUrl": "https://api.wavespeed.ai/api/v3", "requiresPublicMediaUrls": true, "auth": { "type": "bearer", "field": "apiKey" }, "parameters": [ { "name": "model", "type": "string", "required": false, "mapping": "model", "description": "默认 bria/remove-background。" }, { "name": "prompt", "type": "string", "required": false, "mapping": "prompt", "description": "可选工具提示词。" }, { "name": "images", "type": "media[]", "required": true, "mapping": "source image", "description": "源图片。" }, { "name": "providerOptions", "type": "object", "required": false, "mapping": "provider-specific fields", "description": "工具扩展字段。" } ], "create": { "method": "POST", "path": "/bria/remove-background", "contentType": "application/json", "body": { "image": { "$first": { "$map": { "from": { "$ref": "request.images" }, "as": "media", "in": { "$ref": "media.value" } } } }, "prompt": { "$omitEmpty": { "$ref": "request.prompt" } }, "output_format": { "$coalesce": [ { "$ref": "request.providerOptions.image-tools-remove-background.output_format" }, "png" ] } } }, "poll": { "method": "GET", "path": "/predictions/{{taskId}}/result" }, "response": { "taskId": { "$coalesce": [ { "$ref": "response.data.id" }, { "$ref": "response.id" } ] }, "status": { "$coalesce": [ { "$ref": "response.data.status" }, { "$ref": "response.status" }, "pending" ] }, "message": { "$coalesce": [ { "$ref": "response.data.error" }, { "$ref": "response.data.message" }, { "$ref": "response.error.message" } ] }, "images": { "$ref": "response.data.outputs" }, "errorPaths": [ "error.code" ], "resultEphemeral": true } }, { "id": "image-tools-layer-decomposition", "label": "Image Tools Layer Decomposition", "capabilities": [ "image" ], "scopes": [ "admin.system-channel", "user.custom-channel", "canvas", "creation", "agent" ], "baseUrl": "https://api.wavespeed.ai/api/v3", "requiresPublicMediaUrls": true, "auth": { "type": "bearer", "field": "apiKey" }, "parameters": [ { "name": "model", "type": "string", "required": false, "mapping": "model", "description": "默认 bytedance/seedream-v5.0-pro/layer-decomposition。" }, { "name": "prompt", "type": "string", "required": false, "mapping": "prompt", "description": "描述需要拆分的图层。" }, { "name": "images", "type": "media[]", "required": true, "mapping": "source image", "description": "源图片。" }, { "name": "providerOptions", "type": "object", "required": false, "mapping": "provider-specific fields", "description": "工具扩展字段。" } ], "create": { "method": "POST", "path": "/bytedance/seedream-v5.0-pro/layer-decomposition", "contentType": "application/json", "body": { "image": { "$first": { "$map": { "from": { "$ref": "request.images" }, "as": "media", "in": { "$ref": "media.value" } } } }, "prompt": { "$omitEmpty": { "$ref": "request.prompt" } } } }, "poll": { "method": "GET", "path": "/predictions/{{taskId}}/result" }, "response": { "taskId": { "$coalesce": [ { "$ref": "response.data.id" }, { "$ref": "response.id" } ] }, "status": { "$coalesce": [ { "$ref": "response.data.status" }, { "$ref": "response.status" }, "pending" ] }, "message": { "$coalesce": [ { "$ref": "response.data.error" }, { "$ref": "response.data.message" }, { "$ref": "response.error.message" } ] }, "images": { "$ref": "response.data.outputs" }, "errorPaths": [ "error.code" ], "resultEphemeral": true } } ] } }