赞
踩
参考:
http://www.bryh.cn/a/604194.html
import torch
from diffusers import PixArtAlphaPipeline
pipe = PixArtAlphaPipeline.from_pretrained("PixArt-alpha/PixArt-XL-2-1024-MS", torch_dtype=torch.float16)
pipe = pipe.to('cuda')
prompt = "A alpaca made of colorful building blocks, cyberpunk"
image = pipe(prompt, num_inference_steps=30).images[0]
image
image.save("./catcus.png") ##保存图片
加载lcm的gpu使用:
pipe = PixArtAlphaPipeline.from_pretrained("PixArt-alpha/PixArt-LCM-XL-2-1024-MS", torch_dtype=torch.float16)
pipe = pipe.to('cuda')
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。