一个集成了 AI 图像处理、游戏开发工具和 MCP (Model Context Protocol) 服务的多功能助手工具。支持背景移除、图像缩放、精灵图合成和 GIF 制作等功能。
# 克隆项目
git clone https://github.com/your-username/comfyui-helper.git
cd comfyui-helper
# 安装依赖
uv sync
# 安装包为可编辑模式(开发用)
uv pip install -e .
# 全局安装 CLI 工具
uv tool install comfyui-helper
# 或从本地安装
uv tool install /path/to/comfyui-helper
编辑 Claude Desktop 配置文件:
~/AppData/Roaming/Claude/claude_desktop_config.json~/Library/Application Support/Claude/claude_desktop_config.json添加以下配置(替换为您的实际项目路径):
{
"mcpServers": {
"comfyui-helper": {
"command": "uv",
"args": [
"--directory",
"/path/to/comfyui-helper",
"run",
"python",
"-m",
"comfyui_helper"
],
"env": {}
}
}
}
在 Claude Desktop 中可直接调用以下工具:
compose_sprite_sheet - 合成精灵图表scale_image - 缩放图像remove_background - 移除背景batch_remove_background - 批量移除背景# 启动 GIF 制作器 Web GUI
cfh gif-maker
# 查看帮助
cfh --help
from comfyui_helper.core import BackgroundRemover, ImageScaler, SpriteComposer
# 移除背景
remover = BackgroundRemover()
result = await remover.process_image("input.jpg", "output.png")
# 缩放图像
scaler = ImageScaler()
scaler.scale_image("input.jpg", scale_factor=2.0)
# 合成精灵图
composer = SpriteComposer()
composer.create_sprite_sheet("sprites_dir", "output_dir")
comfyui-helper/
├── comfyui_helper/
│ ├── cli/ # 命令行工具
│ │ ├── main.py # CLI 入口
│ │ └── gif_maker_gui.py
│ ├── core/ # 核心功能模块
│ │ ├── background_remover.py
│ │ ├── image_scaler.py
│ │ ├── sprite_composer.py
│ │ ├── gif_maker.py
│ │ └── video_frame_extractor.py
│ └── mcp/ # MCP 服务
│ ├── tools/ # MCP 工具定义
│ └── resources/ # MCP 资源
├── examples/ # 示例项目
├── docs/ # 文档
├── pyproject.toml # 项目配置
└── README.md # 本文档
# 运行 MCP 服务器
uv run python -m comfyui_helper
# 运行 CLI 工具
uv run cfh gif-maker
# 开发模式调试
uv run python -m comfyui_helper.cli.gif_maker_gui
comfyui_helper/core/ 下创建模块comfyui_helper/mcp/tools/ 下添加并注册comfyui_helper/cli/main.py 中添加子命令# 添加新依赖
uv add package-name
# 同步依赖
uv sync
# 重新安装(开发模式)
uv pip install -e .
/ 或双反斜杠 \\# 重新安装依赖
uv sync --refresh
# 如果模块导入失败
uv pip install -e .
~/Library/Logs/Claude/mcp.log (macOS)MIT
欢迎提交 Issue 和 Pull Request!
如有问题或建议,请通过 GitHub Issues 联系。
34 commits
Python
100.0%
一个集成了 AI 图像处理、游戏开发工具和 MCP (Model Context Protocol) 服务的多功能助手工具。支持背景移除、图像缩放、精灵图合成和 GIF 制作等功能。
# 克隆项目
git clone https://github.com/your-username/comfyui-helper.git
cd comfyui-helper
# 安装依赖
uv sync
# 安装包为可编辑模式(开发用)
uv pip install -e .
# 全局安装 CLI 工具
uv tool install comfyui-helper
# 或从本地安装
uv tool install /path/to/comfyui-helper
编辑 Claude Desktop 配置文件:
~/AppData/Roaming/Claude/claude_desktop_config.json~/Library/Application Support/Claude/claude_desktop_config.json添加以下配置(替换为您的实际项目路径):
{
"mcpServers": {
"comfyui-helper": {
"command": "uv",
"args": [
"--directory",
"/path/to/comfyui-helper",
"run",
"python",
"-m",
"comfyui_helper"
],
"env": {}
}
}
}
在 Claude Desktop 中可直接调用以下工具:
compose_sprite_sheet - 合成精灵图表scale_image - 缩放图像remove_background - 移除背景batch_remove_background - 批量移除背景# 启动 GIF 制作器 Web GUI
cfh gif-maker
# 查看帮助
cfh --help
from comfyui_helper.core import BackgroundRemover, ImageScaler, SpriteComposer
# 移除背景
remover = BackgroundRemover()
result = await remover.process_image("input.jpg", "output.png")
# 缩放图像
scaler = ImageScaler()
scaler.scale_image("input.jpg", scale_factor=2.0)
# 合成精灵图
composer = SpriteComposer()
composer.create_sprite_sheet("sprites_dir", "output_dir")
comfyui-helper/
├── comfyui_helper/
│ ├── cli/ # 命令行工具
│ │ ├── main.py # CLI 入口
│ │ └── gif_maker_gui.py
│ ├── core/ # 核心功能模块
│ │ ├── background_remover.py
│ │ ├── image_scaler.py
│ │ ├── sprite_composer.py
│ │ ├── gif_maker.py
│ │ └── video_frame_extractor.py
│ └── mcp/ # MCP 服务
│ ├── tools/ # MCP 工具定义
│ └── resources/ # MCP 资源
├── examples/ # 示例项目
├── docs/ # 文档
├── pyproject.toml # 项目配置
└── README.md # 本文档
# 运行 MCP 服务器
uv run python -m comfyui_helper
# 运行 CLI 工具
uv run cfh gif-maker
# 开发模式调试
uv run python -m comfyui_helper.cli.gif_maker_gui
comfyui_helper/core/ 下创建模块comfyui_helper/mcp/tools/ 下添加并注册comfyui_helper/cli/main.py 中添加子命令# 添加新依赖
uv add package-name
# 同步依赖
uv sync
# 重新安装(开发模式)
uv pip install -e .
/ 或双反斜杠 \\# 重新安装依赖
uv sync --refresh
# 如果模块导入失败
uv pip install -e .
~/Library/Logs/Claude/mcp.log (macOS)MIT
欢迎提交 Issue 和 Pull Request!
如有问题或建议,请通过 GitHub Issues 联系。
34 commits
Python
100.0%