Commit 4fe13ef
committed
feat(storage): allow #a=1&b=2 params; HTTP can use #fname=XXX
HTTPStorage:
Consider https://civitai.com/api/download/models/15603
Which has a content-disposition of "Light and Shadow.safetensors"
But we don't know that in advance, so we'd have to perform the
request each time to see if the file is already cached locally.
To avoid that, we can now give a URL like
http://.../models/15603#fname=light-and-shadow.safetensors
Which will check the cache against this filename.
Notes:
* Hash query is never sent to to the server.
* Application code might still manipulate the filename, e.g. in
the above case, the final name might be
`lora_weights--light_and_shadow.safetensors`
in the diffusers cache directory.1 parent a40129a commit 4fe13ef
2 files changed
Lines changed: 8 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
20 | 25 | | |
21 | 26 | | |
22 | 27 | | |
| |||
25 | 30 | | |
26 | 31 | | |
27 | 32 | | |
28 | | - | |
| 33 | + | |
29 | 34 | | |
30 | 35 | | |
31 | 36 | | |
32 | 37 | | |
33 | 38 | | |
34 | | - | |
| 39 | + | |
35 | 40 | | |
36 | 41 | | |
37 | 42 | | |
| |||
0 commit comments