Nodes/ComfyUI-nkxx/1. Sora2 提交任务 (Wujiai)
ComfyUI Node

1. Sora2 提交任务 (Wujiai)

A text or image-to-video job in one node

By nkxx188·Created 11 months ago·Updated 6 months ago· 14
1. Sora2 提交任务 (Wujiai)
  • image
  • response
promptA cute cat playing on the grass
modelsora-2-all
aspect_ratio16:9
duration10
sizesmall
watermarkfalse
api_key

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; check WujiaiModelBrowser to 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_KEY env var or __init__.py hardcode.

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.

CategoryNkxx/Wujiai/Sora2

Inputs (8)

NameTypeDefaultDescription
promptSTRINGA cute cat playing on the grass
modelSTRINGsora-2-all
aspect_ratioCOMBO16:92 options: 16:9, 9:16
durationCOMBO102 options: 10, 15
sizeCOMBOsmall2 options: small, large
watermarkBOOLEANfalse
imageoptIMAGE
api_keyoptSTRING

Outputs (1)

NameTypeDescription
responseSTRING