wired up perf monitor

This commit is contained in:
ChrisColeTech 2024-08-24 18:59:19 -04:00
parent 7722d2c305
commit 4848427b19
3 changed files with 23 additions and 3 deletions

View File

@ -9,6 +9,28 @@ from api.controllers import register_blueprints
import fooocus_version
import shared
import args_manager
import os
import gradio as gr
import dependency_installer
dependency_installer.check_flask_installed()
dependency_installer.check_GPUtil_installed()
dependency_installer.check_tkinter_installed()
def load_page(filename):
"""Load an HTML file as a string and return it"""
file_path = os.path.join("web", filename)
with open(file_path, 'r') as file:
content = file.read()
return content
def addResourceMonitor():
ceq = None
with gr.Row():
ceq = gr.HTML(load_page('templates/perf-monitor/index.html'))
return ceq
# Cache for system usage data

View File

@ -21,7 +21,6 @@ import fooocus_version
from build_launcher import build_launcher
from modules.launch_util import is_installed, run, python, run_pip, requirements_met, delete_folder_content
from modules.model_loader import load_file_from_url
from tkinter_installer import install_tkinter
REINSTALL_ALL = False
TRY_INSTALL_XFORMERS = False

View File

@ -1299,8 +1299,7 @@ with shared.gradio_root:
outputs=[prompt, style_selections], show_progress=True, queue=True) \
.then(fn=style_sorter.sort_styles, inputs=style_selections, outputs=style_selections, queue=False, show_progress=False) \
.then(lambda: None, _js='()=>{refresh_style_localization();}')
with gr.Row():
perf_monitor = gr.HTML(load_page('templates/perf-monitor/index.html'))
api.http_server.addResourceMonitor()
def dump_default_english_config():