使用说明
gwt集成
AI代理集成 双子座水印工具 --克劳德式技能、Codex式技能和共享MCP服务器
🆕 Gemini 3.5水印配置文件+自动回退 --与配对 双子座水印工具v0.3.1默认工具会尝试当前的Gemini-3.5+配置文件,并在跳过时自动使用传统(3.5之前)配置文件重试,因此一个调用可以处理混合的复古输入。二 *_legacy MCP工具仍用于明确选择加入。请参阅 情景7 在......下面
此仓库为不同的代理系列以及一个共享的MCP服务器提供了专门的技能入口点。
| 集成 | 使用 | 代理如何调用GWT |
|---|---|---|
| 根技能 | Claude Code和类似Claude的代理 | 读取根 SKILL.md → 构建CLI参数→ 直接调用二进制 |
| 食品法典技能 | Codex和Codex类代理 | 安装地点 skills/gwt/ → 读到 SKILL.md → 直接调用二进制 |
| MCP服务器 | Claude Code、Cursor、Zed、OpenAI Codex、任何MCP客户端 | 调用MCP工具→ 服务器.py→ 二进制 |
技能入口点是有意专门化的。这 mcp/ 目录在所有客户端之间保持共享。
布局策略
此仓库使用不同的技能入口点:
- 根技能布局:适用于克劳德式代理人
skills/gwt/:用于Codex类制剂
这避免了强制两个代理系列共享完全相同的提示措辞和安装程序默认值。
安装目标规则
| 集成路径 | 情况 | 安装位置 |
|---|---|---|
| Codex技能 | 正常使用 | ~/.codex/skills/gwt/bin/ |
| 克劳德式技能 | 正常使用 | ~/.claude/skills/gwt/bin/ |
| MCP服务器 | 正常使用 | 共享服务器,独立于技能布局 |
| MCP服务器 | 本地验证 GWT_LOCAL_VALIDATION=1 |
./bin/ 在回购根目录 |
| 任意路径 | 手动覆盖 python install.py --dir <path> |
您指定的目录 |
换句话说,技能层按代理家族划分,而MCP层保持共享。
仓库结构
gwt-integrations/
├── SKILL.md ← Claude-like skill entrypoint
├── install.py ← Claude-like skill installer
├── skills/
│ └── gwt/ ← Codex-like skill entrypoint
├── mcp/
│ ├── server.py ← Shared MCP server (6 tools)
│ └── pyproject.toml
└── LICENSE
根技能和
skills/gwt/技能是故意不同的。他们能 无需拆分MCP服务器,即可针对各自的代理系列进行调优。
这两条路径是如何运作的
┌──────────────────┐
│ install.py (x2) │ Each skill has its own installer
└────────┬─────────┘ (Claude → ~/.claude, Codex → ~/.codex)
│
┌─────────────────┼─────────────────┐
│ │ │
┌─▼───────────┐ ┌──▼──────────┐ ┌───▼─────────────────┐
│ Claude-Like │ │ Codex-Like │ │ MCP Server │
│ SKILL.md │ │ skills/gwt/ │ │ mcp/server.py │
│ (root) │ │ SKILL.md │ │ │
│ │ │ │ │ Agent calls tools, │
│ Agent reads │ │ Agent reads │ │ server builds args,│
│ docs, execs │ │ docs, execs │ │ execs binary │
└─────────────┘ └─────────────┘ └─────────────────────┘
Claude-like Codex-like Any MCP client
二进制发现顺序(默认行为):
GWT_BINARY_PATH环境变量- 系统
PATH ~/.codex/skills/gwt/bin/~/.claude/skills/gwt/bin/./bin/在repo根目录(本地验证/回退)./mcp/bin/相对于server.py(传统回退)
如果二进制文件缺失,每个技能入口点都可以调用自己的 install.py
而MCP服务器仍在repo根目录处共享。
克劳德式技能
安装
cd ~/.claude/skills
git clone https://github.com/allenk/gwt-integrations gwt
克劳德代码发现 SKILL.md 在 ~/.claude/skills/gwt/SKILL.md 自动。
安装GWT二进制文件
当二进制文件丢失时,代理可以运行 install.py 自动。在一个
Claude风格的安装,默认为 ~/.claude/skills/gwt/bin/:
# or run manually
python ~/.claude/skills/gwt/install.py
验证
打开克劳德代码并询问: "What skills do you have?"
食典类技能
安装
对于Codex的GitHub技能安装程序,请使用专用子目录:
python install-skill-from-github.py --repo allenk/gwt-integrations --path skills/gwt
安装后,Codex将从加载技能 ~/.codex/skills/gwt/,和捆绑 install.py 将默认为 ~/.codex/skills/gwt/bin/.
验证
打开Codex并确认 gwt 技能是可用的。
仅限本地验证
为了在验证期间保持仓库自包含,请在本地安装二进制文件 而不是代理技能目录:
python ./install.py --dir ./bin
# then: export GWT_LOCAL_VALIDATION=1
示例提示
Remove the Gemini watermark from this image.
Remove the watermark from all images in ~/Downloads/
The bottom-right corner still has artifacts, fix it
The image keeps getting skipped, try snap search
MCP服务器
安装
git clone https://github.com/allenk/gwt-integrations
cd gwt-integrations
pip install -e ./mcp
仅限本地验证
pip install -e ./mcp
python ./install.py --dir ./bin
MCP服务器将在首次使用时检测到丢失的二进制文件,并返回
install_command 代理可以立即执行:
{
"found": false,
"install_command": "python /path/to/gwt-integrations/install.py --dir /path/to/gwt-integrations/bin"
}
MCP服务器在代理系列之间共享,因此 install_command 总是
以本地仓库为目标 bin/ 目录——它不假定任何特定的
技能目录(~/.claude/ 或 ~/.codex/).
GWT_LOCAL_VALIDATION=1 仍然控制着 搜索顺序 在
find_gwt_binary():设置时,repo本地 bin/ 在搜索之前
技能目录。
配置客户端
克劳德代码:
claude mcp add gwt -- python /path/to/gwt-integrations/mcp/server.py
光标 (.cursor/mcp.json):
{
"mcpServers": {
"gwt": {
"command": "python",
"args": ["/path/to/gwt-integrations/mcp/server.py"]
}
}
}
泽德 (~/.config/zed/settings.json):
{
"context_servers": {
"gwt": {
"command": { "path": "python",
"args": ["/path/to/gwt-integrations/mcp/server.py"] }
}
}
}
OpenAI Codex CLI:
codex --mcp-server "python /path/to/gwt-integrations/mcp/server.py"
MCP工具
| 工具 | 简介 | 目的 |
|---|---|---|
get_gwt_info |
-- | 检查二进制;回报 install_command 如果丢失 |
remove_watermark |
V2 → V1自动回退 | 单文件,全参数控制 |
remove_watermark_snap |
V2(当前) | 单个文件,调整大小/重新压缩的图像 |
remove_watermark_batch |
V2 → V1自动回退 | 整个目录 |
remove_watermark_legacy |
仅限V1(3.5之前) | 单个文件,固定到旧配置文件 |
remove_watermark_batch_legacy |
仅限V1(3.5之前) | 整个目录,固定到旧配置文件 |
从GWT v0.3.1开始,默认工具(remove_watermark /
remove_watermark_batch)首先尝试当前的Gemini-3.5+配置文件,然后
跳过时自动回退到旧配置文件,所以一个单一
调用处理混合的复古输入。通过 no_legacy=True 如果你想
之前的仅V2行为。这 *_legacy 工具仍为
极少数情况下,呼叫者知道图像是3.5之前的版本,并希望
完全跳过V2尝试——请参阅
情景7 当...时
使用每一个。
使用场景
当用户不想手动构建CLI时,此仓库最有用 论据。相反,他们用自然语言描述图像问题 代理将该请求映射到技能路径或MCP工具路径。
场景1:默认角落的标准Gemini水印
用户说:
Remove the Gemini watermark from this image.
Remove the Gemini watermark from the bottom-right corner of this image.
代理行为:
- 技能:在没有高级标志的情况下运行标准GWT检测
- MCP:呼叫
remove_watermark(input_path, output_path)
最适合:
- 典型的Gemini输出
- 正常右下水印
- 生成后未调整大小的图像
场景2:图像被调整大小、重新压缩或截图
用户说:
This image keeps getting skipped. Try snap search.
This image was resized. Use snap search to find the watermark.
代理行为:
- 技能:添加
--fallback-region ... --snap - MCP:呼叫
remove_watermark_snap(...)
最适合:
- JPEG重新压缩
- 社交媒体转发
- 截图或编辑导出
- 标准检测返回的案例
[SKIP]
场景3:一次通过后水印仍然可见
用户说:
The watermark is mostly gone but the corner still looks dirty.
There are still artifacts in the bottom-right corner. Increase the strength a bit.
代理行为:
- 保持相同的检测/自定义区域
- 例如,增加降噪设置
sigma=75, strength=180 - 仅在必要时进一步升级,例如
sigma=100, strength=250
最适合:
- 微弱的边缘残留物
- 部分移除
- 水印光晕或脏角
场景4:非标准水印大小或非标准位置
用户说:
The watermark is not in the normal bottom-right position.
Search the bottom-left 600x600 area with snap.
The watermark size looks unusual. Search the bottom-right 200x200 area.
代理行为:
- 使用区域约束搜索而不是整个图像假设
- 技能:使用
--fallback-region br:...或bl:...随着--snap - MCP:呼叫
remove_watermark(...)随着fallback_region,snap,snap_max_size,以及snap_threshold
最适合:
- 裁剪图像
- 布局移动水印位置
- 小于或大于预期的水印大小
场景5:用户知道确切的矩形
用户说:
Use custom region 683,1297,52,52 and remove it directly.
Do not use snap. Use custom region 683,1297,52,52 directly.
代理行为:
- 跳过广泛搜索
- 将GWT直接应用于提供的区域
- 当人类已经视觉识别出水印时很有用
最适合:
- 来自同一来源的重复图像
- 细粒度清理
- 广泛快速搜索流向错误候选人的情况
场景6:批量处理文件夹
用户说:
Remove Gemini watermarks from every image in this folder.
Batch remove Gemini watermarks from every image in this folder.
代理行为:
- 技能:在目录模式下调用GWT
- MCP:呼叫
remove_watermark_batch(input_dir, output_dir)
最适合:
- 下载文件夹
- 从单代会话导出图像
- 只有部分图像包含水印的混合文件夹
场景7:Pre-Gemini-3.5图像(传统配置文件)
GeminiWatermarkTool v0.3.0引入了两种水印配置文件。开始
在v0.3.1中,默认工具(remove_watermark /
remove_watermark_batch) 自动试用当前的Gemini-3.5+
先配置文件,然后在跳过时回退到传统(3.5之前)配置文件,
因此,一个电话通常可以在没有监督的情况下处理两个年份的葡萄酒。
这 *_legacy 工具仍然用于明确的选择加入。
当你什么都不需要做的时候
对于常见的情况——单张图片,未知年份——只需致电
remove_watermark(input, output)内部的CLI处理V2→
V1重试。如果水印在结果中消失了,那么就完成了。
当默认工具报告时 skipped
A. skipped 默认工具的结果意味着 这两个配置文件都有
已经尝试过,但都不匹配这两者难以区分
原因有:
- 图像 是 Gemini输出,但其水印已损坏 通过大量调整大小/重新编码/编辑。
- 该图像根本不是Gemini输出。
做 不 无声地呼唤 remove_watermark_legacy 此时——
自动回退已经做到了这一点。向用户展示结果
并提供其中一种升级工具:
"I couldn't detect a Gemini watermark on this image (V2 conf X%,
V1 conf Y%). It might be a non-Gemini image, or the watermark may
have been damaged by post-processing. I can try `remove_watermark_snap`
against a region you point to, or you can force removal with a custom
region in the GUI."
何时使用 *_legacy 工具直接
大多数情况下,呼叫者知道图像是3.5之前的版本 Gemini输出并希望完全跳过V2尝试(节省一些 毫秒和一条检测日志行,与一次性呼叫无关 但对于非常大的批次来说很重要)。
remove_watermark_legacy(input, output) # single file
remove_watermark_batch_legacy(input_dir, output_dir) # whole directory
代理应识别的用户端措辞
This is from an older Gemini, before the new version.
Use the legacy profile.
Use --legacy.
代理行为:
- 技能:附加
--legacy转到GWT CLI调用 - MCP:呼叫
remove_watermark_legacy(...)或remove_watermark_batch_legacy(...)
最适合:
- Gemini在3.5版本之前生成的图像
- 混合库:首先使用默认工具处理,然后使用第二个 使用传统工具传递会拾取第一个旧文件 安全跳过通行证
用户应如何与客服沟通
最高信号指令为:
- 描述图像是标准的、调整大小的、裁剪的还是重新压缩的
- 说出要搜索的角落:
bottom-right,bottom-left等等。 - 说明水印大小看起来是正常、较小还是较大
- 如果知道,请直接提供一个地区:
x,y,w,h - 如果工件仍然存在,请说明您是想要温和的清理还是更强烈的清理
示例:
Remove the Gemini watermark from this file.
Try snap search in the bottom-right 200x200 area.
Use custom region 683,1297,52,52.
The first pass worked, but increase strength slightly.
Process this whole folder and skip files with no watermark.
实践中的技能与MCP
- 当您希望代理从正常情况推断CLI标志时,请使用该技能 在一个有技能的代理人中交谈。
- 当您需要结构化的工具调用、显式的参数和更简单的方法时,请使用MCP 与Cursor、Zed、Codex CLI或任何其他MCP客户端集成。
- 在这两种情况下,面向用户的请求都可以保持自然语言;这 集成层将该请求转换为GWT参数。
区域语法参考
| 格式 | 含义 |
|---|---|
x,y,w,h |
绝对像素坐标 |
br:mx,my,w,h |
右下角:margin_right、margin_bottor、宽度、高度 |
bl:mx,my,w,h |
左下角相对 |
tr:mx,my,w,h |
右上角相对 |
tl:mx,my,w,h |
左上/绝对 |
br:auto |
此图像大小的Gemini默认位置 |
故障排除
图像不断得到 [SKIP] --图像在生成后被调整大小/重新压缩。
告诉代理人: “尝试快照搜索” 或使用 remove_watermark_snap.
残留的伪影仍然可见 --告诉代理人: “增强实力”.
升级: sigma=75, strength=180 → sigma=100, strength=250.
macOS网守:
xattr -dr com.apple.quarantine ~/.codex/skills/gwt/bin/GeminiWatermarkTool
# or:
xattr -dr com.apple.quarantine ~/.claude/skills/gwt/bin/GeminiWatermarkTool
Windows智能屏幕:
Unblock-File $env:USERPROFILE\.codex\skills\gwt\bin\GeminiWatermarkTool.exe
# or:
Unblock-File $env:USERPROFILE\.claude\skills\gwt\bin\GeminiWatermarkTool.exe
相关
- 双子座水印工具 --核心C++工具
- Medium上的技术文章 --反向阿尔法混合深潜
- SynthID研究报告 --为什么谷歌的隐形水印无法删除
许可证
麻省理工学院——见 许可证
