diff --git a/fooocus_version.py b/fooocus_version.py index 4069ac12..b653960e 100644 --- a/fooocus_version.py +++ b/fooocus_version.py @@ -1 +1 @@ -version = '1.0.22' +version = '1.0.23' diff --git a/modules/async_worker.py b/modules/async_worker.py index 17cb14d8..61ab4984 100644 --- a/modules/async_worker.py +++ b/modules/async_worker.py @@ -10,6 +10,7 @@ def worker(): import os import time + import shared import random import modules.default_pipeline as pipeline import modules.path @@ -18,6 +19,12 @@ def worker(): from modules.sdxl_styles import apply_style, aspect_ratios from modules.util import generate_temp_filename + try: + async_gradio_app = shared.gradio_root + print(f'''App started successful. Use the app with {str(async_gradio_app.local_url)} or {str(async_gradio_app.server_name)}:{str(async_gradio_app.server_port)}''') + except Exception as e: + print(e) + def handler(task): prompt, negative_prompt, style_selction, performance_selction, \ aspect_ratios_selction, image_number, image_seed, base_model_name, refiner_model_name, \ diff --git a/shared.py b/shared.py new file mode 100644 index 00000000..d61d61fc --- /dev/null +++ b/shared.py @@ -0,0 +1,2 @@ +gradio_root = None + diff --git a/update_log.md b/update_log.md index cb874b92..5f2d9e59 100644 --- a/update_log.md +++ b/update_log.md @@ -1,3 +1,7 @@ +### 1.0.23 + +* Added some hints on linux after UI start so users know the App does not fail. + ### 1.0.20 * Support linux. diff --git a/webui.py b/webui.py index a1e90c0d..17af82f5 100644 --- a/webui.py +++ b/webui.py @@ -1,6 +1,7 @@ import gradio as gr import sys import time +import shared import modules.path import fooocus_version import modules.html @@ -37,8 +38,8 @@ def generate_clicked(*args): return -block = gr.Blocks(title='Fooocus ' + fooocus_version.version, css=modules.html.css).queue() -with block: +shared.gradio_root = gr.Blocks(title='Fooocus ' + fooocus_version.version, css=modules.html.css).queue() +with shared.gradio_root: with gr.Row(): with gr.Column(): progress_window = gr.Image(label='Preview', show_label=True, height=640, visible=False) @@ -93,4 +94,4 @@ with block: ctrls += [base_model, refiner_model] + lora_ctrls run_button.click(fn=generate_clicked, inputs=ctrls, outputs=[run_button, progress_html, progress_window, gallery]) -block.launch(inbrowser=True, server_name='0.0.0.0' if '--listen' in sys.argv else None) +shared.gradio_root.launch(inbrowser=True, server_name='0.0.0.0' if '--listen' in sys.argv else None)