# Engineer Visualopen Lushows

> Manual de ingeniería de élite para CONSTRUIR, DESPLEGAR y VENDER software y apps de IA end-to-end (366 referencias bajo demanda). NÚCLEO — auto-hospedar IA VISUAL open-source (avatares parlantes, video, imagen, lip-sync, TTS, 3D) en GPU serverless BARATO y CORRECTO: RunPod/Modal/Replicate, CUDA/torch/flash_attn/xformers (ABI), OOM de RAM/VRAM, modelos que cargan sub-modelos, sizing de disco y Network-Volume, video segmentado/largo, elegir GPU (Ampere/Ada/Hopper/Blackwell), HANDLER de producción, integrar app (submit/poll/webhook, timeouts, cold-start, execution-timeout), build Docker (GHCR+Actions, smoke-test), afinar VRAM/fragmentación/OOM-mid-run, torch.compile/TensorRT, cuantización (fp8/SVDQuant/GGUF/AWQ/ torchao), multi-GPU (context/sequence parallel), serving (ComfyUI/Triton/vLLM/SGLang), billing de RunPod, storage R2/S3, evals (FID/FVD/LSE), ffmpeg, resiliencia/fallback a API premium. AHORA TAMBIÉN FULL-STACK DE PRODUCTO: web frontend (React/Next/Tailwind/forms/animación/testing) y seguridad web (CSP/X

- Skill: `lushows/engineer-visualopen-lushows` (Agent Skill, multi-file: 367 files)
- Install (CLI): `npx skillmds@latest add lushows/engineer-visualopen-lushows`
- Raw SKILL.md: https://api.skillmd.com/api/skills/lushows/engineer-visualopen-lushows/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Web & Frontend
- Author: Lushows (https://skillmd.com/u/lushows)
- Updated: 2026-09-21
- Page: https://skillmd.com/skills/lushows/engineer-visualopen-lushows

---


# engineer_visualopen_lushows

Manual de ingeniería para desplegar IA visual open-source en GPU serverless. Nace de
una sesión real (LongCat-Video-Avatar 1.5 en RunPod) donde se perdieron horas por
errores evitables. **La meta: cero adivinanzas, estructura actual, iteración fluida.**

## 📚 Biblioteca de referencias (carga bajo demanda, `references/`)

El cuerpo de este SKILL.md es el núcleo (reglas, matriz, debug, costo, handler, build).
Para profundidad por tema, lee el archivo de `references/` correspondiente:

- **`references/01-audio-avatar-pipeline.md`** — audio que mueve la boca: separación de voz
  (audio-separator/UVR), encoders (Whisper vs wav2vec2), prep (16kHz, pyloudnorm, alineación
  frames↔audio), evaluar sync (LSE-C/LSE-D), TTS open (F5/Kokoro/XTTS). **Léelo para avatares/lip-sync.**
- **`references/02-open-models-catalog-2026.md`** — catálogo de modelos visuales open con params, VRAM
  (fp16→quant), **licencia** y fit por tarjeta (24/48/80GB). Avatares, T2V/I2V, imagen, lip-sync.
  **Léelo al ELEGIR modelo** (ojo licencias: FLUX-dev/FLUX.2 non-commercial; LongCat-Avatar=MIT).
- **`references/03-model-customization-lora-controlnet.md`** — **LoRA** (cargar/apilar/fusionar/entrenar),
  **ControlNet**, **IP-Adapter/InstantID**, img2img/inpaint/condición de video, y **prompt engineering**
  (weighting, negatives, CFG distilled). **Léelo para personalizar/condicionar un modelo o afinar prompts.**
- **`references/04-systems-layer-gateway-queue.md`** — la app que fronta la GPU: **async Python** (GIL,
  asyncio/threads/procesos), **FastAPI gateway** (BackgroundTasks NO es cola), **Postgres como cola**
  (FOR UPDATE SKIP LOCKED, LISTEN/NOTIFY), brokers (Celery gotchas), caché/dedup, rate limiting, API design.
  **Léelo al construir el backend que orquesta los jobs.**
- **`references/05-tts-voice-cloning-2026.md`** — **TTS open + clonación de voz**: catálogo con licencia
  (Kokoro/Chatterbox/CosyVoice2/Fish/Higgs Apache-MIT; F5/XTTS non-commercial), zero-shot (segundos de ref,
  es-CO), streaming/latencia, emoción, self-host vs API, flujo "voz de WhatsApp" (Whisper→LLM→TTS). **Léelo para voz.**
- **`references/06-comfyui-backend-produccion.md`** — **ComfyUI headless como API**: `/prompt`+WS+`/history`,
  API format, custom nodes/Manager/snapshots, comfy-deploy/serverless, `extra_model_paths.yaml`, ComfyUI vs
  handler vs diffusers. **Léelo si tu pipeline es un node-graph.**
- **`references/07-training-finetuning-a-fondo.md`** — **LoRA/DreamBooth/full/TextInv** (cuándo cada uno),
  dataset prep (imgs/captions/buckets/reg), tools (kohya/ai-toolkit/SimpleTuner/OneTrainer), hiperparámetros
  REALES SDXL vs FLUX, overfitting, LoRA de VIDEO (Wan/LTX/motion). **Léelo para entrenar.**
- **`references/08-upscaling-restauracion.md`** — **Real-ESRGAN/SUPIR/SwinIR/HAT** + cara **GFPGAN vs
  CodeFormer** (`fidelity_weight`), tiled upscaling sin OOM, pipeline 480p→1080p, restauración de video
  (temporal). **Léelo para upscale/restaurar.**
- **`references/09-interpolacion-edicion-video-ffmpeg.md`** — **RIFE/FILM/IFRNet** (interpolar fps), pipeline
  render-chico→interpolar→upscalar, **ffmpeg avanzado** (concat/trim `-c copy`/crop/overlay/fade/subs/audio/
  GIF), codecs H.264/VP9/AV1 + faststart/yuv420p. **Léelo para editar/exportar video.**

### Roadmap de referencias (✅ 366/366)
**Dominio (IA visual/avatar):** 01 audio-avatar · 02 catálogo modelos · 03 LoRA/ControlNet · 05 TTS/clonación
voz · 06 ComfyUI backend producción · 07 training/fine-tuning a fondo · 08 upscaling/restauración (Real-ESRGAN/
GFPGAN/CodeFormer/SUPIR) · 09 interpolación + edición de video.
**GPU/infra:** 10 profiling/optimización (torch profiler/nsight) · 11 TensorRT/ONNX/compilación AOT · 12
cuantización con código · 13 multi-GPU/distribuido (FSDP/DeepSpeed/NCCL/context-parallel) · 14 batching/KV-cache/PagedAttention.
**Serving/MLOps:** 15 observabilidad prod (Prometheus/Grafana/DCGM/Sentry/OTel) · 16 CI/CD para modelos · 17
evals generativos (FID/FVD/CLIP/LSE) · 18 model registry/versionado · 19 load-testing/capacity (Ley de Little).
**Arquitectura de código/sistemas:** 04 gateway/cola · 20 diseño de APIs (REST/gRPC/GraphQL) · 21 Postgres a fondo
+ pgvector · 22 caching/CDN · 23 event-driven (Kafka/Streams/outbox/saga) · 24 microservicios vs monolito ·
25 código limpio (SOLID/pydantic/types) · 26 testing a fondo (pytest/mocking/e2e).
**Seguridad/ops:** 27 seguridad de apps (OWASP 2025/authn/JWT/OAuth) · 28 seguridad de IA/agentes (prompt injection/
guardrails/OWASP LLM Top 10) · 29 IaC & deploy (Docker/Terraform/k8s/Render) · 30 FinOps de GPU.
**LLM & RAG (ola 2):** 31 RAG a fondo (chunking/embeddings/rerank/hybrid/RAGAS) · 32 agentes y tool-use (ReAct/
MCP/LangGraph/cuándo agente vs workflow) · 33 servir tu propio LLM (vLLM/SGLang/structured output) · 34 prompt
engineering LLM (system prompt/structured/prompt-caching/reasoning) · 35 vision encoders y VLMs (CLIP/SigLIP/DINOv3, auto-caption/moderación).
**Dominio extendido (ola 2):** 36 datasets/scraping/captioning (auto-caption training) · 37 moderación/safety de
imagen (NSFW/**CSAM obligación legal**) · 38 watermarking/procedencia (C2PA/SynthID/EU AI Act Art.50) · 39 legal de
IA generativa (copyright/likeness/deepfakes/NO FAKES/Colombia) · 40 voz en tiempo real (STT/TTS streaming/voice agents).
**Integraciones & sistemas (ola 2):** 41 WhatsApp Cloud API a fondo (templates/media/24h/Flows/pricing) · 42 pagos
LatAm (Stripe/Wompi/MercadoPago/PSE/Nequi/Pix/COD) · 43 search (Postgres FTS vs Meili/Typesense/ES + hybrid) · 44
realtime (SSE/WebSocket/WebRTC + backplane Redis) · 45 Kubernetes a fondo (GPU Operator/KEDA/cuándo NO usarlo).
**🎨 DIRECCIÓN CREATIVA — crear imágenes/videos/animaciones (ola 3):** 46 dirección de arte de imágenes IA
(composición/luz/óptica/film-stock, anti-AI-slop) · 47 dirección cinematográfica de video (shot types/camera moves/
Veo/Kling/Runway/Higgsfield) · 48 animación con IA (motion brush/avatares/loops/cinemagraphs) · 49 consistencia de
personaje y marca (sref/cref/LoRA/IP-Adapter/Kontext) · 50 storyboard & planificación de shots · 51 transiciones y
montaje (J/L cuts/match cut/xfade/Rule of Six) · 52 color grading & look cinematográfico (Resolve/scopes/grano/
halación) · 53 motion graphics & tipografía cinética (captions/Remotion/drawtext) · 54 música/SFX/sonido (ducking/
LUFS/Suno) · 55 pipeline de producción de video IA end-to-end (idea→export, ejemplo reel 30s).
**IA avanzada & producto (ola 4):** 56 RAG agéntico/GraphRAG (Self/CRAG, contextual retrieval, LazyGraphRAG) · 57
fine-tune de modelo propio (avatar/video-LoRA/distillation/GRPO) · 58 observabilidad de LLM/LLMOps (Langfuse/OTel/
evals/cost) · 59 3D generativo (Gaussian splatting/TRELLIS/Hunyuan3D/image-to-3D) · 60 edición de imagen avanzada
(FLUX Kontext/inpaint/BiRefNet/IC-Light relight/compositing) · 61 voice agents & telephony (Vapi/Pipecat/Twilio/
μ-law/latencia) · 62 analytics & tracking (PostHog/funnels/A-B/feature-flags/Habeas-Data) · 63 multi-tenancy &
billing SaaS (RLS/Stripe meters/créditos/quotas) · 64 data pipelines/MLOps datos (Dagster/dbt/medallion/ELT) · 65
automation/n8n (webhooks/firma-HMAC/AI-workflows/cuándo-graduar-a-código).
**Frontend & plataforma (ola 5):** 66 agentes avanzados/computer-use (MCP a fondo, browser/computer automation) ·
67 email transaccional/deliverability (SPF/DKIM/DMARC/Resend/Postmark) · 68 SEO técnico/GEO (CWV/schema/llms.txt
realidad) · 69 i18n/l10n (next-intl/ICU/Intl/es-LatAm/RTL) · 70 accesibilidad a11y/WCAG 2.2 (POUR/ARIA/EAA-2025) ·
71 mobile RN/Expo (SDK54/New-Arch/EAS/push) · 72 búsqueda semántica/embeddings (Qwen3/MRL/HNSW/hybrid/pgvector) ·
73 edge computing/WASM (CF Workers/DO/wasmtime/transformers.js) · 74 seguridad ofensiva/pentesting autorizado
(OWASP WSTG/Burp/nuclei/LLM red-team) · 75 WebGL/Three.js/shaders/creative-coding (R3F/TSL/WebGPU/splats web).
**🎬 Cine, comerciales & producto (ola 6):** 76 VFX/efectos visuales (comp pipeline, keying/roto, Runway-Aleph,
Autodesk-Flow, sims) · 77 comerciales/spots (brief, Big-Idea, AIDA/PAS/StoryBrand, estructuras 6/15/30/60s, DR-vs-
brand, performance-creative) · 78 cine/lenguaje cinematográfico (mise-en-scène, lentes/anamórfico, aspect-ratios,
iluminación de género, DPs) · 79 consistencia de campaña/brand-world (look-bible, style-frames, --sref/style-LoRA,
multi-formato, governance) · 80 visualización/fotografía de producto (packshot/hero, specular control, pipeline
BiRefNet→Kontext→IC-Light, specs Amazon, contact-shadow).
**🔥 ESTADO DEL ARTE jun-2026 (ola 7, snapshot fechado, re-verificar):** 81 modelos imagen SOTA (GPT-Image-2/Nano-
Banana-Pro/FLUX.2/Z-Image) · 82 modelos video SOTA (Veo-3.1/Kling-3/Sora-2/Wan-2.7/LTX-2.3) · 83 LLMs frontier
(Opus-4.8/GPT-5.5/Gemini-3.1/DeepSeek-V4) · 84 avatares SOTA (OmniHuman-1.5/Hedra-C3/HeyGen) · 85 audio SOTA (Suno-V5/
ElevenLabs-Music/Chatterbox).
**Web/frontend moderno 2026 (ola 7):** 86 realtime/CRDT (Yjs/Liveblocks) · 87 state-mgmt (Zustand+TanStack-Query) ·
88 design-systems/tokens (DTCG/shadcn-registry) · 89 web-perf (INP/RSC/CrUX) · 90 PWA/offline (Workbox/Dexie).
**Stack 2026 (ola 7):** 91 Next.js-16/React-19 (Cache-Components/PPR) · 92 frameworks (Astro/Svelte5/RR7/Qwik) · 93
TypeScript-7/tsgo · 94 Tailwind-v4/CSS-OKLCH · 95 tooling (Vite8-Rolldown/Bun/Biome).
**Backend/AI-stack 2026 (ola 7):** 96 DBs serverless (Neon/Supabase/Drizzle-vs-Prisma-7) · 97 backend (Hono/Elysia/
tRPC) · 98 AI-frameworks (AI-SDK-v6/Mastra/LangGraph) · 99 generative-UI/streaming · 100 durable-execution (Inngest/Temporal).
**Negocio/growth 2026 (ola 7):** 101 growth/marketing (loops/CRO/LTV-CAC) · 102 pricing (usage-based/AI-margin/
LatAm-COP) · 103 launch-playbook (waitlist/PH/distribution) · 104 comunidad/retención (aha-moment/Skool) · 105
marketing-con-IA (n8n+LLM/governance).
**IA emergente jun-2026 (ola 7):** 106 robótica/embodied (VLA/π0/Figure/Optimus) · 107 world-models (Genie-3/Marble/
Cosmos-3) · 108 IA-local (Ollama-MLX/Qwen3.6/Apple-FM) · 109 hardware (Blackwell/RTX-5090/Groq) · 110 estado-del-arte-IA (agentes/costo-collapse/EU-AI-Act).
**🏭 PRODUCCIÓN REAL — avatar segmentado en RunPod (ola 8, la sesión que originó este skill, núcleo on-scope):**
111 LongCat-Avatar en RunPod, playbook end-to-end (arquitectura/input verificado/5-errores-caros/costo real) ·
112 execution-timeout & economía del cold start (el fallo a **20m8s**, sizing del timeout, los renders fallidos
SÍ cobran) · 113 **Network Volume** para modelos grandes (matar la re-descarga de 44GB → ~35% menos costo +
más rápido) · 114 video segmentado/largo (`num_segments`: 93-frames/3.72s+3.2s/solape-13/cap, normalizar audio
16kHz) · 115 render largo asíncrono + **poller durable de servidor** (el video no se pierde aunque cierres el
navegador) · 116 voz-clon en producción (retención 7-días de MiniMax/re-clonado resiliente/noise_reduction sin
ffmpeg) · 117 control de cámara/movimiento del avatar **por prompt** (estático/no-zoom, sin negative-prompt,
límite 125-chars) · 118 checklist pre-lanzamiento de render GPU (para no quemar dinero en fallos evitables).
**🛠️ PROFUNDIDAD TÉCNICA — self-hosting de IA visual (ola 9, verificado jun-2026):**
*Avatares & talking-head:* 119 comparativa avatares self-hosted (LongCat/OmniHuman/Hallo3/EMO2/Sonic/MultiTalk/
MuseTalk/SadTalker, VRAM/licencia/fit) · 120 LivePortrait/expression-transfer (Act-One/X-Portrait, retargeting) ·
121 pose/landmarks/audio-encoders para avatar (DWPose/wav2vec2-vs-Whisper/InsightFace, sync).
*Modelos de video:* 122 Wan self-hosting a fondo (T2V/I2V/VACE, 1.3B-vs-14B, fp8) · 123 Hunyuan-Video + FramePack
(video largo en VRAM baja ~6GB) · 124 LTX-Video (DiT rápido casi-realtime).
*Inferencia/optimización:* 125 Diffusers offloading/memoria (model/sequential/group offload, VAE-tiling) · 126
attention backends (FA2/FA3/xformers/SDPA/Sage, ABI — el debug real de LongCat) · 127 torch.compile + TensorRT
para difusión (fp8 Hopper/Ada, warmup).
*Cuantización/memoria/arranque:* 128 cuantización de difusión (fp8/SVDQuant-Nunchaku/GGUF-video/torchao) · 129
VRAM mid-run/OOM hands-on (expandable_segments, picos de VAE) · 130 cold-start optimización profundo (mmap/lazy/snapshot).
*Plataformas GPU:* 131 RunPod a fondo (serverless/pods/flex-active/regiones/volúmenes/billing real) · 132 comparativa
plataformas (RunPod/Modal/Replicate/Fal/Beam/Baseten) · 133 Cog/Replicate packaging.
*Audio self-hosting:* 134 Whisper/faster-whisper/WhisperX (alineación/diarización/word-timestamps) · 135 RVC/voice-
conversion (so-vits/Seed-VC, VC-vs-TTS-clone) · 136 music/SFX gen (MusicGen/Stable-Audio/ACE-Step, licencias).
*Visión utilitaria:* 137 matting/bg-removal a escala (BiRefNet/RMBG-2/SAM/RVM) · 138 upscaling/restauración video a
escala (Real-ESRGAN/SUPIR/SeedVR2, tiling) · 139 ControlNet/IP-Adapter/InstantID serving (consistencia).
*Sistemas/ops de jobs GPU:* 140 streaming de progreso de difusión al cliente (RunPod-stream/SSE/callback_on_step_end) ·
141 webhooks HMAC + idempotencia + DLQ · 142 ffmpeg para avatar/video a fondo (concat segmentos/mux/faststart/NVENC).
**🧱 PROFUNDIDAD II — serving, training, infra y ops (ola 10, verificado jun-2026):**
*Serving frameworks:* 143 ComfyUI custom-nodes + API en producción · 144 Triton Inference Server para difusión
(ensembles/dynamic-batching) · 145 batch/dynamic-batching de difusión (CFG-2×, latencia vs throughput).
*Lip-sync & avatar a fondo:* 146 lip-sync puro (Wav2Lip/MuseTalk-realtime/LatentSync, +restaurador) · 147 avatar
realtime/streaming (STT→LLM→TTS→lip-sync, presupuesto de latencia, WebRTC) · 148 face-restoration del output (GFPGAN
vs CodeFormer — ojo licencia no-comercial).
*Generación imagen/video:* 149 FLUX serving a fondo (dev-non-commercial/schnell/Kontext/fp8/LoRA-stack) · 150 SDXL/
SD3.5 serving optimizado (turbo/LCM/compile) · 151 AnimateDiff + SVD image-to-video.
*Training propio:* 152 LoRA-training de avatar/personaje (dataset→serving) · 153 dataset curation/captioning (JoyCaption/
Florence-2/Qwen-VL) · 154 distillation/aceleración (LCM/Turbo/DMD/Hyper-SD — el `--use_distill` de LongCat).
*Build & entorno:* 155 Docker para ML a fondo (CUDA base/multi-stage/cache) · 156 GHCR + GitHub Actions para workers
GPU (cache/sha-vs-latest/smoke-test) · 157 uv + entornos CUDA reproducibles (lockfiles/índices cu12x).
*Scaling & SRE:* 158 autoscaling de inferencia GPU (scale-to-zero/KEDA/queue-depth) · 159 monitoreo/SLO de servicio
GPU (DCGM/cost-per-job/error-budget) · 160 disaster-recovery + cascada de fallback (self-hosted→API premium).
*Sistemas & datos:* 161 colas de jobs GPU a fondo (BullMQ/Celery/prioridad/DLQ) · 162 storage/CDN para media generada
(R2/S3/signed-URLs/lifecycle) · 163 gestión de pesos de modelos (HF Hub/gated/auth/resiliencia de descarga).
*Calidad, safety & test:* 164 evals de calidad avatar/video (LSE-C/D/SyncNet/ArcFace/VBench) · 165 moderación/safety
del output (NSFW/deepfake/likeness/EU-AI-Act Art.50) · 166 testing del worker GPU local + CI sin GPU.
**🌐 COBERTURA TOTAL — 100 refs de profundidad (ola 11, verificado jun-2026):**
*3D generativo:* 167 image-to-3D (TRELLIS/Hunyuan3D) · 168 Gaussian-splatting serving · 169 NeRF · 170 texturas/PBR ·
171 mesh processing. *Cara/identidad (ojo likeness):* 172 face-swap (InsightFace no-comercial) · 173 PuLID/InstantID ·
174 IP-Adapter face · 175 face-enhance · 176 expression/gaze edit. *Relight/compositing:* 177 IC-Light (V2 non-commercial) ·
178 harmonization · 179 shadow-gen · 180 bg-replacement pipeline · 181 HDR/tone-mapping. *Edición imagen:* 182 inpaint/
outpaint · 183 FLUX-Kontext deep · 184 OmniGen unified · 185 instruct-edit · 186 object removal. *Profundidad/geometría:*
187 depth (DepthAnything/Marigold) · 188 normal/segmentation · 189 optical-flow (RAFT) · 190 tracking (CoTracker/SAM2) ·
191 pose full-body. *Try-on/producto:* 192 virtual try-on (IDM-VTON) · 193 product-photography pipeline · 194 packshot/
ghost-mannequin · 195 texto-en-imagen · 196 QR-art. *Video control:* 197 camera-control · 198 VACE deep · 199 keyframe/
FLF2V · 200 video-extension/loop · 201 video-inpaint. *Video avanzado:* 202 full-body talking avatar (OmniAvatar) · 203
motion/dance-gen · 204 video restyle/relight · 205 audio-reactive video · 206 video super-res temporal. *Motores TTS:* 207
F5-TTS · 208 Kokoro/MeloTTS · 209 XTTS/Coqui · 210 CosyVoice/Fish-Speech · 211 Chatterbox. *Voz avanzada:* 212 emotion/
style TTS · 213 streaming TTS · 214 singing-voice · 215 dubbing/translation · 216 voice-design. *Audio proc:* 217 source-
separation (Demucs/UVR) · 218 denoise/enhance (DeepFilterNet) · 219 audio super-res · 220 forced-alignment/VAD · 221 audio-
watermarking (AudioSeal). *LLM/VLM serving:* 222 vLLM multimodal · 223 SGLang/LMDeploy · 224 TensorRT-LLM VLM · 225 VLM
caption/moderación · 226 structured-output sobre imagen. *Sistemas GPU:* 227 CUDA-graphs · 228 MIG · 229 MPS/time-slicing ·
230 spot/preemptible · 231 checkpoint/resume. *Distribuido:* 232 NCCL tuning · 233 FSDP/DeepSpeed difusión · 234 context/
sequence-parallel video · 235 Ray · 236 gang/topology scheduling. *Training avanzado:* 237 DreamBooth/full-FT · 238
Diffusion-DPO/reward · 239 ControlNet-training · 240 IP-Adapter-training · 241 webdataset/data-loading. *MLOps:* 242
orquestación (Dagster/Flyte) · 243 KServe/BentoML/Ray-Serve · 244 experiment-tracking · 245 data/model-versioning (DVC→
lakeFS) · 246 canary/shadow/blue-green. *Seguridad:* 247 supply-chain (pickle/safetensors) · 248 container/GPU isolation +
SSRF · 249 adversarial/jailbreak · 250 privacidad/biometría · 251 audit-logging. *Costo/bench:* 252 GPU-benchmarking · 253
spot/reserved/arbitraje · 254 cost-allocation/chargeback · 255 TCO self-host-vs-API · 256 throughput checklist. *Edge/on-
device:* 257 CoreML/MLX · 258 ONNX/TFLite móvil · 259 WebGPU/transformers.js · 260 quant/distill edge · 261 browser-avatar.
*Producto/integración:* 262 créditos/cuotas/billing · 263 asset/gallery mgmt · 264 Discord/Telegram bots · 265 prompt-
enhancement con LLM · 266 C2PA/watermark (EU-AI-Act).
**🚀 FULL-STACK DE PRODUCTO — construir y vender apps de IA (ola 12, verificado jun-2026):**
*Copy & contenido:* 267 copywriting persuasivo (AIDA/PAS) · 268 content/SEO-writing · 269 storytelling de marca · 270
email/newsletter copy · 271 social copy/hooks. *Seguridad web:* 272 frontend (CSP/XSS/CSRF/CORS) · 273 auth (OAuth2.1/
passkeys) · 274 API-security (rate-limit/keys/WAF) · 275 secrets-management · 276 supply-chain web (npm/SCA). *Frontend
eng:* 277 component-architecture · 278 forms/validación (RHF/Zod) · 279 animaciones (Motion/GSAP) · 280 data-fetching
(TanStack) · 281 testing frontend (Playwright/Vitest). *Backend/API:* 282 REST/OpenAPI · 283 GraphQL · 284 webhooks/
event-APIs · 285 background-jobs web (BullMQ/Inngest) · 286 file-uploads/media. *Bases de datos:* 287 Postgres avanzado
(EXPLAIN/índices) · 288 Redis patterns · 289 vector-DBs (Qdrant/Pinecone) · 290 modelado/migraciones · 291 ORMs (Prisma/
Drizzle). *Auth & pagos LatAm:* 292 auth-providers (Clerk/Auth0) · 293 RBAC/multi-tenant · 294 Stripe a fondo · 295 pagos
LatAm (Wompi/MercadoPago/PSE) · 296 facturación-electrónica (DIAN/SAT). *DevOps:* 297 CI/CD (GH-Actions) · 298 Docker/
Compose web · 299 deploy (Vercel/Render/Fly) · 300 observabilidad web (Sentry/OTel) · 301 IaC (Terraform/Pulumi).
*Cloud/serverless:* 302 functions edge/lambda · 303 Cloudflare (Workers/D1/R2) · 304 CDN/caching · 305 colas cloud · 306
cron/scheduling. *AI app patterns:* 307 RAG en producción · 308 agentes en producción · 309 memoria de agentes · 310
evals de LLM-apps · 311 guardrails. *AI integración:* 312 streaming-UI · 313 function-calling · 314 MCP a fondo · 315 apps
multimodales · 316 cost-control LLM. *Messaging (negocios LatAm):* 317 WhatsApp-Cloud deep · 318 chatbot-UX · 319 Baileys ·
320 Telegram/Discord/IG · 321 inbox omnicanal. *Growth:* 322 SEO-técnico · 323 analytics (PostHog/GA4) · 324 A/B-testing ·
325 CRO/funnels · 326 referral/viral. *Producto/UX:* 327 onboarding/activación · 328 pricing-page · 329 dashboards/data-viz ·
330 design-systems deep · 331 accesibilidad deep. *Mobile:* 332 RN/Expo a fondo · 333 push-notifications · 334 deploy-stores ·
335 offline-sync · 336 native-modules. *SaaS:* 337 métricas (MRR/churn/LTV) · 338 multi-tenancy patterns · 339 billing/cuotas/
créditos · 340 legal/ToS/privacy-LatAm · 341 soporte/helpdesk. *Data eng:* 342 ETL/ELT · 343 warehouse (BigQuery/DuckDB) ·
344 dbt · 345 event-schema · 346 BI/dashboards. *Automatización:* 347 n8n/Make/Zapier · 348 workflow-patterns · 349 scraping ·
350 browser-automation · 351 RPA. *Realtime/colab:* 352 WS/SSE/WebRTC deep · 353 CRDT/Yjs · 354 presence/cursors · 355 live-
updates · 356 calls/LiveKit. *Performance/escala:* 357 Core-Web-Vitals · 358 caching multi-capa · 359 DB-scaling/sharding ·
360 load-testing · 361 rate-limiting. *Fiabilidad/ops:* 362 resilience-patterns · 363 monitoring/on-call · 364 incident/
postmortems · 365 backups/DR · 366 feature-flags/rollout.

> **Cómo crecer:** cada nueva ola añade `references/NN-tema.md` (verificado con research) + una línea aquí.
> Fronteras siguientes: real-time/CRDT (Yjs/Liveblocks), state mgmt avanzado, design systems/tokens, web perf
> profunda, PWA/offline-first, blockchain/web3 (si aplica), game dev, robotics/embodied AI, quantum (futuro), etc.

---

## ⛔ Las 12 reglas de oro (memorízalas — cada una se pagó con horas perdidas)

1. **VERIFICA contra la fuente real ANTES de construir.** Lee el `requirements.txt`, el
   script de inferencia y un JSON de ejemplo del repo oficial. No asumas args, formato
   de input, ni versiones. (Ej: LongCat pinea `torch==2.6.0` exacto → eso decide la GPU.)
2. **NUNCA hornees modelos grandes (>2-3GB) en la imagen Docker.** Reventaba el build de
   RunPod (límite 30 min + `input/output error` al escribir capa gigante). El modelo se
   descarga en **runtime a un Network Volume** (1 vez, lo reusan todos los workers).
3. **La GPU está casada con la versión CUDA/torch de tu imagen.** No es libre. Ver matriz ↓.
4. **OBSERVABILIDAD PRIMERO.** Loguea cada paso (`flush=True`), transmite la salida de
   subprocess EN VIVO a los logs, envuelve el handler en `try/except` con traceback.
   Sin esto, "vuelas a ciegas" y cada iteración cuesta una hora.
5. **No confíes en el auto-build de GitHub de RunPod — está roto/es frágil.** Usa
   **GitHub Actions → GHCR → RunPod descarga la imagen** (patrón ↓). Habilita iteración real.
6. **Investiga lo MÁS NUEVO del mercado, no modelos de hace 2 años.** En IA visual
   open, lo bueno cambia cada mes. Cita papers/repos con fecha.
7. **Verifica compatibilidad ANTES de mandar al usuario a crear cuentas/pagar/buckets.**
   (Storage S3 vs R2, formatos, ACLs, nombres en minúscula, etc.)
8. **En tiempos muertos (builds, deploys), estudia y anticipa.** No esperes ocioso:
   valida el siguiente paso contra el repo real y ten el fix listo.
9. **NO vayas error-por-error: audita el grafo de imports COMPLETO.** Cuando falta un
   módulo, clona el repo y traza todos los imports del script de inferencia. Detecta deps
   que el `requirements.txt` no declara (`triton`, `regex`, `tqdm`) y líneas TÓXICAS que
   rompen pip entero (paquetes que no existen en PyPI, libs de sistema listadas como pip).
   Luego un **smoke-test de imports en el BUILD** (ver §3) atrapa lo que quede.
10. **NUNCA `pip install ... || true`.** Oculta fallos: la imagen compila "verde" y revienta
    en runtime con `ModuleNotFoundError`. Con el resolver moderno de pip, UNA línea inválida
    en el requirements tumba TODO el archivo → no instala NADA. Quita las líneas malas con
    `sed` y deja que pip falle el build si algo falla de verdad.
11. **La RAM del sistema importa TANTO como la VRAM.** Cargar un modelo grande lo INSTANCIA en
    RAM antes de moverlo a la GPU. Un DiT de 13.6B en fp32 = **54GB de RAM** solo para nacer →
    OOM (`SIGKILL -9`, "triggered memory limits") en una GPU con poca RAM. En RunPod la RAM va
    atada a la GPU (A40=50GB, A100=251GB). Calcula RAM ≈ params×4 (fp32) o ×2 (bf16). Ver §6.6.
12. **Lee el CÓDIGO DE CARGA para encontrar TODOS los modelos/archivos que necesita** — no solo
    el repo "principal". Muchos modelos cargan componentes de OTROS repos por rutas relativas
    (`checkpoint_dir/../OtroModelo`, `subfolder="text_encoder"`). Si solo bajas el principal:
    `OSError: Incorrect path_or_model_id`. Grepea los `from_pretrained(...)` y mapea cada ruta. Ver §10.

---

## 1. Matriz GPU ↔ CUDA ↔ torch (junio 2026)

| Arquitectura | GPUs típicas | Compute | CUDA mín | torch wheel | Notas |
|---|---|---|---|---|---|
| **Ampere** | A40, A6000 (48GB), A100 (40/80GB) | sm_80/86 | 11.x–12.x | cu118/cu124/cu126 | El "48 GB" barato de RunPod. Se está volviendo escaso. |
| **Ada** | L4, L40, RTX 4090 | sm_89 | 12.x | cu124+ | |
| **Hopper** | H100, H200 (141GB) | sm_90 | 12.x | cu124+ | Caro pero potente. |
| **Blackwell** | RTX 5090 (32GB), RTX PRO 6000 (96GB), B200 | **sm_120** | **12.8** | **cu128 (torch≥2.7)** | Lo que RunPod empuja en 2026. Las "PRO". |

### Pinning exacto torch ↔ torchvision ↔ torchaudio ↔ índice cu
**Las tres librerías DEBEN ser del mismo par, y el índice cu NO es un superset entre versiones:**

| torch | torchvision | torchaudio | índices cu disponibles |
|---|---|---|---|
| **2.6.0** | 0.21.0 | 2.6.0 | cu118, **cu124**, cu126 — **NO cu128** |
| **2.7.0** | 0.22.0 | 2.7.0 | cu118, cu126, **cu128** — **NO cu124** |
| **2.8.0** | 0.23.0 | 2.8.0 | cu126, cu128, cu129 — **NO cu118/cu124** |

Regla: `torchvision = 0.{torch_minor+15}.0`; `torchaudio = misma versión que torch`. Instala las 3
del MISMO índice: `pip install torch==2.7.0 torchvision==0.22.0 torchaudio==2.7.0 --index-url .../cu128`.
**⚠️ Gotcha:** torch 2.6 NO tiene cu128 (no corre Blackwell); torch 2.7 NO tiene cu124. No asumas que
una URL existe — el set de CUDA cambia cada release.

**Claves:**
- **`torch 2.7.0` fue el PRIMER release estable con soporte nativo Blackwell (sm_120)**,
  con wheels **cu128**. torch 2.6 NO tiene cu128. (PyTorch issue #159207.)
- Una imagen **cu128 corre en TODO** (Ampere+Ada+Hopper+Blackwell) → es la más universal.
  Una imagen cu124 NO corre en Blackwell ("no kernel image is available").
- Error **`no kernel image is available for execution`** = tu torch es demasiado viejo
  para la GPU (ej. cu124 en Blackwell). Sube CUDA/torch.
- Si el modelo pinea `torch==2.6.0` y quieres Blackwell: hay que **forzar torch 2.7+cu128**
  (quitar el pin con `sed` del requirements) — funciona "con ajustes" pero es riesgo.
- **⚠️ torch 2.7.0 ROMPE TODO el ecosistema de atención en cp310** (flash_attn 2.7.4.post1 Y
  xformers 0.0.30 dan el mismo `undefined symbol _ZN3c105Error...__cxx11`; no hay wheel funcional
  de ninguno). **REGLA: NO subas a la última torch porque sí — usa la que el repo pinea y probó,
  salvo que NECESITES una GPU que la obligue.** Y revalúa esa necesidad si cambian las condiciones:
  ej. nos fuimos a Blackwell por "Ampere escaso en la región del Network Volume" → al QUITAR el
  volumen, Ampere volvió a estar disponible → ya no hacía falta Blackwell → volvimos a torch 2.6
  cu124 (combo nativo del repo) y se acabó la guerra de ABI. Una imagen **cu124 corre en
  Ampere/Ada/Hopper** (todo menos Blackwell sm_120) = pool enorme de GPUs sin tocar torch 2.7.

### flash_attn (la trampa #1 de runtime)
- Usa **wheel pre-compilado** que coincida con: python (cp310), torch (torch2.7), CUDA (cu12), ABI.
  Ej: `flash_attn-2.7.4.post1+cu12torch2.7cxx11abiFALSE-cp310-cp310-linux_x86_64.whl`.
  Así NO necesita compilar (sin nvcc, builds rápidos).
- **`undefined symbol: _ZN3c10...` al importar = mismatch de C++ ABI.** Cambia
  `cxx11abiFALSE` ↔ `cxx11abiTRUE` para que coincida con tu wheel de torch.
- **Detecta el ABI de TU torch antes de elegir el wheel** (en vez de adivinar):
  ```python
  import torch
  print(torch.compiled_with_cxx11_abi())   # True -> usa cxx11abiTRUE ; False -> cxx11abiFALSE
  print(torch.__version__, torch.version.cuda)   # para los campos torchX.Y y cu12
  ```
  Decodifica el wheel: `flash_attn-<ver>+cu12torch2.6cxx11abiFALSE-cp310-cp310-linux_x86_64.whl` =
  cuda 12.x · torch 2.6.x · ABI vieja · CPython 3.10. Los 4 (cuda major, torch minor, abi, cp) deben
  coincidir. **2026: torch ≥2.7 suele venir con ABI NUEVA (TRUE)** → el reflejo viejo de usar abiFALSE
  rompe. Verifica con `compiled_with_cxx11_abi()`.
- flash_attn **2.8.x da undefined symbol con torch 2.6**; el **2.7.4.post1 es el combo estable**
  (Dao-AILab/flash-attention #1783). Verifica el ABI del torch oficial que instalas.
- **torch 2.7.0 ROMPIÓ flash_attn 2.7.4.post1**: el wheel da `undefined symbol _ZN3c105Error...`
  porque PyTorch cambió el ABI en 2.7 y ese wheel se compiló contra el viejo. **Cambiar
  FALSE↔TRUE NO basta — no hay wheel funcional** (issues Dao-AILab #1644, #1696, abiertos).
- **⚠️ xformers NO te salva en torch 2.7 cp310:** `xformers==0.0.30` (la única con wheel cp310 para
  cu128) trae su PROPIO `_C_flashattention3.so` que da **el MISMO `undefined symbol _ZN3c105Error...
  __cxx11`** al `import xformers.ops`. O sea: torch 2.7 rompe flash_attn Y xformers en cp310. No
  hay escapatoria fácil por el lado de las librerías de atención.
- **SOLUCIÓN REAL y definitiva: vuelve al torch que el repo pinea.** Si el repo dice `torch==2.6.0`,
  úsalo con cu124 y el flash_attn `cu12torch2.6` (ese SÍ funciona). Pierdes Blackwell, pero cu124
  corre en Ampere/Ada/Hopper (pool enorme). **Pelear con wheels de atención para torch 2.7 = horas
  perdidas; cambiar a torch 2.6 = 1 commit.** (Lección LongCat: gastamos ~2h en flash_attn↔xformers
  ABI antes de simplemente volver a 2.6 cu124, que funcionó al primer intento.)
- Si DE VERDAD necesitas Blackwell (torch 2.7): tus opciones son (a) compilar flash_attn desde
  fuente con nvcc en la imagen (lento, ~30-60min build), o (b) parchear el modelo a SDPA si su
  código lo soporta (`F.scaled_dot_product_attention`, trae FA2 nativa en torch 2.7, sin ABl).
  Ninguna es trivial. Por eso: **NO subas a torch 2.7 salvo necesidad real de Blackwell.**
- El backend de atención suele venir en el `config.json` del modelo (`enable_flashattn2`/
  `enable_xformers`/`enable_bsa`), NO por CLI → si necesitas cambiarlo, **parchéalo en el handler
  tras descargar el modelo** (con `json.load`/`json.dump`).

---

## 2. Modelos grandes → Network Volume (no en la imagen)

**Patrón correcto:**
- **Imagen Docker = solo código + librerías** (~6-8GB) → build rápido, sin reventar.
- **Modelo (~30GB) → se baja en runtime a `/runpod-volume`** (Network Volume persistente),
  UNA vez, con marcador `.download_complete`. Los workers siguientes lo montan al instante.

```python
VOL = '/runpod-volume' if os.path.isdir('/runpod-volume') else '/app/weights'
CKPT = os.path.join(VOL, 'NombreDelModelo')
_DONE = os.path.join(CKPT, '.download_complete')
def ensure_model():
    if os.path.exists(_DONE): return CKPT, None
    try:
        from huggingface_hub import snapshot_download
        os.makedirs(CKPT, exist_ok=True)
        snapshot_download(repo_id='org/model', local_dir=CKPT, max_workers=8)
        open(_DONE, 'w').close()
        return CKPT, None
    except Exception as e:
        return None, str(e)
```

- Activa `HF_HUB_ENABLE_HF_TRANSFER=1` (descarga rápida). Instala `huggingface_hub[hf_transfer]`.
- **El Network Volume FIJA la región del endpoint.** La GPU compatible DEBE existir y estar
  disponible en esa región. (En RunPod, filtra por la GPU al crear el volumen.)
- Costo volumen ≈ **$0.07/GB/mes**. 100GB = ~$7/mes. Optimiza el tamaño cuando funcione
  (descarga solo los pesos que el modelo realmente carga, ej. saltar fp32 si usas int8).
- **NO** dejar el modelo en disco efímero del contenedor (5GB **default**): se llena → falla.
  Pero el **Container disk se puede subir** (ej. 70GB) → entonces SÍ cabe el modelo en efímero.

### TRADEOFF crítico: Network Volume (region-lock) vs disco efímero (re-descarga)
Aprendido a sangre con LongCat: **un solo Network Volume FIJA la región y si la GPU compatible
escasea ahí, el worker NUNCA arranca** (se queda "Initializing", 0 workers, sin logs — horas
perdidas). Dos salidas:
- **Modelo mediano (~20GB) → SIN volumen, Container disk grande (70GB), descarga en cada cold
  start.** Pierdes ~3-6 min de re-descarga por cold start, pero el worker corre en CUALQUIER
  región con GPU libre. **Esto fue lo que destrabó LongCat.** Ideal con `active=0` y uso esporádico.
- **Modelo grande / alto volumen → Network Volume + `active=1` caliente** para no re-streamear.
  Si usas volumen, **adjunta varias regiones** o elige una con stock real de tu GPU.
- Recuerda: un cambio de Container disk (o de dep) **solo aplica a workers NUEVOS** → borra los
  "Outdated" o cambia el SHA de la imagen para forzar recreación.

---

## 3. Despliegue: CI → registry → serverless (NO auto-build de RunPod)

> El auto-build de GitHub en RunPod es frágil: pushes que no disparan build, "Redeploy"
> que rehace el commit viejo, sin opción de reconectar. **No dependas de él.**

**Patrón GHCR + GitHub Actions (iteración fluida):**

`.github/workflows/build.yml` (crear por la **web de GitHub** — un PAT normal no tiene
`workflow` scope para subir archivos en `.github/workflows/`):

```yaml
name: build-and-push-image
on:
  push: { branches: [ main ] }
  workflow_dispatch: {}
jobs:
  build:
    runs-on: ubuntu-latest
    permissions: { contents: read, packages: write }
    steps:
      - name: Liberar disco del runner   # imágenes CUDA son grandes
        run: |
          sudo rm -rf /usr/share/dotnet /opt/ghc /usr/local/lib/android "$AGENT_TOOLSDIRECTORY" /opt/hostedtoolcache /usr/local/.ghcup
          sudo docker system prune -af || true
      - uses: actions/checkout@v4
      - uses: docker/login-action@v3
        with: { registry: ghcr.io, username: ${{ github.actor }}, password: ${{ secrets.GITHUB_TOKEN }} }
      - uses: docker/build-push-action@v6
        with:
          context: .
          push: true
          tags: |
            ghcr.io/<owner-lowercase>/<repo>:latest
            ghcr.io/<owner-lowercase>/<repo>:${{ github.sha }}
```

Pasos:
1. Commit del workflow → Actions construye y publica la imagen (~10-20 min; tiene HORAS
   de límite, a diferencia de los 30 min de RunPod).
2. **Hacer el paquete GHCR PÚBLICO** (repo → Packages → Package settings → Danger Zone →
   Change visibility → Public) para que RunPod lo baje sin credenciales.
3. RunPod: crear endpoint **"Deploy from Docker registry"** (NO GitHub) con imagen
   `ghcr.io/<owner>/<repo>:latest`. Sin registry auth (es público). Sin Start command
   (la imagen ya trae el CMD).
4. **Iterar después:** push → Actions reconstruye → en RunPod **"Redeploy"** re-descarga
   `:latest`. **Cero recreaciones, cero webhook roto.**

> GHCR/imagen Docker requiere todo en minúscula. owner `Lushows` → `lushows`.

### Smoke-test de deps en el BUILD (atrapa fallos sin gastar GPU)
Agrega al final del Dockerfile un paso que importe TODO el grafo de deps. Si falta o falla
una, **revienta el build en Actions (gratis, 5 min)** en vez de fallar en RunPod tras un
cold start de 8 min en GPU pagada:
```dockerfile
RUN python -c "import torch, flash_attn, triton, regex, tqdm, audio_separator, onnxruntime, \
    transformers, diffusers, librosa, scipy, onnx, PIL, torchvision; \
    print('=== SMOKE IMPORT OK ===')"
```
Este test ya pagó: atrapó `flash_attn` ABI y `onnxruntime` executable-stack ANTES de runtime.
**Build verde con smoke-test = todas las deps importan.** Lo único que NO valida es runtime GPU
(VRAM/OOM/kernels JIT) — eso solo se ve corriendo.

### Pins rotos del upstream → arréglalos en el build
- **Paquete que no existe en PyPI** (vendored/typo, ej. `tritonserverclient==0.0.6` → 404):
  quítalo con `sed`. NO confundir con `triton` (compilador de kernels, sí necesario).
- **Lib de sistema listada como pip** (ej. `libsndfile1==0.0.1`): instálala por `apt`, quítala del requirements.
- **Pin viejo con bug de plataforma**: `onnxruntime==1.16.3` trae el `.so` con bandera
  "executable stack" → `ImportError: cannot enable executable stack` en glibc moderno. **Sube
  a `onnxruntime>=1.17`** (release notes 1.17: binarios sin executable stack). NO uses
  `execstack` (removido de Debian moderno).

---

## 4. Observabilidad primero (handler de serverless)

```python
def log(*a): print('[app]', *a, flush=True)   # CMD con python -u

def handler(job):
    try:
        log('volume_mounted=', os.path.isdir('/runpod-volume'))
        log('disco:', shutil.disk_usage(VOL))
        # ... ensure_model(), download inputs ...
        log('lanzando:', ' '.join(cmd))
        p = subprocess.run(cmd, cwd=REPO)   # SIN capture_output -> streamea a logs en vivo
        log('returncode=', p.returncode)
        if p.returncode != 0:
            return {'error': f'fallo (rc {p.returncode}). Ver logs.'}
        # ... upload, return {'output_video_url': url} ...
    except Exception as ex:
        log('EXCEPCION:\n', traceback.format_exc())
        return {'error': 'excepcion: ' + str(ex)}
```

- **`subprocess.run(cmd)` sin `capture_output`** → la salida del proceso hijo (torchrun,
  etc.) se transmite EN VIVO a los logs del serverless. Ahí ves el crash real.
- **`try/except` de tope con `traceback.format_exc()`** → captura cualquier error y lo
  devuelve/loguea en vez de morir en silencio.
- **NUNCA `sys.exit()` en un handler async** → enmascara el error real con cosas como
  "Event loop is closed".
- Diagnóstico de estado: status **FAILED** del job = el worker **crasheó** (proceso muerto:
  OOM de RAM, segfault, import fallido). Si el handler **devuelve** `{'error':...}` el job
  queda **COMPLETED** con ese output. Distinguirlos te dice si es crash vs error controlado.

---

## 5. RunPod serverless — cheatsheet

- **Endpoint tipo Queue** + handler `runpod.serverless.start({'handler': handler})`.
- **GPU**: marca varias compatibles por prioridad (cheapest-first). RunPod usa la 1ª libre.
  "Unavailable" suele ser TEMPORAL (pico de demanda) → se recupera. Las "PRO" = Blackwell.
- **Execution timeout**: súbelo (ej. 1200s) para modelos lentos / cold start + descarga.
  Es un TECHO de seguridad, solo pagas el tiempo real.
- **Idle timeout** 5s + **Active workers 0** = escala a cero → no pagas en reposo.
- **FlashBoot ON** = cold starts más rápidos tras el primero.
- **Network Volume** (Advanced) montado en `/runpod-volume`; fija la región.
- **Logs vacíos pero "job in progress"** = worker arrancando (pull de imagen) o descarga
  silenciosa → no es error, espera. Logs aparecen cuando el contenedor corre.
- **Workers tab**: estado real (initializing/running/throttled). Workers "Outdated" en
  regiones ajenas = sobras, RunPod las limpia.
- **Costo** ≈ $/s × segundos reales. Ej: RTX 5090 ~$0.00044/s → ~$0.10-0.18/video.

---

## 6. Modelos visual open 2026 (punto de partida — RE-INVESTIGAR siempre)

> Verifica el estado del arte con búsqueda fresca; esto cambia mensualmente.

- **Avatares parlantes (foto+audio→video con gestos):** LongCat-Video-Avatar 1.5
  (Meituan, 13.6B, ~48GB / 32GB con int8, gestos+lip-sync, #1 calidad EvalTalker),
  EchoMimicV2/V3 (medio cuerpo, más liviano), Wan2.2-S2V, HunyuanVideo-Avatar, InfiniteTalk.
- **Lip-sync sobre video base:** MuseTalk. **Cabeza simple (peor):** SadTalker (2024, evitar).
- **TTS / clonación de voz:** F5-TTS (en/zh), MiniMax (multilingüe, clone+TTS con voice_id
  cacheado), ElevenLabs (mejor narrador, de pago).
- **APIs premium (cero deploy, $/video alto):** Kling AI Avatar, OmniHuman (vía fal).
  Útil como **red de seguridad** si el self-host se atasca y hay urgencia.

---

## 6.5 Rendimiento y costo — palancas de inferencia (diffusion video/avatar)

> Verificado contra el código real de LongCat-Avatar 1.5 + research 2026. Aplica a DiTs de video en general.

### Las palancas que mueven costo (de mayor a menor impacto)
1. **`num_inference_steps`** — lineal en pasos del DiT. **La palanca #1.** 50→8 ≈ 6× más barato.
2. **`use_distill`** — activa el camino destilado. En LongCat-Avatar-1.5 fuerza:
   `num_inference_steps=8`, `text_guid

…(truncated)
