huggingface / api-inference-community

Apache License 2.0
161 stars 61 forks source link

[Bug] Multiple Image Outputs are returned in a single byte buffer #418

Open StephenHodgson opened 5 months ago

StephenHodgson commented 5 months ago

Currently if you are attempting to return multiple image outputs from a pipeline task, all of the image data is crammed into a single binary response, which makes it almost impossible to decode and consume.

Ideally we should be returning multiple images like how we return multiple audio files, as json with each blob as image encoded to base64 string.

https://github.com/huggingface/api-inference-community/blob/9748c07fcb5f89f0e1f234ac530736bc2f713d97/api_inference_community/routes.py#L140-L152