Skip to content

Add CoreML conversion helpers #10

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

Merged
merged 4 commits into from
Jul 23, 2024
Merged

Add CoreML conversion helpers #10

merged 4 commits into from
Jul 23, 2024

Conversation

ZachNagengast
Copy link
Collaborator

This PR supports converting models directly using a new helper function, eg:

from diffusionkit.tests.torch2coreml import (
    convert_mmdit_to_mlpackage,
    convert_vae_to_mlpackage
)

converted_mmdit_path = convert_mmdit_to_mlpackage(
    model_version="stabilityai/stable-diffusion-3-medium", 
    latent_h=64, 
    latent_w=64, 
    output_dir=<your_output_dir>
)

There are a number of folder restructurings as well to support this.

The package is deployed here: https://pypi.org/project/diffusionkit/0.2.15/

@ZachNagengast ZachNagengast force-pushed the coreml-converter-helpers branch from 4928b68 to 1fd4942 Compare July 19, 2024 19:15
@arda-argmax
Copy link
Collaborator

Looks good to me! I think we only need to update the Converting Models from PyTorch to Core ML of README.md.

Copy link
Collaborator

@arda-argmax arda-argmax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@arda-argmax arda-argmax merged commit ad8b50c into main Jul 23, 2024
1 check passed
@arda-argmax arda-argmax deleted the coreml-converter-helpers branch July 23, 2024 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants