Replace uv-based installation with Python embeddable ZIP package that works on locked-down Windows environments (e.g. Windows Sandbox with Device Guard). The embeddable python.exe is PSF-signed and doesn't require an installer. - Download Python 3.10.11 embeddable ZIP instead of using uv - Bootstrap pip via get-pip.py (pure Python, no exe) - Install packages to .venv/Lib/site-packages via --target flag - Fix plugin copy fallback (create directory before copying) - Fix launcher scripts to keep window open and show errors - Add .python/ and python-*-embed-*.zip to .gitignore
ArtKrit
ArtKrit is a plugin for Krita that helps artists enhance their drawing skills by scaffolding the process of replicating a reference image into three steps: composition, value, and color. At each stage, ArtKrit generates adaptive composition lines and provides feedback on value and color accuracy to help artists refine their work.
Bottom row: Computational guidance and feedback provided by our system at each step. We offer object-based composition lines to assist with spatial positioning, and we visualize differences in value and color with verbal suggestions to guide the user.
Reference image: "Interior Practice // Kitchen" by Loish (2021, digital).
Installation
Quick Install Available! We provide easy installation scripts (
install.shfor macOS/Linux,install.ps1for Windows) that handle everything automatically. Krita portable is downloaded locally (no system install needed) and all Python dependencies are stored inside the ArtKrit folder. Runrun-kritato launch Krita with console logging, andrun-serverin a separate terminal to start the composition server.Windows: First enable script execution (one-time):
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser, then run.\install.ps1in PowerShell.
Krita
- Install Krita from the official website: https://krita.org/en/download/ (tested on version 5.2.9)
- To facilitate debugging, you can add the path to your Krita binary to your bash or zsh profile. On Mac, it should look like this (it would be bash for older MacOS versions):
This allows you to run Krita from the terminal by typing
echo 'export PATH="/Applications/krita.app/Contents/MacOS/:$PATH"' >> ~/.zshrc source ~/.zshrckrita. All the output from Krita and the plugin will be printed to the terminal.
File Structure Setup
-
On Mac, the Python plugin folder is located at
~/Library/Application Support/Krita/pykrita/. Navigate to this folder andgit clonethis repository. Note that for MacOS, ~/Library/Application Support and /Library/Application Support are different folders. If you don't find the Krita folder, make sure you are in the Application Support for your user. -
Under the
pykritafolder, create aartkrit.desktopfile. The file structure now should look like this:pykrita/ ArtKrit/ ... artkrit.desktop -
In the
artkrit.desktopfile, add the following content:# File: artkrit.desktop [Desktop Entry] Type=Service ServiceTypes=Krita/PythonPlugin X-KDE-Library=ArtKrit X-Python-2-Compatible=false X-Krita-Manual=Manual.html Name=ArtKrit Comment=Docker for ArtKrit
Python Plugin Setup
-
Pick your favorite virtual environment tool (e.g.
uv,venv,conda, etc.) and create a new environment withpython==3.10at your home directory (~).- Make sure you use
python==3.10for compatibility with Krita 5.2.9. - Name your environment
ddrawfor consistency. If you name it something else or place it elsewhere, update the system path at the top ofartkrit.pyandvalue_color.py. - I recommend using
uvto manage your environments for its simplicity and speed.- To install uv (on MacOS),
curl -LsSf https://astral.sh/uv/install.sh | sh - To install the virtual environment,
uv venv ddraw --python 3.10
- To install uv (on MacOS),
- Make sure you use
-
Activate your environment (e.g.,
source ddraw/bin/activate). Now navigate (cd) to~/Library/Application\ Support/Krita/pykrita/ArtKrit -
First, install pytorch with:
pip install torch torchvision torchaudio # If you're using `uv`, you can use the following command: uv pip install torch torchvision torchaudio -
Then install the other required packages:
pip install -r requirements.txt # If you're using `uv`, you can use the following command: uv pip install -r requirements.txt
Running the Plugin
-
In one terminal, run Krita by typing
kritain the terminal. This will allow you to see the output from the plugin. Directly opening Krita also works, but you won't see the output. -
In another terminal, activate your environment and navigate to the
ArtKritfolder. Then start the python server with:python script/composition/server.pyNote, if you get an error, try running it with the specific python version:
python3.10 server.py -
On the first launch, enable the plugin by going to Preferences (cmd+
,), scrolling down, selecting Python Plugin Manager, and checking the ArtKrit box. Then, relaunch Krita. The docker (window) for the plug-in can be found under Settings > Dockers > ArtKrit. -
When setting up a Krita document, it is recommended to set it as the same size as the reference image. This will ensure that the plugin works as intended.
-
Make sure to click
Set Reference Imagebutton every time you reopen Krita. -
If inferencing time for generating adaptive grids is too long, you can try to use smaller models listed in
run_models.py. Note that smaller models will not be as performant.
Helpful Resources
Krita API Documentation: https://api.kde.org/krita/html/ Guide for plugins: https://docs.krita.org/en/user_manual/python_scripting/krita_python_plugin_howto.html