mirror of
https://github.com/idrirap/ComfyUI-Lora-Auto-Trigger-Words.git
synced 2026-03-21 21:22:12 -03:00
fix: no longer crash when internet is unavailable
This commit is contained in:
5
utils.py
5
utils.py
@@ -83,8 +83,11 @@ def save_dict_to_json(data_dict, file_path):
|
|||||||
|
|
||||||
def get_model_version_info(hash_value):
|
def get_model_version_info(hash_value):
|
||||||
api_url = f"https://civitai.com/api/v1/model-versions/by-hash/{hash_value}"
|
api_url = f"https://civitai.com/api/v1/model-versions/by-hash/{hash_value}"
|
||||||
|
try:
|
||||||
response = requests.get(api_url)
|
response = requests.get(api_url)
|
||||||
|
except Exception as e:
|
||||||
|
print(f"[Lora-Auto-Trigger] {e}")
|
||||||
|
return None
|
||||||
if response.status_code == 200:
|
if response.status_code == 200:
|
||||||
return response.json()
|
return response.json()
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user