Skip to content

Conversation

@kashif
Copy link
Contributor

@kashif kashif commented May 18, 2025

What does this PR do?

An implementation of Latent Perceptual Loss (LPL) for training Stable Diffusion XL models, based on the paper "Boosting Latent Diffusion with Perceptual Objectives" (Berrada et al., 2025). LPL is a perceptual loss that operates in the latent space of a VAE, helping to improve the quality and consistency of generated images by bridging the disconnect between the diffusion model and the autoencoder decoder.

Before submitting

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@HuggingFaceDocBuilderDev

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.

Copy link
Member

@sayakpaul sayakpaul left a comment

Choose a reason for hiding this comment

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

Thank you! Very clean stuff!

Should we

  1. Credit the first author for helping with a reference implementation?
  2. Should we apply LoRA on unet instead of full fine-tuning?
  3. Change lpl_sdxl.py to train_sdxl_lpl.py?

Maybe update the PR description with a visual example from full fine-tuning run?

# ... other training arguments ...
```

### Key Parameters
Copy link
Member

Choose a reason for hiding this comment

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

Should also include a full representative training command. Currently, we only show LPL-specific bits in a command but lack one where a full-blown training can be launched (dataset_name, batch_size, etc.).

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.

3 participants