/lattifai-skills:lai-alignfrom lattifai-skills
Aligns existing captions to audio/video with word-level precision using the Lattice-1 model. Useful when captions are out of sync or need karaoke-style timestamps.
Ships in lattifai-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Produces word-level and segment-level timestamps with sub-frame accuracy. Requires an API key — see /lai-setup.
Positional args are input_media, input_caption, output_caption. Pick a <base> (the media stem or YouTube ID) and reuse it; outputs land in the current directory:
# <base> = podcast (from podcast.mp3)
lai alignment align podcast.mp3 podcast.srt podcast.aligned.json
# shortcut:
lai-align podcast.mp3 podcast.srt podcast.aligned.json
# or explicit key=value style (interchangeable, useful inside scripts):
lai alignment align --direct -Y \
input_media=podcast.mp3 \
input_caption=podcast.srt \
output_caption=podcast.aligned.json \
caption.input.split_sentence=false
Format is inferred from the output file extension (30+ formats — see /lai-caption). Add --direct -Y for non-interactive pipeline runs.
Output naming: prefer <base>.aligned.json for downstream pipelines (karaoke / translate / diarize all consume aligned JSON). Use <base>.srt etc. only when the alignment result is the final deliverable.
Append as key=value pairs:
caption.input.split_sentence=false (default in examples) — preserve the source caption's original cue boundaries. Set to true to re-segment into natural sentences via wtpsplit; useful when the source has mid-sentence cue breaks (typical for YouTube auto-captions) and you want clean segments for downstream karaoke / translation / summarizationcaption.render.word_level=true — keep per-word timestamps in the output (needed for karaoke; use a JSON or ASS output path)media.streaming_chunk_secs=300 — process audio >10 min with bounded memory (up to 20 h)alignment.device=auto — override auto device (cuda/mps/cpu)Full list: lai alignment align --help.
{
"supervisions": [{
"text": "Hello world",
"start": 0.0,
"end": 2.5,
"words": [
{"word": "Hello", "start": 0.0, "end": 0.5},
{"word": "world", "start": 0.6, "end": 2.5}
]
}]
}
Fan out to other formats (karaoke ASS, TextGrid, SRT, …) via /lai-caption.
| Problem | Fix |
|---|---|
API KEY verification error | Run lai auth trial or lai auth login — see /lai-setup |
| Timing looks wrong | Try caption.input.split_sentence=true or caption.input.normalize_text=true |
/lai-transcribe — generate a transcript first/lai-diarize — add speaker labels to aligned output/lai-caption — convert aligned JSON to any format/lai-youtube — YouTube URL → aligned captions in one commandWhat SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub lattifai/lattifai-skills --plugin lattifai-skills9 skills in this plugin
/lai-captionConvert 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`)./lai-diarizeIdentify speakers ("who said what") in aligned captions via pyannote.audio. Real speaker names come from the agent's own reasoning over transcript + context (default), with a CLI-LLM fallback for headless runs. Trigger on multi-speaker content (podcasts, interviews, meetings) or phrases like "diarize", "speaker detection", "说话人识别", "区分说话人", "label the speakers". Requires aligned captions — run `/lai-align` first./lai-karaokeGenerate viral-ready karaoke / lyric-video subtitles with per-word highlighting in one command. Adaptive font size from media resolution. Ready-made style presets for TikTok, Reels, Shorts, 抖音, 小红书, YouTube, and cinematic long-form. Trigger on "karaoke 字幕", "卡拉OK", "lyric video", "逐词歌词", "按字高亮", "TikTok 字幕", "抖音字幕", "Reels caption", "Shorts caption", "小红书歌词", "viral subtitles", "爆款字幕", or when a song / podcast / video clip is given and per-word highlighted captions are asked for. For general caption format conversion without karaoke styling, use /lai-caption./lai-setupInstall LattifAI and get a free trial API key. Trigger on first mention of LattifAI / `lai`, authentication errors, trial requests, or "how do I get started with alignment" / "我想做字幕对齐" before `lai --version` is verified. Do NOT trigger when already authenticated — route to `/lai-align`, `/lai-transcribe`, etc./lai-summarizeSummarize a transcript, podcast, or long caption file into structured markdown (TL;DR, chapters with timestamps, quotes, entities). **Primary path uses this session's LLM directly — no API key, no model config.** Trigger on "summarize", "生成摘要", "总结", "TL;DR", "episode summary", "what was discussed", or when the user has a long caption and wants key points. CLI `lai summarize caption` is the secondary path for oversized transcripts / headless runs./lai-transcribeTranscribe audio/video to timestamped captions with Gemini (100+ languages) or local Parakeet / SenseVoice models. Trigger on "transcribe", "speech to text", "转录", "语音转文字", "generate captions from audio", or when the user provides an audio/video file with no text. If the YouTube video already has captions, prefer `/lai-youtube`.Other plugins' skills for the same job