John6666 commited on
Commit
e164e63
1 Parent(s): 2cfc39b

Upload 5 files

Browse files
Files changed (3) hide show
  1. env.py +1 -0
  2. flux.py +2 -3
  3. modutils.py +3 -4
env.py CHANGED
@@ -45,6 +45,7 @@ models = [
45
  "John6666/nsfw-master-flux-lora-merged-with-flux1-dev-fp16-v10-fp8-flux",
46
  "John6666/the-araminta-flux1a1-fp8-flux",
47
  "John6666/acorn-is-spinning-flux-v11-fp8-flux",
 
48
  "John6666/real-horny-pro-fp8-flux",
49
  "John6666/centerfold-flux-v20fp8e5m2-fp8-flux",
50
  "John6666/jib-mix-flux-v208stephyper-fp8-flux",
 
45
  "John6666/nsfw-master-flux-lora-merged-with-flux1-dev-fp16-v10-fp8-flux",
46
  "John6666/the-araminta-flux1a1-fp8-flux",
47
  "John6666/acorn-is-spinning-flux-v11-fp8-flux",
48
+ "John6666/stoiqo-afrodite-fluxxl-f1dalpha-fp8-flux",
49
  "John6666/real-horny-pro-fp8-flux",
50
  "John6666/centerfold-flux-v20fp8e5m2-fp8-flux",
51
  "John6666/jib-mix-flux-v208stephyper-fp8-flux",
flux.py CHANGED
@@ -24,7 +24,6 @@ from modutils import (to_list, list_uniq, list_sub, get_lora_model_list, downloa
24
 
25
  def download_things(directory, url, hf_token="", civitai_api_key=""):
26
  url = url.strip()
27
-
28
  if "drive.google.com" in url:
29
  original_dir = os.getcwd()
30
  os.chdir(directory)
@@ -44,8 +43,8 @@ def download_things(directory, url, hf_token="", civitai_api_key=""):
44
  if "?" in url:
45
  url = url.split("?")[0]
46
  if civitai_api_key:
47
- url = url + f"?token={civitai_api_key}"
48
- os.system(f"aria2c --console-log-level=error --summary-interval=10 -c -x 16 -k 1M -s 16 -d {directory} {url}")
49
  else:
50
  print("\033[91mYou need an API key to download Civitai models.\033[0m")
51
  else:
 
24
 
25
  def download_things(directory, url, hf_token="", civitai_api_key=""):
26
  url = url.strip()
 
27
  if "drive.google.com" in url:
28
  original_dir = os.getcwd()
29
  os.chdir(directory)
 
43
  if "?" in url:
44
  url = url.split("?")[0]
45
  if civitai_api_key:
46
+ user_header = f'"Authorization: Bearer {civitai_api_key}"'
47
+ os.system(f"aria2c --console-log-level=error --summary-interval=10 --header={user_header} -c -x 16 -k 1M -s 16 -d {directory} {url}")
48
  else:
49
  print("\033[91mYou need an API key to download Civitai models.\033[0m")
50
  else:
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:
@@ -120,7 +120,7 @@ def save_images(images: list[Image.Image], metadatas: list[str]):
120
  output_images = []
121
  for image, metadata in zip(images, metadatas):
122
  info = PngImagePlugin.PngInfo()
123
- info.add_text("metadata", metadata)
124
  savefile = f"{str(uuid.uuid4())}.png"
125
  image.save(savefile, "PNG", pnginfo=info)
126
  output_images.append(str(Path(savefile).resolve()))
@@ -802,7 +802,6 @@ def search_lora_on_civitai(query: str, allow_model: list[str] = ["Pony", "SDXL 1
802
  import requests
803
  from requests.adapters import HTTPAdapter
804
  from urllib3.util import Retry
805
-
806
  user_agent = get_user_agent()
807
  headers = {'User-Agent': user_agent, 'content-type': 'application/json'}
808
  base_url = 'https://civitai.com/api/v1/models'
 
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:
 
120
  output_images = []
121
  for image, metadata in zip(images, metadatas):
122
  info = PngImagePlugin.PngInfo()
123
+ info.add_text("parameters", metadata)
124
  savefile = f"{str(uuid.uuid4())}.png"
125
  image.save(savefile, "PNG", pnginfo=info)
126
  output_images.append(str(Path(savefile).resolve()))
 
802
  import requests
803
  from requests.adapters import HTTPAdapter
804
  from urllib3.util import Retry
 
805
  user_agent = get_user_agent()
806
  headers = {'User-Agent': user_agent, 'content-type': 'application/json'}
807
  base_url = 'https://civitai.com/api/v1/models'