Run sdxl-turbo using onnx model

#37
by armeno - opened

I have run stabilityai/sdxl-turbo using as reference this link: https://huggingface.co/docs/optimum/onnxruntime/usage_guides/models.

from optimum.onnxruntime import ORTStableDiffusionXLPipeline

model_id = "stabilityai/sdxl-turbo"
base = ORTStableDiffusionXLPipeline.from_pretrained(model_id)
prompt = "sailing ship in storm by Leonardo da Vinci"
image = base(prompt).images[0]
save_directory = "sd_xl_base"
base.save_pretrained(save_directory)

The run itself is successful but the output image is not the expected one described in the prompt (see attached)
Screenshot from 2024-04-09 13-22-54.png

Does anyone have ideas why it does not generate correct output?

I tried, and I got similar checker images.
Upon digging, this is my conclusion.
The pipeline you are using is SDXL, but not SDXL Turbo.
I think hugging face is yet to create SDXL Turbo pipeline.
Anyone can correct me if I am wrong.
If you use any model id that is related to only SDXL model, then pipeline will work and you can create proper images.

Hello Kartik,
Thank you for the response.
We found out that the issue is related to onnxruntime version.
When installing onnxruntime using 'pip install onnxruntime' on Windows it installs 1.17 version.
If you build onnxruntime1.18 from sources the above pipeline will work and generate proper images.

Regards,
Armen

armeno changed discussion status to closed

Sign up or log in to comment