This page focuses on the code path: turn a local image into an
asset:// asset ID, then reference it to generate a character-consistent video — one script, end to end. For endpoint-by-endpoint documentation and the zero-code web UI see the Asset Library; for the full parameter table of the generation endpoint see the Video Generation API.When you need asset references
When generating character-consistent videos, Seedance 2.0 does not accept reference images containing photorealistic human faces directly (anti-deepfake filtering). You must first ingest the portrait as a trusted asset, get anasset://xxx asset ID, and reference it in the generation request — keeping the character’s face and clothing consistent across episodes and shots. Find your case first:
| Material type | Examples | How to use |
|---|---|---|
| Anime / stylized characters | Anime, cartoon, 3D-cartoon characters | No photorealistic face, generally not blocked: use a public URL / Base64 reference image directly — no ingest needed; start from step 4 (generate) of this page |
| Virtual avatar (AI-generated photorealistic portrait) | Model-generated, no such person exists | Use virtual-avatar ingest (the full flow on this page) and reference the asset:// ID |
| Real face | Photos of celebrities, models, or the user themselves | First run the fully automated real-person verification API flow to get a real-person asset group, pass its groupId when ingesting — the rest of the code is identical to this page |
Prerequisites
The pipeline at a glance
Local image → 1)presign a direct-upload URL and PUT the file to get a public URL → 2) ingest the asset and get an asset Id → 3) poll until Active (about 13 seconds per image) → 4) reference asset://<Id> in the generation request, referring to it as “Image 1” in the prompt → 5) poll the task until succeeded → 6) download content.video_url (the signed link expires in 24 hours — save it immediately).
If you already have a public image URL, skip step 1. Asset IDs are permanent — ingest once, reference forever.
Complete code
Advanced usage with multiple assets
- Multiple reference images: put several
image_urlitems incontent(0–9 images, each withrole: "reference_image") and refer to them as “Image 1”, “Image 2” in order. For one character, referencing a full-body frontal shot plus a neutral frontal face close-up together gives the best consistency. - Mixing sources:
asset://IDs, public URLs, and Base64 (data:image/png;base64,...) can be mixed in the samecontentarray — only images containing photorealistic faces must go throughasset://. - Reference video / audio: you can also add 0–3
video_urlitems (role: "reference_video") and 0–3audio_urlitems (role: "reference_audio"); at least one image or one video is required, and audio must be sent together with an image or video. - Real-person assets: first run the fully automated real-person verification flow — the actor completes liveness verification and you get a dedicated real-person asset group
GroupId; pass it asgroupIdwhen ingesting. The generation-side code is identical to this page.
Common errors
| Error / symptom | Cause | Fix |
|---|---|---|
400 The specified asset ... is not found | The asset:// ID does not belong to the APIYI channel’s account (e.g. ingested with another provider), or the ID is wrong | Re-ingest on icover.ai following this page; double-check the asset ID |
| ”No available channel for this model” | The APIYI token does not have the SeeDance2 group enabled | Enable it in the token settings on api.apiyi.com and retry |
| Python gzip decoding error | The gateway’s gzip response header does not match the actual encoding | Add the "Accept-Encoding": "identity" request header (already in the script) |
Asset status Failed | Image format / dimensions out of spec | Aspect ratio 0.4–2.5, side length 300–6000px, under 30MB — fix and re-upload |
| Direct face image rejected | Photorealistic faces cannot be used as direct reference images (anti-deepfake filtering) | Ingest first and reference the asset:// ID; real-person photos require real-person verification first |
Errors prefixed with PUBLIC_ | Blocked by upstream content moderation (that attempt is not billed) | Adjust the material / prompt and simply retry |
Related pages
Seedance 2.0 Overview
Model selection, pricing, resolution tables, and FAQ
Video Generation API
Full parameter table, the four generation modes, and response format
Asset Library
All asset-library endpoints, the zero-code web UI, and real-person verification