Spaces:
Sleeping
Sleeping
| from fastapi import FastAPI, Form | |
| from fastapi.responses import StreamingResponse | |
| from PIL import Image, ImageDraw, ImageFont | |
| import io | |
| app = FastAPI() | |
| def greet_json(): | |
| return {"Hello": "World!"} | |
| async def get_image(filename: str): | |
| image_path = f"{filename}" | |
| if not os.path.exists(image_path): | |
| return {"error": "Image not found"} | |
| return FileResponse(image_path, media_type="image/jpeg", filename=filename) | |
| # Create a blank image | |