Converted from https://huggingface.co/PixArt-alpha/PixArt-Sigma to Diffusers format using https://github.com/huggingface/diffusers/blob/main/scripts/convert_pixart_alpha_to_diffusers.py
from diffusers import AutoencoderKL, PixArtAlphaPipeline, Transformer2DModel
import torch
dtype = torch.bfloat16
device = "cuda"
vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", torch_dtype=dtype, force_upcast=False, use_safetensors=True).to(device)
transformer = Transformer2DModel.from_pretrained("niklasku/PixArt-Sigma-XL-2-512-MS", torch_dtype=dtype, use_safetensors=True).to(device)
pipe = PixArtAlphaPipeline.from_pretrained("PixArt-alpha/pixart_sigma_sdxlvae_T5_diffusers", torch_dtype=dtype, use_safetensors=True, transformer=transformer, vae=vae).to(device)
torch.manual_seed(42)
image = pipe(prompt="photo of a blue glass sphere on top of a red wooden box on a granite table in a cozy room").images[0]
image.save("output.png")
image.show()
- Downloads last month
- 3