HeyGen 数字人口播
Create the avatar layer for a video. Let ra-video-production-director own the
whole production, captions, QC, and archive; let this skill own HeyGen auth,
avatar selection, generation, and the approved avatar layout.
Before writing or approving any HeyGen motion_prompt, load and apply
heygen-avatar-motion. Its motion classes and validation gate are mandatory
unless the user explicitly requests a different action. Never submit a paid
generation while that validation gate fails.
Fixed profile
Read references/pluviobyte-profile.json before building. Treat it as the
machine-readable default. Do not substitute another look from the same avatar
group.
- Authenticate with HeyGen CLI OAuth and Creator subscription credits. Run
HeyGen commands with
HEYGEN_API_KEY removed from the child environment so
a shell variable cannot silently switch billing lanes.
- Use the landscape Digital Twin look the look specified in
references/pluviobyte-profile.json
For an unspecified digital human,
use Avatar III. The exact named preset 数字人5 always means Avatar V and
counts as an explicit premium-engine request; never resolve it to Avatar III.
Do not silently
substitute a legacy portrait look or a generated suit/scene
look from the same avatar group.
- Use local IndexTTS2 through
tts-skill, voice
pluvio-indextts2-calm-v1. Never ask HeyGen to synthesize the voice and
never use MiniMax or another fallback for local production.
- Treat narration approval as a hard paid-generation gate. Generate the full
IndexTTS2 audition first, give the exact audio file to the user, and wait for
explicit approval of that version before uploading audio to HeyGen. If the
user asks for a digital human without mentioning audio approval, remind them
and stop at the audition stage. Any audio edit invalidates prior approval.
- Default to the approved
headroom_08 circular avatar at the lower-left.
Only use a full-screen/main-canvas avatar when the user explicitly says
全屏数字人 or an equivalent unambiguous instruction.
- Use the compact neutral circle from the profile: 240px portrait content with
one plain white border and no colored accent ring. Keep its bottom alignment
stable when changing canvas ratio. Do not restore the older 300px portrait
or dark-red outer ring unless the user explicitly requests a larger or
emphasized avatar.
- Do not trust one fixed crop for every generated master. The standard
compositor must sample five frames, measure the face center with macOS Vision,
then apply the profile's human-reviewed visual offset. For the approved black-T
circle, candidate 06 places the portrait 20px below mathematical face center
and keeps the horizontal offset at 0px. Remeasure the finished circle and
require the average face center to land within 2px of this offset target. The
profile crop is a reviewed fallback, not evidence that a new master is centered.
- Keep captions and important content outside the avatar exclusion zone.
- Use Avatar IV/V only after the user requests higher quality, invokes the
named preset
数字人5, or Avatar III fails review. State the expected
credit/cost increase before generation. Because 数字人5 is itself an
explicit Avatar V instruction, do not ask the user to reconfirm the engine
after giving the cost notice.
Workflow
Run env -u HEYGEN_API_KEY heygen auth status. Require credential type
oauth, billing type subscription, and plan creator. Stop before a
paid generation if any condition differs.
Generate the complete narration audition with tts-skill; require the
canonical WAV and a voice_manifest.json with used_fallback=false and
minimax_used=false. Check mixed-language names and technical terms before
presenting the audition.
Give the user the exact audition WAV (and optionally a portable MP3) and
wait for an explicit confirmation such as “音频确认,可以生成数字人”. Record
the approved WAV SHA-256 in media/audio-approval.json. Do not upload audio,
build a HeyGen request, or consume credits before this record exists.
Recompute the WAV SHA-256 immediately before upload. If it differs from the
approved hash, invalidate the approval, remind the user, and return to step
- A request to “continue”, “directly produce”, or “make the avatar” is not
audio approval unless the user explicitly confirms the audition itself.
Generate production captions from the approved locked audio with
ra-audio-to-subtitles. Require caption-qc.json to pass before final
composition.
Upload the approved locked WAV with
env -u HEYGEN_API_KEY heygen asset create --file <narration.wav> and save
the JSON response in the project. Extract its asset ID without copying
credentials into files or logs.
Use heygen-avatar-motion to classify each semantic section, save the exact
executable motion prompt, and pass its validation gate. Explanatory body
sections default to hands fully outside the image; visible hand motion is
reserved for meaningful result or conclusion zones.
Resolve the engine from the named preset before building the request. For
an unspecified digital human, generate one 16:9, 1080p avatar master with
fit=contain and engine.type=avatar_iii. For 数字人5, generate the same
single master with engine.type=avatar_v and pass the premium-engine guard:
python3 scripts/build_request.py \
--audio-asset-id '<asset-id>' \
--title '<project title>' \
--engine avatar_v \
--allow-premium-engine \
--output media/heygen-create-request.json
env -u HEYGEN_API_KEY heygen video create \
-d media/heygen-create-request.json --wait \
> media/heygen-create-response.json
Download the completed master with heygen video download. Reuse that
single master for every requested aspect ratio. Do not spend a second
generation merely to change crop, circle placement, background, or canvas
ratio.
For the default layout, overlay the master with
scripts/compose_circle_avatar.py. Its default --center-mode auto samples
the current master, applies the measured crop plus the reviewed visual offset,
then verifies the rendered circle against that target. Archive the generated
centering report. A Remotion/HyperFrames implementation must reproduce the
same measurement, visual offset, and 2px gate rather than copying the fallback
coordinates blindly.
For explicit full-screen mode, use the HeyGen master as the main visual and
skip the circular compositor. Record layout=fullscreen_explicit in the
production note.
Verify media streams, duration, representative frames, subtitle clearance,
hair completeness, reduced headroom, voice provenance, and caption QC.
Then follow ra-video-production-director for final archive delivery.
Standard compositor
Use this when the base edit is already at the requested output size:
python3 scripts/compose_circle_avatar.py \
--base <base-video.mp4> \
--avatar <heygen-master.mp4> \
--output <final.mp4> \
--layout auto \
--audio-source avatar \
--centering-report <centering-report.json>
auto supports the approved 1920x1080 and 1080x1920 layouts. The avatar audio
is authoritative for a narration-only composition. Use --audio-source base
only when the locked narration is already present in the base edit. Do not mix
two copies of the narration.
The adaptive face-measurement pass is mandatory for a newly generated master.
--center-mode profile uses the reviewed black-T fallback crop only for
diagnosis and still must pass the post-render 2px check against the reviewed
visual-offset target. Use --crop-x and --crop-y together only for an
explicitly reviewed manual correction. Never regenerate or spend another
HeyGen credit merely to correct local framing.
Credit guard
Before generation, state how many HeyGen masters will be created. The default
count is one. Layout experiments must use local recomposition and consume zero
additional HeyGen credits. Save request/response JSON and the downloaded master
under the project so retries can detect and reuse completed work.
Output contract
Keep these artifacts in the engineering project:
media/narration.wav and media/voice_manifest.json
media/audio-approval.json containing the explicitly approved audio SHA-256
media/heygen-asset-response.json
media/heygen-create-request.json
media/heygen-create-response.json
media/pluviobyte-avatar-master.mp4
- production caption artifacts and
caption-qc.json
- final MP4, media probe, contact sheet, and SHA-256 record
- centering report with the sampled frames' measurements, reviewed visual-offset
target, applied source crop, final average center, per-axis target deviation,
tolerance, and
status: pass
Never store OAuth tokens or API keys in project artifacts.
1---2name: heygen-digital-avatar3description: Create and composite HeyGen digital-human videos in the content workspace. Use whenever the user asks for a 数字人, 数字人5, HeyGen, AI 口播人物, 数字人小窗, 圆形头像口播, full-screen digital human, or asks to make a video that uses the existing avatar. Enforce Creator-plan CLI OAuth, the configured Digital Twin, local IndexTTS2 narration, Avatar III for an unspecified digital human but Avatar V whenever the named preset 数字人5 is requested, adaptive face measurement plus the approved human-reviewed visual-centering offset in the headroom_08 circular bottom-left layout unless full-screen is explicitly requested, subtitle-safe placement, credit-aware master reuse, final QC/archive routing, and mandatory pairing with `heygen-avatar-motion` before any motion prompt or paid generation.4---56# HeyGen 数字人口播78Create the avatar layer for a video. Let `ra-video-production-director` own the9whole production, captions, QC, and archive; let this skill own HeyGen auth,10avatar selection, generation, and the approved avatar layout.1112Before writing or approving any HeyGen `motion_prompt`, load and apply13`heygen-avatar-motion`. Its motion classes and validation gate are mandatory14unless the user explicitly requests a different action. Never submit a paid15generation while that validation gate fails.1617## Fixed profile1819Read `references/pluviobyte-profile.json` before building. Treat it as the20machine-readable default. Do not substitute another look from the same avatar21group.2223- Authenticate with HeyGen CLI OAuth and Creator subscription credits. Run24 HeyGen commands with `HEYGEN_API_KEY` removed from the child environment so25 a shell variable cannot silently switch billing lanes.26- Use the landscape Digital Twin look the look specified in `references/pluviobyte-profile.json`27 For an unspecified digital human,28 use Avatar III. The exact named preset `数字人5` always means Avatar V and29 counts as an explicit premium-engine request; never resolve it to Avatar III.30 Do not silently31 substitute a legacy portrait look or a generated suit/scene32 look from the same avatar group.33- Use local IndexTTS2 through `tts-skill`, voice34 `pluvio-indextts2-calm-v1`. Never ask HeyGen to synthesize the voice and35 never use MiniMax or another fallback for local production.36- Treat narration approval as a hard paid-generation gate. Generate the full37 IndexTTS2 audition first, give the exact audio file to the user, and wait for38 explicit approval of that version before uploading audio to HeyGen. If the39 user asks for a digital human without mentioning audio approval, remind them40 and stop at the audition stage. Any audio edit invalidates prior approval.41- Default to the approved `headroom_08` circular avatar at the lower-left.42 Only use a full-screen/main-canvas avatar when the user explicitly says43 `全屏数字人` or an equivalent unambiguous instruction.44- Use the compact neutral circle from the profile: 240px portrait content with45 one plain white border and no colored accent ring. Keep its bottom alignment46 stable when changing canvas ratio. Do not restore the older 300px portrait47 or dark-red outer ring unless the user explicitly requests a larger or48 emphasized avatar.49- Do not trust one fixed crop for every generated master. The standard50 compositor must sample five frames, measure the face center with macOS Vision,51 then apply the profile's human-reviewed visual offset. For the approved black-T52 circle, candidate 06 places the portrait 20px below mathematical face center53 and keeps the horizontal offset at 0px. Remeasure the finished circle and54 require the average face center to land within 2px of this offset target. The55 profile crop is a reviewed fallback, not evidence that a new master is centered.56- Keep captions and important content outside the avatar exclusion zone.57- Use Avatar IV/V only after the user requests higher quality, invokes the58 named preset `数字人5`, or Avatar III fails review. State the expected59 credit/cost increase before generation. Because `数字人5` is itself an60 explicit Avatar V instruction, do not ask the user to reconfirm the engine61 after giving the cost notice.6263## Workflow64651. Run `env -u HEYGEN_API_KEY heygen auth status`. Require credential type66 `oauth`, billing type `subscription`, and plan `creator`. Stop before a67 paid generation if any condition differs.682. Generate the complete narration audition with `tts-skill`; require the69 canonical WAV and a `voice_manifest.json` with `used_fallback=false` and70 `minimax_used=false`. Check mixed-language names and technical terms before71 presenting the audition.723. Give the user the exact audition WAV (and optionally a portable MP3) and73 wait for an explicit confirmation such as “音频确认,可以生成数字人”. Record74 the approved WAV SHA-256 in `media/audio-approval.json`. Do not upload audio,75 build a HeyGen request, or consume credits before this record exists.764. Recompute the WAV SHA-256 immediately before upload. If it differs from the77 approved hash, invalidate the approval, remind the user, and return to step78 3. A request to “continue”, “directly produce”, or “make the avatar” is not79 audio approval unless the user explicitly confirms the audition itself.805. Generate production captions from the approved locked audio with81 `ra-audio-to-subtitles`. Require `caption-qc.json` to pass before final82 composition.836. Upload the approved locked WAV with84 `env -u HEYGEN_API_KEY heygen asset create --file <narration.wav>` and save85 the JSON response in the project. Extract its asset ID without copying86 credentials into files or logs.877. Use `heygen-avatar-motion` to classify each semantic section, save the exact88 executable motion prompt, and pass its validation gate. Explanatory body89 sections default to hands fully outside the image; visible hand motion is90 reserved for meaningful result or conclusion zones.918. Resolve the engine from the named preset before building the request. For92 an unspecified digital human, generate one 16:9, 1080p avatar master with93 `fit=contain` and `engine.type=avatar_iii`. For `数字人5`, generate the same94 single master with `engine.type=avatar_v` and pass the premium-engine guard:9596 ```bash97 python3 scripts/build_request.py \98 --audio-asset-id '<asset-id>' \99 --title '<project title>' \100 --engine avatar_v \101 --allow-premium-engine \102 --output media/heygen-create-request.json103 env -u HEYGEN_API_KEY heygen video create \104 -d media/heygen-create-request.json --wait \105 > media/heygen-create-response.json106 ```1071089. Download the completed master with `heygen video download`. Reuse that109 single master for every requested aspect ratio. Do not spend a second110 generation merely to change crop, circle placement, background, or canvas111 ratio.11210. For the default layout, overlay the master with113 `scripts/compose_circle_avatar.py`. Its default `--center-mode auto` samples114 the current master, applies the measured crop plus the reviewed visual offset,115 then verifies the rendered circle against that target. Archive the generated116 centering report. A Remotion/HyperFrames implementation must reproduce the117 same measurement, visual offset, and 2px gate rather than copying the fallback118 coordinates blindly.11911. For explicit full-screen mode, use the HeyGen master as the main visual and120 skip the circular compositor. Record `layout=fullscreen_explicit` in the121 production note.12212. Verify media streams, duration, representative frames, subtitle clearance,123 hair completeness, reduced headroom, voice provenance, and caption QC.124 Then follow `ra-video-production-director` for final archive delivery.125126## Standard compositor127128Use this when the base edit is already at the requested output size:129130```bash131python3 scripts/compose_circle_avatar.py \132 --base <base-video.mp4> \133 --avatar <heygen-master.mp4> \134 --output <final.mp4> \135 --layout auto \136 --audio-source avatar \137 --centering-report <centering-report.json>138```139140`auto` supports the approved 1920x1080 and 1080x1920 layouts. The avatar audio141is authoritative for a narration-only composition. Use `--audio-source base`142only when the locked narration is already present in the base edit. Do not mix143two copies of the narration.144145The adaptive face-measurement pass is mandatory for a newly generated master.146`--center-mode profile` uses the reviewed black-T fallback crop only for147diagnosis and still must pass the post-render 2px check against the reviewed148visual-offset target. Use `--crop-x` and `--crop-y` together only for an149explicitly reviewed manual correction. Never regenerate or spend another150HeyGen credit merely to correct local framing.151152## Credit guard153154Before generation, state how many HeyGen masters will be created. The default155count is one. Layout experiments must use local recomposition and consume zero156additional HeyGen credits. Save request/response JSON and the downloaded master157under the project so retries can detect and reuse completed work.158159## Output contract160161Keep these artifacts in the engineering project:162163- `media/narration.wav` and `media/voice_manifest.json`164- `media/audio-approval.json` containing the explicitly approved audio SHA-256165- `media/heygen-asset-response.json`166- `media/heygen-create-request.json`167- `media/heygen-create-response.json`168- `media/pluviobyte-avatar-master.mp4`169- production caption artifacts and `caption-qc.json`170- final MP4, media probe, contact sheet, and SHA-256 record171- centering report with the sampled frames' measurements, reviewed visual-offset172 target, applied source crop, final average center, per-axis target deviation,173 tolerance, and `status: pass`174175Never store OAuth tokens or API keys in project artifacts.