Upload README_ZH.md
Browse files- README.md +2 -0
- README_ZH.md +172 -0
README.md
CHANGED
|
@@ -3,6 +3,8 @@
|
|
| 3 |
<img src="./images/images_alimama.png" alt="alimama" style="width: 20%; height: auto;">
|
| 4 |
</div>
|
| 5 |
|
|
|
|
|
|
|
| 6 |
EcomID aims to generate customized images from a single reference ID image, ensuring strong semantic consistency while being controlled by keypoints.
|
| 7 |
|
| 8 |
This repository provides the EcomID method and model, combining the strengths of [PuLID](https://github.com/ToTheBeginning/PuLID) and [InstantID](https://github.com/instantX-research/InstantID) for better background consistency, facial keypoint control, and realistic facial representation with improved similarity.
|
|
|
|
| 3 |
<img src="./images/images_alimama.png" alt="alimama" style="width: 20%; height: auto;">
|
| 4 |
</div>
|
| 5 |
|
| 6 |
+
[中文版Readme](./README_ZH.md)
|
| 7 |
+
|
| 8 |
EcomID aims to generate customized images from a single reference ID image, ensuring strong semantic consistency while being controlled by keypoints.
|
| 9 |
|
| 10 |
This repository provides the EcomID method and model, combining the strengths of [PuLID](https://github.com/ToTheBeginning/PuLID) and [InstantID](https://github.com/instantX-research/InstantID) for better background consistency, facial keypoint control, and realistic facial representation with improved similarity.
|
README_ZH.md
ADDED
|
@@ -0,0 +1,172 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<div style="display: flex; justify-content: center; align-items: center;">
|
| 2 |
+
<img src="./images/images_alibaba.png" alt="alibaba" style="width: 20%; height: auto; margin-right: 5%;">
|
| 3 |
+
<img src="./images/images_alimama.png" alt="alimama" style="width: 20%; height: auto;">
|
| 4 |
+
</div>
|
| 5 |
+
EcomID 旨在从单个ID参考图像生成定制的保ID图像,优势在于很强的语义一致性,同时受人脸关键点控制。
|
| 6 |
+
|
| 7 |
+
此仓库提供了 EcomID 方法和模型,方法上结合了 [PuLID](https://github.com/ToTheBeginning/PuLID) 和 [InstantID](https://github.com/instantX-research/InstantID) 的优点,以获得更好的背景一致性、面部关键点控制和更真实的面部以及更高的相似度。
|
| 8 |
+
|
| 9 |
+
# EcomID 概述
|
| 10 |
+
## EcomID 结构
|
| 11 |
+
<img src="./images/overflow.png" alt="alibaba" style="width: 100%; height: auto; margin-right: 5%;">
|
| 12 |
+
|
| 13 |
+
- **PuLID 的 IP-Adapter**:EcomID 借鉴了 PuLID 的 ID-Encoder 和交叉注意力组件,其使用对齐损失训练而成。
|
| 14 |
+
故而该方法有效减少了 ID embedding 对交叉注意力部分的文本 embedding的干扰,最小化对底层模型文本到图像能力的干扰。
|
| 15 |
+
|
| 16 |
+
- **InstantID 的 IdentityNet 架构**:利用 *200 万张美观的人像图像数据集*,训练了IdentityNet,增强了关键点控制,提高了 ID 一致性和面部真实感。在训练过程中,IP-adapter 被冻结,只有 IdentityNet 被训练。面部Keypoint用作条件输入,同时面部嵌入通过交叉注意力集成到 IdentityNet 中。
|
| 17 |
+
|
| 18 |
+
# 展示案例
|
| 19 |
+
## 与其他方法的比较
|
| 20 |
+
### 1、保留文本到图像能力
|
| 21 |
+
<table>
|
| 22 |
+
<tr>
|
| 23 |
+
<th style="width: 28%;">提示</th>
|
| 24 |
+
<th style="width: 24%;">参考图像</th>
|
| 25 |
+
<th style="width: 24%;">EcomID</th>
|
| 26 |
+
<th style="width: 24%;">InstantID</th>
|
| 27 |
+
</tr>
|
| 28 |
+
<tr>
|
| 29 |
+
<td style="font-size: 12px;">女孩,白皮肤,黑头发,长卷发,<span style="color:red"><strong>在欧洲风格的客厅,复古色调,装饰品</strong></span>,景深。</td>
|
| 30 |
+
<td><img src="images/show_case/50.png" alt="参考图像" width="100%"></td>
|
| 31 |
+
<td><img src="images/show_case/49.png" alt="EcomID图像" width="100%"></td>
|
| 32 |
+
<td><img src="images/show_case/48.png" alt="InstantID图像" width="100%"></td>
|
| 33 |
+
</tr>
|
| 34 |
+
<table>
|
| 35 |
+
|
| 36 |
+
如上所示,EcomID ***保留了背景生成能力,同时最大限度地减少了风格化,从而大大增强了真实感***。
|
| 37 |
+
如图可见,EcomID的背景语义一致性得到了改善,且在生成真实图像方面格外有优势。
|
| 38 |
+
|
| 39 |
+
### 2、改善面部控制和相似度
|
| 40 |
+
<table>
|
| 41 |
+
<tr>
|
| 42 |
+
<th style="width: 24%;">提示</th>
|
| 43 |
+
<th style="width: 19%;">参考图像</th>
|
| 44 |
+
<th style="width: 19%;">EcomID</th>
|
| 45 |
+
<th style="width: 19%;">InstantID</th>
|
| 46 |
+
<th style="width: 19%;">PuLID</th>
|
| 47 |
+
</tr>
|
| 48 |
+
<tr>
|
| 49 |
+
<td style="font-size: 12px;">在图书馆前站着的男人的特写肖像,<span style="color:red"><strong>抱着两个微笑的幼儿</strong></span>。</td>
|
| 50 |
+
<td><img src="images/show_case/20.png" alt="参考图像" width="100%"></td>
|
| 51 |
+
<td><img src="images/show_case/17.png" alt="EcomID图像" width="100%"></td>
|
| 52 |
+
<td><img src="images/show_case/18.png" alt="InstantID图像" width="100%"></td>
|
| 53 |
+
<td><img src="images/show_case/19.png" alt="PuLID图像" width="100%"></td>
|
| 54 |
+
</tr>
|
| 55 |
+
<table>
|
| 56 |
+
|
| 57 |
+
如上所示,EcomID 使用关键点作为训练的条件输入,***允许精确调整面部位置、大小和方向***。这种能力确保生成的人像更加可控,同时进一步增强了面部相似性和图像的整体质量。
|
| 58 |
+
|
| 59 |
+
### 更多案例
|
| 60 |
+
EcomID 提高了人像表现,提供了更真实和美观的外观,同时确保语义一致性和更好的内部 ID 相似性(即,不随年龄、发型、眼镜或其他身体变化而变化的特征)。
|
| 61 |
+
<table>
|
| 62 |
+
<tr>
|
| 63 |
+
<th style="width: 24%;">提示</th>
|
| 64 |
+
<th style="width: 19%;">参考图像</th>
|
| 65 |
+
<th style="width: 19%;">EcomID</th>
|
| 66 |
+
<th style="width: 19%;">InstantID</th>
|
| 67 |
+
<th style="width: 19%;">PuLID</th>
|
| 68 |
+
</tr>
|
| 69 |
+
<tr>
|
| 70 |
+
<td style="font-size: 12px;">一个<span style="color:red"><strong>双辫小女孩</strong></span>的特写肖像,穿着白色裙子,傍晚在海滩上。</td>
|
| 71 |
+
<td><img src="images/show_case/21.png" alt="参考图像" width="100%"></td>
|
| 72 |
+
<td><img src="images/show_case/22.png" alt="EcomID图像" width="100%"></td>
|
| 73 |
+
<td><img src="images/show_case/23.png" alt="InstantID图像" width="100%"></td>
|
| 74 |
+
<td><img src="images/show_case/24.png" alt="PuLID图像" width="100%"></td>
|
| 75 |
+
</tr>
|
| 76 |
+
<tr>
|
| 77 |
+
<td style="font-size: 12px;">一个<span style="color:red"><strong>非常小的女孩</strong></span>,双辫,带着<spann style="color:red"><strong>帽子</strong></span>和白色裙子,傍晚在海滩上。</td>
|
| 78 |
+
<td><img src="images/show_case/44.png" alt="参考图像" width="100%"></td>
|
| 79 |
+
<td><img src="images/show_case/47.png" alt="EcomID图像" width="100%"></td>
|
| 80 |
+
<td><img src="images/show_case/46.png" alt="InstantID图像" width="100%"></td>
|
| 81 |
+
<td><img src="images/show_case/45.png" alt="PuLID图像" width="100%"></td>
|
| 82 |
+
</tr>
|
| 83 |
+
<tr>
|
| 84 |
+
<td style="font-size: 12px;">一个满脸胡茬的侦探,<span style="color:red"><strong>戴着帽子</strong></span>,阴影投在他方形的下巴上,<span style="color:red"><strong>嘴里叼着一根香烟</strong></span>,他的风衣唤起了电影黑色风格,在一个<span style="color:red"><strong>阴雨小巷</strong></span>里。</td>
|
| 85 |
+
<td><img src="images/show_case/25.png" alt="参考图像" width="100%"></td>
|
| 86 |
+
<td><img src="images/show_case/26.png" alt="EcomID图像" width="100%"></td>
|
| 87 |
+
<td><img src="images/show_case/27.png" alt="InstantID图像" width="100%"></td>
|
| 88 |
+
<td><img src="images/show_case/28.png" alt="PuLID图像" width="100%"></td>
|
| 89 |
+
</tr>
|
| 90 |
+
<tr>
|
| 91 |
+
<td style="font-size: 12px;">一个微笑的女孩,<span style="color:red"><strong>齐刘海和长发</strong></span>,穿着校服,站在樱花树下,手里拿着一本书。</td>
|
| 92 |
+
<td><img src="images/show_case/29.png" alt="参考图像" width="100%"></td>
|
| 93 |
+
<td><img src="images/show_case/30.png" alt="EcomID图像" width="100%"></td>
|
| 94 |
+
<td><img src="images/show_case/31.png" alt="InstantID图像" width="100%"></td>
|
| 95 |
+
<td><img src="images/show_case/32.png" alt="PuLID图像" width="100%"></td>
|
| 96 |
+
</tr>
|
| 97 |
+
<tr>
|
| 98 |
+
<td style="font-size: 12px;">一个<spann style="color:red"><strong>非常老的</strong></span>女巫,穿着黑色斗篷,戴着尖顶帽,手握魔杖,在雾气缭绕的森林背景下。</td>
|
| 99 |
+
<td><img src="images/show_case/33.png" alt="参考图像" width="100%"></td>
|
| 100 |
+
<td><img src="images/show_case/34.png" alt="EcomID图像" width="100%"></td>
|
| 101 |
+
<td><img src="images/show_case/35.png" alt="InstantID图像" width="100%"></td>
|
| 102 |
+
<td><img src="images/show_case/36.png" alt="PuLID图像" width="100%"></td>
|
| 103 |
+
</tr>
|
| 104 |
+
<tr>
|
| 105 |
+
<td style="font-size: 12px;">一个身穿赛博朋克风格的男人:<span style="color:red"><strong>霓虹配件,反光太阳镜,</strong></span>和带有发光电路图案的皮夹克。他在湿润的城市风貌中冷静地站着。</td>
|
| 106 |
+
<td><img src="images/show_case/37.png" alt="参考图像" width="100%"></td>
|
| 107 |
+
<td><img src="images/show_case/38.png" alt="EcomID图像" width="100%"></td>
|
| 108 |
+
<td><img src="images/show_case/39.png" alt="InstantID图像" width="100%"></td>
|
| 109 |
+
<td><img src="images/show_case/40.png" alt="PuLID图像" width="100%"></td>
|
| 110 |
+
</tr>
|
| 111 |
+
</table>
|
| 112 |
+
|
| 113 |
+
### 更多基础模型、分辨率和风格
|
| 114 |
+
<table>
|
| 115 |
+
<tr>
|
| 116 |
+
<th style="width: 12%;">SDXL 模型</th>
|
| 117 |
+
<th style="width: 24%;">提示</th>
|
| 118 |
+
<th style="width: 16%;">参考图像</th>
|
| 119 |
+
<th style="width: 16%;">EcomID</th>
|
| 120 |
+
<th style="width: 16%;">InstantID</th>
|
| 121 |
+
<th style="width: 16%;">PuLID</th>
|
| 122 |
+
</tr>
|
| 123 |
+
<tr>
|
| 124 |
+
<td>sd-xl-base-1.0</td>
|
| 125 |
+
<td style="font-size: 12px;">女孩,单独,棕色头发,手里抱着一个小泰迪熊,穿着校服,站在图书馆里,<span style="color:red"><strong>卡通风格</strong></span>。</td>
|
| 126 |
+
<td><img src="images/show_case/1.png" alt="参考图像" width="100%"></td>
|
| 127 |
+
<td><img src="images/show_case/2.png" alt="EcomID图像" width="100%"></td>
|
| 128 |
+
<td><img src="images/show_case/3.png" alt="InstantID图像" width="100%"></td>
|
| 129 |
+
<td><img src="images/show_case/4.png" alt="PuLID图像" width="100%"></td>
|
| 130 |
+
</tr>
|
| 131 |
+
<tr>
|
| 132 |
+
<td>EcomXL</td>
|
| 133 |
+
<td style="font-size: 12px;">一个<span style="color:red"><strong>非常小的女孩</strong></span>的特写肖像,双辫,带着<spann style="color:red"><strong>帽子</strong></span>和白色裙子,傍晚在海滩上。</td>
|
| 134 |
+
<td style="font-size: 12px;"><img src="images/show_case/44.png" alt="参考图像" width="100%"></td>
|
| 135 |
+
<td><img src="images/show_case/47.png" alt="EcomID图像" width="100%"></td>
|
| 136 |
+
<td><img src="images/show_case/46.png" alt="InstantID图像" width="100%"></td>
|
| 137 |
+
<td><img src="images/show_case/45.png" alt="PuLID图像" width="100%"></td>
|
| 138 |
+
</tr>
|
| 139 |
+
<tr>
|
| 140 |
+
<td>DreamShaperXL</td>
|
| 141 |
+
<td style="font-size: 12px;">单独,面向观众,微笑,棕色头发,上半身,开衫,牙齿,打开的外套,黑色夹克,模糊背景,真实感</td>
|
| 142 |
+
<td><img src="images/show_case/44.png" alt="参考图像" width="100%"></td>
|
| 143 |
+
<td><img src="images/show_case/6.png" alt="EcomID图像" width="100%"></td>
|
| 144 |
+
<td><img src="images/show_case/7.png" alt="InstantID图像" width="100%"></td>
|
| 145 |
+
<td><img src="images/show_case/8.png" alt="PuLID图像" width="100%"></td>
|
| 146 |
+
</tr>
|
| 147 |
+
<tr>
|
| 148 |
+
<td>leosam_xl_v7</td>
|
| 149 |
+
<td style="font-size: 12px;">一个特写肖像,女孩,单独,裙子,珠宝,海滩和大海,粉色裙子,真实感。</td>
|
| 150 |
+
<td><img src="images/show_case/9.png" alt="参考图像" width="100%"></td>
|
| 151 |
+
<td><img src="images/show_case/15.png" alt="EcomID图像" width="100%"></td>
|
| 152 |
+
<td><img src="images/show_case/14.png" alt="InstantID图像" width="100%"></td>
|
| 153 |
+
<td><img src="images/show_case/16.png" alt="PuLID图像" width="100%"></td>
|
| 154 |
+
</tr>
|
| 155 |
+
</table>
|
| 156 |
+
|
| 157 |
+
### 注意事项
|
| 158 |
+
- 除非特别说明,大部分展示案例使用基础模型 EcomXL 生成,同时EcomID与各种其他基于 SDXL 的模型高度兼容,例如 [leosams-helloworld-xl](https://civitai.com/models/43977/leosams-helloworld-xl)、[dreamshaper-xl](https://civitai.com/models/112902/dreamshaper-xl)、[stable-diffusion-xl-base-1.0](https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0) 等。
|
| 159 |
+
- 它与 SDXL Turbo/Lighting、[EcomXL Inpainting ControlNet](https://huggingface.co/alimama-creative/EcomXL_controlnet_inpaint) 和 [EcomXL Softedge ControlNet](https://huggingface.co/alimama-creative/EcomXL_controlnet_softedge) 的兼容性非常好。
|
| 160 |
+
# 如何使用
|
| 161 |
+
## ComfyUI
|
| 162 |
+
- 已发布 EcomID_ComfyUI 节点:[点击这里](https://code.alibaba-inc.com/ruxue.wrx/EcomID_ComfyUI)
|
| 163 |
+
# 训练细节
|
| 164 |
+
该模型在 200 万张淘宝图像上进行训练,其中人脸比例大于 3%。图像分辨率大于800,且美学评分超过 5.5。
|
| 165 |
+
|
| 166 |
+
混合精度:fp16
|
| 167 |
+
|
| 168 |
+
学习率:1e-4
|
| 169 |
+
|
| 170 |
+
批量大小:2
|
| 171 |
+
|
| 172 |
+
图像大小:1024x1024
|