Skip to content
livliv-devPublic

About

A lightweight 2.5D character player for the web, with lip sync and webcam face tracking.

Topics

Resources

Contributing

Security policy

Stars

1.7k stars

Watchers

3 watching

Forks

Repository files navigation

LivLiv Player

Anime characters that breathe, blink and talk, right on your web page.
A small WebGL2 player. A few lines of code, and 23 characters to start with.

livliv-dev%2Fplayer | Trendshift
npm License: Apache-2.0

English · 中文 · 日本語 · Tiếng Việt

Featured characters breathing, blinking, turning their heads and talking

▶ Try it in your browser

  • Small. WebGL2, no dependencies, about 45 KB gzipped.
  • Talks and copies you. Lip sync from a mic, audio or video, and webcam face tracking. Both run in the browser and load only when you use them.
  • Feels alive. It breathes, blinks, looks at your pointer, and its long hair swings. You can tune the feel while it plays.
  • Plays well with others. LivLiv, VRM and PNGTuber characters on one API, plus full-body characters that stand on the ground.

Quick start

npm i @livliv-dev/player
import { Player } from '@livliv-dev/player'

const player = new Player(document.querySelector('canvas'))
await player.load('https://livliv-dev.github.io/player/characters/v05.livliv')   // Lilith
player.act('nod')

That's it, she's on your page. A couple more tricks:

// talk: the mouth moves with the sound
import { createSpeech } from '@livliv-dev/player/voice'
const speech = createSpeech(player)
button.onclick = () => { speech.unlock(); speech.say('/hello.mp3') }

// copy your face from the webcam (needs @mediapipe/tasks-vision)
import { startFaceTracking } from '@livliv-dev/player/tracking'
await startFaceTracking(player)

VRM and PNGTuber characters go through BodyPlayer, same API. Expressions, actions, feel settings, recorded poses and the rest are in API.md; the .livliv format is in FORMAT.md.

Meet the cast

23 characters, free to use with credit. Click one to play it in the demo; the id under it downloads its .livliv.

Lilith
Lilith
v05
Nana
Nana
d03
Mira
Mira
v03
Stella
Stella
v07
Aster
Aster
v01
Sena
Sena
k01
Aoi
Aoi
char06
Usa
Usa
v06
Hana
Hana
s01
Yui
Yui
d01
Nana
Nana (refined)
d03ft
Sora
Sora
char07
Elio
Elio
k02
Leo
Leo
d02
Kai
Kai
v04
Max
Max
w01
Kujira
Kujira
p01
Kujira Q
Kujira Q
p02
Pen
Pen
p03
Tsubaki
Tsubaki
f05
full body
Neve
Neve
f06
full body
Juno
Juno
f07
full body
Viola
Viola
f08
full body

Load one by URL, https://livliv-dev.github.io/player/characters/<id>.livliv (served with CORS), or copy its folder from characters/ next to your page. index.json lists them all. Each has a cover.webp to show while it loads (the poster option), and full-body characters pick their shot with player.view.fit: 'frame', 'knee' or 'whole'.

Want your own? Bring a PNGTuber (two pictures) or a VRM, or make one from a single picture on livliv.ai and download its .livliv.

What's new

0.6: long hair swings and rests on the body, blinks close cleanly, and feel settings change live with setTuning(). VRM files from Blender play too. Pages written for 0.5 just work. Everything is in the changelog and the releases.

Made by LivLiv

We want the art of creating characters to belong to everyone.

We're open-sourcing our AI tools for character creation, the player and its playback protocol, and a stage where your characters can meet an audience. Made something with it? Show us on Discord or X.

The fine print: character licence, AI, Live2D, embedding, developing

The characters' licence

Most featured characters were made by LivLiv: use them free with credit ("Characters: LivLiv (livliv.ai)"), commercially too if you are an individual. Don't sell them or merchandise made from them, and don't train AI models on them. They are not covered by the Apache License; the terms are in characters/LICENSE.md. Kujira, Kujira Q and Pen come from other people's work, with their own terms in characters/CREDITS.md. The npm package is the player alone: copy the characters you use next to your page, with their licence.

Made with AI

Making a character on livliv.ai uses AI, and the featured characters were made there too. Kujira, Kujira Q and Pen adapt other people's characters, and refined Nana (d03ft) has swinging parts and head-turn keyforms added with LivLiv's own tools. When you show a character made with LivLiv in public, say that AI was used to make it, and don't present it as hand-drawn or hand-rigged. A package's meta.author and meta.license record who made it and on what terms: keep them and follow them.

The player itself only plays. It calls no AI service and reads only the files you point it at. Face tracking runs Google's MediaPipe in the browser, and camera images stay on the device; API.md has the networking details.

Not Live2D

LivLiv Player and the .livliv format are LivLiv's own work. They use no Live2D software or Cubism SDK and don't read .moc3 or .cmo3 files. "Live2D" is a trademark of Live2D Inc.; LivLiv is not affiliated with it.

Embed without code

<iframe src="https://livliv.ai/live/k01" width="480" height="640" allow="camera; microphone"
  style="border:0;background:transparent"></iframe>

The /live/<id> page has a transparent background and works as an OBS Browser Source too.

Develop

git clone https://github.com/livliv-dev/player
cd player
npm install
npm run check          # types
npm run build          # dist/: the entries (ES modules), chunks/ and types/
npm test               # unit and fuzz tests (Node 22.18 or newer, no browser)
npm run test:browser   # every featured character in headless Chromium; once: npx playwright-core install chromium-headless-shell
npm run test:engines   # a sample on Firefox and WebKit; once: npx playwright-core install firefox webkit

Then serve the folder and open /example/demo.html (?model=../characters/<id>/ picks a character); /example/png.html and /example/vrm.html show a PNGTuber and a VRM. src/runtime/ is the renderer and motion code livliv.ai runs. See CONTRIBUTING.md; security reports go to SECURITY.md.

Browser support

WebGL2 and ES2023: Chrome / Edge 97+, Firefox 104+, Safari 15.4+. Tested on current desktop browsers, not yet on phones.

License

The code is under the Apache License 2.0 (see also NOTICE). The featured characters have their own licence, characters/LICENSE.md. You may keep the LivLiv name and logo in your own versions, as long as they don't claim to be the official one.

Thanks

Thanks to 上善无形, ZipZipPipe and 贱兔死顺盖, whose characters Kujira, Kujira Q and Pen are based on: see characters/CREDITS.md.

Lilith Nana Mira
That's the tour. Go make something cute.

About

A lightweight 2.5D character player for the web, with lip sync and webcam face tracking.

Topics

Resources

Contributing

Security policy

Stars

1.7k stars

Watchers

3 watching

Forks

Releases

Packages

Contributors

Languages