Files
qiqi 75876f92be fix(plugin): 图片处理动作只在 ref 节点出现(不再挂 gen/out/layer)
- image-annotate 1.0.2 / white-bg-800 1.0.1 / xianyi-cutout 1.0.2

- 产图节点一个可能有多张结果或多个图层,getNodeImage 只能取 result[0],漂浮菜单里放「编辑图片」会被误读成「编辑结果图」;先「复制/插入为参考图节点」

- 命令面板通道不受影响(仍可显式调用)
2026-10-30 11:02:18 +08:00

1.3 KiB
Raw Permalink Blame History

鲜艺抠图(插件)

调用本机 鲜艺抠图 服务把节点里的图抠成透明底,写回为新的参考图节点。

服务契约(对齐 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 图片输入节点时出现;产图节点先「复制 / 插入为参考图节点」)
  • 右键菜单「插件命令 → 抠图:选中节点」

设置

键 说明
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