-
Couldn't load subscription status.
- Fork 6.4k
[fix] sync ControlNet-SD3 attention parameters of dual_attention_layer and qk_norm with SD3 #9784
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
base: main
Are you sure you want to change the base?
Conversation
96e8f0d to
dc37f5e
Compare
|
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. |
| width=sample_size, | ||
| patch_size=patch_size, | ||
| in_channels=in_channels + extra_conditioning_channels, | ||
| in_channels=in_channels, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this change not related to SD 3.5?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is releated to whether the control net is used for inpainting.
The control image for inpainiting has additional mask channel, but the normal controlnet does not need it. src/diffusers/pipelines/controlnet_sd3/pipeline_stable_diffusion_3_controlnet_inpainting.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we removing this then? we can set it to 0 when it is not needed, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, you are right. I cancelled the commit and I changed the the default num_extra_conditioning_channels to 0 in the from_transformer method such that when using script, erros will not occur.
9de2f3e to
69442d4
Compare
| @classmethod | ||
| def from_transformer( | ||
| cls, transformer, num_layers=12, num_extra_conditioning_channels=1, load_weights_from_transformer=True | ||
| cls, transformer, num_layers=12, num_extra_conditioning_channels=0, load_weights_from_transformer=True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we have to change the default? you can manually pass num_extra_conditioning_channels=0 when you need it to be 0, no?
otherwise I will tag the original author to see if it is ok to change here (to make sure it won't break anything)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because the method in training script use the default parameters and the script is for add control with normal image instead of inpainting. As the result, with num_extra_conditioning_channels=0 in this method, script will occur errors.
In addtion, the default value of num_extra_conditioning_channels in ini method is also 0.
…rs and qk_norm with SD3
c1a60e7 to
2ea004f
Compare
|
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread. Please note that issues that do not follow the contributing guidelines are likely to be ignored. |
When initializing ControlNet-SD3 with the from_transformer method, the dual_attention_layers and qk_norm parameters were not defined in the init method, resulting in the following error:
To resolve this, the missing keyword arguments were added to ensure compatibility with the from_transformer method.
And pos_embed_input for conditioning images needs to be the same as it in original transformers, for the images shape are the same.