Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -44,7 +44,11 @@ def generate_image_and_upload(prompt: str) -> str:
|
|
44 |
return upload_to_chevereto(img_path) # Upload and return URL
|
45 |
else:
|
46 |
return "Error: Model did not return a valid image"
|
47 |
-
|
|
|
|
|
|
|
|
|
48 |
@app.route("/generate", methods=["POST"])
|
49 |
def generate():
|
50 |
"""API Endpoint: Generate an image from a text prompt and upload it."""
|
|
|
44 |
return upload_to_chevereto(img_path) # Upload and return URL
|
45 |
else:
|
46 |
return "Error: Model did not return a valid image"
|
47 |
+
@app.route("/", methods=["GET"])
|
48 |
+
def index():
|
49 |
+
"""Renders the Star Trek-themed UI."""
|
50 |
+
return render_template("index.html")
|
51 |
+
|
52 |
@app.route("/generate", methods=["POST"])
|
53 |
def generate():
|
54 |
"""API Endpoint: Generate an image from a text prompt and upload it."""
|