mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-04-18 19:09:00 +08:00
fix formating
This commit is contained in:
parent
5968b875cf
commit
56dc761ad3
@ -12,17 +12,21 @@ from modules.ui_common import plaintext_to_html
|
||||
import gradio as gr
|
||||
import safetensors.torch
|
||||
|
||||
|
||||
def pnginfo_format_string(plain_text):
|
||||
content = "<br>\n".join(html.escape(x) for x in str(plain_text).split('\n'))
|
||||
return content
|
||||
|
||||
|
||||
def pnginfo_format_setting(name, value):
|
||||
cls_name = 'geninfo-setting-string' if value.startswith('"') else 'geninfo-setting-value'
|
||||
return f"<span class='geninfo-setting-name'>{html.escape(name)}:</span> <span class='{cls_name}' onclick='uiCopyElementText(this)'>{html.escape(value)}</span>"
|
||||
|
||||
|
||||
def pnginfo_format_quicklink(name):
|
||||
return f"<span class='geninfo-quick-link' onclick='uiCopyPngInfo(this, \"{name}\")'>[{html.escape(name)}]</span>"
|
||||
|
||||
|
||||
def run_pnginfo(image):
|
||||
if image is None:
|
||||
return '', '', ''
|
||||
|
Loading…
x
Reference in New Issue
Block a user