Update README.md
Browse files
README.md
CHANGED
|
@@ -4,7 +4,7 @@ import torch
|
|
| 4 |
|
| 5 |
device = "cuda:0"
|
| 6 |
dtype = torch.bfloat16
|
| 7 |
-
repo = "
|
| 8 |
|
| 9 |
pipe = HunyuanImagePipeline.from_pretrained(repo, torch_dtype=dtype)
|
| 10 |
pipe = pipe.to(device)
|
|
@@ -15,12 +15,28 @@ generator = torch.Generator(device=device).manual_seed(649151)
|
|
| 15 |
out = pipe(
|
| 16 |
prompt,
|
| 17 |
num_inference_steps=50,
|
| 18 |
-
true_cfg_scale =3.5,
|
| 19 |
-
negative_prompt = "",
|
| 20 |
height=2048,
|
| 21 |
width=2048,
|
| 22 |
generator=generator,
|
| 23 |
).images[0]
|
| 24 |
|
| 25 |
out.save("test_hyimage_output.png")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
```
|
|
|
|
| 4 |
|
| 5 |
device = "cuda:0"
|
| 6 |
dtype = torch.bfloat16
|
| 7 |
+
repo = "hunyuanvideo-community/HunyuanImage-2.1-Diffusers"
|
| 8 |
|
| 9 |
pipe = HunyuanImagePipeline.from_pretrained(repo, torch_dtype=dtype)
|
| 10 |
pipe = pipe.to(device)
|
|
|
|
| 15 |
out = pipe(
|
| 16 |
prompt,
|
| 17 |
num_inference_steps=50,
|
|
|
|
|
|
|
| 18 |
height=2048,
|
| 19 |
width=2048,
|
| 20 |
generator=generator,
|
| 21 |
).images[0]
|
| 22 |
|
| 23 |
out.save("test_hyimage_output.png")
|
| 24 |
+
```
|
| 25 |
+
|
| 26 |
+
to use a different `guidance_scale`
|
| 27 |
+
|
| 28 |
+
```py
|
| 29 |
+
pipe.guider = pipe.guider.new(guidance_scale=5.0)
|
| 30 |
+
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."
|
| 31 |
+
|
| 32 |
+
generator = torch.Generator(device=device).manual_seed(649151)
|
| 33 |
+
out = pipe(
|
| 34 |
+
prompt,
|
| 35 |
+
num_inference_steps=50,
|
| 36 |
+
height=2048,
|
| 37 |
+
width=2048,
|
| 38 |
+
generator=generator,
|
| 39 |
+
).images[0]
|
| 40 |
+
|
| 41 |
+
out.save("test_hyimage_output_guidnce_scale_5.0.png")
|
| 42 |
```
|