Skip to content

Commit

Permalink
Add logging feature in WebUI (#1821)
Browse files Browse the repository at this point in the history
  • Loading branch information
Abhishek-Varma committed Sep 8, 2023
1 parent 9681d49 commit bde63ee
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions apps/stable_diffusion/src/utils/stable_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,13 @@ def is_valid_file(arg):
help="Flag for enabling rest API.",
)

p.add_argument(
"--debug",
default=False,
action=argparse.BooleanOptionalAction,
help="Flag for enabling debugging log in WebUI.",
)

p.add_argument(
"--output_gallery",
default=True,
Expand Down
3 changes: 3 additions & 0 deletions apps/stable_diffusion/web/index.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from multiprocessing import Process, freeze_support
import os
import sys
import logging

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


if __name__ == "__main__":
if args.debug:
logging.basicConfig(level=logging.DEBUG)
# required to do multiprocessing in a pyinstaller freeze
freeze_support()
if args.api or "api" in args.ui.split(","):
Expand Down

0 comments on commit bde63ee

Please sign in to comment.