add debug mode

This commit is contained in:
Vladimir Mandic
2023-04-29 18:58:10 -04:00
parent 21b6e11b01
commit d4fd25a7fd
3 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -98,7 +98,7 @@ if __name__ == "__main__":
setup.log.debug('Starting WebUI')
logging.disable(logging.INFO)
if args.test:
setup.log.info(f"Test only")
setup.log.info("Test only")
import webui
exit(0)
else:
+2 -2
View File
@@ -60,7 +60,7 @@ def process_batch(p, input_dir, output_dir, inpaint_mask_dir, args):
if processed_image.mode == 'RGBA':
processed_image = processed_image.convert("RGB")
processed_image.save(os.path.join(output_dir, filename))
if cmd_opts.debug:
if cmd_opts.get('debug', False):
log.info(f'Processed: {len(images)} Memory: {memory_stats()} batch')
@@ -146,6 +146,6 @@ def img2img(id_task: str, mode: int, prompt: str, negative_prompt: str, prompt_s
processed = process_images(p)
p.close()
generation_info_js = processed.js()
if cmd_opts.debug:
if cmd_opts.get('debug', False):
log.info(f'Processed: {len(processed.images)} Memory: {memory_stats()} img')
return processed.images, generation_info_js, plaintext_to_html(processed.info), plaintext_to_html(processed.comments)
+1 -1
View File
@@ -46,6 +46,6 @@ def txt2img(id_task: str, prompt: str, negative_prompt: str, prompt_styles, step
processed = process_images(p)
p.close()
generation_info_js = processed.js()
if cmd_opts.debug:
if cmd_opts.get('debug', False):
log.info(f'Processed: {len(processed.images)} Memory: {memory_stats()} txt')
return processed.images, generation_info_js, plaintext_to_html(processed.info), plaintext_to_html(processed.comments)