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

add stable_diffusion_waifu module #2077

Merged

Conversation

rainyfly
Copy link
Contributor

  1. 加入stable_diffusion_waifu模块,使用hakurei的waifu-diffusion预训练参数,用于生成二次元的卡通形象。

应用效果展示

  • 输入文本 "Goku"

  • 输出图像


  • 生成过程


for i, tokens in enumerate(all_tokens):
if len(tokens) > context_length:
raise RuntimeError(f"Input {texts[i]} is too long for context length {context_length}")
result[i, :len(tokens)] = paddle.Tensor(np.array(tokens))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
result[i, :len(tokens)] = paddle.Tensor(np.array(tokens))
result[i, :len(tokens)] = paddle.to_tensor(np.array(tokens), dtype='int64')

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@rainyfly rainyfly merged commit 5dd04d1 into PaddlePaddle:develop Oct 17, 2022
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

Successfully merging this pull request may close these issues.

2 participants