基于 Stable Diffusion 的图像生成服务器
提供通过文本生成图像功能的 MCP 服务器,使用 Stable Diffusion WebUI API。
快速入门
前置条件
- 安装 Node.js
- 确保有运行中的 Stable Diffusion WebUI 实例,并启用
--api
标志
安装步骤
-
克隆仓库: git clone https://github.com/Ichigo3766/image-gen-mcp.git cd image-gen-mcp
-
安装依赖: npm install
-
构建项目: npm run build
-
配置环境变量,编辑配置文件: { "mcpServers": { "image-gen": { "command": "node", "args": ["/path/to/build/index.js"], "env": { "SD_WEBUI_URL": "http://your-sd-webui-url:7860", "SD_AUTH_USER": "username", "SD_AUTH_PASS": "password" } } } }
-
启动服务并调用工具,例如
generate_image
。
开发模式
使用以下命令实时开发: npm run watch