Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

用diffusers实现"Tencent-Hunyuan/HunyuanDiT-Diffusers"模型,只能简单prompt,否则会出图错误 #84

Open
pljj315 opened this issue Jun 13, 2024 · 3 comments

Comments

@pljj315
Copy link

pljj315 commented Jun 13, 2024

简单prompt "a girl"能正常出图,
换成下面图片中的较长一点的prompt就有问题?
代码见下图
image
img_v3_02bq_ab0109ee-718f-414f-bb31-09f58bcd429g
image

@gnobitab
Copy link

Running this code I got two correct images,

from diffusers import HunyuanDiTPipeline
import torch
pipe = HunyuanDiTPipeline.from_pretrained("Tencent-Hunyuan/HunyuanDiT-Diffusers", torch_dtype=torch.float16)
pipe.to('cuda')
pipe.enable_model_cpu_offload()

### NOTE: HunyuanDiT supports both Chinese and English inputs
prompt = ["A male artist standing in front of an easel", "A male artist standing in front of an easel, holding a paintbrush"]
generator=torch.Generator(device="cuda").manual_seed(0)
images = pipe(height=1024, width=1024, prompt=prompt, generator=generator, num_inference_steps=25, guidance_scale=5.0).images

for i in range(2):
    images[i].save("figs/img_%d.png"%i)
image image

could you try this code snippet with different random seeds?

@pljj315
Copy link
Author

pljj315 commented Jun 18, 2024

Running this code I got two correct images,

from diffusers import HunyuanDiTPipeline
import torch
pipe = HunyuanDiTPipeline.from_pretrained("Tencent-Hunyuan/HunyuanDiT-Diffusers", torch_dtype=torch.float16)
pipe.to('cuda')
pipe.enable_model_cpu_offload()

### NOTE: HunyuanDiT supports both Chinese and English inputs
prompt = ["A male artist standing in front of an easel", "A male artist standing in front of an easel, holding a paintbrush"]
generator=torch.Generator(device="cuda").manual_seed(0)
images = pipe(height=1024, width=1024, prompt=prompt, generator=generator, num_inference_steps=25, guidance_scale=5.0).images

for i in range(2):
    images[i].save("figs/img_%d.png"%i)

image image
could you try this code snippet with different random seeds?

换了seed,这个情况依然存在,没有得到改善

@gnobitab
Copy link

我的这段code你跑一下看看work吗?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants