ORTStableDiffusionXLPipeline generated images have a problem

#112
by williamlzw - opened

The resulting image is almost invalid.But with the pytorch model you can generate high quality images.
optimum 1.13.2 , transformers 4.34.1, onnxruntime 1.16.1, diffusers 0.19.0

import os
from optimum.onnxruntime import ORTStableDiffusionXLPipeline

model_dir = os.getenv("SDXL_MODEL_DIR")
model_key_base = os.path.join(model_dir, "stable-diffusion-xl-base-1.0")

pipeline = ORTStableDiffusionXLPipeline.from_pretrained(model_key_base)
#pipeline = ORTStableDiffusionXLPipeline.from_pretrained(model_key_base, provider="CUDAExecutionProvider")
prompt = ["realistic style bird. colorful, lifelike, nature"]
#negative = ["noisy, blurry, deformed, ugly, sloppy, messy"]
steps = 10
guidance_scale = 9
images = pipeline(prompt=prompt, #negative_prompt=negative,
guidance_scale=guidance_scale, num_inference_steps=steps).images

for (i, image) in enumerate(images):
image.save(f'./result_onnx/{i}.jpg')

Sign up or log in to comment