1. Sora2 提交任务 (Wujiai)
A text or image-to-video job in one node
- image
- response
Sora 2 is a closed model - no weights, no local path, so the only way to run it inside ComfyUI is to call someone's API. This node is the Wujiai channel's single-job submitter, the first of a four-node Sora2 pipeline (submit → batch submit → query → download). You type a prompt, optionally attach one image, pick duration and size, and get back a STRING with a task ID. The actual rendering happens on the reseller's servers, minutes or longer away.
The mechanism
Mechanically it's the same skeleton every node in this pack uses. If you feed it an image, it uploads it to Wujiai's host first and swaps in a URL. Then it POSTs a payload to Wujiai's /v1/video/create endpoint - {model, prompt, aspectRatio, size, duration, watermark, image URLs} - and writes the returned task ID into the pack's local JSON task database with a pending status. A random zero-width character gets appended to your prompt to dodge ComfyUI's identical-prompt caching; that's on purpose, leave it alone. From here the workflow moves to WujiaiSora2QueryTasks to poll, then WujiaiSora2GetNextVideo to pull the finished file.
The inputs
The inputs worth caring about:
- prompt - text-to-video direction. The default "A cute cat playing on the grass" is the author's sanity check, not a recommendation.
- model - a free-text field defaulting to
sora-2-all. It's not a dropdown because the model list updates in the cloud; checkWujiaiModelBrowserto see what's current. - aspect_ratio (16:9 / 9:16), duration (10 or 15 seconds), size (small or large) - the three knobs that actually move the price. Bigger and longer costs more per job, full stop.
- watermark - off by default. Turning it on trades a visible watermark for cheaper credits; whether that's worth it depends on what the video is for.
- image - optional IMAGE input for image-to-video. The upload happens automatically; if it fails you'll get an error string rather than a silent mis-fire.
- api_key - blank falls back to the
WUJIAI_KEYenv var or__init__.pyhardcode.
The output is one response STRING: "Sora2 任务提交成功! 模型: ... ID: ..." plus a reminder to use the query node. Nothing wires out of it; the pipeline is driven by the database, not by strings.
Install and gotchas
Setup is the pack-level routine from the README: clone https://github.com/jieg9341-lab/ComfyUI-nkxx into ComfyUI/custom_nodes/, restart, and let it auto-install requests, pandas, openpyxl, yt-dlp, opencv-python, aiohttp. No weights to fetch, but you do need a Wujiai API key from wujiai.org. The traps are the usual ones for this pack: a blank key returns "API Key 不能为空", and Sora 2 moderation is server-side - whatever the upstream refuses, you can't bypass from the node. One Sora-specific gotcha: the model field is free text, so if you typo a model name the submit still looks successful but the job can fail upstream - double-check the name against the model browser before blaming the node.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | A cute cat playing on the grass | — |
| model | STRING | sora-2-all | — |
| 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 |
| watermark | BOOLEAN | false | — |
| imageopt | IMAGE | — | |
| api_keyopt | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| response | STRING | — |