Nodes/ComfyUI-Get-Random-File/Save Video to Remote ⚡
ComfyUI Node

Save Video to Remote ⚡

Ship the finished MP4 to another machine, then maybe delete the original

By ChrisColeTech·Created 2 years ago·Updated 3 days ago· 3
Save Video to Remote ⚡
    • saved_path
    file_path
    receiver_urlhttp://127.0.0.1:8790
    subfolder
    filename
    timeout300
    verify_tlstrue
    model_name
    workflow_name
    prompt
    seed0
    job_id
    extra_metadata
    delete_after_successfalse

    Get this straight first, because it trips up everyone who drags the node in: it does not take a video. There's no VIDEO socket. You give it a file_path - a STRING pointing at a file that already exists on disk - and it streams that file to a receiver app on another machine.

    So the order is: render → a save node writes the MP4 locally → this node hands it across the network → optionally delete the local copy once the far side confirms it landed.

    Why that shape, and when you want it

    ComfyUI's video output nodes write to disk, which is fine on a desktop and awkward on a rented GPU box, a headless machine, or a container that resets itself. You don't want the render here, you want it there.

    This is the "get it there" half, sibling to Save Image to Remote in the same pack, and both share a stance the source states explicitly: fail loud, write nothing local, never retry. There's no spool directory on the rendering machine, and this node isn't in the README's node list - that covers the older folder-saving variants - so what follows comes from the node description and the shipped code.

    How it works

    It opens the file, streams it as multipart/form-data with a file part, and POSTs to <receiver_url>/api/v1/upload. No re-encode, no remux - whatever your upstream node wrote is what arrives. A media_type hint derived from the file's extension (video for mp4/webm/mkv/mov/gif, image or audio for the obvious ones, otherwise a generic file) rides along as a form field.

    Then it waits. The receiver writes the file and replies with ok, saved_to, filename, size_bytes; only then is the job done. Any non-200, or a response without ok: true, raises immediately with the receiver's own code and message. Nothing is retried, nothing is buffered.

    Because the bytes are streamed rather than encoded, nothing is embedded in the file. Text chunks are a PNG thing; video containers don't hold a draggable graph, so model_name, workflow_name, and prompt are fields you fill in for the receiver's benefit.

    The inputs that matter

    • file_path - required, and it must be an existing file. A wrong path gives a plain file not found before anything goes over the wire.
    • receiver_url - http://127.0.0.1:8790 by default, the SSH-tunnel case where the receiver is at the far end. Otherwise paste the public URL the receiver app shows. It must be http(s)://host - a bare hostname is rejected up front, which beats watching a transfer die halfway.
    • subfolder - the routing hint for where the receiver puts it. filename - leave empty to keep the source name; set it to rename on arrival.
    • timeout - 300 seconds by default, max 3600, covering the whole transfer. Video files are big; raise this before blaming the receiver on a slow uplink. verify_tls stays on unless the receiver has a self-signed cert.
    • delete_after_success - off by default. Turned on, the source file is unlinked only after the receiver confirms ok: true, so a failed delivery never deletes anything. Right way round for a destructive option.

    The rest - model_name, workflow_name, prompt, seed, job_id, extra_metadata - is metadata for the receiver's catalogue. extra_metadata must be valid JSON or the node errors before connecting.

    The output is saved_path, a single STRING with the receiver's destination. The UI also shows a row with size, round-trip time, and destination.

    Install

    Manager: search ComfyUI-Get-Random-File, install, restart. Manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/ChrisColeTech/ComfyUI-Get-Random-File
    

    Restart. Dependencies are requests and imageio-ffmpeg - nothing heavy, no model downloads. The console prints [CCTech Suite]: Activated N file nodes on load, and the nodes live under 🤖 CCTech/Files.

    The receiver isn't in this repo, though. Either you're running the author's receiver app, or you write the other end: an endpoint at /api/v1/upload that accepts the file part plus the form fields, saves the bytes, and replies 200 with {"ok": true, "saved_to": ..., "filename": ..., "size_bytes": ...}. Small enough to stand up in an afternoon.

    Common issues

    "receiver unreachable." Nothing is listening at that URL. 127.0.0.1:8790 only makes sense when the receiver runs on the same machine as ComfyUI.

    "...refused the save [http.4xx]." If it's a 404, your URL picked up a path - the node appends /api/v1/upload and keeps whatever came before it. Otherwise read the message; it passes the receiver's own text through verbatim, which is more than most nodes bother doing.

    You enabled delete_after_success and the local file is gone. That's the feature working as advertised - if you wanted a local archive copy too, leave it off.

    One last thing, which covers this whole remote path: there's no authentication in it. No key, no token, no header. Point receiver_url at a public tunnel and you've published an unauthenticated file-write endpoint on the internet, guarded by nothing but an unguessable hostname. Use the SSH route, or put real auth in front.

    Category🤖 CCTech/Files

    Inputs (13)

    NameTypeDefaultDescription
    file_pathSTRING
    receiver_urlSTRINGhttp://127.0.0.1:8790
    subfolderSTRING
    filenameoptSTRING
    timeoutoptINT3005–3600
    verify_tlsoptBOOLEANtrue
    model_nameoptSTRING
    workflow_nameoptSTRING
    promptoptSTRING
    seedoptINT00–9223372036854776000
    job_idoptSTRING
    extra_metadataoptSTRING
    delete_after_successoptBOOLEANfalse

    Outputs (1)

    NameTypeDescription
    saved_pathSTRING