from fastapi import FastAPI from fastapi.responses import FileResponse app = FastAPI() @app.get("/") async def read_root(): # Assuming your PNG file is named "image.png" and is in the same directory as your script file_path = "pydvpl_banner.png" # Serve the image using FileResponse return FileResponse(file_path, media_type="image/png")