# Repository Briefing: yebisu0529-ship-it/ComfyUI-BEN3
> Source: https://repoforai.com/repo/yebisu0529-ship-it/ComfyUI-BEN3 (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/yebisu0529-ship-it/ComfyUI-BEN3
- **Category**: Voice, Vision & Video (语音 / 视觉 / 视频生成)
- **Primary Language**: Python
- **License**: See repository
- **Engineering Health**: B (55/100 · Maintenance 35/35 · Adoption 3/25 · Releases 11/20 · License 6/20)
- **Review Snapshot**: 2026-12-04
- **Deployment / Stack Signals**: GPU, Local AI
- **Momentum**: 102 ★ total (+10 24h / +102 7d) · 2 forks
- **When to Use**: Best for: Existing ComfyUI workflows that need local BEN3 cutouts and reusable masks for still images or batches of frames, with control over precision and chunk size. Skip if: You need a standalone inference API, guaranteed temporal consistency for video, or confirmed commercial redistribution rights before adoption.

## Overview
```text
### Architecture & Core Mechanics
ComfyUI-BEN3 is a Python custom-node extension that runs inference inside the ComfyUI workflow. BEN3 Model Loader resolves a local checkpoint or an auto: Hugging Face preset and sets inference precision and input size. BEN3 Remove Background takes the loaded model and an IMAGE batch, processes the frames in chunks, and returns an IMAGE plus a MASK. Keeping loading separate from image processing lets a graph share the configured model across removal nodes.

The package includes __init__.py, nodes.py, and ben3_runtime.py. BEN3 uses a DINOv3 ViT encoder through transformers’ DINOv3ViTConfig and DINOv3ViTModel, with encoder-layer key normalization across transformers 4.56.x and 5.x. The dependency manifests specify transformers>=4.56.0, safetensors, huggingface-hub, NumPy, Pillow, and OpenCV.

### Key Capabilities & Differentiators
The loader accepts converted ben3.safetensors and ben3_fp16.safetensors as well as upstream ben3.pth. Inference input size is configurable from 256 to 2048 in increments of 16, defaulting to 1024. The removal node processes 1–64 frames per forward pass, defaulting to 4. CUDA auto mode uses fp16, an unsupported bf16 selection falls back to fp16 on GPU, and CPU inference always runs in fp32.

Input IMAGE tensors have shape [B, H, W, 3] or [B, H, W, 4]; any existing alpha channel is ignored. Transparent mode returns straight, non-premultiplied RGBA. Black, white, green, and custom six-digit hex backgrounds return composited RGB. The node also exposes the MASK for separate downstream use, and inversion applies to both that output and compositing. Video support here means processing batches of frames; temporal consistency is not established.

### Trade-offs & Limitations
The direct comparison is ComfyUI’s built-in background-removal loader for BiRefNet. Both loaders list files from models/background_removal/, so seeing a checkpoint in the dropdown does not mean it is compatible: select only BEN3 weights in BEN3 Model Loader. The extension makes precision, frame chunking, and compositing explicit in the graph, but adds dependencies to the host environment. Choose between the two models using representative inputs, since there is no head-to-head quality or performance benchmark here.

Size VRAM on the target machine: start with smaller chunks and raise resolution or chunk size separately while measuring peak usage. Setting keep_model_loaded to false releases GPU residency after execution by moving the model to CPU and clearing the CUDA cache; repeated GPU runs then incur a transfer back to the device. For commercial use, verify the extension and weight terms separately, including DINOv3. The presence of LICENSE and DINOV3_LICENSE.md does not establish the applicable permissions by itself.

### Hardware & Deployment Guide
The package declares Python >=3.9 and recommends ComfyUI >=0.21.0. Clone it into ComfyUI/custom_nodes, install requirements.txt with the Python environment that runs ComfyUI, and restart the host. For older ComfyUI versions, the extension registers models/background_removal/ at import time. Ensure transformers>=4.56.0 is installed, since the DINOv3 model and configuration classes are required.

For offline operation, stage the dependencies and place a BEN3 checkpoint in ComfyUI/models/background_removal/. The auto: presets use network access to retrieve weights from StudioYebisu-ship-it/BEN3-safetensors-ComfyUI or PramaLLC/BEN3; inference itself runs locally. CUDA enables the documented half-precision path, while CPU is an fp32 option. The package metadata lists version 0.1.0, but no GitHub release is listed, so release-to-release compatibility is not established.
```

## Key Capabilities
```text
- Graph integration: BEN3 Model Loader feeds BEN3 Remove Background, which returns both IMAGE and MASK.
- Checkpoint handling: Loads BEN3 .safetensors and upstream .pth files from the shared model directory or resolves an auto: Hugging Face preset.
- Encoder compatibility: Normalizes DINOv3 layer keys between transformers 4.56.x and 5.x.
- Inference controls: Selects an input size of 256–2048 in steps of 16 and a chunk size of 1–64 frames; defaults are 1024 and 4.
- Output formats: Returns straight RGBA or solid-background RGB; mask inversion also applies to compositing.
- Model residency: Disabling keep_model_loaded moves the model to CPU and clears the CUDA cache after a run.
```

## Quick Start / Clone
```bash
cd ComfyUI/custom_nodes
git clone https://github.com/yebisu0529-ship-it/ComfyUI-BEN3.git
cd ComfyUI-BEN3
pip install -r requirements.txt
```
