unified logger

This commit is contained in:
Vladimir Mandic
2026-02-19 09:46:42 +01:00
parent bfe014f5da
commit a3074baf8b
315 changed files with 2507 additions and 2116 deletions
+3 -2
View File
@@ -1,6 +1,7 @@
import gradio as gr
from diffusers.pipelines import StableDiffusionPipeline, StableDiffusionXLPipeline # pylint: disable=unused-import
from modules import shared, scripts_manager, processing, sd_models, devices
from modules import logger
"""
This is a simpler template for script for SD.Next that implements a custom pipeline
@@ -88,7 +89,7 @@ class Script(scripts_manager.Script):
# prepare pipeline
c = shared.sd_model.__class__.__name__ if shared.sd_loaded else ''
if c != pipeline_base:
shared.log.warning(f'{title}: pipeline={c} required={pipeline_base}')
logger.log.warning(f'{title}: pipeline={c} required={pipeline_base}')
return None
orig_pipeline = shared.sd_model # backup current pipeline definition
shared.sd_model = pipeline_class( # create new pipeline using currently loaded model which is always in `shared.sd_model`
@@ -123,7 +124,7 @@ class Script(scripts_manager.Script):
if not latent:
p.task_args['output_type'] = 'np'
shared.log.debug(f'{c}: args={p.task_args}')
logger.log.debug(f'{c}: args={p.task_args}')
# if you need to run any preprocessing, this is the place to do it