Skip to main content
Built by Best ROI Media · First-Party IntegrationMITWave 4 · LiveBestRoiMedia/bestroi-game-tools

Wan

Remote ComfyUI dispatcher for Wan 2.2 image-to-video, first-last-frame, control video, and BiRefNet cutouts.

Submits Wan 2.2 video generation (i2v, flf, control) and BiRefNet frame-cutout jobs to a GPU host running ComfyUI over SSH/HTTP, returning PNG frame sequences, MP4 clips, and structured JSON reports.

View on GitHub ↗
Quick clonegit clone https://github.com/BestRoiMedia/bestroi-game-tools.git
GitHub repositoryBestRoiMedia/bestroi-game-tools
Module path_tools/wan/
LicenseMIT
Release waveWave 4
LanguagesPython

Why we built it

Running 14B video diffusion models requires a dedicated desktop GPU while development happens on a laptop. Wan automates prompt-graph construction, image flattening/alignment, remote job execution, and transparent cutout post-processing.

Architecture & how it works

Constructs ComfyUI workflow graphs for GGUF-quantized Wan 2.2 high/low-noise stages with 4-step LoRAs, dispatches inputs to the configured WAN_HOST, downloads rendered PNG frames and 16 fps clip.mp4, and optionally runs BiRefNet alpha cutouts and hole-clearing.

Key capabilities

  • Three generation modes: i2v (single image), flf (first-last-frame interpolation), and control (motion-guided)
  • Automated frame flattening and 16-pixel dimension alignment
  • GPU-accelerated transparent frame extraction (cutout) and enclosed background hole cleanup (holes)
  • Remote host health check (doctor) and offline graph/validation selftest

Usage example

Generate first-last-frame motion and extract transparent framesPython
export WAN_HOST="user@gpu-host"
python3 wan/wan.py flf ./start.png ./end.png ./out/lunge --prompt "character lunges forward" --w 480 --h 720 --frames 81
python3 wan/wan.py cutout ./out/lunge/frames ./out/lunge/cutout
Frame count must be 4n+1; width and height must be multiples of 16. Pair with onion for motion QA.