ComfyUI Node

AIHub Expose Video

AIHubExposeVideo doesn't decode video, and that's the point

By otavanopisto·Created about a year ago·Updated 22 days ago· 7
AIHub Expose Video
    • VIDEO
    • LOCAL_FILE
    • SEGMENT_ID
    idexposed_video
    labelVideo
    tooltip
    typeupload
    index0
    do_not_processfalse
    optionalfalse

    Read the source docstring of AIHubExposeVideo and you'll find the most honest summary the pack has to offer: "this util does not have the capacity to process the video file itself into something usable, it merely exposes the file name to be used by other nodes that can handle video files." So when a client app connected to the otavanopisto ComfyUI-aihub-workflow-exposer websocket wants to hand your workflow a video, this node is the doorway - but it doesn't open the file. It tells you where the file is, and other video-handling nodes do the real work.

    That division of labor is deliberate. The pack itself ships no video processing dependencies (no ffmpeg binding, no PyAV); it leans on what ComfyUI and its ecosystem already provide. Your job is to wire the outputs onward.

    What it does

    The type input is the interesting control. It's an enum with three choices, and it's really a message to the client about what to send:

    • current_segment - just the currently selected segment from the editor's timeline
    • merged_video - the whole timeline, all segments merged
    • upload - a standalone file the user picks; the default

    Set it once when you build the workflow and the client honors it. The client delivers a file over the websocket (a temp path ComfyUI can read), and the node hands back three outputs:

    • VIDEO - a video object usable by video nodes. Note: if you flip do_not_process on, this comes back None and you handle the file.
    • LOCAL_FILE - the string path to the video on disk. This is the output you'll actually use with most video-loading nodes.
    • SEGMENT_ID - which segment of the timeline this is, so downstream logic can react to it.

    Two booleans shape the behavior: do_not_process (default false) means "leave the file alone, I'll process it manually" - the node returns nothing but the path. optional (default false) suppresses the "Video file not found" error; flip it when a video is genuinely optional and the workflow should proceed without one. If the client sends a path that doesn't exist and optional is off, the source raises ValueError: Video file not found.

    Wiring and gotchas

    Typical graph: LOCAL_FILE → a video loader node (the pack references ComfyUI's video ecosystem) → frame handling → back out through an AIHub action node. The gotcha that burns people: they see the VIDEO output, assume it's decoded frames, and hit a wall. It isn't. If you need frames, decode with a proper video node - the expose is a path, not a player. Second gotcha: leaving do_not_process on by accident means every downstream node gets nothing but a filename and you're suddenly doing manual decoding.

    Install, same as the whole pack - no Python requirements, no model downloads:

    cd ComfyUI/custom_nodes
    git clone https://github.com/otavanopisto/ComfyUI-aihub-workflow-exposer
    

    Restart ComfyUI. Realistic take: this node only matters if you're building a video-editor integration with this pack - which is its actual purpose. If that's you, respect the division of labor: it moves files, not frames.

    Categoryaihub/expose

    Inputs (7)

    NameTypeDefaultDescription
    idSTRINGexposed_videoA unique custom ID for this workflow.
    labelSTRINGVideoThis is the label that will appear in the field.
    tooltipSTRINGAn optional tooltip
    typeCOMBOuploadThe source of the video
    indexINT0This value is used for sorting the input fields when displaying; lower values will appear first.
    do_not_processBOOLEANfalseIf set to true, the video will not be processed by the node and you will have to handle it manually
    optionalBOOLEANfalseIf set to true, it will not raise an error if the video is not found

    Outputs (3)

    NameTypeDescription
    VIDEOVIDEO
    LOCAL_FILESTRING
    SEGMENT_IDSTRING