Native Comfy_Preprocess_Haruhi support for ComfyUI.
For InstantID
This extension differs from the many already available as it doesn't use diffusers but instead implements InstantID natively and it fully integrates with ComfyUI.
-
2024/03/25 完成了第二版的controlnet预处理节点,可以直接在ComfyUI中使用
-
2024/03/16: 上传了第一版controlnet预处理节点
Upgrade ComfyUI to the latest version!
Remember at the moment this is only for SDXL.
-
下载 或者 使用
git clone
本文件夹或者 Comfy_Preprocess_Haruhi 到ComfyUI/custom_nodes/
目录下 或者 使用ComfyUI Manager. -
请将silk-road/Haruhi-expression-controlnet-v3-xl下的controlnet模型下载到
ComfyUI/models/controlnet
目录下。 -
本项目代码部分参考Fannovel16/comfyui_controlnet_aux,并使用新版的controlnet加载方法,请一并安装。
-
工作流中名字中带有InstantID前缀的将依赖InstantID节点,所以请确保已经安装InstantID节点。参考教程:
InstantID requires
insightface
, you need to add it to your libraries together withonnxruntime
andonnxruntime-gpu
.The InsightFace model is antelopev2 (not the classic buffalo_l). Download the models (for example from here or here), unzip and place them in the
ComfyUI/models/insightface/models/antelopev2
directory.The main model can be downloaded from HuggingFace and should be placed into the
ComfyUI/models/instantid
directory. (Note that the model is called ip_adapter as it is based on the IPAdapter).You also needs a controlnet, place it in the ComfyUI controlnet directory.
如果你想使用Haruhi preprocesser节点搭建自己的工作流,节点在node的ControlPreprocessHaruhi目录下,共有四种preprocesser节点:
- 📷Ref Image Preprocessing_mix_v1
- 第一版搭建的controlnet预处理模块,基于基本的openpose和未经mask的lineart进行叠加
- 对应的controlnet模型为controlnet_face-v2-XL
- 📷Ref Image Preprocessing_facepose_v2
- 第二版搭建的controlnet预处理模块,基于自定义的openpose关键点进行连线并上色——facepose
- 对应的controlnet模型为 controlnet_colored_v3
- 📷Ref Image Preprocessing_maskedlineart_v2
- 第二版搭建的controlnet预处理模块,基于对内脸切分进行mask的lineart
- 对应的controlnet模型为controlnet_meshBlended_v3
- 📷Ref Image Preprocessing_mix_v2
- 第二版搭建的controlnet预处理模块,基于自定义的facepose和masked lineart进行叠加
- 对应的controlnet模型为controlnet_meshedLSD_v3
请使用Load Advanced ControlNet Model(diff)进行加载,选择对应的controlnet模型即可,基模型为sd_xl_base_1.0.safetensors,可参考示例工作流。
在 WORKFLOWS
目录下有测试通过的一些基本工作流
本项目共训练了三个批次的controlnet模型,均基于Celeb数据集以及一些公开可爬取的网络数据进行训练:
- silk-road/Haruhi-expression-controlnet-v1-xl
- 本批次旨在跑通controlnet训练的baseline,基于基础openpose
- silk-road/Haruhi-expression-controlnet-v2-xl
- 本批次旨在探索openpose和lineart联合表征表情和ID的可能性,观测到虚影现象的产生
- silk-road/Haruhi-expression-controlnet-v3-xl
- 本批次旨在解决虚影现象的产生以及提升openpose信息对于表情的影响能力和降低lineart对于id信息的影响能力,取得了较好的效果
训练数据中充满了水印,为避免水印出现在生成的数据中,请使用与 1024×1024 稍微不同的分辨率(或标准分辨率),例如1016×1016,效果相当不错,或者尝试在negative prompt中加入一些提示词,可能的水印来源getty images。