Skip to content

Conversation

@gsprochette
Copy link
Collaborator

@gsprochette gsprochette commented Jan 2, 2026

Description

This PR adds protection arround the layers attribute in hqq_diffusers.

hqq_diffusers declares a list of modules in a layers attribute to replicate the behavior of the transformers architecture. However, this creates conflicts with diffusers using the layers name, e.g. z-image.

This PR adds a context that temporarily renames a pre-existing layers attribute and restores it after quantization.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Unit tests, notebook available.

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Additional Notes

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Comment @cursor review or bugbot run to trigger another review on this PR

@gsprochette gsprochette requested review from begumcig and llcnt January 2, 2026 14:06
@gsprochette gsprochette requested review from begumcig and llcnt January 2, 2026 14:37
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.

2 participants