Generating Live2D PSD Templates from YAML
A tool that generates Live2D-ready PSDs from YAML layer structure definitions. Register the result as a Clip Studio Paint template, and the layer scaffolding step disappears from every new character.
Building the PSD layer tree, every time, is tedious
A PSD meant for Live2D is not like a normal illustration. It has to be broken down into many separated layers — front hair, back hair, eyes, brows, mouth, face base, body — each split at joint boundaries. Without that separation, Live2D Cubism cannot deform the parts.
Splitting a finished single-layer illustration after the fact is not realistic. The layers have to be separated from the moment you start drawing.
But here is the thing: the layer hierarchy itself doesn’t change between characters.
- Front hair, face parts, face base, back hair, body
- Eyes: iris highlight, iris, sclera, upper eyelid, lower eyelid
- Mouth: “closed” and “open” as two states
The design of each character is different, but the skeleton of the “deformable structure” is shared. Building folders and layers from scratch every time is pointless manual work.
Clip Studio Paint has a “New from Template” feature. Save a .clip once and you can reuse it. But the structure itself is something I want to manage as YAML — so it’s version-controlled and diff-able.
A YAML → PSD → .clip pipeline
A three-step conversion:
- YAML: define the layer structure
- Node.js script: read the YAML, write a PSD
- CSP: open the PSD, save as
.clip, register as a template
On the Node.js side, I use ag-psd to write the PSD directly. Each layer is an empty 1×1-pixel transparent layer; what matters is the folder hierarchy, layer names, and layer colors.
structure:
- { type: layer, name: 前髪, color: blue }
- type: folder
name: 顔パーツ
color: red
children:
- type: folder
name: 右目
children:
- { type: layer, name: 瞳ハイライト }
- { type: layer, name: 黒目 }
- { type: layer, name: 白目 }
- { type: layer, name: 上まぶた }
- { type: layer, name: 下まぶた }
When opened in CSP, the folder structure, layer names, and layer colors are all preserved.
Three template levels
Live2D is designed to be grown in stages, so there are three templates:
| Phase | Layers | Target motion |
|---|---|---|
| 1 (minimum) | ~15 | Blink, lip sync, head nod |
| 2 (standard) | ~35 | Expressions, head XYZ, basic sway |
| 3 (full) | ~65 | Hair physics, breathing, arms, outfit variants |
Start with Phase 1. Blink, lip sync, and a head nod already make a functional avatar. Grow into Phase 2 and 3 as you need to.
Aiming for everything at once is a path to getting lost.
When you want to change the structure
Because the layer structure lives in YAML, changes are easy:
- Edit
templates/phase2-standard.yaml - Regenerate:
npm run generate:phase2 - Reopen in CSP and resave the
.clip
An added benefit: the evolution of the structure stays in git. You can trace “what did this used to look like?” any time.
The nature of tools like this
Looking back, tools like this are hard to regret building:
- You use it every time you start a new character — utilization grows automatically
- The structure is useful to anyone else doing Live2D, so publishing helps people
- When you come back to it later, the YAML itself serves as the specification
Published
The source is on GitHub. Node.js, MIT License.
It ships with three levels of templates, from a Phase 1 minimum for first-time users to a Phase 3 full rig for production work. The README also walks through registering the generated PSD as a Clip Studio Paint template.