Skip to content

Commit

Permalink
ci: auto update Billions_of_Wildcards
Browse files Browse the repository at this point in the history
  • Loading branch information
bluelovers committed Sep 28, 2024
1 parent bc8335d commit 1973ea3
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion .dev/update-hashes.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,11 @@ def get_model_hashes(id: str | int, api_key: str = None):
def update_bundle_hashes(api_key: str = None):
C0rn_Fl4k3s = get_model_hashes(481009, api_key)
lazy_wildcards = get_model_hashes(449400, api_key)
Billions_of_Wildcards = get_model_hashes(138970, api_key)

bundle_hashes_file = "./sd_webui_pnginfo_injection/bundle_hashes.py"

if C0rn_Fl4k3s or lazy_wildcards:
if C0rn_Fl4k3s or lazy_wildcards or Billions_of_Wildcards:
with open(bundle_hashes_file, "r") as file:
lines = file.readlines()

Expand All @@ -63,6 +64,13 @@ def update_bundle_hashes(api_key: str = None):
lines[i] = f' {hashes_name} = "{auto_v2_hash}"\n'
print(f"Updated {hashes_name} value to {auto_v2_hash} in {bundle_hashes_file}")

if Billions_of_Wildcards:
hashes_name = 'Billions_of_Wildcards'
auto_v2_hash = Billions_of_Wildcards
if hashes_name in line:
lines[i] = f' {hashes_name} = "{auto_v2_hash}"\n'
print(f"Updated {hashes_name} value to {auto_v2_hash} in {bundle_hashes_file}")

with open(bundle_hashes_file, "w", newline='\n') as file:
file.writelines(lines)

Expand Down

0 comments on commit 1973ea3

Please sign in to comment.