目录
安装:
pip install diffusers
模型下载地址:
深入浅出完整解析Stable Diffusion(SD)核心基础知识 - 知乎
from diffusers import StableDiffusionPipeline
import torch
model_id = "./stable-diffusion-v1-5"
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
pipe = pipe.to("cuda")
prompt = "a