This commit is contained in:
lllyasviel 2023-08-13 07:10:26 -07:00 committed by GitHub
parent 8543bb5804
commit 2d71dca12c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 18 additions and 4 deletions

View File

@ -1 +1 @@
version = '1.0.22'
version = '1.0.23'

View File

@ -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, \

2
shared.py Normal file
View File

@ -0,0 +1,2 @@
gradio_root = None

View File

@ -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.

View File

@ -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)