stable-diffusion-webui
stable-diffusion-webui copied to clipboard
return-gif
Enable the returned images to support animated formats, such as GIF and WebP.
Wait... isn't there a webp option on line 118 below?
The purpose of this PR is to enable AnimateDiff to respond a video via API. I'm not aware of any way that pillow can process mp4, so maybe we use another way - when a image is already a binary, we directly return; otherwise, process normally. I can take the responsibility of encoding it to b64 bytes.
Well, two lines directly above added ones:
if isinstance(image, str):
return image
allow for exactly that.
Yes. Let's do it in this way.
@AUTOMATIC1111 That two lines have not been merged to master.
Can we merge the change of api.py to master now? In this way, I don't have to patch module.api.encode_pil_to_base64.
Well, even if this PR is merged into dev, it won't be in the master... I feel that the time for new release is not yet.
Thanks. I will patch encode_pil_to_base64 for the time being. I don't need this PR to support returning videos anyway.
as we found out that there is a more general way to achieve what the author needed, this does not need to be merged; reopen the PR if there's more.