Skip to content

add Min-SNR loss to Controlnet flax train script #3016

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

Merged
merged 3 commits into from
Apr 10, 2023
Merged

Conversation

yiyixuxu
Copy link
Collaborator

@yiyixuxu yiyixuxu commented Apr 8, 2023

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Apr 8, 2023

The documentation is not available anymore as the PR was closed or merged.

@@ -806,6 +812,17 @@ def main():
validation_rng, train_rngs = jax.random.split(rng)
train_rngs = jax.random.split(train_rngs, jax.local_device_count())

def compute_snr(timesteps):
Copy link
Member

Choose a reason for hiding this comment

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

Could you also add a comment on the reference like here?

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.

Thank you so much for doing this quickly.

Let's maybe also update the README mentioning this feature briefly?

@kashif
Copy link
Contributor

kashif commented Apr 8, 2023

thank you so much, this is great! Can you kindly also remove the line from the doc that this is only for Pytorch: https://github.com/huggingface/diffusers/blob/main/docs/source/en/training/text2image.mdx#training-with-min-snr-weighting

@yiyixuxu
Copy link
Collaborator Author

@kashif I will remove that line once we updated the flax script for text2img (I only updated controlnet in this PR)

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.

Looks pretty nice!

@sayakpaul sayakpaul merged commit dcfa6e1 into main Apr 10, 2023
@sayakpaul sayakpaul deleted the mini-snr-loss branch April 10, 2023 02:30
'The integration to report the results and logs to. Supported platforms are `"tensorboard"`'
' (default), `"wandb"` and `"comet_ml"`. Use `"all"` to report to all integrations.'
),
default="wandb",
Copy link
Member

Choose a reason for hiding this comment

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

Did we mean to change the default here? (Just asking)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I just didn't want it to default to something that doesn't exist - cause wandb is the only method I implemented 😅 (and I don't think the other flax training scripts implemented any of these logging methods)

Copy link
Member

Choose a reason for hiding this comment

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

lol, fair enough :)

andsteing pushed a commit to andsteing/diffusers that referenced this pull request Apr 11, 2023
* add wandb team and min-snr loss

* make style

* apply feedbacks
w4ffl35 pushed a commit to w4ffl35/diffusers that referenced this pull request Apr 14, 2023
* add wandb team and min-snr loss

* make style

* apply feedbacks
dg845 pushed a commit to dg845/diffusers that referenced this pull request May 6, 2023
* add wandb team and min-snr loss

* make style

* apply feedbacks
AmericanPresidentJimmyCarter pushed a commit to AmericanPresidentJimmyCarter/diffusers that referenced this pull request Apr 26, 2024
* add wandb team and min-snr loss

* make style

* apply feedbacks
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.

5 participants