What she does on her own
/portrait opens her in a small window of its own (again closes it); /portrait obs
gives a see-through URL for an OBS browser source. She blinks and glances around. While she thinks she
looks up and away, switches sides, glances back at you now and then, and her brow lifts a little, so
thinking is something you can watch. Her ears twitch, and perk up when you start speaking. Her mouth
moves with her actual voice: each sentence's loudness goes to the page as it starts playing, so the lips
match the sound and not a guess. Her mood shows as a smile, a blush or a frown; a failed tool gets a
moment of spiral eyes; a big jump in warmth gets a flustered ><.
On Hyprland the live monitor checks twice a second where her window and your terminal are, and she turns her head and eyes towards the terminal while you talk and while she answers. Move either window and she follows. Anywhere that can't be worked out she looks straight ahead. Framing is bust, face or full body, set in metres on the model rather than pixels, so a 1080p and a 4K screen of the same shape show the same amount of her, only sharper, and a monitor stood on end shows more of her than a wide one.
Two kinds of model
Out of the box she's her own model, a branded robot made in VRoid Studio that ships with the repo. Drop
anything else into portrait/models/, a Live2D model's folder or a .vrm file, and
switch from inside Luna: /portrait models lists what's there, /portrait use 2 or
/portrait use robot switches by number or name. The choice is saved and an open portrait
reloads with the new model straight away. ./viewer.sh serves the portrait on its own, on
a port of its own, with a panel for every model, framing, gesture and reaction, so you can try a model
without Luna running at all.
| Live2D | VRM (3D) | |
|---|---|---|
| Where they come from | Booth, vtuber-nook, the model's own zip. Many are free for personal use; check the page before streaming one | VRoid Studio exports them unchanged. Anything on the standard VRM skeleton works |
| Getting one in | add_live2d.py copies the zip or folder in with plain file names, registers expressions the model forgot to list, shrinks 8K textures to 4K and switches to it | Drop the file in the folder |
| What drives it | The standard Cubism parameters: head angle, eyeballs, eye open and smile, mouth, cheek, brows, breath. Ears are the model's ear physics, found by name | Blink, the five mouth shapes, the mood expressions and look-at from the VRM itself. Ears are bones named like Ear_L |
| More than the head | The body sways on its own, changes posture every half minute, leans in while you talk, hops when pleased, so the clothes physics swings. Breathing is quicker in than out, slower late at night, with a top-up breath before she talks | Full gestures: she waves, hugs, jumps, shrugs, and the tail wags on models with tail bones |
| Faces | Expressions matched to roles by what they show: spiral eyes to confused, >< to flustered, tears to sad | A blush painted on as a second face layer that fades in and out with every expression, since VRoid bakes the cheeks into the texture. Tears that well, streak and dry slowly |
| Per-model settings | A luna.json in the model's folder: credit line, expression roles, ear parameters, crop for bust and face framing, where the cheeks and tear ducts sit. It travels with the model, so switching models switches the settings too | |
The portrait opens in a window of its own with no address bar: a Chromium-style browser's app window
if there is one, otherwise Firefox on a profile of her own with every toolbar hidden, otherwise a tab.
Both kinds can be shown as a hologram: tinted towards one colour, see-through, a glowing edge, faint
scanlines rolling slowly, a tear across the picture every so often and always when a tool fails. It's a
filter over the finished picture, so blinking, talking and the hair physics come through it unchanged.
/holo flips it. The same page drives an HDMI hologram fan or a Holoscope WiFi fan, with a
?fan=1 mode that shows all of her on black and nothing else.
Or just a face
Terminal Luna is the third kind: her face as glowing lines on a screen, the way old sci-fi drew a
computer that talks. There's nothing to download or rig, she's drawn in code, and
/portrait use terminal switches to her. She gets the same events as the other models.
Her mood sets the face she rests on, from the same numbers the 3D model uses. Feelings, emotes,
chat commands and her own *giggles* and 😳 play an expression over it: a wink, a laugh,
a pout, >< eyes and steam when she's flustered, tears, spiral eyes, cross-eyed when she's
booped, around thirty in all. Her voice moves the mouth, with a new shape about every syllable: wide
for ee, round for oh, open for ah. On her own she blinks, glances about, breathes, shows thinking
dots, nods while you talk and drifts off with a zzz.
Her colours, the glow and the line weight are a few lines in her own file, so a second face in other colours is a copy of it.
What's behind her, and what's lit
The background is a setting: her usual dark gradient, see-through, a colour, any picture you drop in
portrait/backgrounds/, or seasonal, which picks a picture from a folder by
the date and the time of day and fades between them on its own. A holiday wins on its days (Halloween,
Christmas, New Year, Valentine's), otherwise the season, and night pictures take over after dark, with
sunrise and sunset worked out for your latitude. South of the equator the seasons flip. Missing pictures
fall back, night to day, holiday to season, so a half-filled folder still works.
Her own robot model has LED paint at the joints, on the chest and at the belt, and with light strips on they react: dark at rest, ears glowing while she listens, a sweep down her body while she thinks, a pulse with her voice while she talks, a flicker when a tool fails, the part you click lighting up. The colour follows her mood unless you pick one. The glow comes from two maps a script makes from the model's own texture, so any model whose strips are painted in one bright colour gets lights the same way, and the maps are plain pictures you can fix in GIMP.
And she has things in her hands now. Once a day in the morning, the first time you're around, she picks
up her mug and takes a sip every few minutes until it's finished. After ten quiet minutes with the
portrait open she brings up a book and reads, turning a page or glancing up at you over it, and puts it
down when you talk to her or presence sees you come back. Props are .glb files in a folder;
the pose studio places one in her hand with handles like Blender's and saves where it sits.
Gestures, and who decides
A 3D model moves more than her head. The built-in set: a wave when you say hi or bye, a hug when you ask, jump and bounce, a shrug when a tool fails, a stretch, a look at her hand and a tuck of her hair on her own every half minute or so, a hand while she talks, a tail wag with the happy ones, a blown kiss and a shy peek for people who role-play with her, and a cry when she stays deeply sad. The affectionate ones only ever come from your own conversations, never from stream chat.
How her replies set them off is a setting, and the cost of each mode is honest:
| Mode | How | Cost |
|---|---|---|
tags | She picks. A line in her prompt lets her place one hidden tag like [hug] where it fits; it's cut out before anything is shown, spoken or saved | About 80 prompt tokens for a few gestures that fit her mood, cached, and a few output tokens when she uses one |
meaning | After she answers, the embedding model compares what was said with a short description of each gesture and plays the one that clearly beats "an ordinary reply" | One embedding call per reply, 10 to 30 ms, off the turn's path |
keywords | Only *hugs*, *waves*, the hug emoji and the like in what she writes, and your hi or hug request | Nothing |
off | Nothing from the conversation. Idle moves and chat still work | Nothing |
Stream chat and Discord reach her too: !wave, !hug, !jump,
!shrug, !kiss, !turn to swing the view round her, a wave back at
anyone's first hello, a jump at a pog, a bounce at a lol. Rate-limited, five seconds between commands,
so a busy room doesn't keep her flailing, and one row in the tools pane turns the lot off.
Making your own, three ways
The pose studio, no code, in a window of its own: /pose, Pose studio in her menu, or the Pages list (Tab once). The debug viewer has two windows: the control panel on the left
plays things, the studio on the right makes and changes them. Pick a gesture from its menu and it opens
on the first key with her holding the pose; click the moment you want on the timeline, click the part of
her to change, and drag its rotation rings like a 3D program's or nudge the sliders. Mirror to the other
side, curl a whole hand at once, set her face at that moment. Tabs for the pose, the keys, the details (its
name, the line that tells Luna when to use it, the words she writes that play it, which touches and moods
it belongs to, a sound, emotes, what the tail does), chains of gestures, and the prop in her hand. Play,
loop, undo and redo, and a refresh keeps unsaved work. Save writes a plain file into
portrait/gestures/ and it plays straight away.
A file in code. Each built-in gesture is one small JavaScript file of key poses in radians
on the standard VRM bone names, with helpers for mirroring and fingers. A new file in the folder is a new
gesture with nothing else to edit: it gets a button in the viewer, /portrait name plays it,
and its about line is what's offered to her as a tag. Flags on the file do the rest:
idle for things she does on her own, private for never-from-chat,
lewd for held back while a tame stream is live, chain for several in a row,
view for swinging the camera round her instead of moving her.
// portrait/gestures/hand_on_heart.js
import { fingers } from './_pose.js';
export default {
about: "touched, grateful", // offered to her as [hand_on_heart]
dur: 3.0, fade: [0.5, 0.6],
keys: [
[0.0, { rightUpperArm: [0, 0.8, 1.15], rightLowerArm: [0, 2.15, -0.15], ...fingers('right', 0.2),
'+head': [0.08, 0, 0.1] }],
[3.0, { rightUpperArm: [0, 0.8, 1.15], rightLowerArm: [0, 2.15, -0.15], ...fingers('right', 0.2) }],
],
expr: { blush: 0.5, happy: [[0, 0], [0.8, 0.5]] },
};
A recorded clip. Poses typed in as numbers are fine for a wave. For real motion, drop a
.vrma into portrait/animations/: XR Animator records one from your webcam, Blender
keyframes one with the VRM add-on, VRoid publishes free samples. wave.vrma replaces the
built-in wave everywhere; wave-2.vrma is another wave picked at random; happy_dance.vrma
is a brand new gesture with a button and a command; anything under private/ never plays
from chat. New clips show up within twenty seconds, no restart. A clips.json beside them
sets the rest per clip: the line that offers it to her, idle or talk, loop and speed, expressions to hold,
whether she keeps her own eyes on you while it plays. Clips play on the standard skeleton, so one recorded
on any model plays on every VRM, with her breathing, blinking and lip-sync carrying on underneath.
Her looks, as cards
The control panel's Cards tab saves the look she has on as a picture: a trading card that carries her model, the room behind her, the hologram filter, her clothes and voice, and the gestures you made. Click a card to put that look back on, or send it to a friend and their Luna can wear it. Her personality stays hers whatever she's wearing. More on the cards page.
Touching her
Click a part of her and she reacts. The zones follow the bones, so they go wherever she goes: head,
nose, mouth, chest, tummy, legs, arms, back, neck, tail. What each one does, per mood, is a table in
portrait/touch.json, and a gesture saved from the studio with a zone and a mood ticked joins
that touch with no other edit. With touch talk on she answers out loud a moment later, in character.
The warm-mood extras and the limits are on the Companion page.
Textures from ComfyUI
New textures for her 3D model, painted by your own ComfyUI from UV templates. A template says where on
the texture a part lives, a bra's cups and straps, the two eye circles; texture.py turns it
into a mask, has ComfyUI paint only that part with whatever checkpoint you have loaded, and puts the result
back at exactly the template's size with everything outside it transparent. Load it in VRoid's texture
editor as a new layer and it lands in the right place. python3 portrait/texture.py irises "ice blue
with silver flecks" from the shell, or "Luna, give me three violet iris options" out loud.