Implement distributed inference API server with FastAPI (#60)
* Implement distributed inference API server with FastAPI - Added a new file `api_server_dist.py` to handle video generation tasks using distributed inference. - Introduced endpoints for task submission, status checking, and result retrieval. - Implemented image downloading and task management with error handling. - Enhanced `infer.py` to ensure proper initialization of distributed processes. - Created a shell script `start_api_with_dist_inference.sh` for easy server startup with environment setup. This commit establishes a robust framework for managing video generation tasks in a distributed manner. * Enhance file download endpoint with path traversal protection and error handling * style: format * refactor: Enhance video generation functionality with task interruption support * feat: Add image upload and video generation endpoint with unique task handling - Introduced a new endpoint `/v1/local/video/generate_form` for video generation that accepts image uploads. - Implemented unique filename generation for uploaded images to prevent conflicts. - Enhanced directory management for input and output paths. - Improved file download response with detailed status and size information. - Added error handling for distributed inference processes and graceful shutdown procedures.
Showing
lightx2v/api_server_dist.py
0 → 100644
This diff is collapsed.
Please register or sign in to comment