IOPaint是一款免费开源的图像修复(inpainting)和图像扩展(outpainting)工具,基于最先进的AI模型技术。该项目由Sanster开发维护,旨在为用户提供强大而便捷的图像编辑功能。
项目地址: https://github.com/Sanster/IOPaint
官方网站: https://www.iopaint.com/
这些模型专门用于移除图像中不需要的对象、瑕疵、水印和人物,包括:
这些模型用于对象替换和图像扩展任务,包括:
IOPaint提供了丰富的插件生态系统:
# 安装IOPaint
pip3 install iopaint
# 启动服务(使用LAMA模型,CPU模式)
iopaint start --model=lama --device=cpu --port=8080
# 首先安装CUDA版本的PyTorch
pip3 install torch==2.1.2 torchvision==0.16.2 --index-url https://download.pytorch.org/whl/cu118
# 然后安装IOPaint
pip3 install iopaint
# AMD GPU用户(仅限Linux)
pip3 install torch==2.1.2 torchvision==0.16.2 --index-url https://download.pytorch.org/whl/rocm5.6
安装完成后,访问 http://localhost:8080 即可开始使用。
iopaint run --model=lama --device=cpu \
--image=/path/to/image_folder \
--mask=/path/to/mask_folder \
--output=output_dir
# 启用交互式分割插件
iopaint start --enable-interactive-seg --interactive-seg-device=cuda
# 克隆项目
git clone https://github.com/Sanster/IOPaint.git
cd IOPaint/web_app
# 安装依赖
npm install
# 构建前端
npm run build
cp -r dist/ ../iopaint/web_app
# 开发模式
npm run dev
# 安装后端依赖
pip install -r requirements.txt
# 启动后端服务
python3 main.py start --model lama --port 8080
开发环境下访问 http://localhost:5173/ 进行前端开发。
IOPaint还推出了移动端应用:
IOPaint是目前最优秀的开源图像修复工具之一,无论是个人用户还是专业开发者,都能从中获得强大的图像编辑能力。