Nodes/ComfyUI-KYNode/create video object from path
ComfyUI Node

create video object from path

Turn a plain file path into a real VIDEO socket

By yorkane·Created 2 years ago·Updated 6 months ago· 10
create video object from path
    • video_object
    video_path

    This is a small but genuinely useful bit of glue: a lot of nodes in this pack (and elsewhere) output a video's location as a plain STRING - KY_SaveVideo and KY_FFmpegImagesToVideo both hand you back a video_path string, not a VIDEO-typed object. But some downstream nodes specifically want a VIDEO socket, not a string. This node is the adapter: give it a path, get back a proper VIDEO object.

    What it's actually doing

    There's no processing here - no re-encoding, no frame extraction, no validation of the file's contents. It wraps a file path string into ComfyUI's VIDEO type so that a socket expecting VIDEO will accept the connection. Think of it less as a video loader and more as a type cast.

    Inputs and outputs

    One required input: video_path, a plain single-line STRING with an empty default - you're expected to type or wire in the actual path yourself. One output: video_object, typed VIDEO.

    That's the entire node. No frame rate, no resolution, no format options - those live on whatever produced the file in the first place, or on whatever consumes the VIDEO object downstream.

    Where it fits

    The natural pairing is exactly the gap described above: chain KY_SaveVideo or KY_FFmpegImagesToVideo's video_path output straight into this node's video_path input, then feed the resulting video_object into whatever expects VIDEO - this pack's own KY_VideoCompare, for instance, which accepts both a raw string path and a VIDEO object, so this node isn't strictly required there, but plenty of other nodes across other packs only accept the typed VIDEO socket and won't take a bare string at all.

    Installing it

    ComfyUI Manager: search ComfyUI-KYNode, install, restart. Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/yorkane/ComfyUI-KYNode
    

    Restart ComfyUI. No external dependencies - it does no decoding of its own.

    Common issues

    Because this node doesn't validate the file at all, a typo'd path or a file that doesn't exist won't fail here - it'll produce a VIDEO object that points at nothing, and the actual error will surface later, in whatever node tries to actually read frames from it. If you're debugging a downstream "file not found" or decode error, check this node's video_path input first rather than assuming the consuming node is broken.

    Relative vs. absolute paths matter and this node has no way to resolve them for you - if video_path is relative, it's relative to wherever ComfyUI's process is running from, which isn't always where you'd assume (especially with a portable/embedded install). When in doubt, use an absolute path, or route through ComfyUI's own input/output folder conventions if the video is already sitting there.

    There's no codec or container checking either - this node will happily wrap a path to a corrupt or unsupported file. If the resulting VIDEO object errors downstream, that's a file-format problem to chase in whatever actually decodes it, not a bug in this node.

    CategoryKY_Video

    Inputs (1)

    NameTypeDefaultDescription
    video_pathSTRING

    Outputs (1)

    NameTypeDescription
    video_objectVIDEO