---
agent:
  instructions: "Use this search API to find relevant content across this site with keywords or natural-language queries, instead of crawling individual pages. Results are returned in Markdown."
  endpoint: "https://framesfield.com/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://developers.cloudflare.com/ai-search/how-to/search-for-agents/"
title: "Topaz 4K Upscale & Sync Lipsync 2.0 fal.ai Batch Skill"
description: "Executable SKILL.md playbook teaching Claude Code, Cursor, and Codex how to trim dead settle frames, run fal.ai queue jobs for Topaz Video Upscale (Proteus 4K $0.08/s, Gaia 2 half-price animation $0.04/s) and Sync Lipsync 2.0 ($3/min Standard · $5/min Pro), and re-mux untouched 48 kHz WAV audio at -14 LUFS."
canonical: "https://framesfield.com/skills/topaz-upscale-and-sync-lipsync-fal-skill"
---

# Topaz 4K Upscale & Sync Lipsync 2.0 fal.ai Batch Skill

> Executable SKILL.md playbook teaching Claude Code, Cursor, and Codex how to trim dead settle frames, run fal.ai queue jobs for Topaz Video Upscale (Proteus 4K $0.08/s, Gaia 2 half-price animation $0.04/s) and Sync Lipsync 2.0 ($3/min Standard · $5/min Pro), and re-mux untouched 48 kHz WAV audio at -14 LUFS.

- **Canonical URL:** https://framesfield.com/skills/topaz-upscale-and-sync-lipsync-fal-skill
- **Raw Payload URL:** https://framesfield.com/raw/skills/topaz-upscale-and-sync-lipsync-fal-skill
- **Asset Type:** SKILL.md
- **Compatible Hosts:** Claude Code, Cursor, Codex
- **Target Creative Tool:** fal.ai Queue API / Topaz Video API / Sync Lipsync 2.0 / FFmpeg
- **License:** MIT
- **Last Verified:** 2026-12-01

## Setup & Install

```bash
mkdir -p .claude/skills/topaz-upscale-sync-lipsync && curl -fsSL https://framesfield.com/raw/skills/topaz-upscale-and-sync-lipsync-fal-skill -o .claude/skills/topaz-upscale-sync-lipsync/SKILL.md

```

## Copyable Asset (SKILL.md)

````markdown
---
name: topaz-upscale-sync-lipsync
description: Run fal.ai serverless queue jobs for Topaz Video Upscale (fal-ai/topaz/upscale/video at $0.01-$0.08/s, half price on Gaia 2, 2x for 60fps) and Sync Lipsync 2.0 (fal-ai/sync-lipsync/v2 at $3/min or /v2/pro at $5/min), plus FFmpeg pre-trimming, 48 kHz WAV preservation, and -14 LUFS master verification. Use when upscaling 720p AI clips to 4K or swapping dialogue on talking-head videos.
---

# Topaz 4K Upscale & Sync Lipsync 2.0 fal.ai Skill

## 1. Mandatory Pre-Flight Cost Estimate (Before Any Paid Call)
Always probe clip duration with `ffprobe` and print estimated fal.ai spend before submitting:
- **Topaz Video Upscale (`fal-ai/topaz/upscale/video`):**
  - `<=720p`: `$0.01/sec` | `720p–1080p`: `$0.02/sec` | `>1080p (4K)`: `$0.08/sec`
  - Multipliers: `target_fps: 60` = `2x` rate; `model: "Gaia 2"` (animation/CGI) = `0.5x` rate.
- **Sync Lipsync 2.0:**
  - `fal-ai/sync-lipsync/v2`: `$3.00/min` (`$0.05/sec`)
  - `fal-ai/sync-lipsync/v2/pro`: `$5.00/min` (`$0.083/sec`)
- **Order of operations rule:** If running BOTH lip-sync and 4K upscaling, ALWAYS run **Sync Lipsync 2.0 first** on the 1080p source plate, then upscale once at the end.

## 2. Topaz Video Upscale Queue Pattern
1. Trim dead opening settle frames (`-ss 0.40`) and extract original 48 kHz WAV audio first.
2. Pick `model: "Proteus"` + `grain: 0.03` for photoreal cinema, or `model: "Gaia 2"` (half price, never 60fps) for 2D/stop-motion animation.
3. Submit asynchronously to `https://queue.fal.run/fal-ai/topaz/upscale/video`:
```bash
curl -sS -X POST "https://queue.fal.run/fal-ai/topaz/upscale/video" \
  -H "Authorization: Key $FAL_KEY" \
  -H "Content-Type: application/json" \
  -d '{"video_url":"'"$VIDEO_URL"'","model":"Proteus","upscale_factor":3,"grain":0.03,"H264_output":true}'
```
4. Poll the returned `status_url` with backoff (5s → 10s, bounded max 60 polls) until `status === "COMPLETED"`, then fetch `response_url` and download `video.url`.

## 3. Sync Lipsync 2.0 Queue Pattern
1. Verify audio duration is within +/-5% of source video duration using `ffprobe`. Warn the user before submitting if delta exceeds 15% (do NOT blindly use `sync_mode: "remap"` on large mismatches).
2. Default `sync_mode: "cut_off"` (or `"silence"` when audio is slightly shorter than video):
```bash
curl -sS -X POST "https://queue.fal.run/fal-ai/sync-lipsync/v2" \
  -H "Authorization: Key $FAL_KEY" \
  -H "Content-Type: application/json" \
  -d '{"video_url":"'"$VIDEO_URL"'","audio_url":"'"$AUDIO_URL"'","sync_mode":"cut_off"}'
```

## 4. Re-Mux Master Audio & Verify Delivery Specs
Re-attach untouched 48 kHz WAV audio without re-encoding video frames (`-c:v copy`):
```bash
ffmpeg -y -i upscaled_4k.mp4 -i source_audio.wav \
  -map 0:v:0 -map 1:a:0 -c:v copy \
  -af "loudnorm=I=-14:TP=-1.0:LRA=11" -c:a aac -b:a 192k -ar 48000 \
  -shortest -movflags +faststart master_final.mp4
```
Verify `width`, `height`, `pix_fmt=yuv420p`, CFR frame rate, and `sample_rate=48000` with `ffprobe`.
````

## Example Input

```text
Upscale our 4 approved 720p Runway Gen-4 clips in ./selects/ to 4K 24fps using Topaz Proteus with 0.03 grain, print total cost first, and re-mux each clip's WAV stem at -14 LUFS.
```

## Expected Output

```text
Probed 4 clips (18.4s trimmed total). Estimated Topaz 4K 24fps cost: $1.47 (18.4s x $0.08/s).
Submitted 4 async queue jobs to fal-ai/topaz/upscale/video -> all COMPLETED.
Re-muxed 48 kHz WAV at -14 LUFS. ffprobe verified: 3840x2160 | h264 | yuv420p | 24/1 fps | 48000 Hz.
```

## Requirements

- `FAL_KEY` environment variable from fal.ai
- Local `ffmpeg`, `ffprobe`, and `curl` available on PATH
- Publicly reachable URLs (or fal.ai storage uploads) for input video/audio files

## Known Limits

- Never upscale multi-cut montages with target_fps: 60—split into single shots first so optical flow does not ghost across cuts
- Always confirm written presenter consent before calling Sync Lipsync 2.0 on real human footage

## Implementation Notes

## Turning fal.ai finishing jobs into repeatable one-line agent runs

Post-production finishing is where manual browser clicking breaks down: trimming 10 clips, tracking async queue IDs, checking whether a shot needs Proteus (`$0.08/s`) vs. half-price Gaia 2 (`$0.04/s`), and re-muxing untouched 48 kHz audio are tedious by hand but trivial for a coding agent armed with strict rate-card math and `ffprobe` gates.

Install this skill to automate both our [Upscale 720p AI Video to Clean 4K & 60fps Delivery](/workflows/ai-video-720p-to-4k-upscale-and-60fps-delivery-pipeline) and [Talking-Head Explainer & Lip-Sync Voice Swap](/workflows/talking-head-explainer-and-lip-sync-dub-pipeline) pipelines across [Topaz Video Upscale API](/specs/topaz-video-upscale) and [Sync Lipsync 2.0](/specs/sync-lipsync-2).
