diff --git a/apps/stable_diffusion/src/utils/stable_args.py b/apps/stable_diffusion/src/utils/stable_args.py index 74626f9ed9..6636bd44f1 100644 --- a/apps/stable_diffusion/src/utils/stable_args.py +++ b/apps/stable_diffusion/src/utils/stable_args.py @@ -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, diff --git a/apps/stable_diffusion/web/index.py b/apps/stable_diffusion/web/index.py index dcb1e570f3..b587130f90 100644 --- a/apps/stable_diffusion/web/index.py +++ b/apps/stable_diffusion/web/index.py @@ -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 @@ -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(","):