ComfyUI Extension: ComfyUI ModelScope Kontext API Node
This is a custom node for ComfyUI that allows users to perform Image-to-Image generation by calling the FLUX.1-Kontext-Dev model via the official ModelScope API.
Custom Nodes (0)
README
ComfyUI ModelScope Kontext API Node
这是一个为ComfyUI设计的自定义节点,它允许用户通过魔搭(ModelScope)的官方API,调用 FLUX.1-Kontext-Dev 模型进行图生图(Image-to-Image)操作。
This is a custom node for ComfyUI that allows users to perform Image-to-Image generation by calling the FLUX.1-Kontext-Dev model via the official ModelScope API.
✨ 功能特性
- 直接的 API 调用:无需在本地下载模型,直接通过 API 在云端生成图像。
- 完整的参数控制:支持调整分辨率(宽度和高度)、随机种子(Seed)、采样步数(Steps)和提示词引导系数(Guidance)。
- 内置图床服务:自动将输入的图像上传到免费图床,以获取可供 API 使用的公开 URL。
🖼️ 节点截图
⚙️ 安装
方法一:使用 Git
- 打开一个终端或命令行窗口。
- 导航到你的 ComfyUI 安装目录下的
custom_nodes
文件夹。cd /path/to/your/ComfyUI/custom_nodes/
- 运行以下命令克隆本仓库:
git clone https://github.com/Onionman61/ComfyUI-ModelScope-Kontext.git
- 重启 ComfyUI。
方法二:手动下载
- 点击本页面右上角的
Code
按钮,然后选择Download ZIP
。 - 解压下载的 ZIP 文件。
- 将解压后的文件夹(确保文件夹名为
ComfyUI-ModelScope-Kontext
)移动到 ComfyUI 的custom_nodes
目录下。 - 重启 ComfyUI。
🚀 使用方法
- 在 ComfyUI 中,通过右键菜单或双击搜索
ModelScope Kontext API
来添加此节点。 - 将一个图像输出连接到本节点的
image
输入。 - 在
api_key
字段中,填入你的 ModelScope API Key。 - 在
prompt
字段中,输入你想要对图像进行的修改描述。 - 根据需要调整
width
,height
,seed
,steps
, 和guidance
参数。 - 将节点的
IMAGE
输出连接到PreviewImage
或SaveImage
节点以查看结果。
🙏 致谢
- 模型提供方: 魔搭 ModelScope
- 图片上传服务: freeimage.host
📄 许可证
本项目采用 MIT License 开源。