π₯οΈ GitHub Β Β ο½ Β Β π Project Page Β Β | Β Β π€ ReCo-DataΒ Β | Β Β π ReCo-BenchΒ Β | Β Β π€ ReCo-Models Β Β | Β Β π Paper Β Β
ReCo: Region-Constraint In-Context Generation for Instructional Video Editing
π If you find ReCo useful, please give a β for this repo, which is important to Open-Source projects. Thanks!
Here, we will gradually release the following resources, including:
Examples of different video editing tasks by our ReCo.
ReCo-Data is a large-scale, high-quality video editing dataset consisting of 500K+ instructionβvideo pairs, covering four video editing tasks: object addition (add), object removal (remove), object replacement (replace), and video stylization (style).
Please download each task of ReCo-Data into the ./ReCo-Data directory by running:
bash ./tools/download_dataset.sh
Before downloading the full dataset, you may first browse the visualization examples.
These examples are collected by randomly sampling 50 instances from each task (add, remove, replace, and style), without any manual curation or cherry-picking, and are intended to help users quickly inspect and assess the overall data quality.
Note: The examples are formatted for visualization convenience and do not strictly follow the dataset format.
After downloading, please ensure that the dataset follows the directory structure below:
ReCo-Data/
βββ add/
β βββ add_data_configs.json
β βββ src_videos/
β β βββ video1.mp4
β β βββ video2.mp4
β β βββ ...
β βββ tar_videos/
β βββ video1.mp4
β βββ video2.mp4
β βββ ...
βββ remove/
β βββ remove_data_configs.json
β βββ src_videos/
β βββ tar_videos/
βββ replace/
β βββ replace_data_configs.json
β βββ src_videos/
β βββ tar_videos/
βββ style/
βββ style_data_configs.json
βββ src_videos/
β βββ video1.mp4
β βββ ...
βββ tar_videos/
βββ video1-a_Van_Gogh_style.mp4
βββ ...
After downloading the dataset, you can directly test and visualize samples from any single task using the following script (taking the replace task as an example):
python reco_data_test_single.py \
--json_path ./ReCo-Data/replace/replace_data_configs.json \
--video_folder ./ReCo-Data \
--debug
You can also load a mixed dataset composed of the four tasks (add, remove, replace, and style) with arbitrary ratios by running:
python reco_data_test_mix_data.py \
--json_folder ./ReCo-Data \
--video_folder ./ReCo-Data \
--debug
src_videos/ contains the original source videos.tar_videos/ contains the edited target videos corresponding to each instruction.*_data_configs.json stores the instructionβvideo mappings and metadata for each task.Traditional video generation metrics often struggle to accurately assess the fidelity and quality of video editing results. Inspired by recent image editing evaluation protocols, we propose a VLLM-based evaluation benchmark to comprehensively and effectively evaluate video editing quality.
We collect 480 videoβinstruction pairs as the evaluation set, evenly distributed across four tasks: object addition, object removal, object replacement, and video stylization (120 pairs per task). All source videos are collected from the Pexels video platform.
For local editing tasks (add, remove, and replace), we utilize Gemini-2.5-Flash-Thinking to automatically generate diverse editing instructions conditioned on video content. For video stylization, we randomly select 10 source videos and apply 12 distinct styles to each, resulting in 120 stylization evaluation pairs.
Please download ReCo-Bench into the ./ReCo-Bench directory by running:
bash ./tools/download_ReCo-Bench.sh
After downloading the benchmark, you can directly start the evaluation using:
cd tools
bash run_eval_via_gemini.sh
In the first stage, Gemini-2.5-Flash-Thinking is used as a VLLM evaluator to score each edited video across multiple evaluation dimensions.
Key arguments used in this step include:
--edited_video_folder: Path to the folder containing the edited (target) videos generated by the model.
--src_video_folder: Path to the folder containing the original source videos.
--base_txt_folder: Path to the folder containing task-specific instruction configuration files.
--task_name: Name of the evaluation task, one of {add, remove, replace, style}.
This step outputs per-video, per-dimension evaluation results in JSON format.
After all four tasks have been fully evaluated, the second stage aggregates the evaluation results and computes the final scores.
--json_folder: Path to the JSON output folder generated in Step 1
(default: all_results/gemini_results)
--base_txt_folder: Path to the instruction configuration folder
This step produces the final benchmark scores for each task as well as the overall performance.
Create and activate the specialized Conda environment:
conda create -n reco python=3.11 -y
conda activate reco
pip install -r requirements.txt
You need to prepare both the base model and our specific checkpoints.
| Model | Source | Description |
|---|---|---|
| Wan-2.1-VACE-1.3B | π€ Hugging Face | Base VACE weights. Place in ./Wan-AI |
| ReCo | π€ Hugging Face | Our ReCo Preview checkpoint. Place in all_ckpts/. We will update better ckpts progressively afterward. |
Organize the files as follows:
.
βββ Wan-AI/
βββ all_ckpts/
β βββ 2026_01_16_v1_release_preview.ckpt
βββ assets/
βββ inference_reco_single.py
We provide a bash script to automate the execution of different tasks (Replace, Remove, Style, Add and Propagation). Run the following command:
bash infer_server_single.sh
To run a specific task manually or customize the execution, use the python command directly:
python inference_reco_single.py \
--task_name replace \
--test_txt_file_name assets/replace_test.txt \
--lora_ckpt all_ckpts/2026_01_16_v1_release_preview.ckpt
| Argument | Type | Default | Description |
|---|---|---|---|
test_txt_file_name | str | assets/... | Path to the .txt file containing test prompts/configs. |
task_name | str | replace | Task type: remove, replace, add, style. Use the _wf suffix (e.g., remove_wf) for Propagation tasks given the first frame. |
base_video_folder | str | assets/test_videos | Directory containing the source videos. |
base_wan_folder | str | ./Wan-AI | Path to the pre-trained Wan-AI model weights. |
lora_ckpt | str | all_ckpts/... | Path to the specific LoRA checkpoint file. |
Will be released soon.
If you find our work helpful for your research, please consider giving a starβ on this repository and citing our work.
@article{zhang2025region,
title={Region-Constraint In-Context Generation for Instructional Video Editing},
author={Zhang, Zhongwei and Long, Fuchen and Li, Wei and Qiu, Zhaofan and Liu, Wu and Yao, Ting and Mei, Tao},
journal={arXiv preprint arXiv:2512.17650},
year={2025}
}
Our code is inspired by several works, including WAN, ObjectClear--a strong object remover, VACE, Flux-Kontext-dev. Thanks to all the contributors!
18 commits
π₯οΈ GitHub Β Β ο½ Β Β π Project Page Β Β | Β Β π€ ReCo-DataΒ Β | Β Β π ReCo-BenchΒ Β | Β Β π€ ReCo-Models Β Β | Β Β π Paper Β Β
ReCo: Region-Constraint In-Context Generation for Instructional Video Editing
π If you find ReCo useful, please give a β for this repo, which is important to Open-Source projects. Thanks!
Here, we will gradually release the following resources, including:
Examples of different video editing tasks by our ReCo.
ReCo-Data is a large-scale, high-quality video editing dataset consisting of 500K+ instructionβvideo pairs, covering four video editing tasks: object addition (add), object removal (remove), object replacement (replace), and video stylization (style).
Please download each task of ReCo-Data into the ./ReCo-Data directory by running:
bash ./tools/download_dataset.sh
Before downloading the full dataset, you may first browse the visualization examples.
These examples are collected by randomly sampling 50 instances from each task (add, remove, replace, and style), without any manual curation or cherry-picking, and are intended to help users quickly inspect and assess the overall data quality.
Note: The examples are formatted for visualization convenience and do not strictly follow the dataset format.
After downloading, please ensure that the dataset follows the directory structure below:
ReCo-Data/
βββ add/
β βββ add_data_configs.json
β βββ src_videos/
β β βββ video1.mp4
β β βββ video2.mp4
β β βββ ...
β βββ tar_videos/
β βββ video1.mp4
β βββ video2.mp4
β βββ ...
βββ remove/
β βββ remove_data_configs.json
β βββ src_videos/
β βββ tar_videos/
βββ replace/
β βββ replace_data_configs.json
β βββ src_videos/
β βββ tar_videos/
βββ style/
βββ style_data_configs.json
βββ src_videos/
β βββ video1.mp4
β βββ ...
βββ tar_videos/
βββ video1-a_Van_Gogh_style.mp4
βββ ...
After downloading the dataset, you can directly test and visualize samples from any single task using the following script (taking the replace task as an example):
python reco_data_test_single.py \
--json_path ./ReCo-Data/replace/replace_data_configs.json \
--video_folder ./ReCo-Data \
--debug
You can also load a mixed dataset composed of the four tasks (add, remove, replace, and style) with arbitrary ratios by running:
python reco_data_test_mix_data.py \
--json_folder ./ReCo-Data \
--video_folder ./ReCo-Data \
--debug
src_videos/ contains the original source videos.tar_videos/ contains the edited target videos corresponding to each instruction.*_data_configs.json stores the instructionβvideo mappings and metadata for each task.Traditional video generation metrics often struggle to accurately assess the fidelity and quality of video editing results. Inspired by recent image editing evaluation protocols, we propose a VLLM-based evaluation benchmark to comprehensively and effectively evaluate video editing quality.
We collect 480 videoβinstruction pairs as the evaluation set, evenly distributed across four tasks: object addition, object removal, object replacement, and video stylization (120 pairs per task). All source videos are collected from the Pexels video platform.
For local editing tasks (add, remove, and replace), we utilize Gemini-2.5-Flash-Thinking to automatically generate diverse editing instructions conditioned on video content. For video stylization, we randomly select 10 source videos and apply 12 distinct styles to each, resulting in 120 stylization evaluation pairs.
Please download ReCo-Bench into the ./ReCo-Bench directory by running:
bash ./tools/download_ReCo-Bench.sh
After downloading the benchmark, you can directly start the evaluation using:
cd tools
bash run_eval_via_gemini.sh
In the first stage, Gemini-2.5-Flash-Thinking is used as a VLLM evaluator to score each edited video across multiple evaluation dimensions.
Key arguments used in this step include:
--edited_video_folder: Path to the folder containing the edited (target) videos generated by the model.
--src_video_folder: Path to the folder containing the original source videos.
--base_txt_folder: Path to the folder containing task-specific instruction configuration files.
--task_name: Name of the evaluation task, one of {add, remove, replace, style}.
This step outputs per-video, per-dimension evaluation results in JSON format.
After all four tasks have been fully evaluated, the second stage aggregates the evaluation results and computes the final scores.
--json_folder: Path to the JSON output folder generated in Step 1
(default: all_results/gemini_results)
--base_txt_folder: Path to the instruction configuration folder
This step produces the final benchmark scores for each task as well as the overall performance.
Create and activate the specialized Conda environment:
conda create -n reco python=3.11 -y
conda activate reco
pip install -r requirements.txt
You need to prepare both the base model and our specific checkpoints.
| Model | Source | Description |
|---|---|---|
| Wan-2.1-VACE-1.3B | π€ Hugging Face | Base VACE weights. Place in ./Wan-AI |
| ReCo | π€ Hugging Face | Our ReCo Preview checkpoint. Place in all_ckpts/. We will update better ckpts progressively afterward. |
Organize the files as follows:
.
βββ Wan-AI/
βββ all_ckpts/
β βββ 2026_01_16_v1_release_preview.ckpt
βββ assets/
βββ inference_reco_single.py
We provide a bash script to automate the execution of different tasks (Replace, Remove, Style, Add and Propagation). Run the following command:
bash infer_server_single.sh
To run a specific task manually or customize the execution, use the python command directly:
python inference_reco_single.py \
--task_name replace \
--test_txt_file_name assets/replace_test.txt \
--lora_ckpt all_ckpts/2026_01_16_v1_release_preview.ckpt
| Argument | Type | Default | Description |
|---|---|---|---|
test_txt_file_name | str | assets/... | Path to the .txt file containing test prompts/configs. |
task_name | str | replace | Task type: remove, replace, add, style. Use the _wf suffix (e.g., remove_wf) for Propagation tasks given the first frame. |
base_video_folder | str | assets/test_videos | Directory containing the source videos. |
base_wan_folder | str | ./Wan-AI | Path to the pre-trained Wan-AI model weights. |
lora_ckpt | str | all_ckpts/... | Path to the specific LoRA checkpoint file. |
Will be released soon.
If you find our work helpful for your research, please consider giving a starβ on this repository and citing our work.
@article{zhang2025region,
title={Region-Constraint In-Context Generation for Instructional Video Editing},
author={Zhang, Zhongwei and Long, Fuchen and Li, Wei and Qiu, Zhaofan and Liu, Wu and Yao, Ting and Mei, Tao},
journal={arXiv preprint arXiv:2512.17650},
year={2025}
}
Our code is inspired by several works, including WAN, ObjectClear--a strong object remover, VACE, Flux-Kontext-dev. Thanks to all the contributors!
18 commits