tharms commited on
Commit
03a170c
·
1 Parent(s): b7b2451

reverted to API mode enabled and GPU

Browse files
modules/async_worker.py CHANGED
@@ -1,8 +1,5 @@
1
  import threading
2
  import re
3
- from modules.patch import PatchSettings, patch_settings, patch_all
4
-
5
- patch_all()
6
 
7
  class AsyncTask:
8
  def __init__(self, args):
@@ -15,10 +12,22 @@ class AsyncTask:
15
 
16
  async_tasks = []
17
 
 
 
 
 
 
 
 
 
18
 
19
  def worker():
20
  global async_tasks
21
 
 
 
 
 
22
  import os
23
  import traceback
24
  import math
 
1
  import threading
2
  import re
 
 
 
3
 
4
  class AsyncTask:
5
  def __init__(self, args):
 
12
 
13
  async_tasks = []
14
 
15
+ def ini_args():
16
+ from args_manager import args
17
+ return args
18
+
19
+ args = ini_args()
20
+ if not args.api_mode:
21
+ from modules.patch import PatchSettings, patch_settings, patch_all
22
+ patch_all()
23
 
24
  def worker():
25
  global async_tasks
26
 
27
+ if args.api_mode:
28
+ return
29
+
30
+ from modules.patch import PatchSettings, patch_settings, patch_all
31
  import os
32
  import traceback
33
  import math
modules/ui_gradio_extensions.py CHANGED
@@ -52,11 +52,6 @@ def css_html():
52
  head = f'<link rel="stylesheet" property="stylesheet" href="{style_css_path}">'
53
  return head
54
 
55
- def zStudiosHeader(power_device):
56
- logo_path = webpath('backstage.png')
57
- zHead = f"""<table><tr><td><img src="{logo_path}" width="36" height="36"/></td><td><font size="5">zStudios Generative Media AI running on {power_device}</font></td></tr></table>"""
58
- return zHead
59
-
60
 
61
  def reload_javascript():
62
  js = javascript_html()
 
52
  head = f'<link rel="stylesheet" property="stylesheet" href="{style_css_path}">'
53
  return head
54
 
 
 
 
 
 
55
 
56
  def reload_javascript():
57
  js = javascript_html()
webui.py CHANGED
@@ -21,7 +21,6 @@ import torch
21
  from modules.sdxl_styles import legal_style_names
22
  from modules.private_logger import get_current_html_path
23
  from modules.ui_gradio_extensions import reload_javascript
24
- from modules.ui_gradio_extensions import zStudiosHeader
25
  from modules.auth import auth_enabled, check_auth
26
  from modules.util import is_json
27
 
@@ -117,7 +116,7 @@ else:
117
  power_device = "CPU"
118
 
119
  with shared.gradio_root:
120
- gr.HTML(zStudiosHeader(power_device))
121
  with gr.Tab("DALL-E"):
122
  with gr.Row(variant="panel"):
123
  model = gr.Dropdown(choices=["dall-e-2", "dall-e-3"], label="Model", value="dall-e-3")
 
21
  from modules.sdxl_styles import legal_style_names
22
  from modules.private_logger import get_current_html_path
23
  from modules.ui_gradio_extensions import reload_javascript
 
24
  from modules.auth import auth_enabled, check_auth
25
  from modules.util import is_json
26
 
 
116
  power_device = "CPU"
117
 
118
  with shared.gradio_root:
119
+ gr.Markdown(f"""# <center>zStudios Generative Media AI running on {power_device}</center>""")
120
  with gr.Tab("DALL-E"):
121
  with gr.Row(variant="panel"):
122
  model = gr.Dropdown(choices=["dall-e-2", "dall-e-3"], label="Model", value="dall-e-3")