Add vae_roundtrip.py example
What does this PR do?
Adds examples/inference/vae_roundtrip.py to demonstrate VAE inference without any other models or pipelines.
Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [x] Did you read the contributor guideline?
- [x] Did you read our philosophy doc (important for complex PRs)?
- [ ] Was this discussed/approved via a GitHub issue or the forum? Please add a link to it if that's the case.
- [ ] Did you make sure to update the documentation with your changes? Here are the documentation guidelines, and here are tips on formatting docstrings.
- [ ] Did you write any new necessary tests?
This just introduces a new demo example file. No need to update documents or update tests.
why do we need this?
cc @sayakpaul
You dont need it. If you think this is not a worthwhile example script, we can just close the ticket. I just submitted this because it took me a while to figure out how to use the VAE due to its non-tensor return values. And I already wrote the script in the first place to evaluate how good/bad the standard SD VAEs are with heavily aliased images.
I just submitted this because it took me a while to figure out how to use the VAE due to its non-tensor return values.
You can mitigate that by specifying return_dict=False in your VAE call.
I am okay accommodating this script under the research_projects folder, if you're down.
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.
I am okay accommodating this script under the
research_projectsfolder, if you're down.
Sure why not. Alternatively there is also examples/community if that is better than placing under examples/research_projects/vae
examples/community are for pipelines that can be loaded with the "custom_pipeline" argument. So, I think research_projects is a better location.
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.
Please note that issues that do not follow the contributing guidelines are likely to be ignored.
Will merge after the CI is green. Sorry for the delay.
We need to make sure the code quality test passes.
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.
Please note that issues that do not follow the contributing guidelines are likely to be ignored.
@asomoza WDYT about this example?
I like the idea but maybe focus it to a more practical use case?
This is used a lot to store the embeddings of the images, so probably a encode and save and a decode functionality would help the community more.
But I also think it's fine as an example if people struggle on how to do this, since we now have the community scripts, maybe this can be simplified and put there?
But I also think it's fine as an example if people struggle on how to do this, since we now have the community scripts, maybe this can be simplified and put there?
Yes exactly. I wouldn't mind having it under research_projects really.
@thomaseding, apologies for the delay on our side. Could you maybe fix the styling problems so that we can merge this?
I can't figure out why the style linter is complaining about unsorted imports.
Anyway I fixed a scaling bug and also added TAESD support.
You can either search for the solutions and use them for the codes provided there "F403", for example. Or you can do "no qa" like done here:
https://github.com/huggingface/diffusers/blob/7bfc1ee1b2cb0961ff111f50a9d096816e4dd921/benchmarks/base_classes.py#L24
@asomoza could you give this a final review and merge?
Thanks a lot!