GIMP-MCP:将 GIMP 与 AI 集成

GIMP-MCP:将 GIMP 与 AI 集成

通过模型上下文协议 (MCP) 将 GIMP 与 AI 模型无缝集成,增强图像编辑功能。

快速入门

安装前提

  • 确保已安装 GIMP 2.10 或更高版本。
  • 安装 Python 3.x。

设置 MCP 服务器

  1. 克隆仓库:git clone https://github.com/modelcontextprotocol/servers.git
  2. 安装依赖:pip install -r requirements.txt
  3. 启动服务器:python mcp_server.py

集成到 GIMP

  1. 找到 GIMP 插件目录:
    • Linux: ~/.config/GIMP/2.10/plug-ins/
    • Windows: C:\Users<用户名>\AppData\Roaming\GIMP\2.10\plug-ins\
    • macOS: ~/Library/Application Support/GIMP/2.10/plug-ins/
  2. 复制插件文件 gimp_mcp_plugin.py 至插件目录。
  3. (Linux/macOS)设置权限:chmod +x gimp_mcp_plugin.py
  4. 重启 GIMP,新功能将出现在 Filters > AI Tools 下。

示例用法

  • 背景移除:Filters > AI Tools > Remove Background。
  • 图像修复:选择区域后使用 Filters > AI Tools > Inpaint Selection。

更多内容参考 README