--- title: DuoEdit emoji: ✂️ colorFrom: yellow colorTo: green sdk: gradio sdk_version: 6.33.0 app_file: app.py short_description: Remove, insert or replace subjects in a video python_version: "3.12" startup_duration_timeout: 1h models: - JiayiWuLeo/DuoEdit - alibaba-pai/Wan2.2-Fun-A14B-Control - Wan-AI/Wan2.2-I2V-A14B-Diffusers - facebook/sam2.1-hiera-large - ZhengPeng7/BiRefNet --- # DuoEdit Demo of [DuoEdit: A Unified Local Video Editing Model Learning Only Two Primitive Operators](https://huggingface.co/papers/2611.35509) ([model](https://huggingface.co/JiayiWuLeo/DuoEdit), [project page](https://jiayi-wu-leo.github.io/duoedit/)). DuoEdit adds LoRA adapters and retrained input projections to [Wan2.2-Fun-A14B-Control](https://huggingface.co/alibaba-pai/Wan2.2-Fun-A14B-Control). The official code repo isn't public yet, so this Space reimplements the conditioning interface from the paper's appendix: `[z_t ; E(box video) ; P(1 - erase mask) ; E(full source)]` as the 52-channel video input, plus `[E(appearance canvas) ; E(identity canvas)]` as prepended reference tokens. Sampling uses flow-matching Euler (shift 5), 25 steps, CFG 4.5, and switches experts at t = 900. Erase masks come from SAM 2.1 video tracking of the box you draw. Reference cut-outs come from BiRefNet. Both experts run in fp8 on ZeroGPU. Example clips and images are from the CC0 [linoyts/repo-to-space-example-videos](https://huggingface.co/datasets/linoyts/repo-to-space-example-videos) and [linoyts/repo-to-space-example-inputs](https://huggingface.co/datasets/linoyts/repo-to-space-example-inputs) datasets.