-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
SDXL Turbo support and example launch #6473
Conversation
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. |
@@ -61,6 +61,34 @@ accelerate launch train_diffusion_dpo_sdxl.py \ | |||
--push_to_hub | |||
``` | |||
|
|||
## SDXL Turbo training command |
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.
Possible to maybe add a note that it enables 4-steps sampling?
parser.add_argument( | ||
"--is_turbo", | ||
action="store_true", | ||
help=("Use if tuning SDXL Turbo instead of SDXL"), |
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.
nit: if we remove the help statement out of the brackets and remove the comma it probably will go to the line above.
timesteps_0_to_3 = timesteps % 4 | ||
timesteps = 250 * timesteps_0_to_3 + 249 |
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.
Can this be explained in the comments a bit? I know about the 4-step part that was discussed in the ADD paper for training of the student.
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.
Awesome! Thanks much.
Just some nits.
hi @bram-w could we also have this setup for SD-turbo version? which is based on SD2.1, thanks |
@bram-w let me know if you need any help :) |
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.
@bram-w testing your script you might also need to change the guidance scale and num steps on the validation step, you could add these lines
guidance_scale = 5.0
num_inference_steps = 25
if args.is_turbo:
guidance_scale = 0.0
num_inference_steps = 4
and add the params here
diffusers/examples/research_projects/diffusion_dpo/train_diffusion_dpo_sdxl.py
Lines 120 to 124 in dc7f024
for prompt in VALIDATION_PROMPTS: | |
with context: | |
image = pipeline(prompt, num_inference_steps=25, generator=generator).images[0] | |
images.append(image) |
and here
pipeline(prompt, num_inference_steps=25, generator=generator).images[0] for prompt in VALIDATION_PROMPTS |
wdyt @sayakpaul
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. |
any update on this PR? |
@bram-w this PR is already in pretty good state. Let us know if and how we can help to get this merged. |
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. |
@bram-w a gentle ping :) |
@radames do you want to push the changes you suggested to the script and we can then merge? |
yes happy to do that, do I have permission to send commits here? |
I think you should be able to since you are a member of the HF org. |
done @sayakpaul |
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.
Thanks a bunch!
What does this PR do?
I added an
--is_turbo
argument to the new Diffusion-DPO scripts to support DPO tuning of the 4-step SDXL Turbo model. I also added an example call in the corresponding READMEBefore submitting
No, but direct follow-up to [Experimental] Diffusion LoRA DPO training #6422
documentation guidelines, and
here are tips on formatting docstrings.
Added readme launch and in-line comments
N/A
Who can review?
@sayakpaul