---
name: flux-lora-wan-vace-fal
description: Run asynchronous fal.ai custom FLUX LoRA training (fal-ai/flux-lora-fast-training at $2.00 per 1,000 steps), calibrated FLUX LoRA inference (fal-ai/flux-lora at $0.035/MP), and mask-guided Alibaba Wan VACE 14B video editing (fal-ai/wan-vace-14b at $0.08/sec 720p) via queue.fal.run. Use when training brand/character LoRAs, archiving .safetensors for ComfyUI, or executing surgical video object removal with FFmpeg CFR prep and mask dilation.
---
# FLUX LoRA Training & Wan VACE 14B fal.ai Skill
## 1. Mandatory Pre-Flight Guardrails (Always Print Estimate First)
- **NEVER use synchronous `https://fal.run` for LoRA training or Wan VACE 14B**—both take 60–240s and trigger HTTP 504 timeouts while billing continues. Always submit to `https://queue.fal.run/<endpoint>`, log `request_id`, and poll `status_url` every 8–10s.
- **Verified Rates (2026-12-01):**
- `fal-ai/flux-lora-fast-training`: **`$2.00` per 1,000 steps** (scales linearly with steps).
- `fal-ai/flux-lora`: **`$0.035` per output megapixel** (or `$0` local ComfyUI after downloading `.safetensors`).
- `fal-ai/wan-vace-14b`: **`$0.08` per output video second** at 720p (`$0.40` per 5s; or `$0` local Apache-2.0 ComfyUI).
- **FFmpeg Modern Flag Rule:** Use `-fps_mode cfr` (NEVER removed `-vsync cfr` on FFmpeg 7–9).
## 2. FLUX LoRA Training (`queue.fal.run/fal-ai/flux-lora-fast-training`)
1. Verify local dataset folder first: `12–20` sharp (`>=768px`) varied stills for characters/SKUs (`is_style: false`, `create_masks: true`) OR `15–25` diverse subjects for house art styles (`is_style: true`, `create_masks: false`). Reject blurry `<768px` frames.
2. Enforce a rare synthetic `trigger_word` (e.g., `ff_brand_v1`, never an English dictionary word).
3. Queue training asynchronously:
```bash
curl -sS -X POST "https://queue.fal.run/fal-ai/flux-lora-fast-training" \
-H "Authorization: Key $FAL_KEY" \
-H "Content-Type: application/json" \
-d '{
"images_data_url": "'"$ZIP_URL"'",
"trigger_word": "'"$TRIGGER"'",
"steps": 1000,
"is_style": false,
"create_masks": true
}'
```
4. Poll `status_url` until `COMPLETED`, fetch `response_url`, and **immediately download `diffusers_lora_file.url`** via `curl -fsSL` into local permanent storage / `ComfyUI/models/loras/` (NEVER `models/checkpoints/`).
5. Run a 4-image calibration strip (`$0.14`) on `fal-ai/flux-lora` locking `seed: 4096` and `guidance_scale: 3.5` across `scale` `[0.65, 0.78, 0.88, 1.00]`. Production sweet spot is almost always `0.78–0.88`.
## 3. Wan VACE 14B Video Object Removal (`queue.fal.run/fal-ai/wan-vace-14b`)
1. Conform raw phone/VFR footage to constant 24fps CFR and save 48 kHz WAV audio first:
```bash
ffmpeg -v warning -y -i raw.mov -r 24 -fps_mode cfr -pix_fmt yuv420p -c:v libx264 -crf 16 -an plate_cfr24.mp4
ffmpeg -v warning -y -i raw.mov -vn -c:a pcm_s16le -ar 48000 original_audio_48k.wav
```
2. Dilate any Meta SAM 2 binary mask video by `+11–12px` radially so cast shadows sit inside the white inpaint area:
```bash
ffmpeg -v warning -y -i sam2_mask.mp4 \
-vf "format=gray,boxblur=12:1,lut=y='if(gt(val,18),255,0)',boxblur=2:1,format=yuv420p" \
-r 24 -fps_mode cfr -c:v libx264 -crf 18 -an mask_dilated.mp4
```
3. **Prompt Rule:** NEVER name the deleted object in `prompt`! Describe strictly the revealed clean background; put unwanted items in `negative_prompt`.
4. Submit async to `queue.fal.run/fal-ai/wan-vace-14b` with `match_input_frames_per_second: true` and `match_input_num_frames: true`, download result MP4, and re-mux `original_audio_48k.wav`.