r3gm commited on
Commit
578d708
·
verified ·
1 Parent(s): 0c60a8e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -429,10 +429,10 @@ class GuiSD:
429
  else:
430
  url_upscaler = UPSCALER_DICT_GUI[upscaler_model_path]
431
 
432
- if not os.path.exists(f"./upscalers/{url_upscaler.split('/')[-1]}"):
433
  download_things(DIRECTORY_UPSCALERS, url_upscaler, HF_TOKEN)
434
 
435
- upscaler_model = f"./upscalers/{url_upscaler.split('/')[-1]}"
436
 
437
  logging.getLogger("ultralytics").setLevel(logging.INFO if adetailer_verbose else logging.ERROR)
438
 
@@ -712,10 +712,12 @@ def process_upscale(image, upscaler_name, upscaler_size):
712
  name_upscaler = UPSCALER_DICT_GUI[upscaler_name]
713
 
714
  if "https://" in str(name_upscaler):
715
- name_upscaler = f"./upscalers/{name_upscaler.split('/')[-1]}"
716
- if not os.path.exists(name_upscaler):
717
  download_things(DIRECTORY_UPSCALERS, name_upscaler, HF_TOKEN)
718
 
 
 
719
  scaler_beta = load_upscaler_model(model=name_upscaler, tile=0, tile_overlap=8, device="cuda", half=True)
720
  image_up = scaler_beta.upscale(image, upscaler_size, True)
721
 
 
429
  else:
430
  url_upscaler = UPSCALER_DICT_GUI[upscaler_model_path]
431
 
432
+ if not os.path.exists(f"./{DIRECTORY_UPSCALERS}/{url_upscaler.split('/')[-1]}"):
433
  download_things(DIRECTORY_UPSCALERS, url_upscaler, HF_TOKEN)
434
 
435
+ upscaler_model = f"./{DIRECTORY_UPSCALERS}/{url_upscaler.split('/')[-1]}"
436
 
437
  logging.getLogger("ultralytics").setLevel(logging.INFO if adetailer_verbose else logging.ERROR)
438
 
 
712
  name_upscaler = UPSCALER_DICT_GUI[upscaler_name]
713
 
714
  if "https://" in str(name_upscaler):
715
+
716
+ if not os.path.exists(f"./{DIRECTORY_UPSCALERS}/{name_upscaler.split('/')[-1]}"):
717
  download_things(DIRECTORY_UPSCALERS, name_upscaler, HF_TOKEN)
718
 
719
+ name_upscaler = f"./{DIRECTORY_UPSCALERS}/{name_upscaler.split('/')[-1]}"
720
+
721
  scaler_beta = load_upscaler_model(model=name_upscaler, tile=0, tile_overlap=8, device="cuda", half=True)
722
  image_up = scaler_beta.upscale(image, upscaler_size, True)
723