aboutsummaryrefslogtreecommitdiffstats
path: root/modules/ui_common.py
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2023-07-18 15:20:22 +0000
committerAUTOMATIC1111 <16777216c@gmail.com>2023-07-18 15:20:22 +0000
commiteb7c9b58fc2fbab205d4bc9f708800870dcda3fb (patch)
tree337bc9e4e6793aa072c2e2a8c10e3a3f7daf6a95 /modules/ui_common.py
parentf865d3e11647dfd6c7b2cdf90dde24680e58acd8 (diff)
parent7f7db1700bda40ba3171a49b6a4ef38f868b7d0a (diff)
downloadstable-diffusion-webui-gfx803-eb7c9b58fc2fbab205d4bc9f708800870dcda3fb.tar.gz
stable-diffusion-webui-gfx803-eb7c9b58fc2fbab205d4bc9f708800870dcda3fb.tar.bz2
stable-diffusion-webui-gfx803-eb7c9b58fc2fbab205d4bc9f708800870dcda3fb.zip
Merge branch 'dev' into release_candidate
Diffstat (limited to 'modules/ui_common.py')
-rw-r--r--modules/ui_common.py9
1 files changed, 5 insertions, 4 deletions
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':