Specify content type in executed output messages
- Dominant language
- Python
- Stars
- 133k
- Forks
- 15.7k
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 155
Description
### Feature Idea
Currently there is an `animated` field being used for webm and animated webp:
https://github.com/comfyanonymous/ComfyUI/blob/1650cda030daa32c9d12a5d92c02663bd076b071/comfy_extras/nodes_images.py#L191
https://github.com/comfyanonymous/ComfyUI/blob/1650cda030daa32c9d12a5d92c02663bd076b071/comfy_extras/nodes_images.py#L138
https://github.com/comfyanonymous/ComfyUI/blob/5d84607bf3a761d796fb0cf3b6fdba8480ead5f7/comfy_extras/nodes_video.py#L74
webp and webm need separate handling so `animated` doesn't help much for the frontend.
In general, the client wants to know the mime type before the request for the resource is actually made, but can only infer from the outputs being in either `images` or `audio` or from filename. To reduce burden on client and improve API, either add a field to denote mime type or add `videos` field.
1. Just add `videos` field for quick solution:
```diff
results: list[FileLocator] = [{
"filename": file,
"subfolder": subfolder,
"type": self.type
}]
+ return {"ui": {"videos": results, "animated": (True,)}}
```
2. Use a field to denote mime type and keep everything in `images`:
```diff
results: list[FileLocator] = [{
"filename": file,
"subfolder": subfolder,
"type": self.type
+ "mimeType" : "video/webm"
}]
return {"ui": {"images": results, "animated": (True,)}}
```
### Existing Solutions
_No response_
### Other
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.