Skip to content
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

Variable Image size #11

Open
divamgupta opened this issue Oct 17, 2022 · 5 comments
Open

Variable Image size #11

divamgupta opened this issue Oct 17, 2022 · 5 comments

Comments

@divamgupta
Copy link

Right now the trivial way to generate images of different sizes is to recreate the Maple Diffusion object with the new size params. Is there any way which is more efficient?

@madebyollin
Copy link
Owner

Per Apple's WWDC session / docs it should be possible to support variable image sizes efficiently:

  1. Replace the height / width usage in UNet placeholders with -1 to indicate an unspecified dimension
  2. Set a flag to skip type inference during UNet graph compilation

I started the code to do this in a branch here: f590ea8. Currently it fails to compile the graph, though.

I think it's probably going to be possible-but-annoying to get variable shapes working - since it requires editing the graph code in order to make sure everything compiles (this may require adding some graph.shapeOf operators when reshaping an hw dim into separate h and w dims, for example, or just never creating any hw dims).

@Gitterman69
Copy link

Diffusion Bee integrated the approach in a perfect way!!!

@ShirasawaSama
Copy link

@madebyollin Hello, is there any new progress on this issue?

@divamgupta
Copy link
Author

divamgupta commented Feb 1, 2024

I actually implemented it with the help of @madebyollin . Code is a bit messy I can make it public or make a PR some day

@ShirasawaSama
Copy link

This is good news, and I can also help you organize the code if you need it.

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

No branches or pull requests

4 participants