Uh oh!
There was an error while loading. Please reload this page.
[Feature] Dynamically adjust the guidance scale for ControlNet XL. - #4569
[Feature] Dynamically adjust the guidance scale for ControlNet XL.#4569pixeli99 wants to merge 1 commit into
Conversation
HuggingFaceDocBuilderDev
commented
Aug 11, 2023
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. |
yiyixuxu
commented
Aug 11, 2023
Wow! super cool. Thanks for your PR! Also, can we see more examples? The vibrant color is really lovely for this sunset photo. It would also be interesting to see how it changes color across different contexts. |
sayakpaul
commented
Aug 11, 2023
I concur with @yiyixuxu's comments. Thanks for contributing this! |
pixeli99
commented
Aug 12, 2023
In fact, I did not find any references. It was just an accidental discovery during my own training of controlnet. This calculation method may not be rigorous. Fortunately, I found a Chinese blog that explains this issue, hoping it will be helpful. https://zhuanlan.zhihu.com/p/587049023
Please note that this adaptive method is not always effective and sometimes may result in oversaturated colors. However, in most cases, we don't need to worry about this.
|
sayakpaul
commented
Aug 15, 2023
@pixeli99 let us know if you need any help to shape this PR in a mergeable state. |
| width: Optional[int] = None, | ||
| num_inference_steps: int = 50, | ||
| guidance_scale: float = 5.0, | ||
| use_dynamic_scale: bool = False, |
There was a problem hiding this comment.
To allow for more flexibility for future changes could we maybe add a parameter
| use_dynamic_scale: bool=False, | |
| guidance_scale_type="static"# dynamic, |
patrickvonplaten
left a comment
There was a problem hiding this comment.
A bit worried about cluttering the call API too much with too many parameters. Would like to think a bit about the broader context of prompt embed tuning/tweaking as described here:
#4778
before moving too fast with this PR
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. |

Before
After
What
For the original parameters, Controlnetxl's output will darken the colors. This is particularly severe when the text prompt length is short. Dynamically selecting guidance scale can alleviate this phenomenon and allow for the use of larger control weight without deteriorating image quality.
How