aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2023-07-15 08:07:25 +0300
committerAUTOMATIC1111 <16777216c@gmail.com>2023-07-15 08:07:25 +0300
commit127635409a7959f6c057a68ccb8e70734cbaf9f3 (patch)
tree2a851b55a081501f1218c16cc1a09b9e781bca64 /modules
parentb8bd8ce4cf687e9e02000387adf4d751b22a4a36 (diff)
add padding and identification to generation log section (Failed to find Loras, Used embeddings, etc...)
Diffstat (limited to 'modules')
-rw-r--r--modules/img2img.py2
-rw-r--r--modules/txt2img.py2
-rw-r--r--modules/ui.py3
-rw-r--r--modules/ui_common.py9
4 files changed, 8 insertions, 8 deletions
diff --git a/modules/img2img.py b/modules/img2img.py
index 664e2688..a811e7a4 100644
--- a/modules/img2img.py
+++ b/modules/img2img.py
@@ -240,4 +240,4 @@ def img2img(id_task: str, mode: int, prompt: str, negative_prompt: str, prompt_s
if opts.do_not_show_images:
processed.images = []
- return processed.images, generation_info_js, plaintext_to_html(processed.info), plaintext_to_html(processed.comments)
+ return processed.images, generation_info_js, plaintext_to_html(processed.info), plaintext_to_html(processed.comments, classname="comments")
diff --git a/modules/txt2img.py b/modules/txt2img.py
index d0be2e73..29d94e8c 100644
--- a/modules/txt2img.py
+++ b/modules/txt2img.py
@@ -70,4 +70,4 @@ def txt2img(id_task: str, prompt: str, negative_prompt: str, prompt_styles, step
if opts.do_not_show_images:
processed.images = []
- return processed.images, generation_info_js, plaintext_to_html(processed.info), plaintext_to_html(processed.comments)
+ return processed.images, generation_info_js, plaintext_to_html(processed.info), plaintext_to_html(processed.comments, classname="comments")
diff --git a/modules/ui.py b/modules/ui.py
index 39d226ad..07ecee7b 100644
--- a/modules/ui.py
+++ b/modules/ui.py
@@ -83,8 +83,7 @@ detect_image_size_symbol = '\U0001F4D0' # 📐
up_down_symbol = '\u2195\ufe0f' # ↕️
-def plaintext_to_html(text):
- return ui_common.plaintext_to_html(text)
+plaintext_to_html = ui_common.plaintext_to_html
def send_gradio_gallery_to_image(x):
diff --git a/modules/ui_common.py b/modules/ui_common.py
index 57c2d0ad..11eb2a4b 100644
--- a/modules/ui_common.py
+++ b/modules/ui_common.py
@@ -29,9 +29,10 @@ def update_generation_info(generation_info, html_info, img_index):
return html_info, gr.update()
-def plaintext_to_html(text):
- text = "<p>" + "<br>\n".join([f"{html.escape(x)}" for x in text.split('\n')]) + "</p>"
- return text
+def plaintext_to_html(text, classname=None):
+ content = "<br>\n".join(html.escape(x) for x in text.split('\n'))
+
+ return f"<p class='{classname}'>{content}</p>" if classname else f"<p>{content}</p>"
def save_files(js_data, images, do_make_zip, index):
@@ -157,7 +158,7 @@ Requested path was: {f}
with gr.Group():
html_info = gr.HTML(elem_id=f'html_info_{tabname}', elem_classes="infotext")
- html_log = gr.HTML(elem_id=f'html_log_{tabname}')
+ html_log = gr.HTML(elem_id=f'html_log_{tabname}', elem_classes="html-log")
generation_info = gr.Textbox(visible=False, elem_id=f'generation_info_{tabname}')
if tabname == 'txt2img' or tabname == 'img2img':