ComfyUI Node

Sora 2 (OpenAI)

Pay for the generation, not the GPU

By Aryan185·Created about a year ago·Updated about a month ago· 14
Sora 2 (OpenAI)
  • input_image
  • frames
  • audio
promptA calico cat playing a piano on stage
api_key
modelsora-2
size1280x720
duration4
seed69

Sora 2 is OpenAI's video model, and it does not run on your machine. It runs on OpenAI's servers, and this node is the bridge that lets you call it from a normal ComfyUI workflow without leaving the canvas. If you want Sora-level motion quality - physically plausible physics, coherent scenes - without a 48GB card or a 40-minute Wan render, this is the cleanest way in.

The catch, before you get excited: it's a paid API, billed per second, and generation is a job, not a render. You submit, you wait, you get frames back. That's the whole trade for not owning the GPU.

How it works

The node uses OpenAI's Videos API, and it's worth understanding the async shape of it because it changes what you expect. On the first run the node creates a generation job (client.videos.create(...)), then polls client.videos.retrieve() every four seconds until the job reports completed or failed. When it's done, it downloads the MP4 and decodes it locally with PyAV (that's the av package in the pack's requirements - without it, this node hard-fails). Frames become an IMAGE batch, and if the clip has an audio track it comes out as a separate AUDIO output.

So the GPU load on your side is just decoding video frames, which is nothing. The wait is on OpenAI.

The inputs that matter

Honestly, most of the setup is choosing your pain point:

  • prompt - the whole ballgame. Sora responds well to detailed, cinematic prompts; vague prompts give you vague video.
  • model - sora-2 or sora-2-pro. Pro is the flagship: better fidelity, more expensive per second. Start with plain sora-2 to learn the API.
  • size - four options: 720x1280 (portrait), 1280x720 (landscape), 1024x1792, 1792x1024.
  • duration - 4, 8, or 12 seconds. This is your cost lever as much as a creative one.
  • input_image (optional) - plug in any IMAGE and it becomes an image-to-video job, sent to the API as a reference frame. This is easy to miss because it's an optional input, and it's where a lot of the interesting work happens.
  • seed and api_key - the seed triggers re-runs in ComfyUI; the key goes straight in the field or as a .env variable name.

The outputs

Two of them, and they go different places:

  • frames - an IMAGE list. This trips people up: you can't wire it straight into a SaveImage, which expects a single image batch. Route it through Video Helper Suite (VHS) to combine and save as mp4 or gif.
  • audio - an AUDIO output, present only if the clip actually has sound. If the video is silent this output is None, and anything connected to it will error. Keep the audio wire detached unless you know you need it.

Installing it

This is one of 20+ nodes in the Aryan185/ComfyUI-ExternalAPI-Helpers pack, so you get them all at once:

cd ComfyUI/custom_nodes
git clone https://github.com/Aryan185/ComfyUI-ExternalAPI-Helpers.git
cd ComfyUI-ExternalAPI-Helpers
pip install -r requirements.txt

Restart ComfyUI and the node appears under the video/generation category. ComfyUI Manager also works - search "ExternalAPI-Helpers". The heavy dependencies (torch, opencv-python) you already have from ComfyUI itself; what actually matters here is av for frame decoding and openai for the API call.

You need an OpenAI API key with billing enabled. Paste it in the api_key field, or copy .env.example to .env, set OPENAI_API_KEY=..., and type OPENAI_API_KEY into the field instead.

Where people get burned

The polling loop means a failed generation isn't instant - you sit through the wait before the node throws "API Error". And if the account has no billing set up, the job fails on create with a 401/402 that looks like a node bug but isn't. Check billing first. Also, note the README's feature list barely mentions Sora (it leans on the Gemini side), but the node is there and current - trust the node, not the README's table of contents.

For the money, Sora 2 is one of the best text-to-video models money can buy. For the workflow, this node is a thin, honest wrapper: prompt, wait, get frames.

Categoryvideo/generation

Inputs (7)

NameTypeDefaultDescription
promptSTRINGA calico cat playing a piano on stage
api_keySTRINGDirectly put OpenAI API key or .env variable name (OPENAI_API_KEY)
modelCOMBOsora-22 options: sora-2, sora-2-pro
sizeCOMBO1280x7204 options: 720x1280, 1280x720, 1024x1792, 1792x1024
durationCOMBO43 options: 4, 8, 12
seedINT691–2147483646
input_imageoptIMAGE

Outputs (2)

NameTypeDescription
framesIMAGE
audioAUDIO