Skip to content

feat(avatars): avatar library, TextToVideo toggle and avatar clips - #351

Merged
edenreich merged 10 commits into
mainfrom
feat/avatars
Oct 1, 2026
Merged

edenreich merged 10 commits into
mainfrom
feat/avatars

Conversation

@edenreich

@edenreich edenreich commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This is the desktop half of talking avatars. Users keep named portraits in ~/.infer/avatars/<name>/, and the agent renders lip-synced clips from them in Content projects. The CLI owns the library and the render (infer avatars and the TextToVideo tool, shipped in infer v0.206.0; the flox manifest already pins v0.208.2). The desktop only wraps the commands, exposes the toggle, teaches the skill and shows the clips.

Stacked on #350, which lets the tools dropdown see top-level config keys like text_to_video. Review that one first.

Closes #311.

Design: paired clips

Export mixes a video clip's own sound only when source_audio is keep, so an avatar clip keeps its voice on the audio track:

  • The script and voice stay a normal spoken clip on the audio track.
  • The avatar clip is a video-track clip over the same range: id: "<spoken id>-avatar", with avatar, voice_sample and status, rendered from that clip's wav.

As a result, Export, Redo voice and Redo drafts work unchanged, and timeline.rs export is untouched. When a spoken clip is re-synthesized, the skill marks its avatar clip draft. Only draft avatar clips are rendered.

Changes

  • Backend
    • New backend/src/avatars.rs with four commands: list_avatars, import_avatar (Rust-side picker), snapshot_avatar (webview camera JPEG staged in a temp file) and delete_avatar, all shelling out to infer avatars.
    • Create streams its stdout lines to the UI over a Channel.
    • agent::infer_command is extracted so the streaming spawn shares the env setup.
  • Config
    • New text_to_video_enabled (text_to_video.enabled), off by default.
    • spawn_gateway sets VIDEOS_ENABLED=true when it is on.
    • TextToVideo joins the tools list.
  • Settings
    • A Text to video toggle in General with the provider note; saving restarts the gateway.
    • A new Avatars tab: import or take a photo, live progress, previews of the generated views, delete, and the consent line.
    • ElevenLabs joins API Keys.
  • Platform
    • ~/.infer/avatars/** is added to the asset scope, and safeImageSrc accepts it.
    • NSCameraUsageDescription is added to Info.plist.
  • Timeline
    • parseTimeline keeps a clip's avatar (it was dropped on the first UI save).
    • Video clips with an avatar are labelled <avatar>: <file> and striped in sampleColour(avatar).
  • Skill (video-editing)
    • New Avatars section: pick the avatar, place the paired clips, call TextToVideo { avatar, audio, output_path }, copy into media/, keep avatar clips in step with their spoken clips, stop before export.
    • Contract, tools list, prerequisites and Redo drafts updated.
  • e2e
    • New avatar-clip.yaml and avatar-clip scenario. Mock mode is scenario-driven with no fake renderer: the clip points at the seeded media/logo.png.
  • README
    • Avatars section: the flow, the ~/.infer/avatars/<name>/ layout, the provider/privacy note, and the ElevenLabs key.

Verification

  • The pre-commit hook passes on every commit: prettier, bun run build, cargo fmt --check, clippy -D warnings, cargo test.
  • bun test: 178 pass.
  • task e2e -- tests/avatar-clip.yaml and tests/captions.yaml pass on macOS.
  • Not verified yet:
    • a real infer avatars create from Settings (it calls the paid image edit API)
    • the macOS camera prompt
    • a real TextToVideo render, which needs an ElevenLabs key

Cross-repo

None needed: the CLI and gateway already ship the feature. The docs for the CLI side landed via inference-gateway/docs#727; the desktop side is tracked in inference-gateway/docs#839.

text_to_speech is a top-level config section, not a tools.<key> entry, so
reading only `infer config get tools` never listed TextToSpeech. Read the
full config dump and match each tool by JSON pointer instead.
…commands

The CLI owns the avatar library in ~/.infer/avatars/<name>/. The desktop
shells out to it: import from a picked photo or a camera snapshot staged
in a temp file, with create's stdout streamed as progress, plus list and
delete. Adds the asset scope for previews and the macOS camera usage
string.
text_to_video.enabled is off by default and restarts the gateway with
VIDEOS_ENABLED=true when saved; TextToVideo joins the tools list. The
Avatars tab imports or snaps a front photo, shows the generated views and
deletes avatars, next to a plain consent and provider note. ElevenLabs
joins the API keys the gateway can use.
A video clip's avatar field survives parse and save, and the clip is
labelled with the avatar's name and striped in its colour, as spoken clips
are for their voice sample.
An avatar clip is a video-track clip over its spoken clip, rendered with
TextToVideo from that clip's wav. The voice stays on the audio track, so
export and redo work unchanged; only draft avatar clips are rendered.
@edenreich
edenreich marked this pull request as ready for review September 26, 2026 21:17
Base automatically changed from fix/tools-top-level-config to main September 27, 2026 01:09
@inference-gateway-maintainer inference-gateway-maintainer Bot moved this to Todo in 2026 Sep 27, 2026
@edenreich
edenreich merged commit 72bb672 into main Oct 1, 2026
1 check passed
@edenreich
edenreich deleted the feat/avatars branch October 1, 2026 15:11
@inference-gateway-maintainer

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.51.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@inference-gateway-maintainer inference-gateway-maintainer Bot added the released Shipped in a release label Oct 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released Shipped in a release

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

[FEATURE] Avatars: record once, reuse a talking avatar in Content projects

1 participant