-
Notifications
You must be signed in to change notification settings - Fork 966
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
[Swift CLI] Optional image width and height? #64
Comments
I tried to convert the models with
Maybe this is not the right approach? |
The current python code to convert the UNET does not reference or use the I've found other issues when trying to add flexible input shapes to the models, but I will have to make a separate issues for that... |
yes! manage to do with SPLIT_EINSUM and cpuAndGPU Looking for a way to use dynamic size + Swift |
@littleowl I was curious about supporting generating images with custom width and height as well. What other issues have you noticed when trying to add flexible input shapes to the models? If it wasn't too difficult to do I wanted to add those options to the frontend I was working on here. |
@godly-devotion I created two other related issues to this. Cannot create CoreML model with Flexible input shapes. and SPLIT_EINSUM - Kernel Panic when testing UNET created with height 96 and width 64 and SPLIT_EINSUM I get errors when implementing the coremltools flexible input shapes. Possibly the next step would be to create an issue with coremltools or ask for help on the developer forums. When using maple-diffusion, I was easily able to modify the width and height at model initialization time after some simple modifications to the code. I am not sure if it is possible to create the model with one aspect ratio and then change the aspect ratio without re-initializing the model. That is obviously the desire though. Or this might be a difference between the old type of CoreML Neural Network and the MLProgram or what not. From my reading, the old type is a bit more dynamic. However, I think we need to use the new type for the ANE. The weights from two generated models with different aspect ratio are exactly the same. So it would be a waste to distribute to users with just different aspect ratios. Maybe fine if you are using for personal use. My GUESS is that the architecture part of model is what is different. Theoretically, I could see that it MIGHT be possible to switch out the architectures and compile the |
@littleowl Gotcha. Looks like we need more info on the new ANE compatible models. I was able to modify and build 64w-96h (after some crazy swap action on my 32GB M1 Pro) but was having trouble figuring out how to pass the width and height to the CLI/library. What did you need to modify in order to pass the latent values? |
Hello~~Could you share maple-diffusion code that you have modified the width and height? |
Figured out how to do it, I've updated the wiki here. Here is the patch for modifying the
|
Will there be support for optional image width and height?
The text was updated successfully, but these errors were encountered: