Portrait
Intégrez des portraits virtuels ou réels vérifiés et réutilisez-les dans Seedance 2.0 avec asset://.
Vue d’ensemble
Portrait converts a virtual spokesperson or verified real person into reusable assets for video generation. The flow returns an asset_id, which Seedance 2.0 can consume as asset://<asset-id>.
The API uses Volcengine-style Action + Version routing with JSON request bodies.
Choisir le parcours
Choisissez le parcours selon que la personne est fictive ou réelle avec vérification H5.
AIGC virtual portrait flow
Use the AIGC path for fictional or brand-owned characters: create a group, register media, then poll until the asset is active.
CreateAssetGrouprequiresGroupType=AIGCandName.CreateAssetacceptsAssetType:Image,Video, orAudio.
Wait for UpstreamStatus=Active before using the asset. Poll GetAsset(Id) roughly every 3 seconds, up to about 60 seconds, until Result.UpstreamStatus becomes Active. Seedance rejects assets still in Processing.
LivenessFace real-person flow
Use LivenessFace for a real person. Create a visual validation session, open H5Link on the user phone, then exchange BytedToken for GroupId.
BytedTokenandH5Linkare valid for about 120 seconds.ValidatePendingmeans the H5 scan is not finished yet.
Wait for UpstreamStatus=Active before using the asset. Poll GetAsset(Id) roughly every 3 seconds, up to about 60 seconds, until Result.UpstreamStatus becomes Active. Seedance rejects assets still in Processing.
Utiliser asset_id dans Seedance 2.0
Avertissement
Only seedance-2.0 and seedance-2.0-fast support asset://. seedance-1.5-pro does not; passing an asset:// URL to it will be rejected upstream.
After GetAsset returns UpstreamStatus=Active, pass the Portrait asset into Seedance 2.0 using an asset:// URL.
| 1 | curl https://api.alltoken.ai/v1/videos/generations -H "Authorization: Bearer $ALLTOKEN_API_KEY" -H "Content-Type: application/json" -d '{ |
| 2 | "model": "seedance-2.0", |
| 3 | "prompt": "A confident keynote speaker on stage, cinematic 4K", |
| 4 | "ratio": "16:9", |
| 5 | "duration": 5, |
| 6 | "resolution": "720p", |
| 7 | "content": [ |
| 8 | { "type": "image_url", "image_url": { "url": "asset://asset-20260318035710-xxxxx" }, "role": "first_frame" } |
| 9 | ] |
| 10 | }' |
Quotas et upload
- Maximum 50 active groups per customer.
DeleteAssetGroupreleases quota immediately. - Maximum 50 assets per group.
Nameis limited to 50 characters.
Two ways to register media into Portrait, depending on whether you have a CDN / public host:
- With CDN / public host:
POST /v1/portrait/?Action=CreateAssetwithURLin JSON body. The URL must be publicly reachable by Volcengine. - Without CDN:
POST /v1/portrait/uploadasmultipart/form-datawithfile+GroupId. The gateway uploads to R2 and auto-registers with Volcengine.
multipart limits: image/jpeg / image/png / image/webp; max size 10 MB; shares the same 50-asset quota as CreateAsset.
| 1 | curl https://api.alltoken.ai/v1/portrait/upload -H "Authorization: Bearer $ALLTOKEN_API_KEY" -F "GroupId=group-20260318035710-xxxxx" -F "file=@./portrait.jpg" |
Les 12 Actions
The /v1/portrait/ endpoint multiplexes 12 Actions via ?Action=... query (Volcengine Action protocol style).
| Action | Purpose | Path |
|---|---|---|
CreateAssetGroup | Create AIGC virtual portrait group | AIGC only |
GetAssetGroup | Get group details | Both |
ListAssetGroups | List groups (filter by GroupType) | Both |
UpdateAssetGroup | Rename / update group meta | Both |
DeleteAssetGroup | Delete group (releases quota) | Both |
CreateAsset | Register asset by URL | Both |
GetAsset | Get asset status / metadata | Both |
ListAssets | List assets in a group | Both |
UpdateAsset | Rename asset | Both |
DeleteAsset | Delete asset (releases quota) | Both |
CreateVisualValidateSession | Start H5 face-scan session | LivenessFace only |
GetVisualValidateResult | Fetch GroupId after scan | LivenessFace only |
Complete API reference: Portrait API reference.
Erreurs
| Code | When it appears | What to do |
|---|---|---|
InvalidParameter | Wrong GroupType, invalid AssetType, or malformed body | Fix the request body and retry. |
AIGCNotAvailable | AIGC group creation is not enabled for the account | Contact AllToken support or use LivenessFace. |
ValidatePending | H5 scan is not finished yet | Wait briefly, then retry before the 120-second token window expires. |
InvalidToken | BytedToken is unknown or not owned by the API key | Create a new validation session. |
TokenExpired | BytedToken has expired | Create a new validation session and ask the user to scan again. |
QuotaExceeded | Group or asset quota is full | Delete unused groups or assets, then retry. |
Forbidden | Cross-customer access to GroupId / AssetId owned by another customer | Use only IDs returned to your own API key. Existence is intentionally hidden. |
InvalidParameter | CreateAssetGroup with GroupType=LivenessFace | LivenessFace groups are auto-created by the H5 scan flow only; do not call CreateAssetGroup for them. |