Use custom model files
mainIf you have a modified version of a model (e.g. converted to a different ONNX IR version for compatibility with an older CUDA toolkit), you can prevent rembg from overwriting it by following these steps:
- Set
MODEL_CHECKSUM_DISABLED=1. - Place your custom
.onnxfile in the models directory (default~/.u2net/) with the expected filename (e.g.u2net.onnx). - Rembg will detect the existing file and use it instead of re-downloading the original.
export MODEL_CHECKSUM_DISABLED=1
# Place custom u2net.onnx in ~/.u2net/
rembg i input.png