IOPaint README

The project's README from github.com/Sanster/IOPaint. As one markdown file: README.md.

IOPaint

A free and open-source inpainting & outpainting tool powered by SOTA AI model.

total download version python version HuggingFace Spaces Open in Colab

Erase(LaMa) Replace Object(PowerPaint)
Draw Text(AnyText) Out-painting(PowerPaint)

Features

Quick Start

Start webui

IOPaint provides a convenient webui for using the latest AI models to edit your images. You can install and start IOPaint easily by running following command:

# In order to use GPU, install cuda version of pytorch first.
# pip3 install torch==2.1.2 torchvision==0.16.2 --index-url https://download.pytorch.org/whl/cu118
# AMD GPU users, please utilize the following command, only works on linux, as pytorch is not yet supported on Windows with ROCm.
# pip3 install torch==2.1.2 torchvision==0.16.2 --index-url https://download.pytorch.org/whl/rocm5.6

pip3 install iopaint
iopaint start --model=lama --device=cpu --port=8080

That's it, you can start using IOPaint by visiting http://localhost:8080 in your web browser.

All models will be downloaded automatically at startup. If you want to change the download directory, you can add --model-dir. More documentation can be found here

You can see other supported models at here and how to use local sd ckpt/safetensors file at here.

Plugins

You can specify which plugins to use when starting the service, and you can view the commands to enable plugins by using iopaint start --help.

More demonstrations of the Plugin can be seen here

iopaint start --enable-interactive-seg --interactive-seg-device=cuda

Batch processing

You can also use IOPaint in the command line to batch process images:

iopaint run --model=lama --device=cpu \
--image=/path/to/image_folder \
--mask=/path/to/mask_folder \
--output=output_dir

--image is the folder containing input images, --mask is the folder containing corresponding mask images. When --mask is a path to a mask file, all images will be processed using this mask.

You can see more information about the available models and plugins supported by IOPaint below.

Development

Install nodejs, then install the frontend dependencies.

git clone https://github.com/Sanster/IOPaint.git
cd IOPaint/web_app
npm install
npm run build
cp -r dist/ ../iopaint/web_app

Create a .env.local file in web_app and fill in the backend IP and port.

VITE_BACKEND=http://127.0.0.1:8080

Start front-end development environment

npm run dev

Install back-end requirements and start backend service

pip install -r requirements.txt
python3 main.py start --model lama --port 8080

Then you can visit http://localhost:5173/ for development. The frontend code will automatically update after being modified, but the backend needs to restart the service after modifying the python code.

IOPaint (Sanster/IOPaint)

Searching Database…

23.3K ·GitHub
archived
这是什么东西?一个免费开源的 AI 图片处理工具:它能擦除图片里不想要的东西、瑕疵、水印或路人,还能借助 Stable Diffusion 替换或生成内容。
它是我直接访问的网站,还是需要安装的软件?既不是云端网站,也不是传统的桌面软件:你把它作为本地网络服务运行,然后通过浏览器里的界面来编辑图片。
我怎么把它跑起来?用 pip 安装 iopaint 这个包,运行 iopaint start,然后在浏览器里打开——模型会在启动时自动下载(可以用 --model-dir 更改存放位置)。
用之前需要先装 Python 吗?它是通过 pip 安装的 Python 程序,所以 Python 是唯一的先决条件——Windows 用户可以用 1-Click Installer,免掉这一步。
这个项目还在积极维护吗?不维护了——GitHub 仓库已经归档,变成只读状态,开发已经停止,不过已发布的工具仍然能用。
除了浏览器,它还有别的形式吗?除了网页界面,还有一个叫 OptiClean 的独立应用,面向 macOS 和 iOS,专门用来擦除物体;网页界面本身可以在 Windows、macOS 和 Linux 上运行。
我修图的时候,照片会被上传到别处吗?不会——IOPaint 完全自托管,你的图片和 AI 模型都留在你自己的设备上。
能用来做商业项目吗,有没有付费版?它基于 Apache-2.0 协议开源,个人和商业用途都免费,没有付费版。
我的电脑没有强力显卡也能用吗?能——普通 CPU 就可以运行,而且如果电脑里有独立显卡或 Apple Silicon 芯片,它会自动用它们来加速。
擦除模型和扩散模型有什么区别?LaMa 这类擦除模型用来去掉不想要的物体、瑕疵、水印或路人;Stable Diffusion inpainting、BrushNet 和 PowerPaintV2 这类扩散模型则是用新内容替换物体,或通过 outpainting 扩展画面。
它自带哪些插件?有 Segment Anything 用于快速交互式选取物体,RemoveBG 和 Anime Segmentation 用于处理背景,RealESRGAN 用于超分辨率放大,GFPGAN 和 RestoreFormer 用于修复人脸,另外还有一个可以浏览图片的 FileManager。
能不能不点浏览器,用命令批量处理?可以——它有命令行批处理模式:用 --image 指向存放输入图片的文件夹,用 --mask 指向对应的蒙版文件夹;一个蒙版文件也可以应用到所有图片上。
我能用自己下载的 Stable Diffusion 模型文件吗?可以——除了自动下载的模型,IOPaint 还能使用本地的 sd ckpt 或 safetensors 文件。
Creator
Sanster
Size
23.5 MB
Stars
23.3K
Age
4y
Commits · 90 Days