implement complete face module

This commit is contained in:
Vladimir Mandic
2024-01-27 08:07:31 -05:00
parent dbe4d2ff70
commit 0bfb17ba72
20 changed files with 1632 additions and 429 deletions
+17 -12
View File
@@ -6,7 +6,7 @@ import html
from datetime import datetime, timedelta
import git
import gradio as gr
from modules import extensions, shared, paths, errors
from modules import extensions, shared, paths, errors, ui_symbols
extensions_index = "https://vladmandic.github.io/sd-data/pages/extensions.json"
@@ -372,27 +372,27 @@ def create_html(search_text, sort_column):
if ext.get('status', None) is None or type(ext['status']) == str: # old format
ext['status'] = 0
if ext['url'] is None or ext['url'] == '':
status = "<span style='cursor:pointer;color:#00C0FD' title='Local'></span>"
status = f"<span style='cursor:pointer;color:#00C0FD' title='Local'>{ui_symbols.bullet}</span>"
elif ext['status'] > 0:
if ext['status'] == 1:
status = "<span style='cursor:pointer;color:#00FD9C ' title='Verified'></span>"
status = f"<span style='cursor:pointer;color:#00FD9C ' title='Verified'>{ui_symbols.bullet}</span>"
elif ext['status'] == 2:
status = "<span style='cursor:pointer;color:#FFC300' title='Supported only with backend:Original'></span>"
status = f"<span style='cursor:pointer;color:#FFC300' title='Supported only with backend:Original'>{ui_symbols.bullet}</span>"
elif ext['status'] == 3:
status = "<span style='cursor:pointer;color:#FFC300' title='Supported only with backend:Diffusers'></span>"
status = f"<span style='cursor:pointer;color:#FFC300' title='Supported only with backend:Diffusers'>{ui_symbols.bullet}</span>"
elif ext['status'] == 4:
status = f"<span style='cursor:pointer;color:#4E22FF' title=\"{ext.get('note', 'custom value')}\"></span>"
status = f"<span style='cursor:pointer;color:#4E22FF' title=\"{ext.get('note', 'custom value')}\">{ui_symbols.bullet}</span>"
elif ext['status'] == 5:
status = "<span style='cursor:pointer;color:#CE0000' title='Not supported'></span>"
status = f"<span style='cursor:pointer;color:#CE0000' title='Not supported'>{ui_symbols.bullet}</span>"
elif ext['status'] == 6:
status = "<span style='cursor:pointer;color:#AEAEAE' title='Just discovered'></span>"
status = f"<span style='cursor:pointer;color:#AEAEAE' title='Just discovered'>{ui_symbols.bullet}</span>"
else:
status = "<span style='cursor:pointer;color:#008EBC' title='Unknown status'></span>"
status = f"<span style='cursor:pointer;color:#008EBC' title='Unknown status'>{ui_symbols.bullet}</span>"
else:
if updated < datetime.timestamp(datetime.now() - timedelta(6*30)):
status = "<span style='cursor:pointer;color:#C000CF' title='Unmaintained'></span>"
status = f"<span style='cursor:pointer;color:#C000CF' title='Unmaintained'>{ui_symbols.bullet}</span>"
else:
status = "<span style='cursor:pointer;color:#7C7C7C' title='No info'></span>"
status = f"<span style='cursor:pointer;color:#7C7C7C' title='No info'>{ui_symbols.bullet}</span>"
code += f"""
<tr style="display: {visible}">
@@ -434,7 +434,12 @@ def create_ui():
check = gr.Button(value="Update all installed", variant="primary")
apply = gr.Button(value="Apply changes", variant="primary")
list_extensions()
gr.HTML('<span style="color: var(--body-text-color)"><h2>Extension list</h2>⯀ Refesh extension list to download latest list with status<br>⯀ Check status of an extension by looking at status icon before installing it<br>⯀ After any operation such as install/uninstall or enable/disable, please restart the server<br></span>')
gr.HTML('''<span style="color: var(--body-text-color)">
<h2>Extension list</h2>
- Refesh extension list to download latest list with status<br>
- Check status of an extension by looking at status icon before installing it<br>
- After any operation such as install/uninstall or enable/disable, please restart the server<br>
</span>''')
gr.HTML('')
info = gr.HTML('')
extensions_table = gr.HTML(create_html(search_text.value, sort_column.value))