Communitygithub.com

live2d-auto-pipeline

>- End-to-end automated pipeline for turning a single front-facing anime character illustration into a production-ready 3x HD Live2D Cubism 5 model for VTube Studio. Covers see-through layer splitting, immediate GPU RealESRGAN 3x super-resolution with color locking, HD layer QA/repair, zero-GUI Auto_Vtb headless CLI export OR automated Auto_Vtb GUI + psd2live MCP rigging polish (via the companion live2d-pipeline MCP server), Cubism export renaming/validation, and 512x512 VTube Studio icon generation. Use whenever the user asks to create, split, upscale, rig, fix, or package a Live2D VTuber model from an illustration or PSD.

What is live2d-auto-pipeline?

live2d-auto-pipeline is a Gemini CLI agent skill that >- End-to-end automated pipeline for turning a single front-facing anime character illustration into a production-ready 3x HD Live2D Cubism 5 model for VTube Studio. Covers see-through layer splitting, immediate GPU RealESRGAN 3x super-resolution with color locking, HD layer QA/repair, zero-GUI Auto_Vtb headless CLI export OR automated Auto_Vtb GUI + psd2live MCP rigging polish (via the companion live2d-pipeline MCP server), Cubism export renaming/validation, and 512x512 VTube Studio icon generation. Use whenever the user asks to create, split, upscale, rig, fix, or package a Live2D VTuber model from an illustration or PSD.

Works with~Claude Code~Codex CLI~Cursor✓Gemini CLI
npx skills add https://github.com/CirnoOwO/live2d-auto-pipeline/tree/HEAD

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

Live2D End-to-End Automated Pipeline (Single Image -> 3× HD VTube Studio Model)

This skill orchestrates the full workflow from a single character illustration to a verified, high-resolution (3840×3840 / 4096×4096 atlas) Live2D Cubism 5 model ready for VTube Studio, with two zero-manual-click execution modes.

Key Architectural Principle: Always run 3× Super-Resolution immediately after see-through layer splitting (Phase 2), BEFORE artwork touch-ups (Phase 3) and BEFORE Auto_Vtb rigging/export (Phase 4). Doing SR upfront eliminates duplicate rigging work and lets Auto_Vtb build crisp high-res meshes on the first pass.


