audiostring
URL of an audio file for the avatar to lip-sync to. When provided, overrides prompt and voice.
heygen/heygen-avatar4/image-to-videoHeygen Avatar4 is HeyGen's image-to-video AI model. Bring static images to life with fluid animation, consistent character motion, and professional-grade video output.
Try the model
PNG, JPEG, WebP, or GIF · 20 MiB maximum
Customize your input with more control.
What would you like to do next?
Select an example to load its inputs and result into the playground.
{
"image": "https://static.sandbase.ai/examples/58f680f7-93d6-4f27-9255-0043d7b5c44c/input/48d5dacb-cf6b-4678-a54d-dd7bc01337fb.png",
"prompt": "Hey friends! Welcome to the GPU force podcast and today we are going to discuss about the rising GPU cost!"
}HeyGen Avatar 4: turn a single photo into a talking presenter, driven by a script or an audio track.
| Field | Type | Default | Notes |
|---|---|---|---|
prompt | string | — | Script to speak. |
image | image URL, required | — | Photo of the presenter. JPEG, PNG, or WebP URL. |
audio | audio URL | — | Optional voice track. |
aspect_ratio | 16:9 / 9:16 / 4:5 / 5:4 / 1:1 | — | Output frame shape. |
voice | string | Melissa | Voice for the script. |
resolution | 360p / 480p / 540p / 720p / 1080p | 720p | Video resolution preset. |
talking_style | stable / expressive | stable | expressive adds more head and hand motion. |
$0.10 per output second; length follows the audio or the spoken script. The quote before submission assumes 5 seconds.
| Output | Price |
|---|---|
| 5s | $0.50 |
| 30s | $3.00 |
| 60s | $6.00 |
Failed runs are not charged.
Related: heygen/avatar5/digital-twin.
Start building
Submit this model through the SandBase Unified Run API.
# The quoted heredoc keeps Unicode and shell metacharacters unchanged.
result=$(curl --fail-with-body --silent \
-X POST "https://api.sandbase.ai/v1/run" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @- <<'SANDBASE_JSON'
{
"model": "heygen/heygen-avatar4/image-to-video",
"image": "https://v3b.fal.media/files/b/0a90062c/A7EIviZqNxZ2HAs0yHeZ6_77a05b99-8588-4ffc-90aa-be7f9d34e9d3.png",
"voice": "Melissa",
"prompt": "Hey friends! Welcome to the GPU force podcast and today we are going to discuss about the rising GPU cost!",
"resolution": "720p",
"talking_style": "stable"
}
SANDBASE_JSON
)
run_id=$(printf '%s' "$result" | jq -r .id)
for attempt in $(seq 1 120); do
status=$(printf '%s' "$result" | jq -r .status)
case "$status" in completed|failed|timeout) break ;; esac
sleep 2
result=$(curl --fail-with-body --silent \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
"https://api.sandbase.ai/v1/run/$run_id")
done
status=$(printf '%s' "$result" | jq -r .status)
[ "$status" = completed ] || { echo "Generation ended: $status" >&2; exit 1; }
printf '%s\n' "$result"Create a SandBase API key and set it in your server environment. All requests use Bearer authentication.
export SANDBASE_API_KEY="YOUR_API_KEY"Keep the key on your server. Do not expose it in browser code or commit it to a repository.
POST to /v1/run with this model ID and its inputs. The request example above includes submission and polling.
Use the returned run ID to poll until the status is completed, failed or timeout. Read output only after completed.
curl "https://api.sandbase.ai/v1/run/$RUN_ID" \
-H "Authorization: Bearer $SANDBASE_API_KEY"Pass a publicly accessible file URL in the model’s image, video or audio field. Supported formats and limits are shown beside each Playground input.
Use the upload or replace control on supported image fields in the Playground. Video URL fields accept a hosted driving video; they do not imply video-upload support.
audiostringURL of an audio file for the avatar to lip-sync to. When provided, overrides prompt and voice.
imagestringrequiredURL of the image to animate. The image should contain a clear face.
voicestringThe voice ID to use for the avatar.
Default: "Melissa"
promptstringThe text the avatar will speak
resolutionstringVideo resolution preset.
Default: "720p"
Possible values: "360p", "480p", "540p", "720p", "1080p"
aspect_ratiostringOutput aspect ratio. Omit to keep the source aspect ratio (falls back to 16:9 when it cannot be read).
Possible values: "16:9", "9:16", "4:5", "5:4", "1:1"
talking_stylestringTalking style: 'stable' for minimal movement, 'expressive' for more animation.
Default: "stable"
Possible values: "stable", "expressive"
{
"model": "heygen/heygen-avatar4/image-to-video",
"image": "https://v3b.fal.media/files/b/0a90062c/A7EIviZqNxZ2HAs0yHeZ6_77a05b99-8588-4ffc-90aa-be7f9d34e9d3.png",
"voice": "Melissa",
"prompt": "Hey friends! Welcome to the GPU force podcast and today we are going to discuss about the rising GPU cost!",
"resolution": "720p",
"talking_style": "stable"
}A completed run exposes its result in output. The following is the model’s saved example, not a new generation.
[
{
"poster": "https://static.sandbase.ai/examples/posters/a1f21fe6264568c9ddae.jpg",
"source": "heygen schema mirror",
"source_url": "https://heygen.example/",
"url": "https://static.sandbase.ai/examples/58f680f7-93d6-4f27-9255-0043d7b5c44c/output/3fac915a-6088-4da9-9af5-2ba18962809a.mp4"
}
]