Kaeya commited on
Commit
dfe10a3
1 Parent(s): 36e7be0

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +55 -0
README.md CHANGED
@@ -2,6 +2,61 @@
2
  license: creativeml-openrail-m
3
  tags:
4
  - stable-diffusion
 
5
  ---
6
 
7
  Mixed stable diffusion models from the ai image channel and elsewhere. Feel free to download.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  license: creativeml-openrail-m
3
  tags:
4
  - stable-diffusion
5
+ - aiartchan
6
  ---
7
 
8
  Mixed stable diffusion models from the ai image channel and elsewhere. Feel free to download.
9
+
10
+
11
+ ## file download code example
12
+
13
+ ```python
14
+ # urlretrieve, no progressbar
15
+ from urllib.request import urlretrieve
16
+ from huggingface_hub import hf_hub_url
17
+
18
+ repo_id = "AIARTCHAN/aichan_blend"
19
+ filename = "AbyssOrangeMix2_nsfw-pruned.safetensors"
20
+ url = hf_hub_url(repo_id, filename)
21
+ urlretrieve(url, filename)
22
+ ```
23
+
24
+ ```python
25
+ # with tqdm, urllib
26
+ import shutil
27
+ from urllib.request import urlopen
28
+ from huggingface_hub import hf_hub_url
29
+ from tqdm import tqdm
30
+
31
+ repo_id = "AIARTCHAN/aichan_blend"
32
+ filename = "AbyssOrangeMix2_nsfw-pruned.safetensors"
33
+ url = hf_hub_url(repo_id, filename)
34
+
35
+ with urlopen(url) as resp:
36
+ total = int(resp.headers.get("Content-Length", 0))
37
+ with tqdm.wrapattr(
38
+ resp, "read", total=total, desc="Download..."
39
+ ) as src:
40
+ with open(filename, "wb") as dst:
41
+ shutil.copyfileobj(src, dst)
42
+ ```
43
+
44
+ ```python
45
+ # with tqdm, requests
46
+ import shutil
47
+ import requests
48
+ from huggingface_hub import hf_hub_url
49
+ from tqdm import tqdm
50
+
51
+ repo_id = "AIARTCHAN/aichan_blend"
52
+ filename = "AbyssOrangeMix2_nsfw-pruned.safetensors"
53
+ url = hf_hub_url(repo_id, filename)
54
+
55
+ resp = requests.get(url, stream=True)
56
+ total = int(resp.headers.get("Content-Length", 0))
57
+ with tqdm.wrapattr(
58
+ resp.raw, "read", total=total, desc="Download..."
59
+ ) as src:
60
+ with open(filename, "wb") as dst:
61
+ shutil.copyfileobj(src, dst)
62
+ ```