Spaces:
Runtime error
Runtime error
cocktailpeanut
commited on
Commit
•
5ce2c5e
1
Parent(s):
9978cfd
update
Browse files
app.py
CHANGED
@@ -430,10 +430,11 @@ def get_civitai_safetensors(link):
|
|
430 |
if(x.status_code != 200):
|
431 |
raise Exception("Invalid CivitAI URL")
|
432 |
model_data = x.json()
|
433 |
-
if(model_data["nsfw"] == True or model_data["nsfwLevel"] > 2):
|
434 |
-
gr.Warning("The model is tagged by CivitAI as adult content and cannot be used in this shared environment.")
|
435 |
-
raise Exception("The model is tagged by CivitAI as adult content and cannot be used in this shared environment.")
|
436 |
-
elif(model_data["type"] != "LORA"):
|
|
|
437 |
gr.Warning("The model isn't tagged at CivitAI as a LoRA")
|
438 |
raise Exception("The model isn't tagged at CivitAI as a LoRA")
|
439 |
model_link_download = None
|
@@ -451,8 +452,9 @@ def get_civitai_safetensors(link):
|
|
451 |
file.write(safetensors_file_request.content)
|
452 |
trigger_word = model.get("trainedWords", [""])[0]
|
453 |
for image in model["images"]:
|
454 |
-
|
455 |
-
|
|
|
456 |
break
|
457 |
break
|
458 |
if(not model_link_download):
|
|
|
430 |
if(x.status_code != 200):
|
431 |
raise Exception("Invalid CivitAI URL")
|
432 |
model_data = x.json()
|
433 |
+
# if(model_data["nsfw"] == True or model_data["nsfwLevel"] > 2):
|
434 |
+
# gr.Warning("The model is tagged by CivitAI as adult content and cannot be used in this shared environment.")
|
435 |
+
# raise Exception("The model is tagged by CivitAI as adult content and cannot be used in this shared environment.")
|
436 |
+
# elif(model_data["type"] != "LORA"):
|
437 |
+
if(model_data["type"] != "LORA"):
|
438 |
gr.Warning("The model isn't tagged at CivitAI as a LoRA")
|
439 |
raise Exception("The model isn't tagged at CivitAI as a LoRA")
|
440 |
model_link_download = None
|
|
|
452 |
file.write(safetensors_file_request.content)
|
453 |
trigger_word = model.get("trainedWords", [""])[0]
|
454 |
for image in model["images"]:
|
455 |
+
image_url = image["url"]
|
456 |
+
# if(image["nsfwLevel"] == 1):
|
457 |
+
# image_url = image["url"]
|
458 |
break
|
459 |
break
|
460 |
if(not model_link_download):
|