0
点赞
收藏
分享

微信扫一扫

云计算知识点-03

这可以说是最快的部署stable diffusion模型的方法了,而且星河社区还有免费的GPU算力提供,这样再也不用担心没有算力了!

操作方法:

# 安装相关库
pip install docarray==0.21.0
pip install paddlehub

# 初始化
from PIL import Image
import paddlehub as hub
module = hub.Module(name='stable_diffusion')

# 开始画图,先画个灯塔
result = module.generate_image(text_prompts="A beautiful painting of a singular lighthouse, shining its light across a tumultuous sea of blood by greg rutkowski and thomas kinkade, Trending on artstation.", output_dir='stable_diffusion_out')

# 用中文试试,发现效果不好,还是改成了英文
result = module.generate_image(text_prompts="Blood elf mage of world of warcraft, using fireball spell", output_dir='stable_diffusion_out')

可以看到画的图还是不错的

 

在V100下22秒输出一张图。

注意,模型限制77个字符的输入,超出会报错:is too long for context length 77

举报

相关推荐

0 条评论