Skip to content

Commit 58b4d0c

Browse files
authored
Merge pull request #9 from etherealxx/queueoff
🎁v2.1.0 (queueoff) Features: - Supports renaming downloaded file with `>` (for example: `https://files.catbox.moe/uarze8.safetensors > neurosama.safetensors`) - Supports extension usage without `--gradio-queue` (ported from [onedotsix](https://github.com/etherealxx/batchlinks-webui/tree/onedotsix)) - Supports running shell command from the UI with `!` (for example: type `!pip freeze`, then hit the `Download all!` button and see the colab console) - Progress bar for `--gradio-queue` Changes: - `aria2` as *the only* download method when using without `--gradio-queue` - Download session will be cut every 80 seconds on when using without `--gradio-queue` (just like [onedotsix](https://github.com/etherealxx/batchlinks-webui/tree/onedotsix)) - _Debug stopwatch (decorator)_ won't run automatically when `globaldebug = True`, must be uncommented manually (it disrupt the progress bar) - Dropped support for webui based on Gradio 3.9 (update your installation, or use [onedotsix](https://github.com/etherealxx/batchlinks-webui/tree/onedotsix) instead) - UI tweak (Smaller font size)
2 parents 1a45a36 + d40d7a1 commit 58b4d0c

File tree

14 files changed

+369
-124
lines changed

14 files changed

+369
-124
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
*.bak
22
*.backup
3+
imageratio.*
34

45
# Byte-compiled / optimized / DLL files
56
__pycache__/

README.md

Lines changed: 98 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -19,30 +19,47 @@
1919

2020
</div>
2121

22-
<!-- TABLE OF CONTENTS -->
23-
24-
<!--
2522
<details>
2623
<summary>Table of Contents</summary>
2724
<ol>
25+
<li><a href="#installation">Installation</a></li>
26+
<li><a href="#about">About</a></li>
27+
<li><a href="#example">Example</a></li>
2828
<li>
29-
<a href="#about-the-project">About The Project</a>
29+
<a href="#syntax">Syntax</a>
3030
<ul>
31-
<li><a href="#built-with">Built With</a></li>
31+
<li><a href="#valid-hashtags">Valid Hastags</a></li>
32+
<li><a href="https://github.com/etherealxx/batchlinks-downloader/blob/main/howtogetthedirectlinks.md">How to get the direct links (Important!)</a></li>
33+
<li><a href="#huggingfaces-download-method">Huggingface's download method</a></li>
34+
<li><a href="#civitais-download-method">CivitAI's download method</a></li>
35+
<li><a href="#rename-downloaded-files">Rename-Downloaded-Files</a></li>
36+
<li><a href="#running-shell-command">Running-Shell-Commands</a></li>
3237
</ul>
3338
</li>
3439
<li>
35-
<a href="#getting-started">Getting Started</a>
40+
<a href="#gradio-queue">Gradio Queue</a>
3641
<ul>
37-
<li><a href="#prerequisites">Prerequisites</a></li>
38-
<li><a href="#installation">Installation</a></li>
42+
<li><a href="#logging">Logging</a></li>
43+
<li><a href="#cancel">Cancel</a></li>
44+
<li><a href="#progress-bar">Progress Bar</a></li>
45+
</ul>
46+
</li>
47+
<li>
48+
<a href="#other-features">Other Features</a>
49+
<ul>
50+
<li><a href="#notification">Notification</a></li>
51+
<li><a href="#local-installation-support">Local Installation Support</a></li>
52+
<li><a href="#latest-release-v210">Latest Release: v2.1.0</a></li>
3953
</ul>
4054
</li>
41-
<li><a href="#usage">Usage</a></li>
4255
<li><a href="#roadmap">Roadmap</a></li>
56+
<li><a href="#known-bugs">Known Bugs</a></li>
57+
<li><a href="#contributing">Contributing</a></li>
58+
<li><a href="#contact">Contact</a></li>
59+
<li><a href="#acknowledgments">Acknowledgements</a></li>
4360
</ol>
4461
</details>
45-
-->
62+
4663

4764
<!-- ABOUT THE PROJECT -->
4865

@@ -66,7 +83,7 @@ or, if your colab use the newer version of webui (gradio version above 3.16.0) y
6683
```
6784
-->
6885

69-
Using `--gradio-queue` on the launch.py argument is highly recommended, as it enables this ectension to show download progress bar on the UI and a cancel button. The option itself has no negative effect on the webui.<br/>
86+
Using `--gradio-queue` on the launch.py argument is highly recommended, as it enables this extension to show download progress bar on the UI and a cancel button. The option itself has no negative effect on the webui. [Read more here.](https://github.com/etherealxx/batchlinks-webui#gradio-queue)<br/>
7087
<img src="images/queue.jpg" alt="Logo" width="300"><br/>
7188

7289
While it's not recommended to use this extension on your local installation, you can use this extension on Windows. [More here](https://github.com/etherealxx/batchlinks-webui#local-installation-support)
@@ -146,7 +163,7 @@ See [here](https://github.com/etherealxx/batchlinks-downloader/blob/main/howtoge
146163

147164
### Huggingface's download method
148165

149-
So there's four supported method: `gdown`, `wget`, `curl` and `aria2`. Use whatever, really. The difference between them are actually little. Myself love using `gdown` since the output is cleaner than the others. aria2 has the fastest download speed, but it doesn't have a good progress bar.
166+
So there's four supported method: `gdown`, `wget`, `curl` and `aria2`. Use whatever, really. The difference between them are actually little. Myself love using `gdown` since the output is cleaner than the others. Some says `aria2` has the fastest download speed.
150167

151168
### Civitai's download method
152169

@@ -170,17 +187,49 @@ https://civitai.com/api/download/models/5616
170187

171188
Check [this page](https://github.com/etherealxx/batchlinks-downloader/blob/main/howtogetthedirectlinks.md) to learn more on how to get the links for each methods.
172189

190+
### Rename Downloaded Files
191+
Using `>` symbol, you can rename files. Take this for example<br/>
192+
<img src="images/rename.jpg" alt="Log" width="407"><br/>
193+
Mostly catbox file has random name, by using `>` symbol after the link, you can type the desired name on the right. (Don't forget the extension)
194+
195+
### Running Shell Commands
196+
You can run shell commands by using `!` in front of the command you want, just like in google colab cells. Then press the `Download All!` button. (Sure, it doesn't download anything, but, well😅)<br/>
197+
<img src="images/shell1.jpg" alt="Log" width="200">
198+
<img src="images/shell2.jpg" alt="Log" width="200"><br/>
199+
You can run many lines at once too!
200+
173201
<!--
174202
175203
<p align="right">(<a href="#readme-top">back to top</a>)</p>
176204
177205
-->
178206

207+
## Gradio Queue
208+
209+
If you use --gradio-queue argument on `launch.py`, some feature will be activated.
179210
### Logging
180211

181-
If you use latest version of [stable-diffusion-webui](https://github.com/AUTOMATIC1111/stable-diffusion-webui), or webui forks that supports `--gradio-queue` args on launch.py, use it and you will be able to enable logging by pressing the `Turn On Logging` radio button. Logging will tell you what are you actually downloading right now on the webui.<br/>
212+
<!-- If you use latest version of [stable-diffusion-webui](https://github.com/AUTOMATIC1111/stable-diffusion-webui), or webui forks that supports `--gradio-queue` args on launch.py, use it and you will be able to -->
213+
Enable logging by pressing the `Turn On Logging` radio button, and wait till `Logging activated` shows up and the box is blinking with orange border. Logging will tell you what are you actually downloading right now on the webui. After your download session is completed, it's recommended to turn back off the feature.<br/>
182214
<img src="images/logging.jpg" alt="Log" width="407"><br/>
183-
Turning on `--gradio-queue` also allows you to cancel ongoing download progress, if somehow the internet speed is slow and you need to restart.
215+
216+
### Cancel
217+
Pressing `cancel` button while download in progress will stops the current session. Useful when at one time the download speeds is too slow. If you're currently downloading a single item, that item will be cancelled, but the other downloaded one will remain intact.<br/>
218+
<img src="images/cancel.jpg" alt="Log" width="500"><br/>
219+
220+
### Progress Bar
221+
There will be an additional progress bar that tells you the current activities.<br/>
222+
<img src="images/progress.jpg" alt="Log" width="500"><br/>
223+
224+
### Changes if `--gradio-queue` is off
225+
Feature listed above will dissapear, and your only option for download is just `aria2` (speed is priority).<br/>Note that when you pressed the `Download All!` button, **nothing will shows up on the UI**. You need to check the colab console.<br/>
226+
<img src="images/checkconsole1.jpg" alt="check" width="407"><img src="images/checkconsole2.jpg" alt="off" width="407"><br/>
227+
Another thing to note is your download session will always be cutted every 70 seconds (to prevent hangs/desync).<br/>
228+
<img src="images/gradiooff1.jpg" alt="off" width="407"><br/>
229+
Don't worry, you can continue your session by pressing the `Resume Download` button. It will refresh the links with the one you haven't downloaded yet, then pressing `Download All!` will download the remaining links.<br/>
230+
<img src="images/gradiooff2.jpg" alt="off" width="407"><br/>
231+
232+
## Other Features
184233

185234
### Notification
186235

@@ -194,14 +243,24 @@ This extension is tested to work on Windows 11. Maybe works on Debian-based linu
194243
On Windows, this extension will install [MEGAcmd](https://github.com/meganz/MEGAcmd) for MEGA file download.
195244
MacOS is not supported.
196245

197-
## Latest release: v2.0.0
246+
## Latest release: v2.1.0
247+
Features:
248+
- Supports renaming downloaded file with `>` (for example: `https://files.catbox.moe/uarze8.safetensors > neurosama.safetensors`)
249+
- Supports extension usage without `--gradio-queue` (ported from [onedotsix](https://github.com/etherealxx/batchlinks-webui/tree/onedotsix))
250+
- Supports running shell command from the UI with `!` (for example: type `!pip freeze`, then hit the `Download all!` button and see the colab console)
251+
- Progress bar for `--gradio-queue`
252+
253+
Changes:
254+
- `aria2` as *the only* download method when using without `--gradio-queue`
255+
- Download session will be cut every 80 seconds on when using without `--gradio-queue` (just like [onedotsix](https://github.com/etherealxx/batchlinks-webui/tree/onedotsix))
256+
- _Debug stopwatch (decorator)_ won't run automatically when `globaldebug = True`, must be uncommented manually (it disrupt the progress bar)
257+
- Dropped support for webui based on Gradio 3.9 (update your installation, or use [onedotsix](https://github.com/etherealxx/batchlinks-webui/tree/onedotsix) instead)
258+
- UI tweak (Smaller font size)
259+
260+
### Release v2.0.0
198261
Features:
199262
- `aria2` as download method.
200263
- Cancel button for cancelling download process (`--gradio-queue` required)
201-
- Debug snapshot.<br/>
202-
When `global_debug = True`, the moment this extension launch, it saves the current state of the webui on various location (into `snapshot.txt`), and when you type `#debugresetdownloads` on the textbox, it will compare the current state and the last saved state, and removes every new file/folder. This will be useful for debugging and testing.
203-
- Debug every download method.<br/>
204-
When `global_debug = True` and you type `#debugevery method` on the textbox, every link that has 4 different method of download (Huggingface etc.) will be downloaded with every method, regardless of the radio button choice. The result is 4 file being downloaded.
205264
- Detection if a CivitAI links no longer exist
206265
- New hashtags: `#textualinversion`, `#ti`, `#aestheticembedding`, `#aestheticembed`, `#controlnet`, and `#cnet`
207266
- Toggle logging on/off
@@ -213,34 +272,44 @@ When `global_debug = True` and you type `#debugevery method` on the textbox, eve
213272
- Supports for aesthetic gradients, controlnet model, and extensions path.
214273
- UI font scaled down
215274
- Uses `subprocess.Popen` instead of `os.system`
275+
<br/>_
276+
- _Debug snapshot_<br/>
277+
When `globaldebug = True`, the moment this extension launch, it saves the current state of the webui on various location (into `snapshot.txt`), and when you type `#debugresetdownloads` on the textbox, it will compare the current state and the last saved state, and removes every new file/folder. This will be useful for debugging and testing.
278+
- _Debug every download method_<br/>
279+
When `globaldebug = True` and you type `#debugevery method` on the textbox, every link that has 4 different method of download (Huggingface etc.) will be downloaded with every method, regardless of the radio button choice. The result is 4 file being downloaded.
280+
- _Debug stopwatch_<br/>
281+
When `globaldebug = True`, it will give an output for how long a single download session lasts
216282

217283
## Roadmap
218284

219285
- [ ] Add checker for downloaded models (so that it won't download again after the model is downloaded)
220-
- [x] aria2 for huggingface download method
221-
- [x] Cleaning the code from unnecesarry comments
222-
- [x] Completed download will use the webui's notification.mp3
223286
- [ ] Logo change
224-
- [ ] Mobile-friendly UI
287+
- [ ] Different UI for mobile
288+
- [ ] Moving most of the content of this Readme.md to Wiki instead
225289
- [ ] Other download sites (s-ul.eu, gitgud, Google Drive)
226290
- [ ] Gradio progress bar
227-
- [x] Supports Windows local installation
228291
- [ ] Support customizable hashtag from the UI
229292
- [ ] UI overhaul
293+
<br/>_
294+
- [x] aria2 for huggingface download method
295+
- [x] Cleaning the code from unnecesarry comments
296+
- [x] Completed download will use the webui's notification.mp3
297+
- [x] Supports Windows local installation
230298
- [x] Using threading/subprocess instead of os.system to download files
231299

232300
## Known Bugs
233301

234-
- Progress bar (the yellow bar) doesn't progress as expected (v3-16-2 branch)
302+
- Progress bar (the yellow bar) doesn't progress as expected
235303
- Sometimes notification sound doesn't play when downloading same file twice in a row
236-
- Windows: The delay between file is downloaded and the output shows is pretty long, and even sometimes the notification comes at the wrong time.
237-
- Links that has bracket in it needs to be 'escaped' (For example, `Baka-DiffusionV1(Fp16).safetensors` must be typed `Baka-DiffusionV1\(Fp16\).safetensors`)
238304
- Sometimes colab cannot be shut down with a single click on the stop button. Hitting the button several times will raise a KeyboardInterrupt and forcely stopping the cell.
305+
- There's still a chance that the UI of non `--gradio-queue` session and/or onedotsix freezes after a download session
306+
- Windows: The delay between file is downloaded and the output shows is pretty long, and even sometimes the notification comes at the wrong time.
307+
<br/>_
308+
- Sometimes the notification bell shows up when starting download, instead of when the download process is completed.
309+
- ~~Links that has bracket in it needs to be 'escaped' (For example, `Baka-DiffusionV1(Fp16).safetensors` must be typed `Baka-DiffusionV1\(Fp16\).safetensors`)~~ Fixed in [v2.0.0](dbb2adb3d07e41654244076b8ef4e851c3bb1f0c)
239310
- ~~The delay between file is downloaded and the output shows is really long (1min+) on [camenduru's v1.6 colab](https://github.com/camenduru/stable-diffusion-webui-colab) (Gradio related?)~~ Seems like fixed in [v1.1.0](fe6feafc07fbbe3efd2883b33855f8d66b5f89ea)
240311
- ~~File downloaded from MEGA will not listed on the output, as it use different download method. There is some delay between the transfare() function complete until it writes the file. I don't know how long the delay is.~~ Fixed in [v1.1.0](fe6feafc07fbbe3efd2883b33855f8d66b5f89ea)
241312

242-
<!-- CONTRIBUTING -->
243-
244313
## Contributing
245314

246315
I just learned python few months ago, by just looking at other peoples project and sometimes asking ChatGPT. Gradio is new for me. I literally just learn it in one day to make this extension, so expect some bugs.
@@ -263,8 +332,6 @@ A star on this project would be nice! Thanks again!
263332
My Email - [email protected] <br/>
264333
My Youtube - [MJ Devlog](https://www.youtube.com/@mjdevlog)
265334

266-
<!-- ACKNOWLEDGMENTS -->
267-
268335
## Acknowledgments
269336

270337
- [Camenduru's Webui Huggingface](https://github.com/camenduru/stable-diffusion-webui-huggingface) - I use his extension as my base (my gradio skill sucks T.T)

images/cancel.jpg

37.7 KB
Loading

images/checkconsole1.jpg

107 KB
Loading

images/checkconsole2.jpg

138 KB
Loading

images/gradiooff1.jpg

118 KB
Loading

images/gradiooff2.jpg

160 KB
Loading

images/progress.jpg

26.3 KB
Loading

images/rename.jpg

32.6 KB
Loading

images/shell1.jpg

12.9 KB
Loading

0 commit comments

Comments
 (0)