you can use the optimum-cli export command: 


	Copied
optimum-cli export onnx --model runwayml/stable-diffusion-v1-5 sd_v15_onnx/
Then perform inference:


	Copied
from optimum.onnxruntime import ORTStableDiffusionPipeline

model_id = "sd_v15_onnx"
pipe = ORTStableDiffusionPipeline.from_pretrained(model_id)
prompt = "a photo of an astronaut riding a horse on mars"
images = pipe(prompt).images[0]
Notice that we didn’t have to specify export=Tru