Update README.md
Browse files
README.md
CHANGED
@@ -1,5 +1,27 @@
|
|
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 |
+
```py
|
7 |
+
from diffusers import HunyuanDiT2DControlNetModel, HunyuanDiTControlNetPipeline
|
8 |
+
import torch
|
9 |
+
controlnet = HunyuanDiT2DControlNetModel.from_pretrained("Tencent-Hunyuan/HunyuanDiT-v1.1-ControlNet-Diffusers-Depth", torch_dtype=torch.float16)
|
10 |
+
|
11 |
+
pipe = HunyuanDiTControlNetPipeline.from_pretrained("Tencent-Hunyuan/HunyuanDiT-v1.1-Diffusers", controlnet=controlnet, torch_dtype=torch.float16)
|
12 |
+
pipe.to("cuda")
|
13 |
+
|
14 |
+
from diffusers.utils import load_image
|
15 |
+
cond_image = load_image('https://huggingface.co/Tencent-Hunyuan/HunyuanDiT-v1.1-ControlNet-Diffusers-Depth/resolve/main/depth.jpg?download=true')
|
16 |
+
|
17 |
+
## You may also use English prompt as HunyuanDiT supports both English and Chinese
|
18 |
+
prompt = "在茂密的森林中,一只黑白相间的熊猫静静地坐在绿树红花中,周围是山川和海洋。背景是白天的森林,光线充足"
|
19 |
+
# prompt = "In the dense forest, a black and white panda sits quietly in green trees and red flowers, surrounded by mountains, rivers, and the ocean. The background is the forest in a bright environment."
|
20 |
+
image = pipe(
|
21 |
+
prompt,
|
22 |
+
height=1024,
|
23 |
+
width=1024,
|
24 |
+
control_image=cond_image,
|
25 |
+
num_inference_steps=50,
|
26 |
+
).images[0]
|
27 |
+
```
|