Update README.md
Browse files
README.md
CHANGED
@@ -1,5 +1,28 @@
|
|
1 |
-
---
|
2 |
-
license: other
|
3 |
-
license_name: tencent-hunyuan-community
|
4 |
-
license_link: https://huggingface.co/Tencent-Hunyuan/HunyuanDiT/blob/main/LICENSE.txt
|
5 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: other
|
3 |
+
license_name: tencent-hunyuan-community
|
4 |
+
license_link: https://huggingface.co/Tencent-Hunyuan/HunyuanDiT/blob/main/LICENSE.txt
|
5 |
+
---
|
6 |
+
|
7 |
+
```py
|
8 |
+
from diffusers import HunyuanDiT2DControlNetModel, HunyuanDiTControlNetPipeline
|
9 |
+
import torch
|
10 |
+
controlnet = HunyuanDiT2DControlNetModel.from_pretrained("Tencent-Hunyuan/HunyuanDiT-v1.1-ControlNet-Diffusers-Pose", torch_dtype=torch.float16)
|
11 |
+
|
12 |
+
pipe = HunyuanDiTControlNetPipeline.from_pretrained("Tencent-Hunyuan/HunyuanDiT-v1.1-Diffusers", controlnet=controlnet, torch_dtype=torch.float16)
|
13 |
+
pipe.to("cuda")
|
14 |
+
|
15 |
+
from diffusers.utils import load_image
|
16 |
+
cond_image = load_image('https://huggingface.co/Tencent-Hunyuan/HunyuanDiT-v1.1-ControlNet-Diffusers-Pose/resolve/main/pose.jpg?download=true')
|
17 |
+
|
18 |
+
## You may also use English prompt as HunyuanDiT supports both English and Chinese
|
19 |
+
prompt="一位亚洲女性,身穿绿色上衣,戴着紫色头巾和紫色围巾,站在黑板前。背景是黑板。照片采用近景、平视和居中构图的方式呈现真实摄影风格"
|
20 |
+
#prompt="An Asian woman, dressed in a green top, wearing a purple headscarf and a purple scarf, stands in front of a blackboard. The background is the blackboard. The photo is presented in a close-up, eye-level, and centered composition, adopting a realistic photographic style"
|
21 |
+
image = pipe(
|
22 |
+
prompt,
|
23 |
+
height=1024,
|
24 |
+
width=1024,
|
25 |
+
control_image=cond_image,
|
26 |
+
num_inference_steps=50,
|
27 |
+
).images[0]
|
28 |
+
```
|