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

Add pad and cropping options to the Latent Diffusion Inferer (+ test). #421

Merged
merged 2 commits into from
Oct 26, 2023

Conversation

virginiafdez
Copy link
Contributor

Add padding and cropping options to the Latent Diffusion Inferer. Includes:

  • Modification of the init, call and sample methods, allowing to pad and then crop the LDM latent space
  • If these shape parameters aren't specified, this works as usual (they are defaulted to None).
  • Added a test on the test_latent_diffusion_inferer trying this new scenario both with VAE+DM and VQVAE+DM.

@virginiafdez virginiafdez linked an issue Sep 19, 2023 that may be closed by this pull request
Copy link
Collaborator

@marksgraham marksgraham left a comment

Choose a reason for hiding this comment

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

Hi @virginiafdez , looks good! Some suggestions about the naming of things and a request for more tests.

generative/inferers/inferer.py Outdated Show resolved Hide resolved
generative/inferers/inferer.py Outdated Show resolved Hide resolved
generative/inferers/inferer.py Outdated Show resolved Hide resolved
generative/inferers/inferer.py Outdated Show resolved Hide resolved
…uting VAE > autoencoder for generalisation purposes, as well as padder and cropper by ldm_resizer and autoencoder_resizer.
@virginiafdez
Copy link
Contributor Author

All suggestions incorporated into the code and pushed.

@marksgraham marksgraham merged commit 1b34e60 into main Oct 26, 2023
@marksgraham marksgraham deleted the 420-crop-and-pad-in-latentdiffusioninferer branch October 26, 2023 14:44
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.

Crop and pad in LatentDiffusionInferer
2 participants