使用飞桨快速部署stable diffusion模型

这可以说是最快的部署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

相关推荐
problc2 分钟前
肉包 Roubao:首款无需电脑的开源 AI 手机自动化助手
人工智能·智能手机·开源
胡伯来了2 分钟前
11 Transformers - 使用Pipeline处理音频
人工智能·transformer·transformers·音频处理·大数据模型
泡泡茶壶_ovo4 分钟前
Zero-Shot Image Captioning with Multi-type Entity Representations(AAAI 2025)
人工智能·深度学习·计算机视觉·imagecaptioning·multimodal
tap.AI4 分钟前
RAG系列(五)生产部署、成本优化与系统评估
人工智能
沃彼特6 分钟前
不用任何软件,检测闪存(SD卡U盘)的真实容量检测非常简单的测试方式,没有之一,不会用电脑都会用这个。
人工智能·目标检测·数据挖掘
Baihai_IDP8 分钟前
LLM 扩展方式的三年演进之路:复杂之后,回归简单
人工智能·面试·llm
QYR_118 分钟前
CAGR2.9%,全球石英波片市场稳步扩张,中国市场增速领跑
大数据·网络·人工智能
2501_9400078611 分钟前
论文检测网站全解析:类型、功能与选择指南
人工智能
CoderIsArt12 分钟前
Lepton AI 平台完整解析:架构、原理、场景与演示
人工智能·lepton ai
大模型真好玩13 分钟前
LangGraph1.0速通指南(三)—— LangGraph1.0 自动邮件处理智能体实战
人工智能·langchain·agent