--- license: mit title: Wan sdk: docker emoji: 🏆 colorFrom: blue colorTo: blue pinned: true thumbnail: >- https://cdn-uploads.huggingface.co/production/uploads/690c81642c226d46d51dc1a5/EhLyLqcHHk_Q_gb7xR1HF.jpeg short_description: Wan --- # AI Video Swarm 8× L40S GPU Video Generation Platform on Hugging Face Spaces ## Hardware - **8× NVIDIA L40S** (48GB VRAM each = 384GB total) - **192 vCPU** - **1534 GB RAM** ## File Structure ``` . ├── app.py # FastAPI main app ├── index.html # Main UI (single file, RTL Arabic) ├── pass.html # Auth gateway ├── logs.html # Real-time logs dashboard ├── requirements.txt # Python dependencies ├── Dockerfile # HF Spaces compatible ├── README.md # This file ├── agents/ │ ├── __init__.py │ ├── orchestrator.py # Master coordinator │ ├── prompt_engineer.py # LLM prompt enhancement │ ├── image_generator.py # FLUX.1-dev keyframe │ ├── video_generator.py # Wan 2.6 + LTX-2.3 │ ├── face_restorer.py # GFPGAN (placeholder) │ ├── frame_interpolator.py # RIFE (placeholder) │ ├── video_upscaler.py # Real-ESRGAN (placeholder) │ └── log_monitor.py # Logging agent ├── config/ │ ├── __init__.py │ ├── settings.py # App config │ ├── models_config.py # Model params │ └── gpu_allocation.py # GPU mapping └── core/ ├── __init__.py ├── auth.py # JWT auth ├── r2_client.py # Cloudflare R2 └── websocket_manager.py # WS connections ``` ## Environment Variables (Secrets) Set these in HF Space Settings > Secrets: - `HF_TOKEN` — HuggingFace access token - `PASS_KEY` — Password for login - `R2_ACCOUNT_ID` — Cloudflare R2 account ID - `R2_BUCKET_NAME` — R2 bucket name - `R2_ACCESS_KEY_ID` — R2 access key - `R2_SECRET_ACCESS_KEY` — R2 secret key - `R2_PUBLIC_DOMAIN` — R2 public domain ## Models Used | Agent | Model | GPU | VRAM | |-------|-------|-----|------| | Video Primary | Wan 2.6 14B (FP8) | GPU-0 | ~45GB | | Video Backup | LTX-2.3 | GPU-1 | ~20GB | | Image | FLUX.1-dev (FP8) | GPU-5 | ~16GB | | Upscale | Real-ESRGAN | GPU-4 | ~8GB | | Face Restore | GFPGAN | GPU-2 | ~8GB | | Interpolation | RIFE | GPU-3 | ~6GB | | Audio | F5-TTS | GPU-6 | ~6GB | | Orchestrator | Qwen 2.5 72B | GPU-7 | ~40GB | ## Notes - PyTorch wheels include CUDA 12.4 — no need for nvidia/cuda base image - All models load at startup (no cold start) - FP8 inference on L40S for 2× speed - NVENC hardware encoding for final output