Save Video gets a bit_depth widget (auto/8-bit/10-bit). 'auto' preserves
the source file's bit depth when re-encoding; 10-bit encodes h264
yuv420p10le from 16-bit RGB frames so float-precision sources keep their
gradients instead of being quantized to 8-bit.
Video inputs can declare 10-bit support via Video.Input(accepts={"depth": 10}).
At input binding, videos bound to inputs without the declaration are
replaced with a copy whose saved files default to 8-bit, so existing nodes keep producing 8-bit files no matter the
source depth. SaveVideo and VideoSlice declare support, so trimming a
10-bit video and saving it keeps 10-bit.
Signed-off-by: bigcat88 <bigcat88@icloud.com>
Bug report in #12651
- to_skip fix: Prevents negative array slicing when the start offset is negative.
- __duration check: Prevents the extraction loop from breaking after a single audio chunk when the requested duration is 0 (which is a sentinel for unlimited).
* Fix VideoFromComponents.save_to crash when writing to BytesIO
When `get_container_format()` or `get_stream_source()` is called on a
tensor-based video (VideoFromComponents), it calls `save_to(BytesIO())`.
Since BytesIO has no file extension, `av.open` can't infer the output
format and throws `ValueError: Could not determine output format`.
The sibling class `VideoFromFile` already handles this correctly via
`get_open_write_kwargs()`, which detects BytesIO and sets the format
explicitly. `VideoFromComponents` just never got the same treatment.
This surfaces when any downstream node validates the container format
of a tensor-based video, like TopazVideoEnhance or any node that calls
`validate_container_format_is_mp4()`.
Three-line fix in `comfy_api/latest/_input_impl/video_types.py`.
* Add docstring to save_to to satisfy CI coverage check
* ComfyAPI Core v0.0.2
* Respond to PR feedback
* Fix Python 3.9 errors
* Fix missing backward compatibility proxy
* Reorganize types a bit
The input types, input impls, and utility types are now all available in
the versioned API. See the change in `comfy_extras/nodes_video.py` for
an example of their usage.
* Remove the need for `--generate-api-stubs`
* Fix generated stubs differing by Python version
* Fix ruff formatting issues