diffusers
diffusers copied to clipboard
Fixing implementation of ControlNet-XS
What does this PR do?
Implements ControlNet-XS with the feedback from PR #5827 incorporated.
See original PR for details.
Who can review?
Core library:
- Pipelines: @patrickvonplaten and @sayakpaul
Hi @patrickvonplaten,
I've updated PR #5827 with your review comments.
Re Do we need the class_labels parameter? (https://github.com/huggingface/diffusers/pull/5827#discussion_r1437019546 and https://github.com/huggingface/diffusers/pull/5827#discussion_r1437019775): Iiuc, class_labels are not only used for upsampling, but also for class-conditioned generation. So I'd include it.
Re https://github.com/huggingface/diffusers/pull/5827#discussion_r1437020210: I'm almost certain using the add_embedding of the base model is correct. That's also how the paper implementation does is. Why would you not do it?
All other comments are incorporated!
@yiyixuxu can you review here?
@yiyixuxu Pinging you as the last comment was 2 weeks ago. Let me know if I can help in any way!
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.
cc @DN6 for a final review
out_channels = out_channels or in_channels
self.in_channels = in_channels
oh sorry I meant do we need to assign it as an attribute to the model?
We don't, but out_channels is also assigned as an attribute to the model. For consistency, I'd also assign in_channels. wdyt @yiyixuxu ?
Looking good overall 👍🏽 Left some comments.
Regarding the naming, we could perhaps call the module ControlNetXSAdapter? Since its behaviour is similar to our other adapters? cc: @yiyixuxu
Regarding the naming, we could perhaps call the module ControlNetXSAdapter? Since its behaviour is similar to our other adapters?
ok!
Regarding the naming, we could perhaps call the module ControlNetXSAdapter? Since its behaviour is similar to our other adapters?
ok!
Sounds good. Have renamed
ControlNetXSAddon->ControlNetXSAdapterControlNetXSAddonDownBlockComponents->DownBlockControlNetXSAdapter, and similarly for mid/up blocksget_down_block_addon->get_down_block_adapter, and similarly for mid/up
@UmerHA the failing tests look relevant here - can you look into and fix?
@yiyixuxu you were right - should be fixed now. can you rerun the tests?
The only failing test seems very unrelated to this PR:
cc @yiyixuxu
@DN6 some of your comments aren't marked as resolved. do you have any more questions/feedback, or is it fine as is?
@UmerHA All good. We can break up the tests in a follow up PR.
@UmerHA We have failing slow tests because the checkpoint doesn't seem to be updated. Can you take care of this please Raised an issue: #7694
Have updated the models & ran the slow test on a T4 - works now.