Plugin which adds selection tools to mask objects in your image with a single click, or by drawing a bounding box.
Click on things to select them!
SegmentFromPoint.mp4
Draw a box around things to select them!
SegmentFromBox.mp4
Select "Precise" in Tool options to get better quality masks. Depending on hardware the operation can take several seconds. This model typically extracts all foreground objects in the area, rather than one specific object that is contained entirely in the box.
The current version of the plugin is built for Krita 5.2.9. Using it with other versions may lead to crashes.
You can download the latest version of the plugin from the releases page.
Download the plugin and unpack the ZIP archive into your Krita installation folder. Then run Krita.
Hints:
- The default installation folder is
C:\Program Files\Krita (x64)
- Copy/extract the contents of the ZIP directly, don't make a separate folder
You can use this script to download and patch Krita with the plugin. It also creates a shortcut to run it.
To do it manually, get the Krita AppImage from the official source and extract
it. This should result in a folder squashfs-root
. Download the plugin tar.gz
and extract it into that folder. Then run Krita. See the commands below for some
environment variables that are needed to run outside the image.
./krita-5.2.9-x86_64.appimage --appimage-extract
tar -xf krita_segmentation_plugin-linux-x64-1.1.0.tar.gz -C squashfs-root/
APPDIR=/squashfs-root APPIMAGE=1 ./squashfs-root/AppRun
Arch users can use the PKGBUILD
on the AUR, or with yay
or paru
:
yay -S krita-ai-tools
# or
paru -S krita-ai-tools
Disclaimer: untested, and maybe not worth the hassle.
To use the GPU backend on Linux you need:
- An NVIDIA GPU for CUDA support
- CUDA Toolkit 12.x installed
- cuDNN 9.x installed
- CUDA Toolkit and cuDNN libraries must be in
LD_LIBRARY_PATH
For your own experiments only, not officially supported.
List of alternative model downloads
To use a different model, find the model folder and replace one or more of the models there (recommended to make a backup!)
- Models are located in
share/krita/ai_models/segmentation
. - Models must be
.onnx
files.
Files to add or replace:
birefnet_cpu.onnx
- preferred when using CPU backendbirefnet_gpu.onnx
- preferred when using GPU backendbirefnet_hr_cpu.onnx
- preferred when using high resolutions (~2K)birefnet_hr_gpu.onnx
- preferred when using high resolutions (~2K)
If a sepcific model doesn't exist, the other ones are used as fallback. So you only really need one of them.
Tip
On older GPUs it might make sense to delete the birefnet_gpu.onnx
file for better performance.
The plugin has to be built as part of Krita, see Building Krita from Source.
After GIT checkout, clone this repository into the plugins folder:
cd krita/plugins
git clone https://github.com/Acly/krita-ai-tools.git
Next modify the CMakeLists.txt
in the same folder (krita/plugins
) by
appending the following line:
add_subdirectory( krita-ai-tools )
Now build and install Krita as usual according to official instructions, and the plugin will be built alongside.
- Object detection: Segment Anything Model, MobileSAM
- Dichotomous segmentation: BiRefNet
- Inference implementation: dlimgedit