LaurentMazare / diffusers-rs

An implementation of the diffusers api in Rust
Apache License 2.0
521 stars 54 forks source link

Add python script for ease of downloading weights #67

Closed eoriont closed 1 year ago

eoriont commented 1 year ago

I wrote a little python script to download the weights automatically. This way, windows users can also run the script! Works for versions 1.5 and 2.1 with 16 or 32 bit weights, as specified in the command. Using this script should mean #65 doesn't happen, since the filenames are correct.

Command syntax:

usage: get_weights.py [-h] [--sd_version {2.1,1.5}] [--weight_bits {16,32}] [--use_cpu]

Download weights for diffusers-rs.

options:
  -h, --help            show this help message and exit
  --sd_version {2.1,1.5}, -v {2.1,1.5}
  --weight_bits {16,32}, -w {16,32}
  --use_cpu, -c

Let me know if there should be something changed/added.

eoriont commented 1 year ago

One concern I have this way is that it's very easy to let all your models build up and fill your data directory. Since there is no distinction in the filenames whether the models are 32 bit or 16 bit, you'll have to either remember which type they are or redownload them. Otherwise, I think this is a little better. What do you think?

LaurentMazare commented 1 year ago

Merged, thanks for the PR!