Skip to content

Conversation

@ethansmith2000
Copy link
Contributor

What does this PR do?

Fixes the implementation of min-snr training for v-prediction models

Based on implementation seen here.
https://github.com/kohya-ss/sd-scripts/blob/main/library/custom_train_functions.py#L66

These two graphs show the weight scheme based on timestep from the kohya implementation.
epssnr
v-predsnr

the current implementation in diffusers takes the eps weight and increases everything by + 1, it appears that the +1 should be relocated to the denominator

Copy link
Member

@sayakpaul sayakpaul left a comment

Choose a reason for hiding this comment

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

Thanks for the fix!

Do you want to apply it to the other scripts too?

@sayakpaul
Copy link
Member

@ethansmith2000 a gentle ping :)

@HuggingFaceDocBuilderDev

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.

@github-actions
Copy link
Contributor

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.

@github-actions github-actions bot added the stale Issues that haven't received updates label Sep 14, 2024
@yiyixuxu yiyixuxu removed the stale Issues that haven't received updates label Nov 16, 2024
@yiyixuxu
Copy link
Collaborator

@ethansmith2000
would you be able to make style? will merge once CI is green and we will ask the community to apply the same change

@github-actions
Copy link
Contributor

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.

@github-actions github-actions bot added the stale Issues that haven't received updates label Dec 11, 2024
@sayakpaul sayakpaul removed the stale Issues that haven't received updates label Dec 12, 2024
@sayakpaul
Copy link
Member

Will merge after the CI is green.

@sayakpaul sayakpaul merged commit 26e80e0 into huggingface:main Dec 12, 2024
8 checks passed
sayakpaul added a commit that referenced this pull request Dec 23, 2024
* fix min-snr implementation

https://github.com/kohya-ss/sd-scripts/blob/main/library/custom_train_functions.py#L66

* Update train_dreambooth.py

fix variable name mse_loss_weights

* fix divisor

* make style

---------

Co-authored-by: Sayak Paul <[email protected]>
Co-authored-by: YiYi Xu <[email protected]>
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.

4 participants