Nodes/ComfyUI-nkxx/1. Sora2 异步提交任务 (Grsai)
ComfyUI Node

1. Sora2 异步提交任务 (Grsai)

Submit a job and walk away

By nkxx188·Created 11 months ago·Updated 6 months ago· 14
1. Sora2 异步提交任务 (Grsai)
  • image
  • response
promptA cute cat playing on the grass
aspect_ratio16:9
duration10
sizesmall
remixTargetId默认无
api_key

This is step 1 of the author's numbered Sora2 async pipeline, and the whole point is in the name: submit and record. It sends one Sora2 video job to the Grsai API, gets a task ID back, writes that ID into the pack's local task database, and returns. No polling, no blocking, no waiting on a 15-second clip - your graph finishes in about a second and the video renders in the background.

The inputs are the same generation knobs as the sync node: prompt (multiline, default "A cute cat playing on the grass"), aspect_ratio (16:9 / 9:16), duration (10 / 15), size (small / large), plus optional image (turns it into image-to-video), remixTargetId (sequel-ify a previous video), and api_key (blank = pack-wide Grsai key).

The single output is response: a short string with the task ID and a nudge to use the query node next. That's it. The real payload is invisible - the task lands in data/sora2_task_history.json under the pack folder, tagged with your prompt, a timestamp, and status: pending. The database is what ties the whole async pipeline together, and because it's a plain JSON file it survives restarts and even ComfyUI crashes. Kill the machine mid-generation and the task is still there when you come back.

Why this pipeline exists: the sync Sora2Generator_Grsai blocks your queue for minutes. For one clip that's fine. For a session where you want to fire off several videos and keep working on something else locally (a Wan loop, a batch, whatever), blocking is a disaster. This node is the "queue and continue" answer, and it's deliberately dumb - submit, store, done.

Install is pack-wide:

cd ComfyUI/custom_nodes
git clone https://github.com/jieg9341-lab/ComfyUI-nkxx

Restart (first boot auto-installs requests, pandas, yt-dlp, opencv-python, aiohttp). You need a Grsai key from nkxx.grsai.ai.

Grounded gotchas:

  • The circuit breaker is watching you. The pack's anti-credit-burn protection triggers if it sees ten identical prompts submitted within seconds - exactly what Auto Queue does when you leave it on. If ComfyUI throws a red error about "安全熔断", that's it: turn off Auto Queue, not the node.
  • Each run is a fresh task. The node uses IS_CHANGED to force re-execution, so it will submit again every time the graph runs. Don't leave it in a continuously-queued workflow unless you want more videos (and fewer credits).
  • The database keeps the last 5 completed tasks by default, so old history rolls off. The current run's ID is in the response string if you need to find it later.
  • Nothing downloads here. If you wire this node to nothing, your video renders, sits in the database marked succeeded, and never comes out. The pipeline only completes with Sora2QueryTasks_GrsaiSora2GetNextVideo_Grsai.
CategoryNkxx/Grsai/视频 (异步)

Inputs (7)

NameTypeDefaultDescription
promptSTRINGA cute cat playing on the grass
aspect_ratioCOMBO16:92 options: 16:9, 9:16
durationCOMBO102 options: 10, 15
sizeCOMBOsmall2 options: small, large
imageoptIMAGE
remixTargetIdoptSTRING默认无
api_keyoptSTRING

Outputs (1)

NameTypeDescription
responseSTRING