2. Sora2 查询状态 (Wujiai)
Poll your whole Sora 2 batch with one node that never blocks
- report
Sora 2 jobs take minutes, and the async way to deal with that is to submit everything, go do something else, and come back to check. That's this node's entire job: "2. Sora2 查询状态 (Wujiai)" reads every Sora 2 task the pack knows about, asks the Wujiai API which ones are done, and prints a one-line-per-task status report. One optional input (api_key), one STRING output (report), nothing else to configure. After the batch submitter dumps fifty task IDs into the database, this is how you find out which of the fifty actually rendered.
How the polling works
Under the hood it's a poller over the local task database, same pattern as the pack's other query nodes. It loads the JSON task store, filters to tasks that are still active, and for each one GETs Wujiai's /v1/video/query endpoint. When a task comes back with a success status and a video URL, the URL is saved into the task record so the download node can grab it without ever asking you for anything. Failures get marked too. Then it prints the full history sorted newest-first, each line shaped like [status] (model) 1234abcd... : prompt snippet... - enough to tell at a glance whether your batch is queued, rendering, or done.
Using it
The bits that matter for actually using it:
- api_key - the fallback chain is node field →
WUJIAI_KEYenv var → whatever's hardcoded in__init__.py. Blank key returns "API Key 不能为空". - report - the single output. Read it on the canvas or tee it into a text display; there's no structured output, so if you're scripting off it, you're parsing text.
Like every node in this pack, this one re-runs fresh on each execution (IS_CHANGED returns a nanosecond timestamp), which is what makes repeated polling work - run it, check the report, run it again, and when a line shows the task is complete, fire WujiaiSora2GetNextVideo to download it. The database survives restarts, so a job you submitted yesterday is still queryable today.
Install and gotchas
Install is the pack routine: clone https://github.com/jieg9341-lab/ComfyUI-nkxx into ComfyUI/custom_nodes/, restart, and let first-load auto-install requests, pandas, openpyxl, yt-dlp, opencv-python, aiohttp. No model downloads, no GPU needed - this node is pure HTTP and a JSON file.
Real talk on where people stumble: the statuses are shown as raw-ish strings unless the query node has mapped them, so don't panic if you see an internal status value you don't recognize - give it a run or two. A task stuck in the same status for a long while is almost always the upstream service being slow, not a broken node. And keep the channel pairing straight: this is the Wujiai Sora 2 query. The pack's Grsai channel has its own Sora 2 query with its own database, and the two never see each other's jobs. Wrong channel, empty report.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| api_keyopt | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| report | STRING | — |