diffusers icon indicating copy to clipboard operation
diffusers copied to clipboard

[Core] Support single file from `from_pretrained`

Open sayakpaul opened this issue 2 years ago • 4 comments

What does this PR do?

Fixes https://github.com/huggingface/diffusers/issues/6461.

@DN6, some considerations I kept in mind:

  • I didn't introduce from_single_file kwarg in from_pretrained().
  • My reasoning is as follows: users are already familiar with the from_single_file() method and they know that they can either pass the local filepath or a URL. This workflow is quite well-known at this point in time.
  • So, I don't think it makes sense to deviate from this and tackle it with a combination of repo_id and weight_name like how it's done in load_lora_weights(). load_lora_weights() also supports passing a direct local path of the LoRA file, though.

So, in a sense, from_pretrained()'s behavior is not deviating from from_single_file() in terms of how from_pretrained() is being called. WDYT?

TODO

  • [ ] Add deprecation cycle to from_single_file()
  • [ ] Tests
  • [ ] Documentation

sayakpaul avatar Feb 15 '24 11:02 sayakpaul

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.

Gently pinging @DN6 @yiyixuxu here.

sayakpaul avatar Mar 06 '24 04:03 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.

github-actions[bot] avatar Mar 30 '24 15:03 github-actions[bot]

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[bot] avatar Apr 26 '24 15:04 github-actions[bot]

Closing this. Cc: @DN6

sayakpaul avatar May 30 '24 13:05 sayakpaul