Closed nbardy closed 1 month ago
Found a few more issues trying to workaround.
Had to add a few patches to diffusers and now getting an image but it's not converging
Here is my current script:
import torch
from diffusers import Transformer2DModel, PixArtSigmaPipeline
from transformers import T5EncoderModel
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
weight_dtype = torch.float16
encoder = T5EncoderModel.from_pretrained(
"PixArt-alpha/pixart_sigma_sdxlvae_T5_diffusers",
subfolder="text_encoder",
torch_dtype=weight_dtype,
use_safetensors=True,
)
transformer = Transformer2DModel.from_pretrained(
"PixArt-alpha/PixArt-Sigma-XL-2-1024-MS",
subfolder="transformer",
torch_dtype=weight_dtype,
use_safetensors=True,
)
pipe = PixArtSigmaPipeline.from_pretrained(
"PixArt-alpha/pixart_sigma_sdxlvae_T5_diffusers",
transformer=transformer,
text_encoder=encoder,
torch_dtype=weight_dtype,
use_safetensors=True,
)
pipe.to(device)
# Enable memory optimizations.
# pipe.enable_model_cpu_offload()
prompt = "A small cactus with a happy face in the Sahara desert."
with torch.cuda.amp.autocast(): # Enable mixed precision to optimize performance
image = pipe(prompt).images[0]
image.save("./cactus.png")
Remove this line:
with torch.cuda.amp.autocast(): # Enable mixed precision to optimize performance
Trying to run inference and getting an issue with loading the model via diffusers:
From current main diffusers:
Version: