Kumpulan scripts untuk generate video menggunakan Wan Animate di ComfyUI.
run-workflow-simple-with-video.ts- Main script dengan video motion reference βrun-workflow-correct.ts- Workflow dengan parameter originalrun-workflow-http.ts- Upload files + run workflow
run-workflow-runpod-api.ts- RunPod serverless API (requires custom deployment)check-runpod-capabilities.ts- Test endpoint capabilities
Dockerfile.runpod- Docker image untuk deploy custom ComfyUIhandler.py- RunPod serverless handler
Video berhasil di-generate dengan settings optimal:
https://zqyh42lvmsz2qy-8188.proxy.runpod.net:443/view?filename=WanComfy_00003.mp4&type=output
https://zqyh42lvmsz2qy-8188.proxy.runpod.net:443/view?filename=WanComfy_00006.mp4&type=output
{
video_width: 720,
video_height: 1280,
video_length_frames: 144, // 9 seconds @ 16fps
skip_first_frames: 24, // Skip 1.5 detik
steps: 6, // Balanced quality/speed
cfg_scale: 1.2,
positive_prompt: "photorealistic video of blond women wearing navy blue bikini",
negative_prompt: "blurry, low quality, distorted, noise, grainy, artifacts, watermark"
}Jika punya akses ke ComfyUI server langsung:
# 1. Upload files dulu (myimage.png, myvideo.mp4)
# 2. Update server URL di script (line 271)
# 3. Run
npx tsx run-workflow-simple-with-video.tsProblem: Endpoint RunPod saat ini (ns0kzuko048dbt) tidak support custom nodes:
- β
VHS_LoadVideotidak tersedia - β
WanAnimateToVideotidak tersedia
Solutions:
# 1. Build Docker image dengan Wan Animate
docker build -f Dockerfile.runpod -t your-registry/comfyui-wan:latest .
# 2. Push to Docker registry
docker push your-registry/comfyui-wan:latest
# 3. Deploy di RunPod Serverless:
# - Go to RunPod > Serverless
# - Create new endpoint
# - Use custom Docker image
# - Configure GPU & storage# 1. Launch RunPod GPU Pod
# 2. Install ComfyUI + Wan Animate
git clone https://github.com/comfyanonymous/ComfyUI
cd ComfyUI
pip install -r requirements.txt
# Install custom nodes
cd custom_nodes
git clone <WAN_ANIMATE_REPO>
git clone https://github.com/Kosinkadink/ComfyUI-VideoHelperSuite
# 3. Download models (Wan 2.2, VAE, CLIP)
# 4. Start ComfyUI
python main.py --listen 0.0.0.0 --port 8188
# 5. Update script dengan pod URLCari Wan Animate model di Replicate.com yang sudah deployed.
Cause: Steps terlalu rendah (4) Fix: Naikkan ke 6-8 steps, tapi reduce frame count untuk VRAM
Cause: Video belum mulai bergerak
Fix: skip_first_frames: 24 (1.5 detik)
Cause: Resolution + frames terlalu besar Fix:
- Reduce resolution: 1080x1920 β 720x1280
- Reduce frames: 176 β 144
- Reduce steps: 20 β 6
Cause: ComfyUI server shutdown (RunPod auto-shutdown) Fix: Restart server atau launch new pod
Edit di run-workflow-simple-with-video.ts:
const inputs = {
positive_prompt: "YOUR_PROMPT_HERE",
video_width: 720, // Max 1080 untuk VRAM 24GB
video_height: 1280, // Vertical video
video_length_frames: 144, // 9 detik @ 16fps
seed: 940412395777954, // Random atau fixed
steps: 6, // 4-8 range optimal
cfg_scale: 1.2, // 1.0-2.0 range
};Jika masih ada static image:
skip_first_frames: 32, // Skip 2 detikWorkflow menggunakan:
- LoadImage - Load subject image
- VHS_LoadVideo - Load reference video (motion)
- CLIPTextEncode - Process prompts
- CLIPVisionEncode - Extract visual features
- WanAnimateToVideo - Generate latent with motion
- face_video: Video reference untuk wajah
- pose_video: Video reference untuk pose
- background_video: Video reference untuk background
- KSampler - Denoise latents
- VAEDecode - Decode to pixels
- VHS_VideoCombine - Combine frames to video
- myimage.png - Subject image (390KB)
- myvideo.mp4 - Reference video (2.7MB, 332 frames @ 30fps)
{
"dependencies": {
"@types/node": "^24.10.1",
"form-data": "^4.0.4"
},
"devDependencies": {
"@types/form-data": "^2.2.1",
"ts-node": "^10.9.2",
"typescript": "^5.9.3"
}
}- ComfyUI: https://github.com/comfyanonymous/ComfyUI
- Video Helper Suite: https://github.com/Kosinkadink/ComfyUI-VideoHelperSuite
- RunPod: https://runpod.io/
MIT
Note: Wan Animate models sangat besar (~14GB). Pastikan storage cukup saat deploy.