Spaces:
Running on Zero
A newer version of the Gradio SDK is available: 6.24.0
title: Wan Loop Generator
emoji: 🔁
colorFrom: purple
colorTo: blue
sdk: gradio
sdk_version: 6.10.0
python_version: 3.10.13
app_file: app.py
pinned: false
license: gpl-3.0
tags:
- image-to-video
Wan Loop Generator
A minimal Gradio Space that generates a seamless downloadable video loop from
one image and a prompt. The output selector offers MKV (High Quality) by
default and MP4 (Compressed). The prompt is passed unchanged to the text encoder. There is no
autoprompt, hidden negative prompt, or filename-based preset.
Every result includes an embedded browser-compatible H.264 preview and a separate download in the selected format. MKV downloads therefore retain AV1 quality without sacrificing in-page playback; MP4 selection reuses one file for both preview and download.
The runtime uses vendored ComfyUI-WanVideoWrapper nodes with two Wan 2.2 I2V
passes (high-noise and low-noise), identical start and end images, RIFE seam
interpolation, resident tiled RealESRGAN_x2plus upscaling, and selectable
AV1/MKV or H.264/MP4 encoding at 1280x720 and 17 fps. MKV uses the reference
Thunar SUPERIOR preset (libsvtav1, preset 6, CRF 45); MP4 uses libx264,
preset slow, CRF 28, tune film and faststart. Wan inference remains 832x480, so HD output does not
increase diffusion token count.
The two wrapper passes use separate sm_120 AOT block packages with external
weights. The packages contain GPU code only: checkpoint files remain unchanged
and external to this Space. Incompatible GPU or PyTorch environments fall back
to the same eager wrapper path before any module is patched.
The application service, tokenizer, wrapper nodes, AOT handles, and UMT5 text
encoder are prepared once when the ZeroGPU worker starts. UMT5 is loaded from
a pinned, prequantized Quanto QINT8 derivative of the unchanged source BF16
checkpoint, avoiding runtime quantization. On ZeroGPU large, VAE,
high-noise, and low-noise are loaded on GPU strictly one at a time. The tiled
VAE is released after encode and reloaded only for final decode; high is
destroyed before low is loaded. Checkpoints are localized once in ephemeral
Xet cache, while UMT5 QINT8 remains globally reusable.
Weights remain in the Hub repositories listed in the metadata and are mounted as read-only volumes. Each model repository's license and usage conditions apply. Users are responsible for the content they generate.
The runtime includes GPL-3.0 ComfyUI code, Apache-2.0 ComfyUI-WanVideoWrapper code, and an MIT-licensed RIFE subset from ComfyUI-Frame-Interpolation. The reduced RRDBNet/inference implementation is derived from Apache-2.0 BasicSR and BSD-3-Clause Real-ESRGAN. Their license texts and provenance are retained alongside the vendored sources. The official x2 checkpoint is downloaded from the upstream v0.2.1 release and verified by size and SHA-256; model weights are not stored in this repository.
The default ZeroGPU size is large. ZERO_GPU_SIZE=xlarge remains available
for explicit experiments without changing code or enabling CPU offload.