XCLiu commited on
Commit
1178436
1 Parent(s): 3a21074

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +28 -5
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-Canny", 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-Canny/resolve/main/canny.jpg?download=true')
17
+
18
+ ## You may also use English prompt as HunyuanDiT supports both English and Chinese
19
+ prompt="在夜晚的酒店门前,一座古老的中国风格的狮子雕像矗立着,它的眼睛闪烁着光芒,仿佛在守护着这座建筑。背景是夜晚的酒店前,构图方式是特写,平视,居中构图。这张照片呈现了真实摄影风格,蕴含了中国雕塑文化,同时展现了神秘氛围"
20
+ #prompt="At night, an ancient Chinese-style lion statue stands in front of the hotel, its eyes gleaming as if guarding the building. The background is the hotel entrance at night, with a close-up, eye-level, and centered composition. This photo presents a realistic photographic style, embodies Chinese sculpture culture, and reveals a mysterious atmosphere."
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
+ ```