Sora2 视频生成同步 (Grsai)
Sora2 text/image-to-video, synchronously, with a progress bar and a download
- image
- video
- video_url
- response
Sora2 is OpenAI's closed video line, and this node is the "just give me a video" version of it inside the ComfyUI-nkxx pack: you type a prompt, optionally attach an image, hit Queue, and ComfyUI sits there polling the Grsai reseller API until a finished MP4 lands in your output folder. It's synchronous, it shows a real progress bar, and when it's done you've got three outputs instead of a task ID and a prayer.
The inputs that matter:
- prompt - multiline, default "A cute cat playing on the grass". Sora responds well to full cinematic sentences, not tag soup.
- aspect_ratio - 16:9 or 9:16. Two choices, that's it.
- duration - 10 or 15 seconds.
- size -
smallorlarge. Cost and resolution knob; there's no visible 4K toggle here. - image (optional) - attach one and it becomes image-to-video (the node uploads it to Grsai and passes it as the start frame).
- remixTargetId - optional video-remix target ID (
s_xxxx). This is "make a sequel to that other video I generated" - you'd grab the PID from a previous run's response. Leave "默认无" to ignore it. - api_key - blank uses the pack-wide Grsai key (env var
GRSAI_KEYor the global key manager).
The outputs are the nice part: video is a proper ComfyUI VIDEO (VideoAdapter-wrapped local file), video_url is the remote URL so you can re-download or share it, and response is a status blob with the task ID, the PID (which you'll want for remixTargetId later), and your remaining credit balance.
Mechanically it's honest about being a poller: it posts to /v1/video/sora-video, then loops /v1/draw/result every ~3 seconds for up to 900 seconds, driving the progress bar the whole way. Because IS_CHANGED returns a fresh timestamp, it re-runs on every queue execution - so don't leave it in a graph you're continuously queueing unless you actually want to burn credits each pass.
The whole pack installs the same way:
cd ComfyUI/custom_nodes
git clone https://github.com/jieg9341-lab/ComfyUI-nkxx
Restart; first boot auto-installs requests, pandas, yt-dlp, opencv-python and friends. You need a Grsai key from nkxx.grsai.ai - no key, no request, and the node tells you exactly that in the response string.
Grounded gotchas:
- This node blocks your graph. That's the point of "同步". A 15-second Sora2 clip can take minutes; if you want to keep the queue moving, use the async trio (
Sora2SubmitAndRecordTask_Grsai→Sora2QueryTasks_Grsai→Sora2GetNextVideo_Grsai) instead. - The download is
yt-dlpfirst,curlfallback, three retries. If both fail you still get the URL invideo_url- grab it manually rather than re-queueing and paying twice. - Every run costs API credits. The node helpfully shows the remaining balance, which is the pack's way of making you feel the pain.
removeWatermarkis baked into the request payload, so outputs come back clean - a real advantage over some reseller channels that stamp their logo on everything.
For a one-off clip this is the node you reach for. For anything batch or background, the async set is strictly better, and that's what the author's own numbered workflows use.
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 (3)
| Name | Type | Description |
|---|---|---|
| video | VIDEO | — |
| video_url | STRING | — |
| response | STRING | — |