-
Notifications
You must be signed in to change notification settings - Fork 947
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Xl python inference #261
Xl python inference #261
Conversation
Thanks @lopez-hector! I ran a quick test and received the following error:
|
Interesting, I don't get this issue when using the converted packages from https://huggingface.co/apple/coreml-stable-diffusion-xl-base/tree/main/packages. I just redownloaded them and tested. Using these packages from hugging face the expected inputs for the UNET are:
Im not sure how those were converted before being uploaded to HF. What are the expected inputs for your converted packages? |
I see! I am currently testing models exported from #227 and the different input shapes are handled on the Swift code path but not on the Python code path. cc: @ZachNagengast |
@lopez-hector Do you mind adding a similar support for accepting both input shapes on the Python code path? |
@lopez-hector There is one more thing I was thinking about improving about the Python inference code path which is to switch to coremltools.models.CompiledMLModel from |
Will add support for input shapes soon. Happy to include the change for CompileMLModel here. I was hoping there was a way to speed that up! |
@lopez-hector Thanks! |
Note that the |
Added support for (12,) and (2, 6) shape. Just tested it using #227 conversion script. It was able to handle (2,6) time_ids shape. |
Hi @atiorh, I added support for the CompiledMLModel. On my M2 Max MacBook, it reduces loading time by half for the text encoders and VAE. About 3/4 reduction for the UNET. UNET takes about 15s to load from compiled sources.
|
Excellent, thanks @lopez-hector! |
expected_inputs
_get_add_time_ids()
Retains backwards compatibility.
"A high quality photo of a surfing dog"
num_inference_steps = 25
seed = 93
guidance_scale = 10
Thank you for your interest in contributing to Core ML Stable Diffusion! Please review CONTRIBUTING.md first. If you would like to proceed with making a pull request, please indicate your agreement to the terms outlined in CONTRIBUTING.md by checking the box below. If not, please go ahead and fork this repo and make your updates.
We appreciate your interest in the project!
Do not erase the below when submitting your pull request:
#########