https://github.com/ZHO-ZHO-ZHO/ComfyUI-PhotoMaker-ZHO
Unofficial implementation of PhotoMaker for ComfyUI
https://github.com/ZHO-ZHO-ZHO/ComfyUI-PhotoMaker-ZHO
comfyui stable-diffusion
Last synced: 6 months ago
JSON representation
Unofficial implementation of PhotoMaker for ComfyUI
- Host: GitHub
- URL: https://github.com/ZHO-ZHO-ZHO/ComfyUI-PhotoMaker-ZHO
- Owner: ZHO-ZHO-ZHO
- License: gpl-3.0
- Created: 2024-01-15T20:56:39.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-22T14:13:49.000Z (about 1 year ago)
- Last Synced: 2024-12-13T15:19:39.081Z (6 months ago)
- Topics: comfyui, stable-diffusion
- Language: Python
- Homepage:
- Size: 96.7 KB
- Stars: 791
- Watchers: 15
- Forks: 42
- Open Issues: 58
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- awesome-comfyui - **ComfyUI PhotoMaker (ZHO)**
README

# ComfyUI PhotoMaker
Unofficial implementation of [PhotoMaker](https://github.com/TencentARC/PhotoMaker) for ComfyUI

单张参考与多张参考的对比:


## 项目介绍 | Info
- 来自对[PhotoMaker](https://github.com/TencentARC/PhotoMaker)的非官方实现
- 版本:V2.5 支持lora、支持多批次、支持通用的styler
## 视频演示
https://github.com/ZHO-ZHO-ZHO/ComfyUI-PhotoMaker/assets/140084057/d58af6e7-d0f3-41ff-ab33-195cb6d66e9e
## 节点说明 | Features
- 基础模型加载 | base model loader
- 📷Base Model Loader from hub🤗:支持从 huggingface hub 自动下载模型,输入模型名称(如:SG161222/RealVisXL_V3.0)即可
- 📷Base Model Loader locally:支持加载本地模型(需 SDXL 系列模型)- PhotoMaker Adapter 模型加载 | PhotoMaker Adapter Loader
- 📷PhotoMaker Adapter Loader from hub🤗:支持从 huggingface hub 自动下载模型
- 📷PhotoMaker Adapter Loader locally:支持加载本地模型,输入 photomaker-v1.bin 模型所在路径即可- 参考图预处理 | 📷Ref Image Preprocessing
- 直接模式 | Direct_input:接入单/多张图像(非必要项)
- 路径模式 | Path_input:自动读取路径中的所有图像- Lora模型加载 | 📷LoRALoader 🆕
- 支持加载本地 lora 模型
- 支持权重调节- 提示词 + 风格 | 📷Prompt_Styler 🆕
- 与各种提示词(文本)输入(如肖像大师等)、styler兼容
- prompt、negative:正负提示词
- 支持权重调节
- style_name:支持官方提供的10种风格
- (No style)
- Cinematic
- Disney Charactor
- Digital Art
- Photographic (Default)
- Fantasy art
- Neonpunk
- Enhance
- Comic book
- Lowpoly
- Line art- PhotoMaker 生成 | 📷PhotoMaker Generation 🆕
- pipe:接入模型
- pil_image:接入预处理图像
- positivet、negative:正负提示词
- batch_size:生成数量
- style_strength_ratio:风格混合强度(高于30按30计算)
- step:步数,官方默认50步,但毕竟是基于SDXL模型,我实测下来30步足够了
- guidance_scale:提示词相关度,一般默认为5
- width、height:尺寸设置(需1024维度)
- seed:种子## 风格 | Styles

## 安装 | Install
- 手动安装:
1. `cd custom_nodes`
2. `git clone https://github.com/ZHO-ZHO-ZHO/ComfyUI-PhotoMaker.git`
3. `cd custom_nodes/ComfyUI-PhotoMaker`
4. `pip install -r requirements.txt`
5. 重启 ComfyUI## 工作流 | Workflows
- [V2.5 Disney-Character_PhotoMaker + DragNUWA](https://github.com/ZHO-ZHO-ZHO/ComfyUI-PhotoMaker/blob/main/PhotoMaker%20Workflows/Disney-Character_PhotoMaker%2BDragNUW%E3%80%90Zho%E3%80%91.json) 🆕
https://github.com/ZHO-ZHO-ZHO/ComfyUI-PhotoMaker/assets/140084057/ca2bfff4-701c-4960-ac11-b893f90c044c
- [V2.5 lora + batch](https://github.com/ZHO-ZHO-ZHO/ComfyUI-PhotoMaker/blob/main/PhotoMaker%20Workflows/PhotoMaker_lora_batch%E3%80%90Zho%E3%80%91.json) 🆕

- [V2.5 portraitmaster + styler + lora](https://github.com/ZHO-ZHO-ZHO/ComfyUI-PhotoMaker/blob/main/PhotoMaker%20Workflows/PhotoMaker_lora_portrait_styler%E3%80%90Zho%E3%80%91.json) 🆕

- [V2.5 本地模型 locally](https://github.com/ZHO-ZHO-ZHO/ComfyUI-PhotoMaker/blob/main/PhotoMaker%20Workflows/V2.5%20PhotoMaker_locally%E3%80%90Zho%E3%80%91.json)
- [V2.5 自动下载 huggingface hub](https://github.com/ZHO-ZHO-ZHO/ComfyUI-PhotoMaker/blob/main/PhotoMaker%20Workflows/V2.5%20PhotoMaker_fromhub%E3%80%90Zho%E3%80%91.json)
(注:特意补充了 V2.5 的基础工作流,V2.0 工作流已弃用)
## 更新日志
- 20240122
新增 Disney-Character: PhotoMaker + DragNUWA 工作流,可配合 DragNUWA 融合多个人物特征生成迪士尼风格大片!
- 20240121
修复 bfloat16 bug
- 20240120
补充两个基础工作流
- 20240119
更新为 V2.5:支持lora、支持自定义生成数量、支持通用提示词输入(文本)如:styler、portraitmater等
新增 lora + batch、portraitmaster + styler + lora 两个工作流
- 20240119
更新为 V2.1:参考图改为直接输入/路径输入两种新模式,其中直接输入支持多图

- 20240118
更新为 V2.0:节点拆分 + 支持本地模型 + 支持自定义尺寸 +提速3倍
新增本地、hub加载工作流
- 20240117
新增单张图输入,并给出对比图
修复bug,初版上线
- 20240116
创建项目
## 速度实测 | Speed
- V2.0 提速 3 倍
- A100 50步 7s

- V1.5
- A100 50步 23s

- v100 50步 90s

## Stars
[](https://star-history.com/#ZHO-ZHO-ZHO/ComfyUI-PhotoMaker&Date)
## 关于我 | About me
📬 **联系我**:
- 邮箱:[email protected]
- QQ 群:839821928🔗 **社交媒体**:
- 个人页:[-Zho-](https://jike.city/zho)
- Bilibili:[我的B站主页](https://space.bilibili.com/484366804)
- X(Twitter):[我的Twitter](https://twitter.com/ZHOZHO672070)
- 小红书:[我的小红书主页](https://www.xiaohongshu.com/user/profile/63f11530000000001001e0c8?xhsshare=CopyLink&appuid=63f11530000000001001e0c8&apptime=1690528872)💡 **支持我**:
- B站:[B站充电](https://space.bilibili.com/484366804)
- 爱发电:[为我充电](https://afdian.net/a/ZHOZHO)## Credits
感谢[@erLin](https://twitter.com/eviljer)对ComfyUI 的图像张量 Shape (N, H, W, C)的提醒,帮助我成功修复了bug!
[PhotoMaker](https://github.com/TencentARC/PhotoMaker)