Skip to content
This repository has been archived by the owner on Feb 7, 2025. It is now read-only.

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
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crop and pad in LatentDiffusionInferer
2 participants