Lai Caption logo

Lai Caption

Organization
lattifai
lai-caption

Convert between 30+ caption/subtitle formats (SRT, VTT, ASS, JSON, TextGrid, LRC, FCPXML, Premiere, …) and shift timing. Trigger on "convert captions", "SRT to VTT", "转换字幕格式", "shift timing", "ASS styling", "karaoke effect", "导入Premiere", or any caption-format question. Do NOT trigger to fix timing accuracy (`/lai-align`) or translate (`/lai-translate`).

Overview

Publisherlattifai
Repositorylattifai-skills
Skill namelai-caption
Stars
32
Forks
1
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by lattifai on GitHub. Read the source before you install it.

Installation

Install the Lai Caption AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/lattifai/lattifai-skills/tree/main/skills/lai-caption
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/lattifai/lattifai-skills.git /tmp/lattifai-skills
mkdir -p .claude/skills
cp -r /tmp/lattifai-skills/skills/lai-caption .claude/skills/lai-caption
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Lai Caption in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Lai Caption on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Lai Caption is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Caption Format Conversion

Convert, shift, and style caption files. Format is auto-detected from file extension.

laicap-convert and lai caption convert are the same command — the former is the shortcut entry-point. For pipeline / non-interactive use, add --direct -Y (direct execution, skip confirmation).

Convert

laicap-convert (== lai caption convert) takes two positional args: input_path and output_path. All styling/rendering keys are flat top-level config (render.*, ass.*), not caption.*.

All examples assume a single <base> (media stem or YouTube ID) reused across the pipeline; outputs land in the current directory.

bash
# <base> = podcast
laicap-convert podcast.srt podcast.vtt

Common pairs:

bash
laicap-convert podcast.aligned.json podcast.srt        # JSON → playback formats
laicap-convert podcast.srt podcast.ass                 # basic → styled
laicap-convert podcast.transcript.md podcast.srt       # Gemini markdown → SRT
laicap-convert podcast.aligned.json podcast.TextGrid   # → Praat

Add -Y for non-interactive runs. Use input_format=srt (top-level flag) to override auto-detection when the extension is wrong.

Shift Timing

bash
laicap-shift podcast.srt podcast.shifted.srt 2.5     # forward 2.5 s
laicap-shift podcast.srt podcast.shifted.srt -1.0    # backward 1 s

ASS Styling

Top-level ass.* keys (see lai caption convert --help for the full list):

bash
laicap-convert podcast.srt podcast.ass \
    ass.font_name="Noto Sans CJK SC" \
    ass.font_size=48 \
    ass.primary_color="#FFFFFF"

Karaoke (per-word highlighting)

Requires word-level JSON input (produced by /lai-align with caption.render.word_level=true, or /lai-youtube with the same flag — the upstream flag populates words arrays in the JSON).

bash
laicap-convert podcast.aligned.json podcast.karaoke.ass \
    ass.karaoke_effect=sweep \
    ass.karaoke_color_scheme=azure-gold

render.word_level scope — default is word-scope (per-word \k / \kf / \ko emission). Only pass render.word_level=false to switch to line-scope (a single override at event start, whole text block animates together — CapCut-style "fade in"). You don't need render.word_level=true to enable karaoke; ass.karaoke_effect alone does it.

  • ass.karaoke_effect: sweep (classic karaoke fill), instant (hard on/off), outline (outline-only highlight)
  • ass.karaoke_color_scheme (12 presets, each tunes primary/secondary/outline/back): azure-gold, sakura-purple, mint-ocean, gardenia-green, sunset-warm, prussian-elegant, burgundy-classic, langgan-spring, mars-teal, spring-field, navy-pink, apricot-dark
  • ass.kinetic_style (orthogonal per-word animation, 15 options grouped by feel):
    • Impact: bounce, pop, shake, pulse, swing
    • Smooth: fade, zoom, rise, typewriter, blur_in
    • Stylized: glow, neon, wave, flicker, stagger

Bilingual ASS

Format selection, typography conventions (line order / color / font-size ratio), and four scenario recipes (learning SRT / social ASS / karaoke / dual-track upload) all live in /lai-translate §Bilingual Delivery Guide — don't duplicate. Minimal one-liner for a bilingual JSON from /lai-translate:

bash
# `<base>.translated.json` is the merged JSON (source + translation) from
# `/lai-translate merge.py --bilingual`.
laicap-convert podcast.translated.json podcast.zh.translated.ass \
    ass.primary_color="#FFFFFF" \
    ass.translation_color="#FFC209"

