Update app.py
Browse files
app.py
CHANGED
@@ -131,7 +131,8 @@ Scene idea: {scene_idea}"""
|
|
131 |
try:
|
132 |
image_url = generate_image_hf(scene_idea, expanded_story)
|
133 |
except Exception as e:
|
134 |
-
|
|
|
135 |
|
136 |
creation_id = str(uuid.uuid4())
|
137 |
creation = Creation(
|
@@ -189,6 +190,7 @@ def generate_image_hf(scene_idea, story):
|
|
189 |
json={"inputs": prompt},
|
190 |
timeout=60
|
191 |
)
|
|
|
192 |
if res.status_code == 200:
|
193 |
import base64
|
194 |
return f"data:image/png;base64,{base64.b64encode(res.content).decode()}"
|
|
|
131 |
try:
|
132 |
image_url = generate_image_hf(scene_idea, expanded_story)
|
133 |
except Exception as e:
|
134 |
+
image_url = None
|
135 |
+
logging.error(f"image generation completely failed")
|
136 |
|
137 |
creation_id = str(uuid.uuid4())
|
138 |
creation = Creation(
|
|
|
190 |
json={"inputs": prompt},
|
191 |
timeout=60
|
192 |
)
|
193 |
+
logging.info(f"model: {model}, status:{res.status_code},response: {res.text[:300]}")
|
194 |
if res.status_code == 200:
|
195 |
import base64
|
196 |
return f"data:image/png;base64,{base64.b64encode(res.content).decode()}"
|