Nodes/NIUNIUAPI/🫅sora2角色创建
ComfyUI Node

🫅sora2角色创建

Extract a reusable character from a clip

By xiongmaowf·Created 9 months ago·Updated 8 months ago· 2
🫅sora2角色创建
    • 角色ID
    • 用户名
    • 主页链接
    • 头像URL
    • 响应信息
    🎞️ 视频URL
    🕒 时间戳1,3
    🎰 随机种子0
    🌐 API地址https://api.llyapps.com
    🤖 模型名称sora-2-character
    🔑 API密钥

    Character consistency is the thing that separates "AI video" from "a movie." Sora 2's answer is a persistent-character feature: you hand it a short clip of someone, it builds a character profile, and you get back an ID you can reference in later generations so the same face shows up again. This node is the "hand it the clip" half of that flow. Run it once on a good shot of your subject, and the 角色ID (character ID) that comes out is the thing you'd feed into a Sora 2 generation elsewhere. It's the cloud equivalent of a character LoRA - you just never see the weights.

    What it is, and what it isn't

    It's a one-shot setup node, not a generator. No prompt, no canvas output - the whole point is producing an identifier. That makes it the odd one out in this pack, and worth understanding before you click it, because the input isn't an image or a video file either. The one required thing is a video URL that has to be publicly reachable over http/https. The relay's servers are the ones fetching that video, not you - a local file path won't work. So if you just rendered a clip locally, you'll need it hosted somewhere accessible before this node can see it.

    How it works

    The mechanism is a small shrug in code form. The node sends your video URL and timestamp window to the relay as a chat-completions request - model sora-2-character, with the request details JSON-encoded as the user message, since that's how the api.llyapps.com endpoint implements character creation. If that path 404s, it falls back to two native endpoints (/sora/v1/characters, then /v1/sora/characters). Then it parses the response for the character ID, username, permalink, and profile picture.

    There's a nicety in the timestamps: the 时间戳 field takes a start,end window, default "1,3", and the duration is validated to be between 1 and 3 seconds. That's not arbitrary - Sora 2 wants a tight, clean shot of the character to build its profile from. Pick a window where the face is sharp and well-lit, not mid-blink.

    Inputs and outputs

    Only six required fields, no optional inputs:

    • 🎞️ 视频URL - the accessible clip, http/https. The make-or-break input.
    • 🕒 时间戳 - start,end in seconds, 1–3 second span.
    • 🤖 模型名称 - defaults to sora-2-character; change only if your provider lists another alias.
    • 🌐 API地址 / 🔑 API密钥 - the usual https://api.llyapps.com default plus your key.
    • 🎰 随机种子 - effectively optional; a seed of 0 isn't sent.

    Outputs are five strings: 角色ID (the thing you actually want), 用户名, 主页链接, 头像URL, and 响应信息 (the full response JSON). If no character ID comes back, the node still returns the whole response in that last slot so you can see what the relay actually said.

    Installing it

    Same pack as the rest of NIUNIUAPI. ComfyUI Manager → search "ComfyUI-NIUNIUAPI" → install → restart, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/xiongmaowf/ComfyUI-NIUNIUAPI
    # restart ComfyUI
    

    Deps are requests, pillow, numpy - no models, no downloads.

    Gotchas

    The big one is the URL. If the relay can't reach your video, everything else is moot - and "can't reach" includes localhost addresses and anything behind a login. Second: the node prints DEBUG: lines to your ComfyUI console while it runs (including a snippet of the request payload). Harmless, but if you're logging in a shared environment, know it's there.

    Worth being straight about the other end of the flow: this pack ships the character creation node, but none of its other nodes accept a character ID as input. You take the 角色ID out and use it wherever your Sora 2 provider expects it - the relay's own API or another Sora node. Think of this as the front half of a two-step process, with the second step living outside this pack. And the usual wrapper-node terms apply: it's metered, your clip leaves your machine, and your provider's content policy decides what counts as a creatable character.

    CategoryNIUNIUAPI

    Inputs (6)

    NameTypeDefaultDescription
    🎞️ 视频URLSTRING填写可访问的视频URL(http/https)。
    🕒 时间戳STRING1,3
    🎰 随机种子INT00–2147483647
    🌐 API地址STRINGhttps://api.llyapps.com默认使用 https://api.llyapps.com,也可填写其他支持NewAPI的服务商地址
    🤖 模型名称STRINGsora-2-character模型名称,例如 sora-2-character
    🔑 API密钥STRING

    Outputs (5)

    NameTypeDescription
    角色IDSTRING
    用户名STRING
    主页链接STRING
    头像URLSTRING
    响应信息STRING