Commit
·
5d3a553
1
Parent(s):
bfa3982
Upload web-ui.py
Browse files
web-ui.py
CHANGED
@@ -174,21 +174,23 @@ with gr.Blocks() as demo:
|
|
174 |
outputs=[output_gallery, output_text, display_seed],
|
175 |
)
|
176 |
|
|
|
|
|
|
|
177 |
def start_ngrok():
|
178 |
# Set the correct port here. By default, Gradio uses 7860, but it might be different in your setup
|
179 |
gradio_port = 7860
|
180 |
ngrok.set_auth_token(args.ngrok_token)
|
181 |
public_url = ngrok.connect(gradio_port)
|
182 |
print(f"Public URL: {public_url}")
|
183 |
-
|
184 |
-
|
185 |
if __name__ == "__main__":
|
186 |
# Launch the Gradio app in a separate thread
|
187 |
-
threading.Thread(target=
|
188 |
|
189 |
# Give Gradio a few seconds to start up
|
190 |
-
time.sleep(
|
191 |
|
192 |
# Start ngrok
|
193 |
if args.ngrok_token:
|
194 |
-
start_ngrok()
|
|
|
174 |
outputs=[output_gallery, output_text, display_seed],
|
175 |
)
|
176 |
|
177 |
+
def start_gradio():
|
178 |
+
demo.launch(share=args.share, inbrowser=True)
|
179 |
+
|
180 |
def start_ngrok():
|
181 |
# Set the correct port here. By default, Gradio uses 7860, but it might be different in your setup
|
182 |
gradio_port = 7860
|
183 |
ngrok.set_auth_token(args.ngrok_token)
|
184 |
public_url = ngrok.connect(gradio_port)
|
185 |
print(f"Public URL: {public_url}")
|
186 |
+
|
|
|
187 |
if __name__ == "__main__":
|
188 |
# Launch the Gradio app in a separate thread
|
189 |
+
threading.Thread(target=start_gradio).start()
|
190 |
|
191 |
# Give Gradio a few seconds to start up
|
192 |
+
time.sleep(15) # Adjust the sleep time if necessary
|
193 |
|
194 |
# Start ngrok
|
195 |
if args.ngrok_token:
|
196 |
+
start_ngrok()
|