Spaces:
Runtime error
Runtime error
Commit
·
d6e88b2
1
Parent(s):
7c8e9f9
Update app.py
Browse files
app.py
CHANGED
@@ -244,6 +244,54 @@ def generate_image(prompt):
|
|
244 |
"https://img.freepik.com/free-photo/3d-view-planet-earth_23-2150499242.jpg?size=626&ext=jpg"
|
245 |
]
|
246 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
247 |
|
248 |
if "face" in prompt:
|
249 |
output_url = random.choice(faces)
|
@@ -301,6 +349,18 @@ def generate_image(prompt):
|
|
301 |
output_url = random.choice(rain)
|
302 |
elif "future" in prompt:
|
303 |
output_url = random.choice(future)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
304 |
else:
|
305 |
return "No image generated."
|
306 |
image = load_image(output_url)
|
|
|
244 |
"https://img.freepik.com/free-photo/3d-view-planet-earth_23-2150499242.jpg?size=626&ext=jpg"
|
245 |
]
|
246 |
|
247 |
+
beach = [
|
248 |
+
"https://img.freepik.com/free-photo/beautiful_1203-2633.jpg?size=626&ext=jpg&ga=GA1.1.1708812069.1697374121&semt=sph",
|
249 |
+
"https://img.freepik.com/free-photo/beautiful-tropical-beach-sea-ocean-with-white-cloud-blue-sky-copyspace_74190-8663.jpg?size=626&ext=jpg&ga=GA1.1.1708812069.1697374121&semt=sph",
|
250 |
+
"https://img.freepik.com/free-photo/umbrella-chair-with-pillow-around-beautiful-landscape-beach-sea_74190-8173.jpg?size=626&ext=jpg&ga=GA1.1.1708812069.1697374121&semt=sph",
|
251 |
+
"https://img.freepik.com/free-photo/empty-sea-beach-background_74190-313.jpg?size=626&ext=jpg&ga=GA1.1.1708812069.1697374121&semt=sph",
|
252 |
+
"https://img.freepik.com/free-photo/tropical-beach_74190-188.jpg?size=626&ext=jpg&ga=GA1.1.1708812069.1697374121&semt=sph"
|
253 |
+
]
|
254 |
+
|
255 |
+
sun = [
|
256 |
+
"https://img.freepik.com/free-vector/sparkling-sunrise-light-effect_52683-30445.jpg?size=626&ext=jpg&ga=GA1.2.1708812069.1697374121&semt=sph",
|
257 |
+
"https://img.freepik.com/free-photo/view-blue-sky-cloud-nature-background_1150-27443.jpg?size=626&ext=jpg&ga=GA1.1.1708812069.1697374121&semt=sph",
|
258 |
+
"https://img.freepik.com/free-vector/realistic-sun-element-vector-gray-background_53876-118580.jpg?size=626&ext=jpg&ga=GA1.1.1708812069.1697374121&semt=sph",
|
259 |
+
"https://img.freepik.com/free-vector/gradient-summer-heat-background_23-2149423259.jpg?size=626&ext=jpg&ga=GA1.1.1708812069.1697374121&semt=sph",
|
260 |
+
"https://img.freepik.com/free-psd/natural-light-lens-flare-psd-gold-background-sun-ray-effect_53876-140441.jpg?size=626&ext=jpg&ga=GA1.1.1708812069.1697374121&semt=sph"
|
261 |
+
]
|
262 |
+
|
263 |
+
bread = [
|
264 |
+
"https://img.freepik.com/free-photo/bread-crust-assortment-pastry_23-2148359129.jpg?size=626&ext=jpg&ga=GA1.2.1708812069.1697374121&semt=sph",
|
265 |
+
"https://img.freepik.com/free-photo/delicious-bread-towel_23-2148544723.jpg?size=626&ext=jpg&ga=GA1.2.1708812069.1697374121&semt=sph",
|
266 |
+
"https://img.freepik.com/free-photo/different-kinds-fresh-bread-as-background-top-view_114579-8017.jpg?size=626&ext=jpg&ga=GA1.2.1708812069.1697374121&semt=sph",
|
267 |
+
"https://img.freepik.com/free-photo/organic-whole-grain-baguette-placed-linen-fabric_140725-5042.jpg?size=626&ext=jpg&ga=GA1.2.1708812069.1697374121&semt=sph",
|
268 |
+
"https://img.freepik.com/free-photo/different-types-bread-made-from-wheat-flour_140725-5648.jpg?size=626&ext=jpg&ga=GA1.2.1708812069.1697374121&semt=sph"
|
269 |
+
]
|
270 |
+
|
271 |
+
fontain = [
|
272 |
+
"https://img.freepik.com/free-photo/fountain-gabriel-miro-square-alicante_1268-22029.jpg?size=626&ext=jpg&ga=GA1.1.1708812069.1697374121&semt=sph",
|
273 |
+
"https://img.freepik.com/free-photo/world-war-ii-memorial-washington-dc_649448-809.jpg?size=626&ext=jpg&ga=GA1.1.1708812069.1697374121&semt=sph",
|
274 |
+
"https://img.freepik.com/free-photo/chicago-skyline-with-buckingham-fountain_649448-759.jpg?size=626&ext=jpg&ga=GA1.1.1708812069.1697374121&semt=sph",
|
275 |
+
"https://img.freepik.com/free-photo/fountains-bridge-manzanares-river_1398-3626.jpg?size=626&ext=jpg&ga=GA1.1.1708812069.1697374121&semt=sph",
|
276 |
+
"https://img.freepik.com/free-photo/shanghai-people-s-square_649448-3873.jpg?size=626&ext=jpg&ga=GA1.1.1708812069.1697374121&semt=sph"
|
277 |
+
]
|
278 |
+
|
279 |
+
tree = [
|
280 |
+
"https://img.freepik.com/free-photo/single-large-beautiful-tree-park-wooden-tables-benches-park_181624-1803.jpg?size=626&ext=jpg&ga=GA1.1.1708812069.1697374121&semt=sph",
|
281 |
+
"https://img.freepik.com/free-photo/beautiful-view-white-building-middle-trees-forest-cloudy-sky_181624-27439.jpg?size=626&ext=jpg&ga=GA1.1.1708812069.1697374121&semt=sph",
|
282 |
+
"https://img.freepik.com/free-photo/wide-angle-shot-single-tree-growing-clouded-sky-during-sunset-surrounded-by-grass_181624-22807.jpg?size=626&ext=jpg&ga=GA1.1.1708812069.1697374121&semt=sph",
|
283 |
+
"https://img.freepik.com/free-photo/3d-countryside-landscape-with-tree-against-blue-sky_1048-11883.jpg?size=626&ext=jpg&ga=GA1.1.1708812069.1697374121&semt=sph",
|
284 |
+
"https://img.freepik.com/free-photo/forest-covered-greenery-sunlight-madeira-portugal_181624-12464.jpg?size=626&ext=jpg&ga=GA1.1.1708812069.1697374121&semt=sph"
|
285 |
+
]
|
286 |
+
|
287 |
+
palmtree = [
|
288 |
+
"https://img.freepik.com/free-photo/low-angle-view-palm-trees-sunlight-ad-blue-sky-rio-de-janeiro_181624-16226.jpg?size=626&ext=jpg&ga=GA1.1.1708812069.1697374121&semt=ais",
|
289 |
+
"https://img.freepik.com/free-photo/low-angle-shot-coconut-trees-against-blue-sky-with-sun-shining-through-trees_181624-15750.jpg?size=626&ext=jpg&ga=GA1.1.1708812069.1697374121&semt=ais",
|
290 |
+
"https://img.freepik.com/free-photo/low-angle-shot-palm-trees-blue-cloudy-sky_181624-46408.jpg?size=626&ext=jpg&ga=GA1.1.1708812069.1697374121&semt=ais",
|
291 |
+
"https://img.freepik.com/premium-photo/coconut-palm-tree-beach-thailand-coconut-tree-with-blur-sky_34142-182.jpg?size=626&ext=jpg&ga=GA1.1.1708812069.1697374121&semt=ais",
|
292 |
+
"https://img.freepik.com/free-photo/tropical-beach_74190-188.jpg?size=626&ext=jpg&ga=GA1.1.1708812069.1697374121&semt=ais"
|
293 |
+
]
|
294 |
+
|
295 |
|
296 |
if "face" in prompt:
|
297 |
output_url = random.choice(faces)
|
|
|
349 |
output_url = random.choice(rain)
|
350 |
elif "future" in prompt:
|
351 |
output_url = random.choice(future)
|
352 |
+
elif "beach" in prompt:
|
353 |
+
output_url = random.choice(beach)
|
354 |
+
elif "sun" in prompt:
|
355 |
+
output_url = random.choice(sun)
|
356 |
+
elif "bread" in prompt:
|
357 |
+
output_url = random.choice(bread)
|
358 |
+
elif "fountain" in prompt:
|
359 |
+
output_url = random.choice(fontain)
|
360 |
+
elif "tree" in prompt:
|
361 |
+
output_url = random.choice(tree)
|
362 |
+
elif "palm tree" in prompt:
|
363 |
+
output_url = random.choice(palmtree)
|
364 |
else:
|
365 |
return "No image generated."
|
366 |
image = load_image(output_url)
|