-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add image upload and delete endpoints in server.py #6277
base: master
Are you sure you want to change the base?
Conversation
Add image upload and delete endpoints in server.py ### Description This pull request introduces new endpoints in `server.py` for uploading images in byte stream format and for deleting files. ### Changes Made - Added an endpoint for uploading images: `POST /upload/image_stream` - Added an endpoint for deleting files: `DELETE /delete-file` ### Notes Please review the changes and let me know if any modifications are needed.
I believe that functions like “delete file” should only be permitted through an extension and should not exist as a core endpoint. |
@ltdrdata I thought it would be necessary to have a feature to use and remove images uploaded when using the API, so I created it. I guess I need to remake it as an extension. For now, I will exclude this part and try to submit the PR again. Thank you for the good suggestion. |
What is the reason for trying to send via byte stream instead of websocket? https://github.com/comfyanonymous/ComfyUI/blob/master/custom_nodes/websocket_image_save.py |
In the project I am working on, multiple users need to receive results through the Image-text-to-Image process, and they have to upload different images each time. Since users upload images and execute workflows only when needed, I believe there is no reason to bear the overhead of WebSocket connections. Therefore, using a byte stream can be more efficient for handling the frequent and varied image uploads, as it allows for simpler and potentially faster data transmission without the overhead of maintaining a WebSocket connection. |
Description
This pull request introduces new endpoints in
server.py
for uploading images in byte stream format and for deleting files.Changes Made
POST /upload/image_stream
DELETE /delete-file
Notes
Please review the changes and let me know if any modifications are needed.