{"id":13788252,"url":"https://github.com/nousr/koi","last_synced_at":"2025-04-05T16:10:29.066Z","repository":{"id":58324128,"uuid":"530483274","full_name":"nousr/koi","owner":"nousr","description":"A plug-in for Krita that enables the use of AI models for img2img generation.","archived":false,"fork":false,"pushed_at":"2023-03-12T14:12:44.000Z","size":93,"stargazers_count":447,"open_issues_count":17,"forks_count":35,"subscribers_count":16,"default_branch":"main","last_synced_at":"2025-03-29T15:47:08.405Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nousr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null},"funding":{"github":["nousr"]}},"created_at":"2022-08-30T03:32:05.000Z","updated_at":"2025-03-27T12:21:24.000Z","dependencies_parsed_at":"2024-01-07T03:52:23.786Z","dependency_job_id":"35276249-45ff-46cf-9569-d6bf42f4cf6e","html_url":"https://github.com/nousr/koi","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nousr%2Fkoi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nousr%2Fkoi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nousr%2Fkoi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nousr%2Fkoi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nousr","download_url":"https://codeload.github.com/nousr/koi/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247361695,"owners_count":20926643,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T21:00:40.609Z","updated_at":"2025-04-05T16:10:29.040Z","avatar_url":"https://github.com/nousr.png","language":"HTML","funding_links":["https://github.com/sponsors/nousr"],"categories":["Plugins for third party apps","Tools","📥Standalone [^](#table)"],"sub_categories":["Extending Functionality","Stable Diffusion (SD)","AI-Powered [^](#table)"],"readme":"# koi 🎣\n\n[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/nousr/koi/blob/main/koi_colab_backend.ipynb) \u003ca href=\"https://discord.gg/hDBbsXDd6K\"\u003e\u003cimg alt=\"Join us on Discord\" src=\"https://img.shields.io/discord/1015817150608453732?color=5865F2\u0026logo=discord\u0026logoColor=white\"\u003e\u003c/a\u003e [![GitHub](https://badgen.net/badge/icon/github?icon=github\u0026label)](https://github.com/nousr/koi)\n\nkoi is an open source plug-in for [Krita](https://krita.org/) that allows you to use AI to accelerate your art workflow!\n\n#### Disclaimer ✋\n\u003e In the interest of getting the open source community on board--I have released this plug-in early. In its current state you may run into issues (particularly during the setup process). If you do, I encourage you to open an issue here on GitHub and describe your problems so that it can be fixed it for you and others!\n\n---\n\n## Overview 😄\n\n\u003e The goal of this repository is to serve as a starting point for building increasingly useful tools for artists of all levels of experience to use. \n\n[Link to original twitter thread](https://twitter.com/nousr_/status/1564797121412210688)\n\nThis plug-in serves as a working example of how new A.I. models like Stable Diffusion can lower the barrier of entry to art so that anyone can enjoy making their dreams a reality!\n\nBecause this is an open source project I encourage you to try it out, break things, and come back with suggestions!\n\n## Getting Started 🏁\n\nIf you are new to git, or get stuck during the installation process, [Lewington](https://github.com/Lewington-pitsos) made a nice [step-by-step video](https://www.youtube.com/watch?v=rIhQakm4Efk).\n\nThe easiest way to get started is to follow the plug-in installation process for krita. Then use the google colab backend server *(button at the top of this readme)*! This should give you a good introduction to the setup process and get you up and running fast!\n\n---\n\n## Installation 🔨\n\n### Krita has a few plug-in installation methods, however, I will refer you to the one I use.\n\n- **Step 1**: Find your operating system's `pykrita` folder [reference](https://docs.krita.org/en/reference_manual/resource_management.html#resource-management)\n- **Step 2**: Clone the repository, and copy the `koi` folder and `koi.desktop` to `pykrita`. (restart krita now if it is open)\n- **Step 3**: Open Krita and navigate to the python plug-in menu [reference](https://scripting.krita.org/lessons/plugins-introduction)\n- **Step 4**: Enable the `koi` plugin and restart Krita to load the plug-in.\n\n### The next thing you will need to do is setup the backend server that do all the computation!\n\n- **Step 0**: Ensure you have a GPU-accelerated installation of `pytorch`. *(You can skip this step if you are using Colab or already have it)*\n  - Follow the installation instructions on pytorch's official [getting started](https://pytorch.org/get-started/locally/).\n- **Step 1**: Get the latest version of HuggingFace's `diffusers` from source by going to the [GitHub repo](https://github.com/huggingface/diffusers)\n  - From here you can clone the repo `git clone https://github.com/huggingface/diffusers.git` \u0026 `cd diffusers` to move into the directory.\n  - Install the package with `pip install -e .`\n  \n- **Step 2**: Install this package! I recommend moving out of the diffusers folder if you haven't already (eg. `cd ..`)\n  - `git clone https://github.com/nousr/koi.git`, then  `cd koi` and `pip install -e .`\n  \n\u003e ***Note :raising_hand:***\n\u003e\n\u003e Before continuing, make sure you accept the terms of service for the `diffusers` model [link to do so here](https://huggingface.co/CompVis/stable-diffusion-v1-4).\n\u003e\n\u003e Next, inside your terminal run the `huggingface-cli login` command and paste a token generated from [here](https://huggingface.co/settings/tokens). If you don't want to repeat this step in the future you can then run `git config --global credential.helper store`. *(note: only do this on a computer you trust)*\n\n\n- **Step 3**: Run the server by typing `python server.py`\n  - If you did everything correctly you should see an address spit out after some time (eg. 127.0.0.1:8888)\n- **Step 4**: Open Krita, if you haven't already, and paste your address into the `endpoint` field of the plugin\n  - You will also need to append the actual API endpoint you are using. By default this is `/api/img2img`\n  - If you are using all of the default settings your endpoint field will look something like this `http://127.0.0.1:8888/api/img2img`\n\n---\n\n## Inference 🖌️\nThis part is easy!\n- Step 1: Create a new canvas that is **512 x 512** (px) in size and make a **single-layer** sketch *(note: these are temporary restrictions)*.\n- Step 2: Fill out the prompt field in the `koi` panel (default location is somewhere on the right of your screen).\n- Step 3: Make any additional changes you would like to the inference parameters (strength, steps, etc.)\n- Step 4: Copy and paste your server's endpoint to the associated field\n- Step 5: Click `dream`!\n\n---\n\n## FAQ ❔\n\n- ***What does `koi` stand for?***\n  - *Krita Open(source) Img2Img: While support for StableDiffusion is first, the goal is to have this plug-in be compatible with any model!*\n- ***Why the client/server setup?***\n  - *The goal is to make this as widely available as possible. The server can be run anywhere with a GPU (i.e. colab) and allow those with low-powered hardware to still use the plug-in!*\n- **I'm getting an error with \"set-size\"**\n  - This usually happens when you either forget \"/api/img2img\" at the end of your endpoint when copying it into the plugin OR you have some issue with your backend server (check the output on your server for more information).\n---\n\n# TODO\n- [x] Add colab backend example\n- [ ] Flesh out UI\n- [ ] Move to CompVis repo\n- [ ] Add CI\n- [ ] Abstract away drop-in models for the server\n- [ ] Improve documentation\n- [ ] Add DreamStudio API support\n- [ ] Add support for arbitrary canvas size \u0026 selection-based img2img\n- [ ] Add support for masks\n- [ ] Offer more configuration options\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnousr%2Fkoi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnousr%2Fkoi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnousr%2Fkoi/lists"}