Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,7 +6,6 @@ import time
|
|
| 6 |
url = "https://nexra.aryahcr.cc/api/image/complements"
|
| 7 |
headers = {"Content-Type": "application/json"}
|
| 8 |
|
| 9 |
-
no_nsfw_image_path = "no_nsfw.png"
|
| 10 |
|
| 11 |
def generate_image(prompt, model):
|
| 12 |
data = {"prompt": prompt, "model": model}
|
|
@@ -15,9 +14,6 @@ def generate_image(prompt, model):
|
|
| 15 |
if response.status_code == 200:
|
| 16 |
response_data = response.json()
|
| 17 |
image_id = response_data.get("id")
|
| 18 |
-
|
| 19 |
-
if not image_id:
|
| 20 |
-
return no_nsfw_image_path
|
| 21 |
|
| 22 |
while True:
|
| 23 |
status_response = requests.get(f"{url}/{image_id}")
|
|
|
|
| 6 |
url = "https://nexra.aryahcr.cc/api/image/complements"
|
| 7 |
headers = {"Content-Type": "application/json"}
|
| 8 |
|
|
|
|
| 9 |
|
| 10 |
def generate_image(prompt, model):
|
| 11 |
data = {"prompt": prompt, "model": model}
|
|
|
|
| 14 |
if response.status_code == 200:
|
| 15 |
response_data = response.json()
|
| 16 |
image_id = response_data.get("id")
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
while True:
|
| 19 |
status_response = requests.get(f"{url}/{image_id}")
|