Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -71,7 +71,7 @@ async def upload_image(image_file:UploadFile):
|
|
| 71 |
image_bytes = await image_file.read()
|
| 72 |
uploaded_image = Image.open(io.BytesIO(image_bytes)).convert("RGB")
|
| 73 |
|
| 74 |
-
return JSONResponse(content={"message": "
|
| 75 |
|
| 76 |
@app.get("/get_image")
|
| 77 |
async def get_image(response_class=StreamingResponse):
|
|
@@ -165,7 +165,7 @@ async def generate_new_img(hex_code: str, prompt: str = Query(..., description="
|
|
| 165 |
|
| 166 |
@app.get("/create_ad_template",response_class=StreamingResponse)
|
| 167 |
async def create_ad_template(punchline: str, punchline_color:str, button_text:str,button_color:str):
|
| 168 |
-
if uploaded_image is not None and uploaded_logo is not None and
|
| 169 |
# Create LOGO
|
| 170 |
print("Drawing")
|
| 171 |
#logo_width, logo_height = logo_image.size
|
|
|
|
| 71 |
image_bytes = await image_file.read()
|
| 72 |
uploaded_image = Image.open(io.BytesIO(image_bytes)).convert("RGB")
|
| 73 |
|
| 74 |
+
return JSONResponse(content={"message": "Image uploaded successfully"})
|
| 75 |
|
| 76 |
@app.get("/get_image")
|
| 77 |
async def get_image(response_class=StreamingResponse):
|
|
|
|
| 165 |
|
| 166 |
@app.get("/create_ad_template",response_class=StreamingResponse)
|
| 167 |
async def create_ad_template(punchline: str, punchline_color:str, button_text:str,button_color:str):
|
| 168 |
+
if uploaded_image is not None and uploaded_logo is not None and generated_image is not None:
|
| 169 |
# Create LOGO
|
| 170 |
print("Drawing")
|
| 171 |
#logo_width, logo_height = logo_image.size
|