Add ass.karaoke_effect=sweep ass.karaoke_color_scheme=... for per-word karaoke on the source line.

Speaker Color

ass.speaker_color=... paints dialogue per speaker (needs /lai-diarize output in the source). Accepts:

  • "" — disabled (default)
  • "auto" — 10-color LattifAI palette (cycles for >10 speakers)
  • "#RRGGBB,#RRGGBB,..." — CSV of explicit colors, one per speaker in appearance order
bash
# Host = cyan-blue, Guest = pink — short CSV palette
laicap-convert diarized.json out.ass \
    render.include_speaker_in_text=true \
    ass.speaker_color="#658AE4,#F7C3D9"

Broadcast-Grade Profiles (standardization.*)

standardization.* reflows segments to meet CPL/CPS/duration rules before writing. Useful for delivering SRT/VTT to Netflix-class platforms or tighter YouTube specs.

Fields (all top-level):

  • standardization.min_duration / max_duration — segment duration bounds (s)
  • standardization.min_gap — minimum inter-segment gap (s)
  • standardization.max_lines / max_chars_per_line — line wrapping limits
  • standardization.optimal_cps — target characters-per-second for readability
  • standardization.start_margin / end_margin — pre/post roll per segment
  • standardization.margin_collision_mode — trim (default), drop, …

Ready-made profiles:

bash
# Netflix-ish: 42 CPL × 2 lines, 0.8-7 s
laicap-convert diarized.json out.netflix.srt \
    standardization.min_duration=0.8 \
    standardization.max_duration=7.0 \
    standardization.min_gap=0.08 \
    standardization.max_lines=2 \
    standardization.max_chars_per_line=42 \
    standardization.start_margin=0.05 \
    standardization.end_margin=0.15

# YouTube-ish: shorter cues, narrower lines
laicap-convert diarized.json out.youtube.srt \
    standardization.min_duration=0.5 \
    standardization.max_duration=5.0 \
    standardization.max_chars_per_line=35 \
    standardization.start_margin=0.03 \
    standardization.end_margin=0.10

start_margin / end_margin also benefit karaoke exports (give lyrics breathing room) — combine with the karaoke recipe above.

Supported Formats

CategoryFormats (read & write unless noted)
Standard.srt, .vtt, .ass / .ssa, .lrc, .txt, .md
Data.json, .tsv, .csv, .aud
Linguistic.TextGrid, .ttml / .xml
NLE.fcpxml; .prproj.xml (write-only)

Full list: lai caption convert --help.

Data Preservation

Convert to .json first to keep word-level timing, speakers, and translations — then fan out to delivery formats.

  • Word-level timing: JSON, TextGrid, ASS-karaoke only
  • Speakers: JSON, VTT, ASS, TextGrid (partial in SRT)
  • Full styling: ASS only

Common Issues

ProblemFix
Unknown input formatSpecify input_format=srt (top-level flag, not caption.input_format)
Encoding errorRe-save the file as UTF-8
Karaoke has no highlightingSource JSON needs words arrays — re-run /lai-align with caption.render.word_level=true, then convert with just ass.karaoke_effect=sweep (no render.word_level needed; default is word-scope)
No parameter named 'caption' / 'input'For laicap-convert, styling keys are flat (render.*, ass.*) and input/output are positional (input_path/output_path) — there is no caption.* namespace here
Plain text missing timingAdd timing via /lai-align first

Related Skills

  • /lai-align — fix timing accuracy (conversion doesn't change timing)
  • /lai-transcribe — generate captions from audio first
  • /lai-translate — translate before bilingual conversion
  • /lai-diarize — add speaker labels for speaker-colored output

Frequently asked questions

What does the Lai Caption AI skill do?

Convert between 30+ caption/subtitle formats (SRT, VTT, ASS, JSON, TextGrid, LRC, FCPXML, Premiere, …) and shift timing. Trigger on "convert captions", "SRT to VTT", "转换字幕格式", "shift timing", "ASS styling", "karaoke effect", "导入Premiere", or any caption-format question. Do NOT trigger to fix timing accuracy (`/lai-align`) or translate (`/lai-translate`).

Why use Lai Caption on TypingMind?

Because you install it once and use it with any model. Lai Caption is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Lai Caption in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/lattifai/lattifai-skills/tree/main/skills/lai-caption. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Lai Caption?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Lai Caption?

As many as you like. As long as a model supports skills, you can use Lai Caption with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Lai Caption AI skill free?

Yes. It is published on GitHub by lattifai under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