Skip to content

Fix missing gradient_checkpointing init in ZImageControlNetModel#13267

Open
yunjoochoi wants to merge 2 commits intohuggingface:mainfrom
yunjoochoi:fix/z-image-controlnet-gradient-checkpointing
Open

Fix missing gradient_checkpointing init in ZImageControlNetModel#13267
yunjoochoi wants to merge 2 commits intohuggingface:mainfrom
yunjoochoi:fix/z-image-controlnet-gradient-checkpointing

Conversation

@yunjoochoi
Copy link

@yunjoochoi yunjoochoi commented Mar 15, 2026

What does this PR do?

One-line fix — missing self.gradient_checkpointing = False init, consistent with all other ControlNet implementations

ZImageControlNetModel sets _supports_gradient_checkpointing = True and references
self.gradient_checkpointing in its forward() method, but never initializes
self.gradient_checkpointing = False in __init__().

This causes enable_gradient_checkpointing() to raise:
ValueError: The module ZImageControlNetModel does not support gradient checkpointing.
Please make sure to use a module that supports gradient checkpointing by creating
a boolean attribute gradient_checkpointing.

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