- 需构建的插件由 build-plugin.mjs 从 package.json 注入版本,校验器负责兜底 - 根 README 记录 plugin/ → src/index.js 的三段构建原因与 shared/ 约定 - 修 xianyi-cutout/README 里 plugins-publish.sh 的过时警示(现已产出 integrity)
鲜艺抠图(插件)
调用本机 鲜艺抠图 服务把节点里的图抠成透明底,写回为新的参考图节点。
服务契约(对齐 iwb-plaus v3.1.3)
POST {apiUrl}/rmbg?crop=true|false # 默认 http://localhost:30092
Content-Type: application/octet-stream # 原始图片字节;无 token、无 JSON
→ 返回原始 PNG 字节
比原扩展多做的:补齐了超时(AbortController + 可配 timeoutMs,原版没有任何超时)。
入口
- 节点漂浮菜单「抠图」(选中 ref / out 节点时出现)
- 右键菜单「插件命令 → 抠图:选中节点」
设置
| 键 | 说明 |
|---|---|
apiUrl |
本地服务地址。CSP 仅放行 127.0.0.1 / localhost 的 30092 端口 |
crop |
抠图后裁掉多余透明像素(对应接口 crop 参数) |
timeoutMs |
超时毫秒(默认 120000) |
发布
cd /Users/qiqi/open/github/image-workbench-web
# 两个发布器现在都会写 SRI integrity(.mjs 默认 dry-run,--upload 才写 KV)
cp /Users/qiqi/open/github/iwb-plugins/xianyi-cutout/src/index.js /tmp/plugin-xianyi-cutout.js
node scripts/plugins-publish.mjs /tmp/plugin-xianyi-cutout.js --upload --version xianyi-cutout=1.0.1