Environment, MCP Servers & Prerequisites

  • Python Runtime (CUDA GPU): E:\live2d\see-through\.venv\Scripts\python.exe (PyTorch CUDA, PIL, OpenCV, psd_tools).
  • Java 21 Runtime: java in PATH (used by Auto_Vtb headless CLI mode).
  • see-through Repo & Local Models: E:\live2d\see-through\
    • models\seethroughv0.0.2_layerdiff3d
    • models\seethroughv0.0.1_marigold
  • RealESRGAN Anime Weights: RealESRGAN_x4plus_anime_6B.pth
  • Auto_Vtb (2.4 beta): E:\live2d\Auto_Vtb_2.4_beta\Auto_Vtb.exe (app\Auto_Vtb-0.6.0-*.jar, tested on Auto_Vtb_beta 2.4 beta)
  • Registered MCP Servers (~/.gemini/config/mcp_config.json):
    1. live2d-pipeline (Stdio MCP: live2d_pipeline_mcp.py) — Full workflow automation permissions:
      • pipeline_split_seethrough, pipeline_superres_3x
      • auto_vtb_headless_export (100% zero-GUI official Auto_Vtb CLI export)
      • auto_vtb_launch, auto_vtb_open_psd, auto_vtb_export_gui, auto_vtb_save_project_gui (automated GUI open/export/save via Ctrl+Shift+O / Ctrl+Shift+G / Ctrl+Shift+S)
      • pipeline_rig_polish_standard (automated Phase 4 bust isolation + skirt curve + lip opacity + bust render)
      • pipeline_rename_validate, pipeline_generate_vts_icon, pipeline_archive_project
    2. psd2live (Streamable HTTP MCP: http://127.0.0.1:23871/mcp) — Auto_Vtb's built-in 43 live rigging tools for fine-grained custom deformer/keyform edits.

Execution Modes (Choose Based on Requirement)

ModeWhen to UseAuto_Vtb Manual UI Needed?
Mode A — Zero-GUI Headless Full-AutoFastest 100% unattended pipeline from single PNG → ready VTS model + icon.png. Uses Auto_Vtb's official headless CLI (--atlas 4096) + headless PSD bust icon render.None (0 clicks, no GUI window)
Mode B — Studio Rig-Polish Full-AutoCharacters with wide hats, coats/capes, rigid props, or custom accessories requiring fine Phase 4 psd2live MCP rigging (DeformHatFollow, DeformBustChest isolation, DeformSkirtPhysics curve, ArtMeshMouth_lip opacity).None via live2d-pipeline MCP (auto_vtb_open_psd → psd2live MCP → auto_vtb_export_gui); falls back to 2 UI clicks only if running in an isolated non-interactive desktop station.

Pipeline Overview

[Source Image]
   │
   ▼  Phase 1: see-through Split (1280×1280 layered PSD)
   │           MCP: live2d-pipeline.pipeline_split_seethrough  |  scripts/step1_seethrough_split.py
   ▼  Phase 2: Unified GPU 3× Super-Resolution (3840×3840 HD PSD, color-locked)
   │           MCP: live2d-pipeline.pipeline_superres_3x       |  scripts/step2_psd_superres_3x.py
   ▼  Phase 3: 3× HD Layer Visual QA & Artwork Repair (eyes, mouth, hat/cloak splits, props)
   │           references/layer_qa_checklist.md
   ▼  Phase 4: Auto_Vtb Rigging & Export
   │           ├─ Mode A (Zero-GUI): MCP auto_vtb_headless_export (or step4_auto_vtb_bridge.py headless-export)
   │           └─ Mode B (Studio MCP): MCP auto_vtb_open_psd -> psd2live MCP + pipeline_rig_polish_standard -> auto_vtb_export_gui
   │           references/psd2live_rig_playbook.md
   ▼  Phase 5: Clean Model Rename & JSON/Atlas Integrity Check
   │           MCP: live2d-pipeline.pipeline_rename_validate   |  scripts/step5_rename_cubism_model.py
   ▼  Phase 6: 512×512 VTube Studio Icon Generation
   │           MCP: live2d-pipeline.pipeline_generate_vts_icon |  scripts/step6_generate_vts_icon.py
   ▼  Phase 7: Mandatory Editable Project Archival (<CHAR_DIR>\project\)
               MCP: live2d-pipeline.pipeline_archive_project   |  scripts/step4_auto_vtb_bridge.py archive-project

Phase 1: Layer Splitting (see-through)

Preferred via MCP: live2d-pipeline → pipeline_split_seethrough(image_path, out_dir, resolution=1280, steps=30, seed=42).

CLI equivalent:

& "E:\live2d\see-through\.venv\Scripts\python.exe" `
  "E:\live2d\skills\live2d-auto-pipeline\scripts\step1_seethrough_split.py" `
  --image "<SRC_IMAGE_PATH>" `
  --out-dir "<WORK_DIR>" `
  --resolution 1280 --steps 30 --seed 42

Validation Gate:

  • Confirm the generated PSD (<WORK_DIR>\<name>_lrsplit.psd or <WORK_DIR>\<name>.psd — see-through writes L/R layers under <name>.psd in newer builds) exists and inspect extracted layers.

Phase 2: Immediate Unified 3× Super-Resolution (Before Art Fixes & Rigging)

Preferred via MCP: live2d-pipeline → pipeline_superres_3x(input_psd, output_psd, scale=3, export_layers_dir, preview_png).

CLI equivalent:

& "E:\live2d\see-through\.venv\Scripts\python.exe" `
  "E:\live2d\skills\live2d-auto-pipeline\scripts\step2_psd_superres_3x.py" `
  --input-psd "<WORK_DIR>\<name>.psd" `
  --output-psd "<WORK_DIR>\<name>_lrsplit_3x_HD.psd" `
  --scale 3 `
  --export-layers-dir "<WORK_DIR>\layers_3x" `
  --preview-png "<WORK_DIR>\preview_3x.png"

Validation Gate:

  • Confirm built-in round-trip reload assertion passes with all exact layer names intact.
  • Visually inspect <WORK_DIR>\preview_3x.png and individual layers via read_file to spot any see-through splitting or painter-order defects for Phase 3.

Phase 3: 3× HD Layer QA & Artwork Repair (Pre-Rigging)

Read layer_qa_checklist.md and repair splitting/visual defects directly on the 3× PNGs in <WORK_DIR>\layers_3x, then rebuild <WORK_DIR>\<name>_lrsplit_3x_HD.psd.

Priority repairs to check on every character:

  1. Painter Order & Fused Layers: Verify eyelash-r/l & eyebrow-r/l are ABOVE face; split any hat or cloak back fused into topwear (hat-back behind back hair, headwear hat-front above front hair, cloak-back behind sleeves/legs, topwear front vest/shoulder flaps above handwear-r/l & neck).
  2. Eyes: Symmetrical clean eyewhite-r/l, crisp eyelash-r/l, and seamless rounded top domes on irides-r/l (prevents flat-top cutoff when looking down).
  3. Mouth: Replace thin closed mouth with a clean 3× petite anime open mouth (~64×38 px).
  4. Legs/Boots & Hairclips: Split legwear/footwear cleanly into -r/-l and separate hairclips into headwear-r/headwear-l.
  5. Waist & Props: Add waist gap patch; separate rigid bags/badges/wands cleanly so sleeves or skirts never clip through them.

PSD Rebuild Pitfall: Always use PixelLayer.frompil(img, psd, name=name, top=y0, left=x0) (never layer_name=) and run a reload assertion checking every layer.name.

Validation Gate:

  • Render 3× close-up side-by-side verification composites (face/hat vs reference, torso/cloak vs reference, neutral + extreme downward gaze) and inspect via read_file.

Phase 4: Auto_Vtb Automated Rigging & Export

Mode A — Zero-GUI Headless Full-Auto (No Auto_Vtb Window Required)

Preferred via MCP: live2d-pipeline → auto_vtb_headless_export(input_psd, output_dir, atlas=4096).

CLI equivalent:

& "E:\live2d\see-through\.venv\Scripts\python.exe" `
  "E:\live2d\skills\live2d-auto-pipeline\scripts\step4_auto_vtb_bridge.py" `
  headless-export `
  --input-psd "<WORK_DIR>\<name>_lrsplit_3x_HD.psd" `
  --output-dir "<EXPORT_DIR>" `
  --atlas 4096

Runs Auto_Vtb's official JVM CLI (io.github.psd2live.MainKt --input ... --output ... --atlas 4096) in ~10 seconds with zero GUI, directly producing .moc3, .cmo3, 4096×4096 texture_00.png, .model3.json, .physics3.json, expressions, and motions.

Mode B — Studio Rig-Polish Full-Auto (live2d-pipeline + psd2live MCP)

  1. Auto-Open PSD: Call live2d-pipeline → auto_vtb_open_psd(psd_path="<WORK_DIR>\\<name>_lrsplit_3x_HD.psd") (automatically launches Auto_Vtb.exe if needed, triggers Ctrl+Shift+O, loads the PSD, and waits until psd2live MCP reports loaded=true, busy=false).
    • Note: If invoked from an isolated non-interactive desktop session where Win32 cannot focus GUI windows, fall back to asking the user to open the PSD in Auto_Vtb (or switch to Mode A).
  2. Standard Automated Rig Polish: Call live2d-pipeline → pipeline_rig_polish_standard(qa_dir, chest_box, render_bust_out) for strict chest-only DeformBustChest isolation, smooth monotonic DeformSkirtPhysics curve, delicate ArtMeshMouth_lip_0/1 opacity, and 1024×1024 bust render.
  3. Character-Specific Polish via psd2live MCP: Follow psd2live_rig_playbook.md for custom accessories (e.g., DeformHatFollow 3D head-turn warp for hats, rebinding hairclips to DeformHairFrontPhysics, far-ear fade DeformEarOcclusionR/L, pixel-diff heatmap verification, and 4-sheet multi-pose QA verification).
  4. Auto-Export: Call live2d-pipeline → auto_vtb_export_gui(output_dir="<EXPORT_DIR>") (triggers Ctrl+Shift+G Export To Directory and waits for Cubism files to finish writing).

Phase 5: Clean Model Renaming & Integrity Validation

Preferred via MCP: live2d-pipeline → pipeline_rename_validate(model_dir="<EXPORT_DIR>", name="<ModelName>").

CLI equivalent:

& "E:\live2d\see-through\.venv\Scripts\python.exe" `
  "E:\live2d\skills\live2d-auto-pipeline\scripts\step5_rename_cubism_model.py" `
  --model-dir "<EXPORT_DIR>" `
  --name "<ModelName>"

Validation Gate:

  • Reports 0 leftover references, all referenced files exist with non-zero bytes, and texture_00.png (4096×4096 RGBA) loads cleanly.

Phase 6: VTube Studio Icon Generation (icon.png)

Preferred via MCP: live2d-pipeline → pipeline_generate_vts_icon(input_png="<BUST_1024_PNG>", output_png="<EXPORT_DIR>\\icon.png", style="soft-warm", preview_png="<WORK_DIR>\\icon_vts_preview.png").

  • In Mode A (Headless) without a live psd2live bust render, omit input_png and pass input_psd="<WORK_DIR>\\<name>_lrsplit_3x_HD.psd" — the tool automatically composites & crops a crisp 1024×1024 transparent bust portrait headlessly!

CLI equivalent:

& "E:\live2d\see-through\.venv\Scripts\python.exe" `
  "E:\live2d\skills\live2d-auto-pipeline\scripts\step6_generate_vts_icon.py" `
  --input-png "<BUST_RENDER_1024_PNG>" `
  --output-png "<EXPORT_DIR>\icon.png" `
  --size 512 --style soft-warm `
  --preview-png "<WORK_DIR>\icon_vts_preview.png"

Validation Gate:

  • Visually inspect <WORK_DIR>\icon_vts_preview.png via read_file to verify head crown, accessories, face, and collar sit cleanly inside VTube Studio's rounded-square mask.
  • Confirm <EXPORT_DIR>\<ModelName>.vtube.json was automatically generated/updated with "FileReferences": { "Icon": "icon.png", "Model": "<ModelName>.model3.json" } so VTube Studio displays the icon automatically on first import without manual selection.

Phase 7: Mandatory Editable Project Preservation (<CHAR_DIR>\project\)

CRITICAL RULE: Never discard editable project files after exporting to VTube Studio, and never pass --no-cmo3 when exporting from Auto_Vtb. Every pipeline run MUST archive a complete, self-contained editable engineering bundle into <CHAR_DIR>\project\ (separate from the VTube Studio runtime folder <CHAR_DIR>\<ModelName>\) so the character can be re-edited later in Photoshop/CSP, Auto_Vtb, or Live2D Cubism Editor.

Preferred via MCP:

  • (Mode B GUI only, optional before export): live2d-pipeline → auto_vtb_save_project_gui(project_file="<CHAR_DIR>\\project\\<ModelName>.psd2live") (or psd2live.project_save if already bound).
  • (Always required in both Mode A and Mode B): live2d-pipeline → pipeline_archive_project(project_dir="<CHAR_DIR>\\project", model_name="<ModelName>", hd_psd="<WORK_DIR>\\<name>_lrsplit_3x_HD.psd", model_dir="<EXPORT_DIR>", layers_dir="<WORK_DIR>\\layers_3x_repaired", repair_script="<REPAIR_SCRIPT_PY>").

CLI equivalent:

& "E:\live2d\see-through\.venv\Scripts\python.exe" `
  "E:\live2d\skills\live2d-auto-pipeline\scripts\step4_auto_vtb_bridge.py" `
  archive-project `
  --project-dir "<CHAR_DIR>\project" `
  --model-name "<ModelName>" `
  --hd-psd "<WORK_DIR>\<name>_lrsplit_3x_HD.psd" `
  --model-dir "<EXPORT_DIR>" `
  --layers-dir "<WORK_DIR>\layers_3x_repaired" `
  --repair-script "<REPAIR_SCRIPT_PY>"

Preserved Artifacts inside <CHAR_DIR>\project\:

  • <ModelName>_3x_HD.psd — Repaired 3840×3840 layered source PSD (Photoshop / CSP / Auto_Vtb)
  • <ModelName>.cmo3 — Editable Live2D Cubism 5 Editor project
  • <ModelName>.psd2live.json — Auto_Vtb rig metadata & parameter specification
  • <ModelName>.psd2live — Portable Auto_Vtb workspace archive (when Mode B GUI is used)
  • layers_3x_repaired/ — Individual 3× HD layer PNGs + manifest.json
  • repair_<ModelName>_3x.py — Exact reproducible Phase 3 artwork repair script
  • PROJECT_MANIFEST.json — Timestamped manifest indexing all archived files

Validation Gate:

  • Confirm <CHAR_DIR>\project\PROJECT_MANIFEST.json exists and verify <ModelName>_3x_HD.psd and <ModelName>.cmo3 are present with non-zero bytes.

Related Skills