How to convert an optimized onnx model

#147
by KotomiHacker - opened

I saw the onnx branch having a better onnx model than I converted. The biggest difference is that there are more reduntant nodes around softmax by self converting onnx model, which leads to much more memory usage. Check the details in the image below.
Here is my solution to convert onnx model.
script: https://github.com/huggingface/diffusers/blob/main/scripts/convert_stable_diffusion_checkpoint_to_onnx.py
env: torch1.13 + onnxruntime 1.14+ diffusers 0.15.1

Could you share how to convert the model shown in left side?
image.png

Sign up or log in to comment