Spaces:
Paused
Paused
P01yH3dr0n
commited on
Commit
•
39661d4
1
Parent(s):
e56790d
Update utils.py
Browse files
utils.py
CHANGED
@@ -2,6 +2,7 @@ import random
|
|
2 |
import io
|
3 |
import zipfile
|
4 |
import requests
|
|
|
5 |
|
6 |
from PIL import Image
|
7 |
|
@@ -82,9 +83,9 @@ def generate_novelai_image(
|
|
82 |
with zip_ref.open(file_names[0]) as file:
|
83 |
return file.read(), payload
|
84 |
else:
|
85 |
-
return "NAI doesn't return any images", response
|
86 |
else:
|
87 |
-
return "Generation failed", response
|
88 |
|
89 |
|
90 |
|
|
|
2 |
import io
|
3 |
import zipfile
|
4 |
import requests
|
5 |
+
import json
|
6 |
|
7 |
from PIL import Image
|
8 |
|
|
|
83 |
with zip_ref.open(file_names[0]) as file:
|
84 |
return file.read(), payload
|
85 |
else:
|
86 |
+
return "NAI doesn't return any images", json.loads(response.content)
|
87 |
else:
|
88 |
+
return "Generation failed", json.loads(response.content)
|
89 |
|
90 |
|
91 |
|