ComfyUI InstantID 项目下载及安装教程
ComfyUI_InstantID 项目地址: https://gitcode.com/gh_mirrors/co/ComfyUI_InstantID
1. 项目介绍
ComfyUI InstantID 是一个为 ComfyUI 设计的扩展插件,旨在提供对 InstantID 的原生支持。与现有的许多插件不同,该扩展不使用 diffusers,而是原生实现 InstantID,并完全集成到 ComfyUI 中。InstantID 是一个用于图像生成的技术,能够根据参考图像生成高质量的图像。
2. 项目下载位置
你可以通过以下链接访问 ComfyUI InstantID 项目的 GitHub 仓库进行下载:
3. 项目安装环境配置
在安装 ComfyUI InstantID 之前,你需要确保你的环境已经配置好以下依赖项:
- ComfyUI: 确保你已经安装了最新版本的 ComfyUI。
- Python: 推荐使用 Python 3.8 或更高版本。
- InsightFace: 你需要安装 InsightFace 库,以及
onnxruntime
和onnxruntime-gpu
。
环境配置示例
以下是配置环境的步骤:
-
安装 Python 依赖项:
pip install insightface onnxruntime onnxruntime-gpu
-
下载 InsightFace 模型:
从以下链接下载 InsightFace 模型(antelopev2):
下载后,将模型解压并放置在
ComfyUI/models/insightface/models/antelopev2
目录下。 -
下载 InstantID 模型:
从 HuggingFace 下载 InstantID 模型(ip_adapter):
下载后,将模型放置在
ComfyUI/models/instantid
目录下。
环境配置示例图片
4. 项目安装方式
安装 ComfyUI InstantID 的步骤如下:
-
克隆项目仓库:
git clone https://github.com/cubiq/ComfyUI_InstantID.git
-
将项目放置在 ComfyUI 的
custom_nodes
目录下:mv ComfyUI_InstantID ComfyUI/custom_nodes/
-
安装项目依赖项:
进入项目目录并安装所需的 Python 依赖项:
cd ComfyUI/custom_nodes/ComfyUI_InstantID pip install -r requirements.txt
5. 项目处理脚本
ComfyUI InstantID 提供了一些示例工作流,你可以在 examples
目录中找到这些工作流。以下是一个简单的处理脚本示例:
from ComfyUI_InstantID import InstantID
# 初始化 InstantID
instant_id = InstantID()
# 加载参考图像
reference_image = "path/to/reference_image.png"
# 生成图像
output_image = instant_id.generate(reference_image)
# 保存生成的图像
output_image.save("output.png")
通过以上步骤,你可以成功下载并安装 ComfyUI InstantID 项目,并开始使用它进行图像生成。
ComfyUI_InstantID 项目地址: https://gitcode.com/gh_mirrors/co/ComfyUI_InstantID