OpenAI Video (FlexAI)
A /v1/videos node for the gateways, not for OpenAI
- image
- image_2
- image_3
- image_4
- VIDEO
The name is doing a lot of lying. This node doesn't talk to OpenAI's video product - OpenAI retired its hosted Videos API back in September 2026, and the pack's README says so plainly. What flexai:openai_video actually does is speak the shape of that API (POST /v1/videos, poll, download) at whatever OpenAI-compatible proxy you point it at - in practice a reseller gateway like tu-zi or new-api, where one key gets you Seedance 2.x, MiniMax H3 and Veo 3.1 behind the same endpoint. ComfyUI's own Partner Nodes already sell those on prepaid credits; this is the other route, usually cheaper and definitely less vetted.
Why bother with an API node
None of these models have weights you can download. Veo 3.1 is Google's, Seedance is ByteDance's, and no amount of VRAM changes that - the only door is an HTTP call, with the per-call cost, data-leaves-the-machine and unremovable filter that come with it. MiniMax H3 does have open weights now, but on this node you're renting the hosted channel, not running the file.
What you give up with a small third-party pack is vetting: arbitrary Python holding your key, in the one node category where phoning home is the intended behaviour.
How it works
The request is built from ratio + resolution + duration, not pixels. That's the part people get wrong: modern video APIs don't take size, they pick their own pixel pair from a tier and an aspect ratio. custom_size survives only for Sora-style channels that insist on a pixel field.
Then it goes async: create the job, poll GET /v1/videos/{id}, download from /content, wrap the bytes in a VideoFromFile, hand you a VIDEO output. No frame tensors get materialized, which is why long clips don't eat your RAM the way a local decode would.
The interesting part is the family rules. The node reads the model name and enforces the right table before anything hits the wire. Seedance 2.0 / 2.0 fast / 2.0 mini / 2.5 get upper-case wire tokens (720P, SUPER_4K), duration clamping (4–15s, or 4–30s on 2.5) and output_format only on 2.5. MiniMax H3 is limited to 768P/2K, 4–15s, and won't mix a first/last-frame run with reference video or audio. Veo 3.1 takes 16:9 or 9:16 only, tiers sent lower case, duration snapped to 4/6/8s. Anything unrecognised falls through to a permissive legacy table - which is what you want if your gateway sells a model nobody's taught this node about yet.
It's also forgiving about responses (yes, {"code":0,"data":{...}} wrappers) and degrades the body through five shapes before giving up, which is most of why it works on gateways it was never tested against.
The inputs that actually matter
provider is which .env entry to use - leave it unset and the run dies with "API key is not configured." model is the dropdown, and out of the box it holds exactly two entries, sora-2 and sora-2-pro, both useless upstream now. Put your gateway's real model id in custom_model; run once and it's saved to flexai_models.json and appears in the dropdown next time.
For frames: one image plus reference_mode: auto becomes the first frame. Two images and auto flips to multi-subject reference, which is usually not what you meant - for frame one and frame N, say first_last_frame explicitly. On Seedance 2.5 a frame-driven run forces ratio to adaptive, so your first frame keeps its own shape instead of being cropped.
Set timeout with intent: 900s is fine at 720p, thin for 1080p. The one output is VIDEO - SaveVideo for an mp4, Get Video Components for frames and audio as tensors.
Installing it
ComfyUI Manager, search "FlexAI" - or:
cd ComfyUI/custom_nodes
git clone https://github.com/Semonxue/Comfyui-flexai.git
cd Comfyui-flexai
pip install -r requirements.txt
Dependencies are light - openai, Pillow, python-dotenv, requests. No torch, no model downloads. Then drop a .env in the pack folder:
OPENAI_PROVIDERS=gateway
OPENAI_API_KEY_gateway=sk-your-key
OPENAI_API_BASE_gateway=https://your-gateway.example.com/v1
Restart ComfyUI. The token after OPENAI_API_KEY_ is what appears in the provider dropdown; list several channels and switch per node.
Where people get burned
The node isn't in the menu at all. It's a V3-schema node, registered only when your ComfyUI exposes the VIDEO type. On an older build it's missing while the image and text nodes load fine. Update ComfyUI rather than debugging the install.
Your gateway isn't OpenAI. An unrecognised model id drops you to the legacy table with every family rule off, so validation happens at the gateway and you get whatever error it invents.
Rejections are explicit, so read them. Bad resolutions and ratios come back listing what's allowed ("Supported: 480p, 720p, super_720p, …"). That's the node being helpful, not broken.
Turn on debug before you file an issue. It logs the request, each poll and the download to debug.log in the pack folder, so you can see which body shape the gateway accepted.
Video references are URLs. reference_video takes https:// or asset://, not a data URI - even though reference_audio accepts one.
Inputs (21)
| Name | Type | Default | Description |
|---|---|---|---|
| provider | COMBO | default | API provider (configured in .env). |
| model | COMBO | sora-2 | Video model. Seedance 2.0 / 2.0 fast / 2.0 mini / 2.5, MiniMax H3 and Veo 3.1 get their per-family resolution, duration and ratio rules enforced; any other OpenAI-style channel falls back to permissive settings. |
| custom_modelopt | STRING | Override the model and save it to the dropdown. | |
| promptopt | STRING | A cinematic drone shot over a misty mountain range. | — |
| imageopt | IMAGE | — | |
| image_2opt | IMAGE | — | |
| image_3opt | IMAGE | — | |
| image_4opt | IMAGE | — | |
| reference_modeopt | COMBO | auto | How the connected images are used. auto: 1 image -> first frame (imageToVideo), 2+ images -> multi-subject reference (referToVideo, role reference_image). first_frame: only slot 1 as first frame. first_last_frame: slot 1 = first frame, slot 2 = last frame. reference: every image is a reference subject. MiniMax H3 cannot mix a first/last-frame run with reference video/audio or with more than 2 images. |
| ratioopt | COMBO | 16:9 | Aspect ratio sent as `ratio` — the model picks the actual pixels. `adaptive` lets it derive the shape from the reference media. Families restrict this: Veo 3.1 accepts 16:9 / 9:16 only. |
| resolutionopt | COMBO | 720p | Resolution tier sent as `resolution`, upper case for Seedance (720P, SUPER_4K...). Seedance 2.0: 480p/720p/1080p/4k + super_*; 2.0 fast/mini: 480p/720p + super_*; 2.5: 480p/720p/1080p; MiniMax H3: 768p/2k; Veo 3.1: 720p/1080p/4k (lower case). Unsupported values are rejected with the allowed list. |
| custom_sizeopt | STRING | Legacy override, e.g. '1792x1024'. Only needed for channels that require a pixel `size` (Sora-style). When set, ratio/resolution are derived from it. | |
| durationopt | INT | 81–60 | Clip length in seconds, sent as integer `duration` (Seedance) and string `seconds` (Sora-style). Seedance 2.0: 4-15s, 2.5: 4-30s; MiniMax H3: 4-15s; Veo 3.1: snaps to 4/6/8s; sora-2: 4/8/12. |
| generate_audioopt | BOOLEAN | true | Seedance only: sent as `generate_audio` (native audio track). Ignored for MiniMax H3 / Veo 3.1, which decide audio themselves. |
| watermarkopt | BOOLEAN | false | Seedance only: sent as `watermark` (model-side watermark). Not forwarded for other families. |
| output_formatopt | COMBO | auto | Container format sent as `output_format`. Seedance 2.5 only (mp4 or mov); 'auto' omits the field and lets the model decide. |
| reference_videoopt | STRING | Optional reference video: an HTTP(S) URL or asset:// id (data URIs are not supported for video). Seedance 2.5 alone also accepts it as videoExtend input (exactly one clip, ratio becomes adaptive). Seedance 2.0/2.5 accept it as a multimodal reference. | |
| reference_audioopt | STRING | Optional reference audio: HTTP(S) URL, asset:// id, or an mp3/wav data URI. Sent as a content item with role reference_audio. | |
| poll_intervalopt | INT | 51–60 | Seconds between status polls (shortened if the server sends a poll hint). |
| timeoutopt | INT | 90030–7200 | Overall timeout in seconds for polling + download. Video renders often take 1-5 minutes; pro/1080p can take longer. |
| debugopt | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| VIDEO | VIDEO | — |