1.5. Sora2 批量提交 (CSV/Excel)
Fifty Sora 2 videos from one CSV, submitted five at a time
- image
- task_ids
- report
Why batch
This is the node that makes Sora 2 a batch operation instead of a one-at-a-time chore. WujiaiSora2SubmitBatchTask reads prompts from a CSV or Excel file and fires them at the Wujiai API concurrently, up to 999 of them per run (50 by default). If your workflow involves "generate fifty product shots as video" or a queue of prompts you've been sitting on, this is the one you reach for. The name in the pack is "1.5. Sora2 批量提交 (CSV/Excel)" - it slots right after the single submitter and before the query node.
How it reads your file
The mechanism is worth understanding because it explains the dependencies the whole pack installs. It reads your file with pandas (that's why the pack auto-installs pandas and openpyxl - Excel support), pulls the strings from the column you name, optionally prepends prompt_prefix to each, and caps the list at max_count. Then it spins up a ThreadPoolExecutor with concurrency workers (default 5, capped at 20) and POSTs each prompt to Wujiai's /v1/video/create endpoint, uploading your shared image once and reusing that URL for every job if you want image-to-video across the whole batch. Each returned task ID lands in the pack's local JSON database for the query node to find later.
The inputs
The inputs that do the work:
- file_path - absolute path to a
.csv,.xls, or.xlsx. This is the one input with no default; point it at your file or nothing happens. - column_name - which column holds the prompts. Default
prompt. - concurrency - the throttle. 5 is the default and a sane ceiling for keeping the API happy; cranking it to 20 will submit faster but also spend faster.
- max_count - 50 default, up to 999. Handy cap for when your sheet has 2,000 rows and you want to test on a slice.
- prompt_prefix, image, api_key - the optional extras. api_key follows the usual fallback chain (node →
WUJIAI_KEYenv var →__init__.py). - model / aspect_ratio / duration / size / watermark - shared across the whole batch, so pick once.
sora-2-allis the default model string.
Two outputs come back: task_ids (one task ID or error per prompt, one per line) and report, which summarizes totals - "批量提交完成 | 总数: 50 | 成功: 49 | 失败: 1". The success/fail split is how you know which rows to re-run; a failed row's error text sits in task_ids next to its prompt.
Install and gotchas
Install is the standard pack story: clone https://github.com/jieg9341-lab/ComfyUI-nkxx into ComfyUI/custom_nodes/, restart, auto-install the six deps. No model files, but it absolutely needs the Wujiai key. The traps: giving it a file path with a typo returns a friendly "文件不存在" style message; naming a column that isn't in the sheet errors out with "列 'xxx' 不存在"; and remember every successful submit costs real credits - max_count and concurrency are the two dials that decide whether this node is a convenience or a surprise bill. This is also the node to pair with WujiaiLLMWriter, which can generate that prompt CSV for you in the first place.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| file_path | STRING | — | |
| column_name | STRING | prompt | — |
| 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 | — |
| concurrency | INT | 51–20 | — |
| prompt_prefixopt | STRING | — | |
| max_countopt | INT | 501–999 | — |
| imageopt | IMAGE | — | |
| api_keyopt | STRING | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| task_ids | STRING | — |
| report | STRING | — |