Instructions to use BigD233333/D2DF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use BigD233333/D2DF with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("BigD233333/D2DF", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
From Draft to Draft-Free: One-Step Video Object Removal via Privileged Distillation and Fast Planting
Zizhao Chen, Ping Weiβ , Guang Dai, Jingdong Wang, Mengmeng Wangβ
Xi'an Jiaotong University Β· SGIT AI Lab Β· Zhejiang University of Technology Β· Baidu
β Corresponding authors
D2DF is a three-stage framework for one-step video object removal. It first distills a multi-step draft-guided diffusion teacher into D2DF-DG, a one-step draft refiner, through Prior-Privileged Consistency Distillation (PPCD). It then uses the lightweight Self-Guided Fast Planting (SGFP) module to construct pseudo-drafts in latent space, producing D2DF-DF, a fully draft-free one-step generator.
This repository provides standalone inference code for both D2DF-DF and D2DF-DG
using the official Hugging Face diffusers and transformers packages.
Installation
git clone https://github.com/bigD233/D2DF.git
cd D2DF
pip install -r requirements.txt
We recommend Python 3.11 and an NVIDIA GPU with CUDA support. The released
inference code was tested with PyTorch 2.8, CUDA 12.8, diffusers >= 0.32, and
transformers >= 4.44.
Model Weights
Download the base CogVideoX-5B-I2V model from its official Hugging Face repository.
Download the D2DF-DF and D2DF-DG checkpoints from our
D2DF Hugging Face repository. After
extracting the downloaded archives, pass the corresponding directories to
--transformer_path.
The included prompt_embeds.pt stores the pre-computed embedding for the prompt
"background", so the T5 encoder does not need to be loaded during normal
inference.
Input Format
Prepare the input as directories of numbered image files:
inputs/
βββ imgs/
β βββ 00000.jpg
β βββ 00001.jpg
β βββ ...
βββ mask/
β βββ 00000.png
β βββ 00001.png
β βββ ...
βββ drafts/ # required only by D2DF-DG
βββ 00000.jpg
βββ 00001.jpg
βββ ...
- The repository includes this ready-to-run 25-frame example under
inputs/. - Frames, masks, and drafts are read in filename order.
- Mask pixels belonging to the removal target should have value
255by default. - Inputs are resized to the requested output resolution.
- The default setting uses 25 frames at 480 x 720 resolution.
Inference
D2DF-DF: Draft-Free One-Step Removal
No external draft is required:
python infer.py \
--mode df \
--base_model_path <PATH_TO_COGVIDEOX_5B_I2V> \
--transformer_path <PATH_TO_D2DF_DF> \
--frames_dir inputs/imgs \
--mask_dir inputs/mask \
--output_dir outputs/I-210910_I09032_T04_df \
--num_frames 25 \
--height 480 \
--width 720
D2DF-DG: Draft-Guided One-Step Refinement
Supply a draft produced by a video object removal method such as ProPainter:
python infer.py \
--mode dg \
--base_model_path <PATH_TO_COGVIDEOX_5B_I2V> \
--transformer_path <PATH_TO_D2DF_DG> \
--frames_dir inputs/imgs \
--mask_dir inputs/mask \
--draft_dir inputs/drafts \
--output_dir outputs/I-210910_I09032_T04_dg \
--num_frames 25 \
--height 480 \
--width 720
The default configuration performs one denoising step with
guidance_scale=1.0. The output directory contains an MP4 video and a GIF
preview. Add --save_frames to also save individual PNG frames.
Citation
@misc{chen2026d2df,
title={From Draft to Draft-Free: One-Step Video Object Removal via Privileged Distillation and Fast Planting},
author={Zizhao Chen and Ping Wei and Guang Dai and Jingdong Wang and Mengmeng Wang},
year={2026}
}
Acknowledgements
Our implementation is built upon CogVideoX, Hugging Face Diffusers, and ProPainter. We sincerely thank the contributors of these projects for their excellent work.
License
This repository is released under the Apache License 2.0.
Contact
For questions about this work, please contact Zizhao Chen.
- Downloads last month
- -