Skip to content

Commit

Permalink
chore: avoid error stop others
Browse files Browse the repository at this point in the history
  • Loading branch information
bluelovers committed Oct 19, 2024
1 parent ad5477d commit 9b643c0
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions sd_webui_pnginfo_injection/on_before_image_saved.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,14 @@ def _search_and_add_controlnet_hashes(res: dict, resource_hashes: dict):
if match:
value = json_loads(value)
if value:
data = parse_generation_parameters_extra(value)
if "Model" in data:
name, hash = find_hash_in_name(data["Model"])
if hash:
hashes_is_changed |= _add_to_resource_hashes(resource_hashes, f"controlnet:{name.strip()}", hash)
try:
data = parse_generation_parameters_extra(value)
if "Model" in data:
name, hash = find_hash_in_name(data["Model"])
if hash:
hashes_is_changed |= _add_to_resource_hashes(resource_hashes, f"controlnet:{name.strip()}", hash)
except Exception as e:
my_print("Error parsing", key, value, name, hash)

return hashes_is_changed

Expand Down

0 comments on commit 9b643c0

Please sign in to comment.