-
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
Allow passing a checkpoint state_dict to convert_from_ckpt (instead of just a string path) #4653
Conversation
…f just a string path)
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.
Ok for me once tests are all green. @sayakpaul wdyt?
@patrickvonplaten I don't think the failing tests are from this PR. Looking at the code of these tests, they don't use anything from the ckpt loader.
|
You're right @cmdr2 :-) Updating this PR to "main" |
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. |
Thanks @patrickvonplaten ! :) |
@cmdr2 Man, this parameter change from "checkpoint_path" to "checkpoint_path_or_dict" break everything, why not add a new parameter? @patrickvonplaten I believe this PR break the fundamental open-close development rules, and Diffusers's guidelines too |
@xhinker I'm sorry, yes this was a mistake on my part. I assumed that the first argument wouldn't work with named parameters, since it was a mandatory argument (i.e. no default value). Clearly that was a mistake on my part. Unfortunately, I see a few other scripts have started using the new variable name now (after it was checked-in on Aug 26). So reverting this change would break someone else again. Again, my apologies for not checking all my assumptions. |
Hi, @cmdr2 thank you for the response, agree we should keep it as it is now. I will need to update all code in my part to reflect the change. but please, add new changes, instead of changing the existing input output, or dependance logic. Thank you. |
Yeah going forward now that |
…f just a string path) (huggingface#4653) Co-authored-by: Patrick von Platen <[email protected]>
…f just a string path) (huggingface#4653) Co-authored-by: Patrick von Platen <[email protected]>
This allows passing either a string path or a state_dict to the
download_from_original_stable_diffusion_ckpt()
method.This makes it a bit more consistent with other model loading functions in diffusers, as well as allows external management and inspection of the state_dict (for e.g. Easy Diffusion analyzes the state dict for a few more things to determine the correct config file).
In general, it just provides a lot more flexibility to the users of this function, without any real downside.
Thanks!