Discussions
Background Removal for Custom Video Avatars via API
Hi HeyGen Support Team,
We're using the HeyGen API to generate videos from templates with custom video avatars. We need to remove or replace the avatar's training background, but none of the available API options appear to work for custom video avatars.
What we tried:
matting: true on the character object in POST /v2/video/generate -- background was not removed
remove_background: true (top-level) on POST /v2/videos -- background was not removed
background: { type: 'color', value: '#00FF00' } on POST /v2/video/generate -- avatar still rendered with its original training background instead of solid green
matting: true in character variable properties on POST /v2/template/{id}/generate -- background was not removed in template output
What we need:
We want to use custom video avatars in HeyGen templates while removing or replacing the avatar's original training background, so the avatar composites cleanly onto the template's scene backgrounds.
Questions:
- Is background removal for custom video avatars supported via the API?
- Does the avatar need to be re-trained with matting enabled for any of these parameters to work? If so, how do we enable matting during training via the API (POST /v2/photo_avatar/train or similar)?
- Is there a plan to support background replacement (e.g., green screen) or removal for custom video avatars on the template endpoint (/v2/template/{id}/generate)?
Thank you for your time and consideration.