Using the python module fastAPI, I can\'t figure out how to return an image. In flask I would do something like this:
@app.route(\"/vector_image\", methods=[
You can do something very similar in FastAPI
from fastapi import FastAPI, Response app = FastAPI() @app.post("/vector_image/") async def image_endpoint(): # img = ... # Create the image here return Response(content=img, media_type="image/png")