Update README.md
Browse files
README.md
CHANGED
|
@@ -8,13 +8,13 @@ license_link: https://huggingface.co/Tencent-Hunyuan/HunyuanDiT/blob/main/LICENS
|
|
| 8 |
from diffusers import HunyuanDiT2DControlNetModel, HunyuanDiTControlNetPipeline
|
| 9 |
import torch
|
| 10 |
|
| 11 |
-
controlnet = HunyuanDiT2DControlNetModel.from_pretrained("Tencent-Hunyuan/HunyuanDiT-v1.2-ControlNet-Diffusers-
|
| 12 |
|
| 13 |
pipe = HunyuanDiTControlNetPipeline.from_pretrained("Tencent-Hunyuan/HunyuanDiT-v1.2-Diffusers-Distilled", controlnet=controlnet, torch_dtype=torch.float16)
|
| 14 |
pipe.to("cuda")
|
| 15 |
|
| 16 |
from diffusers.utils import load_image
|
| 17 |
-
cond_image = load_image('https://huggingface.co/Tencent-Hunyuan/HunyuanDiT-v1.2-ControlNet-Diffusers-
|
| 18 |
|
| 19 |
## You may also use English prompt as HunyuanDiT supports both English and Chinese
|
| 20 |
prompt="在茂密的森林中,一只黑白相间的熊猫静静地坐在绿树红花中,周围是山川和海洋。背景是白天的森林,光线充足。照片采用特写、平视和居中构图的方式,呈现出写实的效果"
|
|
@@ -30,4 +30,6 @@ image = pipe(
|
|
| 30 |
control_image=cond_image,
|
| 31 |
num_inference_steps=50,
|
| 32 |
).images[0]
|
|
|
|
|
|
|
| 33 |
```
|
|
|
|
| 8 |
from diffusers import HunyuanDiT2DControlNetModel, HunyuanDiTControlNetPipeline
|
| 9 |
import torch
|
| 10 |
|
| 11 |
+
controlnet = HunyuanDiT2DControlNetModel.from_pretrained("Tencent-Hunyuan/HunyuanDiT-v1.2-ControlNet-Diffusers-Depth", torch_dtype=torch.float16)
|
| 12 |
|
| 13 |
pipe = HunyuanDiTControlNetPipeline.from_pretrained("Tencent-Hunyuan/HunyuanDiT-v1.2-Diffusers-Distilled", controlnet=controlnet, torch_dtype=torch.float16)
|
| 14 |
pipe.to("cuda")
|
| 15 |
|
| 16 |
from diffusers.utils import load_image
|
| 17 |
+
cond_image = load_image('https://huggingface.co/Tencent-Hunyuan/HunyuanDiT-v1.2-ControlNet-Diffusers-Depth/resolve/main/depth.jpg?download=true')
|
| 18 |
|
| 19 |
## You may also use English prompt as HunyuanDiT supports both English and Chinese
|
| 20 |
prompt="在茂密的森林中,一只黑白相间的熊猫静静地坐在绿树红花中,周围是山川和海洋。背景是白天的森林,光线充足。照片采用特写、平视和居中构图的方式,呈现出写实的效果"
|
|
|
|
| 30 |
control_image=cond_image,
|
| 31 |
num_inference_steps=50,
|
| 32 |
).images[0]
|
| 33 |
+
|
| 34 |
+
image.save('./image.png')
|
| 35 |
```
|