1.5 Sora2 异步批量提交 (Grsai)
Fire 50 Sora2 videos from a spreadsheet without blocking your queue
- image
- task_ids
- report
If you've got a spreadsheet full of prompts and you want a video for each one, Sora2SubmitBatchTask_Grsai is the fire-and-forget way to do it: it reads a CSV/XLSX column, submits each prompt as a Sora2 video task concurrently, records every task ID into the pack's local database, and hands you a report - all without ever blocking the graph on a render. It's step 1.5 in the author's numbered async pipeline, slotting between the single submit and the query/download steps.
Inputs:
- file_path - the CSV or Excel file. Absolute path; the node checks it exists. CSV is read as UTF-8, and
.xls/.xlsxgo through pandas. - column_name - which column holds the prompts (default
prompt). If the column is missing, you get a clear error, not garbage. - aspect_ratio, duration, size - the usual generation knobs, applied to every row.
- concurrency - how many submissions run at once, 1–20 (default 5). The real cost/pace dial.
- prompt_prefix - optional text prepended to every row's prompt (great for a consistent style tag).
- max_count - cap on how many rows get submitted, up to 999 (default 50). Your spreadsheet can have 2,000 rows; this is the emergency brake.
- image, remixTargetId, api_key - one shared reference image, a shared sequel target, and the key (blank = pack-wide).
Outputs: task_ids (one per submitted row - the lines that are clean IDs are the wins, lines containing "失败"/"异常" are the fails) and report ("批量完成 | 总数: N | 成功: X | 失败: Y").
Mechanically it's a ThreadPoolExecutor over the row count, capped at your concurrency. Every successful submit is stored in data/sora2_task_history.json with status: pending, so the rest of the pipeline (query → download) picks them up exactly like hand-submitted ones. The IS_CHANGED trick forces re-execution every run, which is great for "queue another batch" - and exactly the foot-gun the pack's circuit breaker is designed to catch if you enable Auto Queue on top of it. Budget accordingly: max_count defaults to 50 because 50 Sora2 renders is real money.
Install is the pack-wide routine:
cd ComfyUI/custom_nodes
git clone https://github.com/jieg9341-lab/ComfyUI-nkxx
Restart and let it auto-install pandas (required for the Excel path), openpyxl, requests, yt-dlp, and friends on first boot. Grsai key from nkxx.grsai.ai.
Grounded gotchas:
- Every submitted row costs credits. The report shows your balance implicitly and the API errors per-row rather than aborting the batch, so a batch can half-succeed. Read the
task_idsoutput to see which rows failed and why. - One shared
imagegets uploaded once and used for all rows - there's no per-row image column here. For per-row reference images you're in a different workflow. - The DB trims old completed tasks (last 5), so don't wait a week before downloading and expect the full list.
- 20 concurrency against a flaky API will produce more "异常" rows than 5 will. Start at the default.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| file_path | STRING | — | |
| column_name | STRING | prompt | — |
| 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 |
| concurrency | INT | 51–20 | — |
| prompt_prefixopt | STRING | — | |
| max_countopt | INT | 501–999 | — |
| imageopt | IMAGE | — | |
| remixTargetIdopt | STRING | 默认无 | — |
| api_keyopt | STRING | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| task_ids | STRING | — |
| report | STRING | — |