diff --git a/deoldify/__init__.py b/deoldify/__init__.py index 48563b0..d75ed46 100644 --- a/deoldify/__init__.py +++ b/deoldify/__init__.py @@ -1,7 +1,14 @@ import sys import logging -logging.getLogger().addHandler(logging.StreamHandler(sys.stdout)) -logging.getLogger().setLevel(logging.INFO) +try: + import modules.shared + IS_INSIDE_WEBUI = True +except ImportError: + IS_INSIDE_WEBUI = False + +if not IS_INSIDE_WEBUI: + logging.getLogger().addHandler(logging.StreamHandler(sys.stdout)) + logging.getLogger().setLevel(logging.INFO) from deoldify._device import _Device