参考:
https://pytorch.org/blog/accelerating-generative-ai-3/
https://colab.research.google.com/drive/1jZ5UZXk7tcpTfVwnX33dDuefNMcnW9ME?usp=sharing#scrollTo=jueYhY5YMe22
大概GPU资源8G-16G;另外模型资源下载慢可以在国内镜像:https://aifasthub.com/
1、加速代码
能加速到2秒左右
from diffusers import StableDiffusionXLPipeline
import torch
pipe = StableDiffusionXLPipeline.from_pretrained(
"stabilityai/stable-diffusion-xl-base-1.0<