Skip to content

Commit bde63ee

Browse files
Add logging feature in WebUI (#1821)
1 parent 9681d49 commit bde63ee

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

apps/stable_diffusion/src/utils/stable_args.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,13 @@ def is_valid_file(arg):
633633
help="Flag for enabling rest API.",
634634
)
635635

636+
p.add_argument(
637+
"--debug",
638+
default=False,
639+
action=argparse.BooleanOptionalAction,
640+
help="Flag for enabling debugging log in WebUI.",
641+
)
642+
636643
p.add_argument(
637644
"--output_gallery",
638645
default=True,

apps/stable_diffusion/web/index.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from multiprocessing import Process, freeze_support
22
import os
33
import sys
4+
import logging
45

56
if sys.platform == "darwin":
67
# import before IREE to avoid torch-MLIR library issues
@@ -41,6 +42,8 @@ def launch_app(address):
4142

4243

4344
if __name__ == "__main__":
45+
if args.debug:
46+
logging.basicConfig(level=logging.DEBUG)
4447
# required to do multiprocessing in a pyinstaller freeze
4548
freeze_support()
4649
if args.api or "api" in args.ui.split(","):

0 commit comments

Comments
 (0)