Spaces:
Running
Running
Upload convert_url_to_diffusers_multi_gr.py
Browse files
convert_url_to_diffusers_multi_gr.py
CHANGED
@@ -311,7 +311,7 @@ def convert_url_to_diffusers(url: str, civitai_key: str="", is_upload_sf: bool=F
|
|
311 |
model_type = mtype
|
312 |
else:
|
313 |
new_file = get_download_file(temp_dir, url, civitai_key)
|
314 |
-
if not new_file: raise Exception(f"Safetensors file not found: {url}")
|
315 |
model_type = get_model_type_from_key(new_file)
|
316 |
new_dir = Path(new_file).stem.replace(" ", "_").replace(",", "_").replace(".", "_") #
|
317 |
|
|
|
311 |
model_type = mtype
|
312 |
else:
|
313 |
new_file = get_download_file(temp_dir, url, civitai_key)
|
314 |
+
if not new_file or Path(new_file).suffix not in set([".safetensors", ".ckpt", ".bin", ".sft"]): raise Exception(f"Safetensors file not found: {url}")
|
315 |
model_type = get_model_type_from_key(new_file)
|
316 |
new_dir = Path(new_file).stem.replace(" ", "_").replace(",", "_").replace(".", "_") #
|
317 |
|