add padding and identification to generation log section (Failed to find Loras, Used embeddings, etc...)

This commit is contained in:
AUTOMATIC1111 2023-07-15 08:07:25 +03:00
parent b8bd8ce4cf
commit 127635409a
5 changed files with 18 additions and 14 deletions

View File

@ -240,4 +240,4 @@ def img2img(id_task: str, mode: int, prompt: str, negative_prompt: str, prompt_s
if opts.do_not_show_images: if opts.do_not_show_images:
processed.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")

View File

@ -70,4 +70,4 @@ def txt2img(id_task: str, prompt: str, negative_prompt: str, prompt_styles, step
if opts.do_not_show_images: if opts.do_not_show_images:
processed.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")

View File

@ -83,8 +83,7 @@ detect_image_size_symbol = '\U0001F4D0' # 📐
up_down_symbol = '\u2195\ufe0f' # ↕️ up_down_symbol = '\u2195\ufe0f' # ↕️
def plaintext_to_html(text): plaintext_to_html = ui_common.plaintext_to_html
return ui_common.plaintext_to_html(text)
def send_gradio_gallery_to_image(x): def send_gradio_gallery_to_image(x):

View File

@ -29,9 +29,10 @@ def update_generation_info(generation_info, html_info, img_index):
return html_info, gr.update() return html_info, gr.update()
def plaintext_to_html(text): def plaintext_to_html(text, classname=None):
text = "<p>" + "<br>\n".join([f"{html.escape(x)}" for x in text.split('\n')]) + "</p>" content = "<br>\n".join(html.escape(x) for x in text.split('\n'))
return text
return f"<p class='{classname}'>{content}</p>" if classname else f"<p>{content}</p>"
def save_files(js_data, images, do_make_zip, index): def save_files(js_data, images, do_make_zip, index):
@ -157,7 +158,7 @@ Requested path was: {f}
with gr.Group(): with gr.Group():
html_info = gr.HTML(elem_id=f'html_info_{tabname}', elem_classes="infotext") 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}') generation_info = gr.Textbox(visible=False, elem_id=f'generation_info_{tabname}')
if tabname == 'txt2img' or tabname == 'img2img': if tabname == 'txt2img' or tabname == 'img2img':

View File

@ -227,29 +227,33 @@ button.custom-button{
align-self: end; align-self: end;
} }
.performance { .html-log .comments{
padding-top: 0.5em;
}
.html-log .performance {
font-size: 0.85em; font-size: 0.85em;
color: #444; color: #444;
display: flex; display: flex;
} }
.performance p{ .html-log .performance p{
display: inline-block; display: inline-block;
} }
.performance p.time, .performance p.vram, .performance p.time abbr, .performance p.vram abbr { .html-log .performance p.time, .performance p.vram, .performance p.time abbr, .performance p.vram abbr {
margin-bottom: 0; margin-bottom: 0;
color: var(--block-title-text-color); color: var(--block-title-text-color);
} }
.performance p.time { .html-log .performance p.time {
} }
.performance p.vram { .html-log .performance p.vram {
margin-left: auto; margin-left: auto;
} }
.performance .measurement{ .html-log .performance .measurement{
color: var(--body-text-color); color: var(--body-text-color);
font-weight: bold; font-weight: bold;
} }