Nodes/maomao/1. NewAPI Submit Video Task
ComfyUI Node

1. NewAPI Submit Video Task

The ComfyUI node that turns API credits into a Sora video

By xiaohuangzhengbang·Created 2 months ago·Updated 2 months ago· 2
1. NewAPI Submit Video Task
  • image
  • image_2
  • image_3
  • report
api_key
modelsora-2
promptA subtle presenting gesture in front of an office building.
aspect_ratio9:16
secondsauto
sizeauto
generate_audiofalse
negative_prompt
retry_on_transient_failuretrue
max_retries3
custom_model

Sora and Veo are API-only. You can't download the weights, so the only way to get one of those clips into your ComfyUI workflow is to pay a relay and call it over HTTP. NewApiSubmitVideoTask is the node that writes that check. It's the first of three nodes in the xiaohuangzhengbang/maomao pack that turn a NewAPI-style video relay into an async three-step pipeline: submit, poll, download.

Why bother? Because the alternative is running Wan locally and waiting ten minutes per clip on your own GPU. If your brief is Sora-quality motion or Veo's native audio, the closed models are the only ones that do it - the KB's closed-source-models doc is blunt that Veo 3.1's native audio still has no open-source equivalent. This pack is how you use those models without leaving ComfyUI: the finished video lands back in your normal graph.

How it works

You give it a Bearer API key (the one you get when you buy relay access), a model, and a prompt, and it POSTs to {relay}/v1/videos. The interesting part is image-to-video: wire any of the optional image, image_2, or image_3 inputs and the node uploads each one to tmpfiles.org first, then sends the public URLs to the provider. Yes, your frames sit on a public file host for a while - fine for test clips, worth knowing before you feed it something private.

Submission is async, so the node doesn't wait for the video. It saves the job - including the full request payload - to newapi_video_tasks.json in the pack folder, and returns a report string.

The inputs that matter

  • api_key - the relay key. Leave it blank and the node just returns 缺少 API Key ("missing API key") and does nothing.
  • model - sora-2, or veo-8s-image-to-video, which the pack maps to gemini-veo-3.1-generate-preview-ref-8s (Google Veo 3.1, image-to-video, 8 seconds).
  • prompt - a multiline box; the default is a fairly bland "A subtle presenting gesture in front of an office building."
  • seconds - auto, 12, 16, 20. The catch: those choices only apply to sora-2. Veo is fixed at 8 seconds, and auto silently resolves to 12 for sora-2. Ask for 20 seconds on a Veo job and it quietly downgrades to 8 - the report mentions it, but it's easy to miss.
  • aspect_ratio / size - both dropdowns; size set to auto derives from the aspect ratio (16:9→1280x720, 9:16→720x1280, 1:1→1024x1024).
  • custom_model (optional) - a raw model name that overrides the dropdown. The author's own test log shows the relay also exposes other gemini-veo-3.1-generate-preview-* variants, so this is the escape hatch for models that never got a button.

There's also generate_audio, negative_prompt, retry_on_transient_failure, and max_retries (0–20, default 3). The last two get stored with the task and only really matter later, in the query node.

Output

Just one: report, a STRING. Treat it as a human-readable status line, not data - it's [sora-2] 提交成功:<task-id> plus notes, and everything comes back in Chinese because the author writes in Chinese (the repo's docs are thin English, the messages are not). The task id itself lives in the JSON file, which is what the next two nodes read.

Install

Via ComfyUI Manager, search maomao (the pack title) and install, then restart ComfyUI. Or by hand:

cd ComfyUI/custom_nodes
git clone https://github.com/xiaohuangzhengbang/maomao

Restart. There's no requirements.txt and no model download - the pack only uses requests, numpy, and Pillow, all already in ComfyUI's environment. All the heavy compute happens on the relay's servers, which is why the whole pack is one small Python file.

The trap

All three nodes in this pack return NaN from IS_CHANGED (the always-rerun trick documented in the node-plumbing doc), meaning they execute on every queue run, cache be damned. With this node, that's a fresh paid submission every time you hit Queue - twice if you queue twice. Don't leave it wired into a workflow you re-run while iterating on a prompt; treat it as "click this when you actually want a clip." And given the relay's track record - the pack's own test log shows upstream video completion failing under load - set the query node's retry machinery up before you start spending.

CategoryNewAPI/Video Async

Inputs (14)

NameTypeDefaultDescription
api_keySTRING
modelCOMBOsora-22 options: sora-2, veo-8s-image-to-video
promptSTRINGA subtle presenting gesture in front of an office building.
aspect_ratioCOMBO9:163 options: 16:9, 9:16, 1:1
secondsCOMBOauto4 options: auto, 12, 16, 20
sizeCOMBOauto4 options: auto, 1280x720, 720x1280, 1024x1024
generate_audioBOOLEANfalse
negative_promptSTRING
retry_on_transient_failureBOOLEANtrue
max_retriesINT30–20
custom_modeloptSTRING
imageoptIMAGE
image_2optIMAGE
image_3optIMAGE

Outputs (1)

NameTypeDescription
reportSTRING