Install Guide - Interpause/auto-sd-krita GitHub Wiki

UPDATE: New Extension-based version: https://github.com/Interpause/auto-sd-paint-ext

This guide is primarily written for Windows users. However, development is done on a (Gentoo) Linux laptop, so Linux users should have a smooth setup.

If you already have installed AUTOMATIC1111's fork, you might want to check out this first: Quick Switch Using Existing AUTOMATIC1111 Install.

NOTE: Even if you have used a another/previous Krita plugin, you must follow Installing the WebUI/Backend below. Our APIs are very unlikely to be compatible.

Installing the WebUI/Backend

Follow the corresponding installation guide from AUTOMATIC1111's wiki:

The installation process is almost exactly the same because instead of modifying the codebase, the backend server calls the webUI's internal APIs. If there are any issues, you might want to look at AUTOMATIC1111's wiki first before submitting an issue.

However, I appended .template to webui-user.bat and webui.sh. So first, copy webui-user.bat.template and rename it to webui-user.bat. Afterwards, fill in the values. For example:

:: copy & rename `webui-user.bat.template` to `webui-user.bat`
@echo off

:: i.e. using Python Launcher from https://www.python.org/getit/
set PYTHON=py -3.10
:: below can be left empty for most installations
set GIT=
set VENV_DIR=
:: set CLI args you like, for example:
set COMMANDLINE_ARGS= --medvram --always-batch-cond-uncond --listen

call webui.bat

Afterwards, double click webui-user.bat as per normal to run it & begin the (extremely long; be patient) installation.

Plugin Installation

Download Krita and launch it.

Find the pykrita folder

On the menubar, go to Settings > Manage Resources....

On the popup, click Open Resource Folder. Take note of the pykrita folder located inside (or create it if it doesn't exist).

Install the plugin

The following assumes you cloned/downloaded the repository to C:\Users\john\Documents and did not rename the folder from auto-sd-krita. Adjust accordingly.

The plugin consists of the krita_diff folder and krita_diff.desktop file located in C:\Users\john\Documents\auto-sd-krita\krita_plugin. To install the plugin, copy them into the pykrita folder from earlier.

(Alternative) Symlink install

A symlink is a shortcut to a file or folder that redirects to the real file or folder when read by an application, allowing for automatic updates to the plugin. However, symlinks require admin permissions and are fragile on Windows.

Open an admin prompt and run the following commands, adjusting the file/folder paths based on your own configuration:

cd <location-of-pykrita-folder>
mklink /j krita_diff C:\Users\john\Documents\auto-sd-krita\krita_plugin\krita_diff
mklink krita_diff.desktop C:\Users\john\Documents\auto-sd-krita\krita_plugin\krita_diff.desktop

Enabling the plugin

  1. Restart Krita.
  2. On the menubar, go to Settings > Configure Krita...
  3. On the left sidebar, go to Python Plugin Manager.
  4. Look for Stable Diffusion Plugin and tick the checkbox.
  5. Restart Krita again for changes to take effect.

The SD Plugin docked window should appear on the left of the Krita window. If it does not, look on the menubar under Settings > Dockers for SD Plugin.

Troubleshooting

If the SD Plugin docked window doesn't appear and isn't present under Settings > Dockers, follow steps 1 to 4 from Enabling the plugin. Stable Diffusion Plugin will likely be greyed out. Submit an issue with the error message that is shown when hovering over it.

If Stable Diffusion Plugin is not present, ensure you followed Install the plugin closely.

Updating

WebUI/Backend

If installed using git, the code should automatically pull updates on start up. If it doesn't, open a Command Prompt inside the auto-sd-krita folder and do git pull or use Github Desktop to do so.

Plugin

If you used the symlink install then no action is required here besides restarting Krita.

Otherwise, repeat Install the plugin after pulling the updates.

Troubleshooting

  • Are you running the modified backend? Do note the plugin isn't compatible with the backend of other plugins or the incomplete official API.
  • Delete krita_diff_plugin.ini and krita_diff_plugin_scripts.ini from %APPDATA%\krita (on Windows) or ~/.config/krita (on Linux) if the plugin is unable to start.
  • If the plugin is able to start but doesn't function as expected, try Restore Defaults under the Config tab.

Next Steps

You might want to check out the Usage Guide.