diffusers scheduler add_noise前向加噪可视化

参考:
http://www.bryh.cn/a/604194.html

1、diffusers Pipeline使用

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')

diffusers scheduler add_noise前向加噪可视化_第1张图片

你可能感兴趣的:(深度学习,多模态,aigc,AI作画,stable,diffusion)