1. Sora2 异步提交任务 (Grsai)
Submit a job and walk away
- image
- response
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_CHANGEDto 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
responsestring 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_Grsai→Sora2GetNextVideo_Grsai.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | A cute cat playing on the grass | — |
| aspect_ratio | COMBO | 16:9 | 2 options: 16:9, 9:16 |
| duration | COMBO | 10 | 2 options: 10, 15 |
| size | COMBO | small | 2 options: small, large |
| imageopt | IMAGE | — | |
| remixTargetIdopt | STRING | 默认无 | — |
| api_keyopt | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| response | STRING | — |