Skip to content
Projets

zibojia/MiniMax-Remover

Voir sur GitHub

À propos

Il s'agit de l'implémentation officielle de notre article : « MiniMax-Remover: Taming Bad Noise Helps Video Object Removal ».

Design et médias

Comment ces chiffres sont mesurés

What you can do

  • Fast: Requires only 6 inference steps and does not use CFG, making it highly efficient.
  • Effective: Seamlessly removes objects from videos and generates high-quality visual content.
  • Robust: Maintains robustness by preventing the regeneration of undesired objects or artifacts within the masked region, even under varying noise conditions.

Progression mesurée des étoiles

in 24h
+1
in 7 days
+3
in 15 days
+5
in 1 month
Historique en cours

Variations nettes sur des périodes qui se chevauchent, pas des totaux quotidiens. Les mesures absentes restent vides. Les étoiles indiquent l’intérêt, pas la qualité.

README.md

Original

MiniMax-Remover: Taming Bad Noise Helps Video Object Removal

Bojia Zi*, Weixuan Peng*, Xianbiao Qi†, Jianan Wang, Shihao Zhao, Rong Xiao, Kam-Fai Wong
* Equal contribution. † Corresponding author.

Huggingface Model Github Huggingface Space arXiv YouTube Demo Page Replicate


🚀 Overview

MiniMax-Remover is a fast and effective video object remover based on minimax optimization. It operates in two stages: the first stage trains a remover using a simplified DiT architecture, while the second stage distills a robust remover with CFG removal and fewer inference steps.


✨ Features:

  • Fast: Requires only 6 inference steps and does not use CFG, making it highly efficient.

  • Effective: Seamlessly removes objects from videos and generates high-quality visual content.

  • Robust: Maintains robustness by preventing the regeneration of undesired objects or artifacts within the masked region, even under varying noise conditions.


🛠️ Installation

All dependencies are listed in requirements.txt.

pip install -r requirements.txt

🏃‍♂️ Gradio Demo

firstpage

You can use this gradio demo to remove objects. Note that you don't need to compile the sam2.

cd gradio_demo
python3 test.py

📂 Download

huggingface-cli download zibojia/minimax-remover --include vae transformer scheduler --local-dir .

⚡ Quick Start

Minimal Example

import torch
from diffusers.utils import export_to_video
from decord import VideoReader
from diffusers.models import AutoencoderKLWan
from transformer_minimax_remover import Transformer3DModel
from diffusers.schedulers import UniPCMultistepScheduler
from pipeline_minimax_remover import Minimax_Remover_Pipeline

random_seed = 42
video_length = 81
device = torch.device("cuda:0")

# Load model weights separately
vae = AutoencoderKLWan.from_pretrained("./vae", torch_dtype=torch.float16)
transformer = Transformer3DModel.from_pretrained("./transformer", torch_dtype=torch.float16)
scheduler = UniPCMultistepScheduler.from_pretrained("./scheduler")

images = # images in range [-1, 1]
masks = # masks in range [0, 1]

# Initialize the pipeline (pass the loaded weights as objects)
pipe = Minimax_Remover_Pipeline(vae=vae, transformer=transformer, \
    scheduler=scheduler, torch_dtype=torch.float16
).to(device)

result = pipe(images=images, masks=masks, num_frames=video_length, height=480, width=832, \
    num_inference_steps=12, generator=torch.Generator(device=device).manual_seed(random_seed), iterations=6 \
).frames[0]
export_to_video(result, "./output.mp4")

📧 Contact

Feel free to send an email to [email protected] if you have any questions or suggestions.

Explorer des projets similaires

Chargement…