Nodes/comfyui-byokey/BYOKey Video Gen (Generic)
ComfyUI Node

BYOKey Video Gen (Generic)

Point it at any submit-then-poll API

By MeteorAndy·Created 4 months ago·Updated 3 months ago· 0
BYOKey Video Gen (Generic)
  • image
  • output
api_key
base_urlhttps://api.example.com
submit_url
poll_url_template
prompt
model
auth_header_nameAuthorization
auth_prefixBearer
task_id_fielddata.task_id
status_fielddata.task_status
video_url_fielddata.task_result.videos.0.url
done_statusessucceed,completed,done,success
fail_statusesfailed,error
poll_interval10
max_wait600

This is the odd one out in the BYOKey pack: it has no official ComfyUI equivalent, and it doesn't know what vendor it's talking to. Instead of wrapping a specific API, BYOKey_VideoGen is a configurable submit-then-poll client - you tell it the submit URL, the poll URL, the auth scheme, and where the task id, status, and video URL live in the vendor's JSON, and it becomes a VIDEO node for any provider that follows the "POST a job, poll a task endpoint until a video URL appears" pattern. Kling, Luma, an internal tool, a relay - if it speaks that shape, this node can drive it.

It's also the node that shows you exactly how the whole pack works under the hood, because it exposes the machinery the other nodes hardcode.

How it works. POST the prompt (and optional image, sent as a base64 data URI) to submit_url, or to a path resolved against base_url. Read the task id out of the response at task_id_field. Then poll poll_url_template - with {task_id} replaced - every poll_interval seconds, reading the status at status_field. When the status matches one of done_statuses (default succeed,completed,done,success), grab the video URL at video_url_field, download it, and wrap it in a real ComfyUI VIDEO object. If a status hits fail_statuses (failed,error), it raises. That's the entire contract.

The config you'll actually touch:

  • submit_url / poll_url_template - the load-bearing pair. Poll template must contain {task_id}.
  • auth_header_name + auth_prefix - the credential scheme. Authorization + Bearer covers most vendors; set auth_prefix empty for a bare token, or switch to X-API-Key for APIs that want the key in a custom header.
  • task_id_field / status_field / video_url_field - dotted paths into the JSON, e.g. data.task_id, data.task_status, data.task_result.videos.0.url. Numeric segments index into lists, so paths into arrays of videos work.
  • done_statuses / fail_statuses - comma-separated status strings. Different vendors use different words ("succeed" is a Kling-ism); add yours.
  • model - optional, dropped into the request body if set.
  • base_url - used to resolve relative submit/poll paths; also the relay/proxy override point.

Output: one output (VIDEO) socket - real comfy_api.latest.InputImpl.VideoFromFile, so it plugs into the same preview/save nodes as the official API video nodes.

Install. Shared pack, one clone:

cd ComfyUI/custom_nodes
git clone https://github.com/MeteorAndy/comfyui-byokey.git
# restart ComfyUI; nodes under api/byokey/video

No models, no extra deps - ComfyUI's bundled torch, aiohttp, PIL, numpy and av.

Gotchas. This node is for tinkerers; if the vendor's JSON shape is unusual, you'll spend an afternoon on field paths. That's the cost of generality. And while the mechanism is configurable, the security posture isn't - it's a node that holds a credential and makes outbound calls by design, from a pack with no community track record yet. Read the source before pointing it at anything real.

Categoryapi/byokey/video

Inputs (16)

NameTypeDefaultDescription
api_keySTRINGVendor API key / token.
base_urlSTRINGhttps://api.example.comVendor API host. Used to resolve relative submit/poll paths. Override for relays/proxies.
submit_urlSTRINGPOST URL (or path relative to base_url) to submit the generation task.
poll_url_templateSTRINGGET URL (or path relative to base_url) with a {task_id} placeholder to poll status.
promptSTRINGText prompt.
modeloptSTRINGOptional model id to include in the request body.
imageoptIMAGEOptional reference image (sent as a base64 data URI).
auth_header_nameoptCOMBOAuthorizationHTTP header used to send the credential.
auth_prefixoptSTRINGBearer Prefix prepended to the api_key in the auth header (use empty for a bare token).
task_id_fieldoptSTRINGdata.task_idDotted path to the task id in the submit response.
status_fieldoptSTRINGdata.task_statusDotted path to the status in the poll response.
video_url_fieldoptSTRINGdata.task_result.videos.0.urlDotted path to the result video URL in the poll response (numeric segments index lists).
done_statusesoptSTRINGsucceed,completed,done,successComma-separated statuses that mean success.
fail_statusesoptSTRINGfailed,errorComma-separated statuses that mean failure.
poll_intervaloptINT101–120Seconds between status polls.
max_waitoptINT60030–3600Max seconds to wait for completion.

Outputs (1)

NameTypeDescription
outputVIDEOGenerated video.