KarthikAI commited on
Commit
77aca21
·
verified ·
1 Parent(s): 8eb2a89

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -1
app.py CHANGED
@@ -63,4 +63,15 @@ async def generate(
63
  return JSONResponse(content={"error": str(e)}, status_code=500)
64
 
65
  # 21. Return the BLIP caption, the constructed prompt, and the generated image URL
66
- return {"caption": caption, "prompt": prompt, "image_url": image_url}
 
 
 
 
 
 
 
 
 
 
 
 
63
  return JSONResponse(content={"error": str(e)}, status_code=500)
64
 
65
  # 21. Return the BLIP caption, the constructed prompt, and the generated image URL
66
+ return {"caption": caption, "prompt": prompt, "image_url": image_url}
67
+
68
+ @app.get("/latest")
69
+ def get_latest():
70
+ if last_image_data["image_url"]:
71
+ return last_image_data
72
+ else:
73
+ return {"error": "No image generated yet."}
74
+
75
+ @app.get("/")
76
+ def root():
77
+ return {"status": "ok"}