Skip to content

Commit 950d854

Browse files
authored
Merge pull request #61 from jkoelker/jk/tqdm
feat: disable progress bars by default for cleaner logs
2 parents 5f8ea37 + 52a7c07 commit 950d854

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ Config uses layered TOML with hot-reload:
4040
| `HF_HOME` | No | Hugging Face cache directory |
4141
| `CIVITAI_API_KEY` | No | Civitai API key for downloading restricted models |
4242
| `CIVITAI_CACHE_DIR` | No | Civitai cache directory (default: `~/.cache/civitai`) |
43+
| `ENABLE_PROGRESS_BARS` | No | Set to `1` to enable tqdm progress bars (disabled by default) |
4344

4445
## Discord Commands
4546

src/oneiro/main.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@
77

88
def main() -> None:
99
"""Run the Oneiro Discord bot."""
10+
if os.environ.get("ENABLE_PROGRESS_BARS", "").lower() not in ("1", "true", "yes", "on"):
11+
os.environ.setdefault("HF_HUB_DISABLE_PROGRESS_BARS", "1")
12+
13+
from diffusers.utils import logging as diffusers_logging
14+
15+
diffusers_logging.disable_progress_bar()
16+
1017
token = os.environ.get("TOKEN")
1118
if not token:
1219
raise ValueError("TOKEN environment variable required")

0 commit comments

Comments
 (0)