zerhero commited on
Commit
dbf53c9
1 Parent(s): 169b607

fix spaces issue

Browse files
Files changed (1) hide show
  1. app.py +25 -7
app.py CHANGED
@@ -1,3 +1,4 @@
 
1
  import os
2
  from stablepy import Model_Diffusers
3
  from stablepy.diffusers_vanilla.style_prompt_config import STYLE_NAMES
@@ -34,9 +35,6 @@ from examples.examples import example_prompts
34
  from utils.download_utils import download_things
35
  from utils.model_utils import get_model_list
36
 
37
-
38
- # from utils.string_utils import process_string
39
-
40
  preprocessor_controlnet = {
41
  "openpose": [
42
  "Openpose",
@@ -136,6 +134,7 @@ for url in [url.strip() for url in download_model.split(',')]:
136
  hf_token,
137
  CIVITAI_API_KEY
138
  )
 
139
  for url in [url.strip() for url in download_vae.split(',')]:
140
  if not os.path.exists(f"./vaes/{url.split('/')[-1]}"):
141
  download_things(
@@ -144,6 +143,7 @@ for url in [url.strip() for url in download_vae.split(',')]:
144
  hf_token,
145
  CIVITAI_API_KEY
146
  )
 
147
  for url in [url.strip() for url in download_lora.split(',')]:
148
  if not os.path.exists(f"./loras/{url.split('/')[-1]}"):
149
  download_things(
@@ -193,6 +193,7 @@ def get_my_lora(link_url):
193
  hf_token,
194
  CIVITAI_API_KEY
195
  )
 
196
  new_lora_model_list = get_model_list(directory_loras)
197
  new_lora_model_list.insert(0, "None")
198
 
@@ -211,6 +212,7 @@ def get_my_lora(link_url):
211
 
212
  print('\033[33m🏁 Download and listing of valid models completed.\033[0m')
213
 
 
214
  def extract_parameters(input_string):
215
  parameters = {}
216
  input_string = input_string.replace("\n", "")
@@ -268,9 +270,21 @@ import diffusers
268
  diffusers.utils.logging.set_verbosity(40)
269
  import warnings
270
 
271
- warnings.filterwarnings(action="ignore", category=FutureWarning, module="diffusers")
272
- warnings.filterwarnings(action="ignore", category=UserWarning, module="diffusers")
273
- warnings.filterwarnings(action="ignore", category=FutureWarning, module="transformers")
 
 
 
 
 
 
 
 
 
 
 
 
274
  from stablepy import logger
275
 
276
  logger.setLevel(logging.DEBUG)
@@ -519,7 +533,11 @@ class GuiSD:
519
  url_upscaler = upscaler_dict_gui[upscaler_model_path]
520
 
521
  if not os.path.exists(f"./upscalers/{url_upscaler.split('/')[-1]}"):
522
- download_things(directory_upscalers, url_upscaler, hf_token)
 
 
 
 
523
 
524
  upscaler_model = f"./upscalers/{url_upscaler.split('/')[-1]}"
525
 
 
1
+ import spaces
2
  import os
3
  from stablepy import Model_Diffusers
4
  from stablepy.diffusers_vanilla.style_prompt_config import STYLE_NAMES
 
35
  from utils.download_utils import download_things
36
  from utils.model_utils import get_model_list
37
 
 
 
 
38
  preprocessor_controlnet = {
39
  "openpose": [
40
  "Openpose",
 
134
  hf_token,
135
  CIVITAI_API_KEY
136
  )
137
+
138
  for url in [url.strip() for url in download_vae.split(',')]:
139
  if not os.path.exists(f"./vaes/{url.split('/')[-1]}"):
140
  download_things(
 
143
  hf_token,
144
  CIVITAI_API_KEY
145
  )
146
+
147
  for url in [url.strip() for url in download_lora.split(',')]:
148
  if not os.path.exists(f"./loras/{url.split('/')[-1]}"):
149
  download_things(
 
193
  hf_token,
194
  CIVITAI_API_KEY
195
  )
196
+
197
  new_lora_model_list = get_model_list(directory_loras)
198
  new_lora_model_list.insert(0, "None")
199
 
 
212
 
213
  print('\033[33m🏁 Download and listing of valid models completed.\033[0m')
214
 
215
+
216
  def extract_parameters(input_string):
217
  parameters = {}
218
  input_string = input_string.replace("\n", "")
 
270
  diffusers.utils.logging.set_verbosity(40)
271
  import warnings
272
 
273
+ warnings.filterwarnings(
274
+ action="ignore",
275
+ category=FutureWarning,
276
+ module="diffusers"
277
+ )
278
+ warnings.filterwarnings(
279
+ action="ignore",
280
+ category=UserWarning,
281
+ module="diffusers"
282
+ )
283
+ warnings.filterwarnings(
284
+ action="ignore",
285
+ category=FutureWarning,
286
+ module="transformers"
287
+ )
288
  from stablepy import logger
289
 
290
  logger.setLevel(logging.DEBUG)
 
533
  url_upscaler = upscaler_dict_gui[upscaler_model_path]
534
 
535
  if not os.path.exists(f"./upscalers/{url_upscaler.split('/')[-1]}"):
536
+ download_things(
537
+ directory_upscalers,
538
+ url_upscaler,
539
+ hf_token
540
+ )
541
 
542
  upscaler_model = f"./upscalers/{url_upscaler.split('/')[-1]}"
543