Skip to content

Releases: martianzhang/aigc-cli

v1.11.1

Choose a tag to compare

@github-actions github-actions released this 22 Jul 10:10

Full Changelog: v1.11.0...v1.11.1

v1.11.0

Choose a tag to compare

@github-actions github-actions released this 22 Jul 09:51

Full Changelog: v0.4.1...v1.11.0

v1.10.3

Choose a tag to compare

@github-actions github-actions released this 21 Jul 13:41

Full Changelog: v1.10.2...v1.10.3

v1.10.2

Choose a tag to compare

@github-actions github-actions released this 21 Jul 10:06

Full Changelog: v1.10.1...v1.10.2

v1.10.1

Choose a tag to compare

@github-actions github-actions released this 21 Jul 09:33

Full Changelog: v1.9.0...v1.10.1

v1.10.0

Choose a tag to compare

@github-actions github-actions released this 21 Jul 07:54

Full Changelog: v1.9.0...v1.10.0

v1.9.0

Choose a tag to compare

@github-actions github-actions released this 19 Jul 00:34

v1.9.0 — MI-GAN AI 水印修补:基于 ONNX 深度学习的去水印重构

亮点

--remove-watermark 完全重构,默认算法从经典 Alpha Map 逆 alpha 混合升级为 MI-GAN AI 修补(基于 LaMa 的 ONNX 推理 inpainting 模型,28MB):

  • AI 修补:用深度生成模型重绘水印区域,而非逆 alpha 混合,对复杂纹理背景效果更好
  • 自动降级:MI-GAN 失败自动 fallback 到 Alpha Map 经典算法
  • 无需 --producer:自动从 TC260/C2PA 元数据识别 producer,或通过 NCC 模板匹配检测位置
  • 手动位置指定:新增 --watermark-box 精确控制修补区域

新功能

  • aigc-cli detect --remove-watermark --watermark-box "200,60" — 手动指定水印位置(右下角 200×60)
  • aigc-cli detect --remove-watermark --watermark-box "800,900,200,60" — 绝对坐标格式
  • aigc-cli detect --remove-watermark --watermark-box "-10,-10,200,60" — 负值表示距右/下边缘距离
  • aigc-cli detect --remove-watermark --alpha-map — 强制使用经典 Alpha Map 算法
  • aigc-cli detect --remove-watermark --mi-gan — 强制使用 MI-GAN AI 修补

算法选择

算法 方式 说明
MI-GAN(默认) AI 修补 ONNX 推理,基于 LaMa 的 inpainting 模型。需要 migan.onnx(28MB)放在 ~/.config/aigc-cli/models/
Alpha Map(经典) 逆 alpha 混合 需要 --learn-watermark 学习的水印配置,用 --alpha-map 强制启用

水印位置解析优先级

1. --watermark-box         手动指定(最精确)
2. 元数据 producer 已知    → PositionResolver 计算位置
3. 通用检测(未识别 producer) → NCC 模板匹配
4. 右下角 fallback 区域    (300×80)

依赖变更

  • 新增:github.com/martianzhang/pure-onnx(pure-onnx 的 fork,修复编译问题)
  • 运行时:需 ONNX Runtime 共享库(与 detect / background 共享,无需重复下载)
  • 模型:migan.onnx(28MB)可通过 aigc-cli detect init 或其他方式放置到 models 目录

Full Changelog: v1.8.0...v1.9.0

v1.8.0

Choose a tag to compare

@github-actions github-actions released this 18 Jul 14:34

v1.8.0 — AI 去背:基于 RMBG 2.0 的语义分割背景移除

亮点

aigc-cli background 命令完全重写,核心算法从色度键控(Chroma Key)升级为 RMBG 2.0 语义分割模型(BiRefNet, 256MB ONNX FP16)。

  • 任意背景:不再局限于纯色/渐变背景,支持照片级复杂场景
  • 像素级分割:发丝、毛绒边缘等细节处理更精确
  • 完全离线:纯 Go 本地推理,无 API Key 需求
  • 保持原有功能:--replace / --autocrop / --shadow 等标志全部保留

新功能

  • aigc-cli background init — 首次使用前下载 RMBG 2.0 模型
  • remove_background MCP 工具 — 在 Claude Desktop / Cursor 等 AI 客户端中直接调用

破坏性变更

  • 删除了 --tolerance--feather--smooth--erode--close--bg-color--fg-threshold 等 chroma key 调参标志。RMBG 语义分割无需手动调节
  • 删除了 --ai 标志(两步法:AI 再生图 → 去背)。RMBG 直接处理复杂背景,不再需要此 trick
  • --output 输出现在是 固定 PNG 格式(因需要 alpha 通道)

依赖变更

  • 新增:github.com/amikos-tech/pure-onnx(已在 go.mod 中,无新增外部依赖)
  • 运行时:需 ONNX Runtime 共享库(与 detect init 共享,无需重复下载)

Full Changelog: v1.7.1...v1.8.0

v1.7.1

Choose a tag to compare

@github-actions github-actions released this 18 Jul 07:34

Full Changelog: v1.7.0...v1.7.1

v1.7.0

Choose a tag to compare

@github-actions github-actions released this 18 Jul 07:15

v1.7.0 — 背景处理

新命令

background — 去背景 / 换背景 / AI 辅助去背

新增 aigc-cli background 命令,基于纯 Go 的色度键控引擎,专为 AI 生成的纯色背景图优化。

算法管线

  • K-Means k=5 多色背景检测 + 角点验证(排除主体颜色污染)
  • CIELAB ΔE 色度键控 + P90 自适应容差
  • 形态学闭合填孔(--close-radius
  • Sobel 梯度引导边缘羽化
  • 反向 alpha 去边(Color Spill Suppression)
  • 泛洪填充(Flood Fill)解决主体与背景同色问题
  • 多簇时自动放宽容差适配渐变背景

核心参数

  • --remove — 去背景,输出透明 PNG
  • --replace "#RRGGBB" / --replace image.png — 换背景色或图片
  • --autocrop / --ac — 裁剪到主体边界框
  • --aspect-ratio / --ar — 强制输出宽高比(1:116:93:4
  • --padding — 主体四周留白
  • --shadow — 主体背后投影(偏移、模糊、颜色、不透明度可调)
  • --mask-only — 输出灰度遮罩用于调试
  • --tolerance / --feather-radius / --erode-radius / --close-radius — 精细调参
  • --ai [模板名] — AI 辅助去背,先用大模型把背景压成纯色再精确去背。内置模板:defaultwhitehumanproductgood

用法示例

aigc-cli background input.png --remove --ac --padding 20
aigc-cli background input.png --replace "#FF0000"
aigc-cli background input.png --remove --shadow
aigc-cli background input.png --remove --ac --ai default

详细文档见 docs/guide-background.md


其他变更

  • --print-config 现在能正确显示所有配置字段
  • 修复 Gemini 水印检测在部分图片上的误报

Full Changelog: v1.6.0...v1.7.0