Companion Avatar — Multi-State Dynamic AI Companion Avatar & Desktop Icon Universal Skill
Turn any concept, brand vibe, or material preference into 100% identity-locked, zero frame-jump, five-platform-zero-audio-conflict dynamic AI companions (including idle breathing/head-tilt/blink, working headphone-typing + dual status capsules, waving wake-up greeting/completion celebration — all in seamless dynamic WebP, plus full Web PWA / iOS / Android Adaptive desktop icons).
Why not use <video> or direct AI video generation?
- Zero facial drift and zero frame jumps: AI video generation often suffers from hair flickering, facial deformation, impure gray backgrounds, and broken start/end frames. This skill uses "AI-locked high-res master +
NumPy2πperiodic bilinear mesh skeletal deformation" to guarantee 100% same character and absolute start-end closure. - Five-platform zero conflicts (especially compatible with STT & power-saving mode): In iOS
WKWebViewand AndroidWebView,<video>can pop up playback buttons in low-power mode, and when the microphone is active for speech recognition (STT), it can be interrupted byAVAudioSession. Animated WebP (image/webp) uses the system's native image compositor, providing0msoffline first-frame output, low power consumption, and full decoupling from voice input.
Standard Four-Step Workflow
Step 1: Determine Material Style & Character Proposal (output master proposal first when comparing multiple options)
Read the Material & Style Preset Prompt Library and the machine-readable directory index presets/manifest.json. You can directly reuse the 6 officially curated out-of-the-box packages (I / J / G / D / B / A, each includes three-state 20fps dynamic WebP, full-stack desktop icons, and 1024×1024 original high-res master *-source-idle-1024.jpg) from ./presets/, or generate new character proposals using one of the 13 uncanny-valley-proof high-quality materials:
I· Frosted White Jade with Purple Aura Orb (I-frosted-jade-spirit): Warm matte white jade shell with dreamy purple crystal/lavender glow inside (strictly no yellow light), minimalist and restrained.J· Caramel Malt Curly Teddy Bear Cub (J-curly-teddy-cub): Handcrafted micro-curly plush texture, classic high-contrast warm-toned design with pure white background.G· Cream Orange & White Lucky Fold-Ear Kitten (G-silky-plush-kitten): Ultra-soft rabbit plush patchwork craft, a charming little shopkeeper.D· Nordic White Porcelain with Light Maple Wood Robot (D-nordic-porcelain-bot): Matte white porcelain shell + natural light maple wood ear cap + micro-expressive dark face mask.B· Trendy Matte Silky Soft Vinyl Shiba Inu (B-matte-vinyl-shiba): Trendy matte skin-feel soft vinyl, loyal and energetic.A· Handmade Coarse Wool Felt Owl (A-needle-felt-owl): Handcrafted needle-felted wool texture, scholarly and steady.
Hard constraint: All master prompts must require pure
#FFFFFFbackground, above-chest centered composition, ample safe white margins on top and sides so it perfectly crops into an82dpcircular avatar window and won't cut edges when slightly rotated/tilted.
Step 2: Image-to-Image Grounding from Frontal Master
- First generate the
idlefrontal half-body master, visually verify pure white background, rounded proportions, no text/watermarks. - Use this frontal master as reference input to derive two same-identity poses:
working(reply/thinking/calculating state): 3/4 side view facing right, wearing same-color padded over-ear headphones, both paws/hands resting on a mini silver laptop without logos, with ample pure white margins to fully include the device and character inside the inscribed circle.waving(optional, wake-up greeting/completion celebration state): Same frontal proportions, eyes become curved smile arcs◠ ◠, one paw/hand raised to the side for waving (if not separately generated, the packaging script can also auto-synthesize a closed-eyes smile bounce loop based onidle).
Step 3: Run the Universal Packager to Produce Dynamic WebP & Full-Stack Icons
Call the built-in script build_companion_pack.py (requires python3, Pillow, numpy, cwebp, img2webp on the local machine):
python3 scripts/build_companion_pack.py \
--idle /path/to/idle_base.jpg \
--working /path/to/working_base.jpg \
--waving /path/to/waving_base.jpg \
--out /path/to/output_dir \
--prefix bibi \
--app-icons
The script automatically:
- Purifies near-white background to uniform
#FFFFFFand fills the circular safe margin; - Auto-detects light face/dark dot eyes or dark mask/luminous pixel eyes, synthesizing natural blink frames without ghosting;
- Generates three
280×280 @ 20fpsseamless loop animations:<prefix>-idle.webp(breathing + curious head tilt + blink),<prefix>-working.webp(alternating paw typing on keyboard + focused slight nod + screen glow reflection + blink),<prefix>-waving.webp(waving sway + light bounce); - If
--app-iconsis passed, simultaneously outputsicon-1024.png(iOS RGB without alpha channel),icon-512.png,icon-192.png(PWA), andic_launcher_fg.png(Android Adaptive108dpsafe zone foreground); - Outputs
<prefix>-qa-sheet.pngfor frame-by-frame visual inspection (must open withread_fileto visually verify blink and edge zero artifacts).
Step 4: Integrate Frontend 240ms Three-State Crossfade Circular Window & Dual Status Capsule
Refer to Frontend Three-State Crossfade & Dual Capsule Template to integrate into the host project:
- All colors must reference the host
tokens.css(adhering to global style hard-coded gate, zero wild#hex); - All state transition timers in JS must call
timer?.unref?.()to avoid blocking Node from exiting in non-browser integration tests.
Presets ship only the animated WebPs, avatar PNGs and QA sheets. The full app icon set and 1024 source images are not included to save space; regenerate with
--app-iconswhen needed. Presets ship only the animated WebPs, avatar PNGs and QA sheets. Run the builder with--app-iconsto regenerate the full icon set.