aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Aires Rastén <johan@oljud.se>2022-09-22 08:47:16 +0000
committerAUTOMATIC1111 <16777216c@gmail.com>2022-09-22 13:34:54 +0000
commita213d3a21c9e37297fdcb2c2b48bd24290a479cf (patch)
treec5b3ea28b67e24da27dab00ac10fd865f1a9f9bc
parent34d5a31ea2bdb9348057425160de9439dcc208a1 (diff)
downloadstable-diffusion-webui-gfx803-a213d3a21c9e37297fdcb2c2b48bd24290a479cf.tar.gz
stable-diffusion-webui-gfx803-a213d3a21c9e37297fdcb2c2b48bd24290a479cf.tar.bz2
stable-diffusion-webui-gfx803-a213d3a21c9e37297fdcb2c2b48bd24290a479cf.zip
Add option to always log generation info
-rw-r--r--modules/img2img.py6
-rw-r--r--modules/shared.py1
-rw-r--r--modules/txt2img.py6
3 files changed, 11 insertions, 2 deletions
diff --git a/modules/img2img.py b/modules/img2img.py
index 91689232..bce8b712 100644
--- a/modules/img2img.py
+++ b/modules/img2img.py
@@ -118,4 +118,8 @@ def img2img(mode: int, prompt: str, negative_prompt: str, prompt_style: str, pro
shared.total_tqdm.clear()
- return processed.images, processed.js(), plaintext_to_html(processed.info)
+ generation_info_js = processed.js()
+ if opts.samples_log_stdout:
+ print(generation_info_js)
+
+ return processed.images, generation_info_js, plaintext_to_html(processed.info) \ No newline at end of file
diff --git a/modules/shared.py b/modules/shared.py
index 841a9877..5ffaefc5 100644
--- a/modules/shared.py
+++ b/modules/shared.py
@@ -125,6 +125,7 @@ class Options:
"outdir_img2img_grids": OptionInfo("outputs/img2img-grids", 'Output directory for img2img grids', component_args=hide_dirs),
"outdir_save": OptionInfo("log/images", "Directory for saving images using the Save button", component_args=hide_dirs),
"samples_save": OptionInfo(True, "Always save all generated images"),
+ "samples_log_stdout": OptionInfo(False, "Always print all generation info to standard output"),
"save_selected_only": OptionInfo(False, "When using 'Save' button, only save a single selected image"),
"samples_format": OptionInfo('png', 'File format for individual samples'),
"filter_nsfw": OptionInfo(False, "Filter NSFW content"),
diff --git a/modules/txt2img.py b/modules/txt2img.py
index 9123fca1..d2cf39ef 100644
--- a/modules/txt2img.py
+++ b/modules/txt2img.py
@@ -44,5 +44,9 @@ def txt2img(prompt: str, negative_prompt: str, prompt_style: str, prompt_style2:
shared.total_tqdm.clear()
- return processed.images, processed.js(), plaintext_to_html(processed.info)
+ generation_info_js = processed.js()
+ if opts.samples_log_stdout:
+ print(generation_info_js)
+
+ return processed.images, generation_info_js, plaintext_to_html(processed.info)