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

made DDPM compatible with UNet2DConditionModel #10536

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Mafaz03
Copy link

@Mafaz03 Mafaz03 commented Jan 12, 2025

Summary

This PR addresses compatibility issues when using the UNet2DConditionModel with the DDPM pipeline. The issue arises because the UNet2DConditionModel requires encoder_hidden_states, which is not currently handled by the DDPM pipeline.

Problem Statement

Models such as UNet2DConditionModel [https://huggingface.co/docs/diffusers/en/api/models/unet2d-cond]
requires encoder_hidden_states that doesnt work well with DDPM pipeline as it doesnt have it as input parameter.

Fixes

  • Updated the DDPM pipeline’s __init__ method to accept encoder_hidden_states as an optional parameter.
  • Modified subsequent methods in the pipeline to pass encoder_hidden_states to the model during inference and training.
  • Ensured backward compatibility by keeping encoder_hidden_states optional.

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.

1 participant