From bb97e695dab44a4665a85f9b0c49263ff148aceb Mon Sep 17 00:00:00 2001 From: Vladimir Mandic Date: Mon, 30 Dec 2024 21:48:26 -0500 Subject: [PATCH] log cleanup Signed-off-by: Vladimir Mandic --- modules/devices.py | 2 +- modules/images_resize.py | 2 +- modules/processing_args.py | 3 ++- modules/processing_vae.py | 4 ++-- modules/ui_extra_networks.py | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/modules/devices.py b/modules/devices.py index 6168ac63a..c98aea696 100644 --- a/modules/devices.py +++ b/modules/devices.py @@ -486,7 +486,7 @@ def set_cuda_params(): device_name = get_raw_openvino_device() else: device_name = torch.device(get_optimal_device_name()) - log.info(f'Torch parameters: backend={backend} device={device_name} config={opts.cuda_dtype} dtype={dtype} vae={dtype_vae} unet={dtype_unet} context={inference_context.__name__} nohalf={opts.no_half} nohalfvae={opts.no_half_vae} upcast={opts.upcast_sampling} deterministic={opts.cudnn_deterministic} test-fp16={fp16_ok} test-bf16={bf16_ok} optimization="{opts.cross_attention_optimization}"') + log.info(f'Torch parameters: backend={backend} device={device_name} config={opts.cuda_dtype} dtype={dtype} context={inference_context.__name__} nohalf={opts.no_half} nohalfvae={opts.no_half_vae} upcast={opts.upcast_sampling} deterministic={opts.cudnn_deterministic} fp16={"pass" if fp16_ok else "fail"} bf16={"pass" if bf16_ok else "fail"} optimization="{opts.cross_attention_optimization}"') def cond_cast_unet(tensor): diff --git a/modules/images_resize.py b/modules/images_resize.py index 362be79ee..183e1d7f1 100644 --- a/modules/images_resize.py +++ b/modules/images_resize.py @@ -129,5 +129,5 @@ def resize_image(resize_mode: int, im: Image.Image, width: int, height: int, ups shared.log.error(f'Invalid resize mode: {resize_mode}') t1 = time.time() fn = f'{sys._getframe(2).f_code.co_name}:{sys._getframe(1).f_code.co_name}' # pylint: disable=protected-access - shared.log.debug(f'Image resize: input={im} width={width} height={height} mode="{shared.resize_modes[resize_mode]}" upscaler="{upscaler_name}" context="{context}" type={output_type} result={res} time={t1-t0:.2f} fn={fn}') # pylint: disable=protected-access + shared.log.debug(f'Image resize: source={im.width}:{im.height} target={width}:{height} mode="{shared.resize_modes[resize_mode]}" upscaler="{upscaler_name}" type={output_type} time={t1-t0:.2f} fn={fn}') # pylint: disable=protected-access return np.array(res) if output_type == 'np' else res diff --git a/modules/processing_args.py b/modules/processing_args.py index 34e93e8d4..f39537538 100644 --- a/modules/processing_args.py +++ b/modules/processing_args.py @@ -340,7 +340,8 @@ def set_pipeline_args(p, model, prompts:list, negative_prompts:list, prompts_2:t if not debug_enabled and k.endswith('_embeds'): del clean[k] clean['prompt'] = 'embeds' - shared.log.info(f'{desc}: pipeline={model.__class__.__name__} task={sd_models.get_diffusers_task(model)} batch={p.iteration + 1}/{p.n_iter}x{p.batch_size} set={clean}') + task = str(sd_models.get_diffusers_task(model)).replace('DiffusersTaskType.', '') + shared.log.info(f'{desc}: pipeline={model.__class__.__name__} task={task} batch={p.iteration + 1}/{p.n_iter}x{p.batch_size} set={clean}') if p.hdr_clamp or p.hdr_maximize or p.hdr_brightness != 0 or p.hdr_color != 0 or p.hdr_sharpen != 0: shared.log.debug(f'HDR: clamp={p.hdr_clamp} maximize={p.hdr_maximize} brightness={p.hdr_brightness} color={p.hdr_color} sharpen={p.hdr_sharpen} threshold={p.hdr_threshold} boundary={p.hdr_boundary} max={p.hdr_max_boundry} center={p.hdr_max_center}') diff --git a/modules/processing_vae.py b/modules/processing_vae.py index 034d17065..04af9bab1 100644 --- a/modules/processing_vae.py +++ b/modules/processing_vae.py @@ -136,8 +136,8 @@ def full_vae_decode(latents, model): vae_name = os.path.splitext(os.path.basename(sd_vae.loaded_vae_file))[0] if sd_vae.loaded_vae_file is not None else "default" vae_stats = f'vae="{vae_name}" dtype={model.vae.dtype} device={model.vae.device} upcast={upcast} slicing={getattr(model.vae, "use_slicing", None)} tiling={getattr(model.vae, "use_tiling", None)}' - latents_stats = f'shape={latents.shape} dtype={latents.dtype} device={latents.device}' - stats = f'{vae_stats} latents {latents_stats}' + latents_stats = f'latents={latents.shape}:{latents.device}:{latents.dtype}' + stats = f'{vae_stats} {latents_stats}' log_debug(f'VAE config: {model.vae.config}') try: diff --git a/modules/ui_extra_networks.py b/modules/ui_extra_networks.py index 96c9e4391..fed39da27 100644 --- a/modules/ui_extra_networks.py +++ b/modules/ui_extra_networks.py @@ -277,7 +277,7 @@ class ExtraNetworksPage: self.html += ''.join(htmls) self.page_time = time.time() self.html = f"
{subdirs_html}
{self.html}
" - shared.log.debug(f"Networks: page='{self.name}' items={len(self.items)} subfolders={len(subdirs)} tab={tabname} folders={self.allowed_directories_for_previews()} list={self.list_time:.2f} thumb={self.preview_time:.2f} desc={self.desc_time:.2f} info={self.info_time:.2f} workers={shared.max_workers} sort={shared.opts.extra_networks_sort}") + shared.log.debug(f"Networks: page='{self.name}' items={len(self.items)} subfolders={len(subdirs)} tab={tabname} folders={self.allowed_directories_for_previews()} list={self.list_time:.2f} thumb={self.preview_time:.2f} desc={self.desc_time:.2f} info={self.info_time:.2f} workers={shared.max_workers}") if len(self.missing_thumbs) > 0: threading.Thread(target=self.create_thumb).start() return self.patch(self.html, tabname)