Nodes/ComfyUI-AI-CustomURL/Generate Video (AI CustomURL)
ComfyUI Node

Generate Video (AI CustomURL)

The Sora node that actually handles the async polling for you

By bowtiedbluefin·Created 10 months ago·Updated 10 months ago· 3
Generate Video (AI CustomURL)
  • image
  • video_url
  • video_id
  • api_key
  • status
  • response_json
base_urlhttps://api.openai.com/v1
api_key
modelsora-2
prompt
resolution1080p
duration4
fps24
aspect_ratio16:9
auto_polltrue
poll_interval5
max_wait_time1200
advanced_params_json

Video is the one place where the closed labs still hold a real quality lead - Sora-grade output simply isn't coming off a consumer GPU, and even the KB's own history lesson is that open video keeps catching up but hasn't finished. This node is the pragmatic bridge: it calls POST /videos/create on an OpenAI-compatible API (sora-2 by default) and - this is the part that actually saves you - it handles the messy async wait itself. No babysitting a job that takes minutes.

How it works

Video generation on these APIs isn't one request-and-done like an image. You submit a job, get back an ID, and then you poll GET /videos/{id} until it's completed. This node wraps that whole dance. Submit, then poll every poll_interval seconds (default 5) for up to max_wait_time seconds (default 1200 - twenty minutes). Status updates stream to the console so you can watch it grind.

Two details are worth knowing because they're OpenAI-specific and the source code goes out of its way to handle them:

  • Duration gets snapped. OpenAI only accepts 4, 8, or 12 second videos, so your duration is silently rounded to the nearest legal value and the console tells you it did. Non-OpenAI providers get your exact number.
  • Resolution gets mapped. OpenAI only ships four sizes - 1280x720, 720x1280, 1024x1792, 1792x1024. The node maps your resolution + aspect_ratio combo onto the closest one. Other APIs get the full mapping (up to 1920x1080 etc.).

The optional image input converts an IMAGE to a base64 data URL for image-to-video, so you can animate a frame that came from a local sampler.

The outputs and how they chain

Five outputs, and they're designed to plug into the pack's other nodes:

  • video_url - the finished download URL. Feed it to Save Video from URL to pull it to disk (OpenAI's content URLs need an Authorization header, which is why Save Video has its own api_key input).
  • video_id - the job ID, kept for resume.
  • api_key - your key, passed straight through so the save node can reuse it.
  • status - completed, failed, timeout (status: …), or processing.
  • response_json - the raw API response for debugging.

If you disable auto_poll, or it times out, you don't lose the job: take the video_id and hand it to Retrieve Video Status (AI CustomURL) whenever you're ready to check back.

Installing it

ComfyUI Manager → search "AI CustomURL" → Install, restart. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/bowtiedbluefin/ComfyUI-AI-CustomURL
cd ComfyUI-AI-CustomURL
pip install -r requirements.txt

API-only - no model downloads. Just requests, aiohttp, pillow, numpy, torch, torchaudio, and opencv-python.

Common issues

  • "No valid video URL" downstream - the generation errored or timed out before a URL existed. Check status and response_json, don't assume.
  • Timeout at the default 20 minutes - big prompts or crowded API queues happen. Raise max_wait_time or set auto_poll to false and poll manually with the retrieve node.
  • Sora access - the default model name means nothing if your account doesn't have video API access; expect a "model not found"-style error until it does.

Reality check: this is a tiny single-author pack with zero community footprint as of writing. The video endpoint in particular is at the mercy of whatever your provider's API actually looks like. But as the only node family here that genuinely automates the painful async polling, it's the one that earns its keep.

Categoryai_customurl

Inputs (13)

NameTypeDefaultDescription
base_urlSTRINGhttps://api.openai.com/v1
api_keySTRING
modelSTRINGsora-2
promptSTRING
resolutionCOMBO1080p3 options: 1080p, 720p, 480p
durationINT41–60
fpsINT241–60
aspect_ratioCOMBO16:95 options: 16:9, 9:16, 1:1, 4:3, 21:9
auto_pollCOMBOtrue2 options: true, false
poll_intervalINT51–60
max_wait_timeINT120060–7200
imageoptIMAGE
advanced_params_jsonoptSTRING

Outputs (5)

NameTypeDescription
video_urlSTRING
video_idSTRING
api_keySTRING
statusSTRING
response_jsonSTRING