tomoya 7 months ago
parent
commit
d1766f0e33
1 changed files with 2 additions and 1 deletions
  1. 2 1
      backend/app/app/api/api_v1/endpoints/images.py

+ 2 - 1
backend/app/app/api/api_v1/endpoints/images.py

@@ -156,7 +156,8 @@ def get_image(
             add_sampling_metadata=True,
             api_name="/generate"
     )   
-    return FileResponse(result, background=background_tasks(remove_file, result))
+    background_tasks.add_task(remove_file, result)
+    return FileResponse(result, background=background_tasks)
 
 @router.websocket("/sr")
 async def websocket_endpoint(websocket: WebSocket):