Skip to content

Self-hosted Wan 2.1 on RunPod/Vast.ai for bulk generation #73

Description

@rancur

Problem

fal.ai charges $0.15-$0.25 per Wan 2.1 generation. Self-hosted on spot A100s costs $0.03-0.04 per generation -- 4-6x cheaper.

Benchmarks

GPU 480p (5s clip) 720p (5s clip) Cost/hr (spot) Cost/gen (480p)
A100 80GB ~170s ~523s $0.78 $0.037
H100 SXM ~85s ~284s $1.00 $0.024

Proposal

Create a self-hosted inference pipeline:

  1. RunPod Serverless for burst workloads (pay per second, auto-scale to zero)
  2. Vast.ai spot A100s for batch processing (cheapest bulk rate)
  3. Retry logic for spot preemption
  4. Batch queue with progress tracking

For 5,000 tracks x 3 video segments each = 15,000 generations:

  • On H100 spot at 480p: 15,000 / 42 per hour = 357 GPU-hours = $357 total
  • vs fal.ai: 15,000 x $0.15 = $2,250 total

Implementation

  • New: src/generator/self_hosted.py -- RunPod/Vast.ai client
  • src/generator/video_pipeline.py -- add "self-hosted" provider
  • src/generator/model_router.py -- route to self-hosted for bulk jobs
  • Docker image with Wan 2.1 + ComfyUI for deployment

Risk

  • Spot instances can be preempted mid-generation (lost work)
  • Need checkpointing or accept ~5% retry rate
  • More DevOps overhead than API calls

Labels: cost-optimization, infrastructure

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions