BYOKey Video Gen (Generic)
Point it at any submit-then-poll API
- image
- output
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+Bearercovers most vendors; setauth_prefixempty for a bare token, or switch toX-API-Keyfor 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.
Inputs (16)
| Name | Type | Default | Description |
|---|---|---|---|
| api_key | STRING | Vendor API key / token. | |
| base_url | STRING | https://api.example.com | Vendor API host. Used to resolve relative submit/poll paths. Override for relays/proxies. |
| submit_url | STRING | POST URL (or path relative to base_url) to submit the generation task. | |
| poll_url_template | STRING | GET URL (or path relative to base_url) with a {task_id} placeholder to poll status. | |
| prompt | STRING | Text prompt. | |
| modelopt | STRING | Optional model id to include in the request body. | |
| imageopt | IMAGE | Optional reference image (sent as a base64 data URI). | |
| auth_header_nameopt | COMBO | Authorization | HTTP header used to send the credential. |
| auth_prefixopt | STRING | Bearer | Prefix prepended to the api_key in the auth header (use empty for a bare token). |
| task_id_fieldopt | STRING | data.task_id | Dotted path to the task id in the submit response. |
| status_fieldopt | STRING | data.task_status | Dotted path to the status in the poll response. |
| video_url_fieldopt | STRING | data.task_result.videos.0.url | Dotted path to the result video URL in the poll response (numeric segments index lists). |
| done_statusesopt | STRING | succeed,completed,done,success | Comma-separated statuses that mean success. |
| fail_statusesopt | STRING | failed,error | Comma-separated statuses that mean failure. |
| poll_intervalopt | INT | 101–120 | Seconds between status polls. |
| max_waitopt | INT | 60030–3600 | Max seconds to wait for completion. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| output | VIDEO | Generated video. |