Views
No views yet
1from diffusers import HunyuanImagePipeline
2import torch
3
4device = "cuda:0"
5dtype = torch.bfloat16
6repo = "hunyuanvideo-community/HunyuanImage-2.1-Diffusers"
7
8pipe = HunyuanImagePipeline.from_pretrained(repo, torch_dtype=dtype)
9pipe = pipe.to(device)
10
11prompt = "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."
12
13generator = torch.Generator(device=device).manual_seed(649151)
14out = pipe(
15 prompt,
16 num_inference_steps=50,
17 height=2048,
18 width=2048,
19 generator=generator,
20).images[0]
21
22out.save("test_hyimage_output.png")guidance_scale1pipe.guider = pipe.guider.new(guidance_scale=5.0)
2prompt = "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."
3
4generator = torch.Generator(device=device).manual_seed(649151)
5out = pipe(
6 prompt,
7 num_inference_steps=50,
8 height=2048,
9 width=2048,
10 generator=generator,
11).images[0]
12
13out.save("test_hyimage_output_guidnce_scale_5.0.png")