High-quality video object removal with automatic model management and universal resolution support




cd ComfyUI/custom_nodes
git clone https://github.com/CasterPollux/MiniMax-bmo.git
cd MiniMax-Remover
# Install with CUDA support (recommended)
pip install -r requirements.txt
# Run the setup script for automatic ComfyUI integration
python setup_comfyui_integration_bmo.py
When you first use the node:
🔍 Checking for MiniMax-Remover models...
📥 Models not found locally. Starting automatic download...
🌐 Downloading MiniMax-Remover models to: ./models
📊 Expected download size: ~25-30 GB
⏳ This may take several minutes depending on your connection...
🎉 Models downloaded successfully!
✅ Processing your video...
The system automatically tries these locations in priority order:
ComfyUI/custom_nodes/MiniMax-Remover/models/
├── minimax_vae/ (VAE encoder/decoder)
├── minimax_transformer/ (main diffusion model)
└── minimax_scheduler/ (denoising scheduler)
ComfyUI/models/
├── minimax_vae/ (MiniMax VAE models)
├── minimax_transformer/ (MiniMax Transformer models)
└── minimax_scheduler/ (MiniMax Scheduler configs)
~/.cache/minimax-remover/models/
├── minimax_vae/
├── minimax_transformer/
└── minimax_scheduler/
Windows: C:\Users\[Username]\.cache\minimax-remover\models\
If auto-download fails or you prefer manual control:
# Option 1: Use built-in script
python download_models.py
# Option 2: Direct HuggingFace download
huggingface-cli download zibojia/minimax-remover --local-dir ./models --local-dir-use-symlinks False
# Then rename folders for clarity:
mv ./models/vae ./models/minimax_vae
mv ./models/transformer ./models/minimax_transformer
mv ./models/scheduler ./models/minimax_scheduler
# Option 3: Download to ComfyUI models directory
huggingface-cli download zibojia/minimax-remover --local-dir ComfyUI/models --local-dir-use-symlinks False
# Then rename folders for clarity:
mv ComfyUI/models/vae ComfyUI/models/minimax_vae
mv ComfyUI/models/transformer ComfyUI/models/minimax_transformer
mv ComfyUI/models/scheduler ComfyUI/models/minimax_scheduler
📋 For detailed setup instructions, see AUTO_DOWNLOAD_GUIDE.md
The node now handles any resolution input with automatic compatibility:
| Input Resolution | Problem | Auto-Fixed To | Result |
|---|---|---|---|
1000x1778 |
125x222.25 latent | 1008x1784 |
126x223 ✅ |
720x480 |
No issue | 720x480 |
90x60 ✅ |
1920x1080 |
240x135 | 1920x1088 |
240x136 ✅ |
📋 For technical details, see TENSOR_DIMENSION_FIX_GUIDE.md
Problem Solved: Users were experiencing OpenCV reinstallation prompts and conflicts.
Root Cause: Multiple conflicting OpenCV version requirements across different files:
- requirements.txt: opencv-python==4.5.5.64 (exact old version)
- requirements_bmo.txt: opencv-python>=4.8.0 (newer minimum)
- pyproject.toml: opencv-python>=4.7.0 (different minimum)
Solution Applied:
- ✅ Standardized OpenCV requirements to opencv-python>=4.5.0,<5.0.0 across all files
- ✅ Safe installation procedures that don't break existing OpenCV installations
- ✅ Recovery scripts for users with broken installations
Result: No more OpenCV reinstallation prompts or conflicts!
Problem Solved: Conflicts between MiniMax-Remover and DWPose/DW preprocessors.
Root Cause: Multiple compatibility issues:
- PyTorch version conflicts (torch==2.6 vs DWPose requirement <2.4)
- Segment Anything model loading conflicts
- ONNX runtime conflicts
- CUDA memory issues from simultaneous GPU usage
Solution Applied:
- ✅ Compatible PyTorch range: torch>=2.0.0,<2.5.0 for DWPose compatibility
- ✅ TorchVision compatibility: Proper version alignment
- ✅ Memory management: Smart GPU memory handling
- ✅ Model isolation: Prevents loading conflicts
Result: MiniMax-Remover now works seamlessly with DWPose and other preprocessors!
📋 For detailed compatibility info, see DW_PREPROCESSOR_COMPATIBILITY.md
Add the Node: Look for "MiniMax-Remover (BMO)" in the MiniMax-Remover category
Connect Inputs:
images: Your video frames as IMAGE typemasks: Your binary masks as MASK type
Configure (Optional):
num_inference_steps: 12 (default, optimal quality/speed balance)iterations: 6 (mask expansion, default works for most cases)seed: Any number for reproducible resultsauto_download: True (default, enables automatic model management)
Run: Perfect results with any resolution combination!
auto_download: True (default) - Automatic model managementnum_inference_steps: 12 (default) - Quality/speed balanceiterations: 6 (default) - Mask expansion iterationsseed: 42 (default) - Random seed for reproducible resultsvae_path: "auto" (default) - Auto-detected VAE pathtransformer_path: "auto" (default) - Auto-detected Transformer path scheduler_path: "auto" (default) - Auto-detected Scheduler path🔧 Using BMO MiniMax-Remover Pipeline (Flexible Resolution)
📐 Input Analysis:
Images: torch.Size([165, 1920, 1080, 3])
Masks: torch.Size([165, 1024, 576, 1])
Using input dimensions as target: 1920x1080
🔧 Auto-resizing for compatibility to 1920x1080
VAE-compatible target: 1920x1088
Resizing masks: 1024x576 -> 1920x1088
🎉 Models downloaded successfully with descriptive names!
📁 MiniMax VAE: D:\ComfyUI\custom_nodes\MiniMax-Remover\models\minimax_vae
📁 MiniMax Transformer: D:\ComfyUI\custom_nodes\MiniMax-Remover\models\minimax_transformer
📁 MiniMax Scheduler: D:\ComfyUI\custom_nodes\MiniMax-Remover\models\minimax_scheduler
✅ Processing complete - perfect results!
🔍 Checking for MiniMax-Remover models...
✅ Found existing models at: D:\ComfyUI\custom_nodes\MiniMax-Remover\models (descriptive names)
VAE: D:\ComfyUI\custom_nodes\MiniMax-Remover\models\minimax_vae
Transformer: D:\ComfyUI\custom_nodes\MiniMax-Remover\models\minimax_transformer
Scheduler: D:\ComfyUI\custom_nodes\MiniMax-Remover\models\minimax_scheduler
✅ BMO MiniMax-Remover models loaded successfully!
🚀 Processing your video...
# Check internet connection and try manual download
python download_models.py
# Or use HuggingFace CLI
huggingface-cli download zibojia/minimax-remover --local-dir ./models
# If PyTorch gets downgraded to CPU version during installation:
# 1. Reinstall PyTorch with CUDA support first
pip install torch>=2.0.0,<2.8.0 torchvision>=0.15.0,<0.20.0 --index-url https://download.pytorch.org/whl/cu121
# 2. Then install other dependencies
pip install -r requirements.txt --no-deps --force-reinstall diffusers transformers accelerate
# Install with compatible versions
pip install -r requirements.txt
# If issues persist, see INSTALLATION_GUIDE_OPENCV_FIX.md
# Use compatible PyTorch version
pip install "torch>=2.0.0,<2.5.0" "torchvision>=0.15.0,<0.20.0"
# See DW_PREPROCESSOR_COMPATIBILITY.md for details
The MiniMax-Remover models can be stored in two different locations. Check both locations to find your models:
MiniMax-Remover/
├── 📄 README.md (this file)
├── 🔧 minimax_mask_node_bmo.py (main ComfyUI node)
├── 🔧 pipeline_minimax_remover_bmo.py (processing pipeline)
├── 🔧 transformer_minimax_remover.py (model architecture)
├── 📦 requirements.txt (dependencies)
├── 📁 models/ (auto-downloaded models with descriptive names)
│ ├── minimax_vae/ (VAE encoder/decoder)
│ ├── minimax_transformer/ (main diffusion model)
│ └── minimax_scheduler/ (denoising scheduler)
├── 📋 Documentation/
│ ├── AUTO_DOWNLOAD_GUIDE.md
│ ├── TENSOR_DIMENSION_FIX_GUIDE.md
│ ├── DW_PREPROCESSOR_COMPATIBILITY.md
│ ├── INSTALLATION_GUIDE_OPENCV_FIX.md
│ └── OPENCV_FIX_SUMMARY.md
└── 🛠️ Scripts/
├── download_models.py
├── setup_comfyui_integration_bmo.py
└── fix_comfyui_diffusers.py
ComfyUI/
├── models/
│ ├── checkpoints/ (Stable Diffusion models)
│ ├── vae/ (Standard VAE models)
│ ├── loras/ (LoRA models)
│ ├── minimax_vae/ (🎯 MiniMax VAE - auto-downloaded here)
│ ├── minimax_transformer/ (🎯 MiniMax Transformer - auto-downloaded here)
│ └── minimax_scheduler/ (🎯 MiniMax Scheduler - auto-downloaded here)
└── custom_nodes/
└── MiniMax-Remover/
├── 📄 README.md
├── 🔧 minimax_mask_node_bmo.py
├── 🔧 pipeline_minimax_remover_bmo.py
└── 📦 requirements.txt
💡 Tip: When the node runs, it will display the actual local paths where your models are found, so you'll know exactly which location is being used.
AUTO_DOWNLOAD_GUIDE.md - Model download and managementTENSOR_DIMENSION_FIX_GUIDE.md - Resolution compatibility detailsDW_PREPROCESSOR_COMPATIBILITY.md - DWPose integration guideINSTALLATION_GUIDE_OPENCV_FIX.md - OpenCV issue resolutionOPENCV_FIX_SUMMARY.md - Complete fix summary$ claude mcp add MiniMax-bmo \
-- python -m otcore.mcp_server <graph>