Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -166,7 +166,7 @@ async def generate_new_img(hex_code: str, prompt: str = Query(..., description="
|
|
| 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 |
|
| 169 |
-
if
|
| 170 |
# Create LOGO
|
| 171 |
print("Drawing")
|
| 172 |
#logo_width, logo_height = logo_image.size
|
|
@@ -219,11 +219,9 @@ async def create_ad_template(punchline: str, punchline_color:str, button_text:st
|
|
| 219 |
|
| 220 |
else:
|
| 221 |
color = (255, 0, 0) # This represents red
|
| 222 |
-
generated_image = Image.new("RGB", (
|
| 223 |
-
color = (0, 255, 0) # This represents red
|
| 224 |
-
uploaded_image_image = Image.new("RGB", (image_width, image_height), color)
|
| 225 |
color = (0, 0, 255) # This represents red
|
| 226 |
-
uploaded_logo = Image.new("RGB", (
|
| 227 |
# Create LOGO
|
| 228 |
print("Drawing newwww imagess........")
|
| 229 |
#logo_width, logo_height = logo_image.size
|
|
|
|
| 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 |
|
| 169 |
+
if uploaded_logo is not None and generated_image is not None:
|
| 170 |
# Create LOGO
|
| 171 |
print("Drawing")
|
| 172 |
#logo_width, logo_height = logo_image.size
|
|
|
|
| 219 |
|
| 220 |
else:
|
| 221 |
color = (255, 0, 0) # This represents red
|
| 222 |
+
generated_image = Image.new("RGB", (350, 350), color)
|
|
|
|
|
|
|
| 223 |
color = (0, 0, 255) # This represents red
|
| 224 |
+
uploaded_logo = Image.new("RGB", (100, 100), color)
|
| 225 |
# Create LOGO
|
| 226 |
print("Drawing newwww imagess........")
|
| 227 |
#logo_width, logo_height = logo_image.size
|