YiYiXu HF Staff commited on
Commit
535faf5
·
verified ·
1 Parent(s): 230e90c

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +30 -0
README.md ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ```py
2
+ from diffusers import HunyuanImageRefinerPipeline
3
+ import torch
4
+ from diffusers.utils import load_image
5
+
6
+ device = "cuda:1"
7
+ dtype = torch.bfloat16
8
+
9
+
10
+ repo = "YiYiXu/HunyuanImage-2.1-Refiner-Diffusers"
11
+
12
+ pipe = HunyuanImageRefinerPipeline.from_pretrained(repo, torch_dtype=dtype)
13
+ pipe = pipe.to(device)
14
+
15
+ prompt = "A cute, cartoon-style anthropomorphic penguin plush toy with fluffy fur, standing in a painting studio, wearing a red knitted scarf and a red beret with the word “Tencent” on it, holding a paintbrush with a focused expression as it paints an oil painting of the Mona Lisa, rendered in a photorealistic photographic style."
16
+ image = load_image("/raid/yiyi/HunyuanImage-2.1/generated_image.png")
17
+
18
+ generator = torch.Generator(device=device).manual_seed(649151)
19
+ out = pipe(
20
+ prompt,
21
+ image=image,
22
+ num_inference_steps=4,
23
+ guidance_scale =3.5,
24
+ height=2048,
25
+ width=2048,
26
+ generator=generator,
27
+ ).images[0]
28
+
29
+ out.save("test_hyimage_refiner_output.png")
30
+ ```