John6666 commited on
Commit
dfa3eb1
·
verified ·
1 Parent(s): ab41240

Upload 2 files

Browse files
Files changed (2) hide show
  1. dc.py +3 -4
  2. modutils.py +2 -2
dc.py CHANGED
@@ -178,7 +178,6 @@ UPSCALER_KEYS = list(UPSCALER_DICT_GUI.keys())
178
 
179
  def download_things(directory, url, hf_token="", civitai_api_key=""):
180
  url = url.strip()
181
-
182
  if "drive.google.com" in url:
183
  original_dir = os.getcwd()
184
  os.chdir(directory)
@@ -198,8 +197,8 @@ def download_things(directory, url, hf_token="", civitai_api_key=""):
198
  if "?" in url:
199
  url = url.split("?")[0]
200
  if civitai_api_key:
201
- url = url + f"?token={civitai_api_key}"
202
- os.system(f"aria2c --console-log-level=error --summary-interval=10 -c -x 16 -k 1M -s 16 -d {directory} {url}")
203
  else:
204
  print("\033[91mYou need an API key to download Civitai models.\033[0m")
205
  else:
@@ -680,7 +679,7 @@ class GuiSD:
680
  #progress(1, desc="Inference preparation completed. Starting inference...")
681
 
682
  info_state = "" # for yield version
683
- return self.infer_short(self.model, pipe_params, progress), info_state
684
  ## END MOD
685
 
686
  def dynamic_gpu_duration(func, duration, *args):
 
178
 
179
  def download_things(directory, url, hf_token="", civitai_api_key=""):
180
  url = url.strip()
 
181
  if "drive.google.com" in url:
182
  original_dir = os.getcwd()
183
  os.chdir(directory)
 
197
  if "?" in url:
198
  url = url.split("?")[0]
199
  if civitai_api_key:
200
+ user_header = f'"Authorization: Bearer {civitai_api_key}"'
201
+ os.system(f"aria2c --console-log-level=error --summary-interval=10 --header={user_header} -c -x 16 -k 1M -s 16 -d {directory} {url}")
202
  else:
203
  print("\033[91mYou need an API key to download Civitai models.\033[0m")
204
  else:
 
679
  #progress(1, desc="Inference preparation completed. Starting inference...")
680
 
681
  info_state = "" # for yield version
682
+ return self.infer_short(self.model, pipe_params), info_state
683
  ## END MOD
684
 
685
  def dynamic_gpu_duration(func, duration, *args):
modutils.py CHANGED
@@ -82,8 +82,8 @@ def download_things(directory, url, hf_token="", civitai_api_key=""):
82
  if "?" in url:
83
  url = url.split("?")[0]
84
  if civitai_api_key:
85
- url = url + f"?token={civitai_api_key}"
86
- os.system(f"aria2c --console-log-level=error --summary-interval=10 -c -x 16 -k 1M -s 16 -d {directory} {url}")
87
  else:
88
  print("\033[91mYou need an API key to download Civitai models.\033[0m")
89
  else:
 
82
  if "?" in url:
83
  url = url.split("?")[0]
84
  if civitai_api_key:
85
+ user_header = f'"Authorization: Bearer {civitai_api_key}"'
86
+ os.system(f"aria2c --console-log-level=error --summary-interval=10 --header={user_header} -c -x 16 -k 1M -s 16 -d {directory} {url}")
87
  else:
88
  print("\033[91mYou need an API key to download Civitai models.\033[0m")
89
  else: