# Wan2.2 I2V for Retention-Studio Clip Production

Session-derived pattern for using native ComfyUI Wan2.2 as one component in a deterministic short-form content pipeline.

## Core lesson

For production-oriented Shorts, do not treat Wan2.2 as the whole video renderer. Use it for photorealistic texture and motion only, then add captions, numbers, labels, arrows, risk meters, and audit-sensitive facts in a deterministic renderer.

Recommended production chain:

```text
mechanism shot plan
→ keyframe prompt
→ approved 9:16 keyframe
→ Wan2.2 image-to-video variants by seed
→ human/automated clip review
→ deterministic caption/overlay/audio renderer
```

## Prompting pattern

Use a short, concrete I2V prompt with:

- one subject
- one action
- one camera move
- explicit identity preservation
- balanced exposure
- no baked text/logos/watermarks

Template:

```text
Photorealistic vertical video of the same [subject] in [environment].
Camera [single camera move].
[One motion/detail cue].
Stable composition, balanced exposure, realistic reflections/materials.
Preserve the same [subject] and [environment].
No text, no logo, no watermark.
```

Negative prompt baseline:

```text
cartoon, animation, deformed subject, duplicated subject, disappearing subject, melting body, distorted geometry, blurry, low detail, flickering colors, abstract, static image, camera shake, overexposed, underexposed, dark frame, text, subtitles, captions, watermark, logo, unreadable letters, fake UI text
```

Domain-specific additions for money/auto/system videos:

```text
fake numbers, fake labels, brand logos, unreadable license plate, fake license plate text, distorted wheels, melted car body, broken windshield geometry
```

## Keyframe requirements

A good keyframe matters more than another clever text prompt. Require:

- full subject clearly visible
- silhouette supports the intended movement
- enough free space in movement direction
- clean negative space for captions in upper/lower thirds
- no readable text, logos, UI gibberish, license plates, fake numbers
- balanced exposure; avoid dark or overexposed frames
- exact/near-exact target aspect ratio before upload

Bad example: a front-facing sitting rabbit as the start image for “rabbit hopping across meadow”. It preserves identity but does not support motion.

Good example: side-view rabbit in mid-hop pose with open meadow ahead.

## A5000 native Wan2.2 baseline

Known-good local/Tailscale native stack:

```text
UNET: wan2.2_ti2v_5B_fp16.safetensors
T5:   umt5_xxl_fp8_e4m3fn_scaled.safetensors
VAE:   wan2.2_vae.safetensors
```

Conservative production-preview settings:

```text
416x736
61 frames
12 fps
12–16 steps
CFG 4.5–6.0
sampler uni_pc
scheduler simple
```

Avoid 10 fps for anything that will be reviewed as motion quality: it is acceptable for smoke tests, but it visibly stutters with push-ins/parallax and can make a good prompt look worse than it is. For final Shorts, generate locally at ~12 fps if VRAM-bound, then retime/interpolate/render the final assembly to 24 fps. Do not ask Wan2.2 to produce text/labels at 24 fps; let the deterministic renderer handle overlays.

Use 3+ seeds per approved keyframe and select the best clip; do not judge the model from one seed.

## Pipeline artifact shape

Useful repo-level abstractions for future projects:

- `keyframe_prompt`: converts shot plans into keyframe prompt + I2V motion prompt + negative prompt + ComfyUI preset.
- `keyframe_package`: creates image-generator requests with target paths and acceptance checklists before any GPU run.
- `i2v_clip_jobs`: expands I2V prompt plans into seeded scene jobs with keyframe/output paths and review criteria.
- `comfyui_client`: uploads the keyframe, submits native Wan2.2 workflow, polls queue/history, downloads MP4.
- `i2v_job_runner`: skips missing keyframes and existing outputs, supports dry-run/limit, writes run reports, and can resume after a timeout.

Clip job status should start as `needs_keyframe` until the expected image exists. This prevents accidental GPU runs with missing/placeholder keyframes. Unit tests for this status must use a temporary keyframe root; otherwise real production keyframes in `data/keyframes/...` can flip expected status from `needs_keyframe` to `ready` and make tests environment-dependent.

## Running and resuming seeded jobs

Recommended execution pattern:

```text
1. Generate/approve keyframes.
2. Run one limited job first (`--limit 1`) to validate upload, workflow, poll/download, and frame geometry.
3. ffprobe the first MP4: width/height, fps, frame count, duration.
4. Extract a mid-frame and visually inspect before launching all seeds.
5. Run the full job package; if the command times out while ComfyUI keeps running, poll `/queue`, inspect `/history`, download the completed file from `/view`, then rerun the runner so existing outputs are skipped and remaining jobs continue.
```

For SaveVideo / video outputs, parse ComfyUI history defensively. Output nodes may include metadata lists such as `"animated": [true]` beside the actual file list. Do not call `.get()` on every list item. Ignore `bool`/`null` metadata, require dict items with string `filename`/`subfolder`/`type`, validate the downloaded file exists, and ffprobe duration/FPS before declaring success. A nonzero runner exit code is not success unless explicitly marked recovered and then validated; otherwise block the final artifact. If a raw Wan clip is much shorter than the target final duration, block or hard-warn instead of hiding it as a loop under overlays.

Do not commit raw generated MP4s/keyframes by default. Commit durable metadata instead: run reports, clip review JSON, tests, and pipeline code. Keep media as local/runtime artifacts unless the user explicitly wants assets versioned.

## Keyframe fallback caveat

If the preferred image generator is unavailable, edited source-photo keyframes can unblock pipeline validation, but label them as test-quality. Neutralizing logos/license plates often leaves circular/blurred patches that remain visible in I2V outputs. Use these only to validate the runner/assembly path; replace them with clean purpose-generated keyframes before judging final content quality.

## Review criteria

For each generated clip, check:

- subject is clear in first 0.5s
- motion supports the retention beat
- no baked text/logos/watermarks
- no distracting deformation/flicker
- caption-safe space remains
- usable duration is long enough for the planned edit

Technical success is not content success. A clip can render correctly and still be rejected if it does not serve the hook/body/payoff beat.
