Edit photos by describing the change, on your own GPU. A free, open-source alternative to Nano Banana and ChatGPT image editing: photos stay on your computer, no daily limit. One installer for Windows, Mac and Linux sets up the best open model (Qwen-Image 2.1). MCP server for AI agents.
TypeScript ai-photo-editorcomfyui-alternativegenerative-fillimage-editingimage-generationinpaintinglinuxlocal-aimacosmcpmcp-servernano-banana-alternativeofflinephoto-editorprivacyqwen-imageqwen-image-2-1stable-diffusion-cppvulkanwindows
Docker: each release publishes the image to ghcr.io; compose uses it (no clone, no build)
Gabriele Lozupone0877c17780b8
diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.ymlnew file mode 100644index 0000000..b37c96f--- /dev/null+++ b/.github/workflows/docker.yml@@ -0,0 +1,58 @@+name: Docker image++# Builds docker/Dockerfile and publishes it as ghcr.io/gabrielelozupone/kokon on every release:+# tags 0.11.0 and 0.11, plus latest for a release that is not a pre-release. The image holds no+# models; Kokon's setup downloads them into the data volume. Guide: docs/docker.md.+on:+ release:+ types: [published]+ workflow_dispatch:+ inputs:+ tag:+ description: "Release tag to build again, e.g. v0.11.0"+ required: true++permissions:+ contents: read+ packages: write++concurrency:+ group: docker-${{ github.event.release.tag_name || inputs.tag }}+ cancel-in-progress: false++jobs:+ image:+ runs-on: ubuntu-latest+ steps:+ - uses: actions/checkout@v4+ with:+ ref: ${{ github.event.release.tag_name || inputs.tag }}+ - uses: docker/setup-buildx-action@v3+ - uses: docker/login-action@v3+ with:+ registry: ghcr.io+ username: ${{ github.actor }}+ password: ${{ secrets.GITHUB_TOKEN }}+ - id: meta+ uses: docker/metadata-action@v5+ with:+ images: ghcr.io/gabrielelozupone/kokon+ # latest=auto: semver tags without a pre-release part also get "latest".+ flavor: latest=auto+ tags: |+ type=semver,pattern={{version}},value=${{ github.event.release.tag_name || inputs.tag }}+ type=semver,pattern={{major}}.{{minor}},value=${{ github.event.release.tag_name || inputs.tag }}+ labels: |+ org.opencontainers.image.title=Kokon+ org.opencontainers.image.description=Kokon for NVIDIA GPUs (CUDA), used from a browser+ org.opencontainers.image.licenses=AGPL-3.0-only+ - uses: docker/build-push-action@v6+ with:+ context: .+ file: docker/Dockerfile+ platforms: linux/amd64+ push: true+ tags: ${{ steps.meta.outputs.tags }}+ labels: ${{ steps.meta.outputs.labels }}+ cache-from: type=gha+ cache-to: type=gha,mode=maxdiff --git a/docker/Dockerfile b/docker/Dockerfileindex 8c11658..6b58a81 100644--- a/docker/Dockerfile+++ b/docker/Dockerfile@@ -2,9 +2,10 @@# The same Linux build as the .deb/.rpm (Ubuntu 22.04, glibc 2.35). The engine (stable-diffusion.cpp)# and the model are downloaded by Kokon's setup into /data, like in the desktop app, so the image# stays small; the NVIDIA Container Toolkit provides the driver. Guide: docs/docker.md.+# Each release publishes it as ghcr.io/gabrielelozupone/kokon (.github/workflows/docker.yml).+# To build it yourself, from the repository root:#-# docker build -f docker/Dockerfile -t kokon .-# docker compose -f docker/compose.yaml up -d+# docker build -f docker/Dockerfile -t ghcr.io/gabrielelozupone/kokon:latest .FROM ubuntu:22.04 AS buildARG DEBIAN_FRONTEND=noninteractive@@ -37,7 +38,8 @@ ENV QLS_DATA_DIR=/data \QLS_CONFIG_DIR=/config \QLS_OUTPUT_DIR=/gallery \NVIDIA_VISIBLE_DEVICES=all \- NVIDIA_DRIVER_CAPABILITIES=compute,utility KOKON_CONTAINER=1+ NVIDIA_DRIVER_CAPABILITIES=compute,utility \+ KOKON_CONTAINER=1USER kokonVOLUME ["/data", "/config", "/gallery"]# The browser UI (password required). The token API on 39151 stays inside the container.diff --git a/docker/compose.yaml b/docker/compose.yamlindex 610de2d..81c6f29 100644--- a/docker/compose.yaml+++ b/docker/compose.yaml@@ -1,17 +1,17 @@# Kokon on an NVIDIA GPU, used from a browser: http://<this computer's address>:39152-# Needs the NVIDIA Container Toolkit. First start, then set the password once:+# Needs the NVIDIA Container Toolkit. In the folder with this file, start it, then set the+# password once:#-# docker compose -f docker/compose.yaml up -d+# docker compose up -d# docker exec -it kokon kokon-service --set-password#+# Update to a new version: docker compose pull && docker compose up -d# Guide: docs/docker.md. For access from outside your home use Tailscale or another VPN# (docs/remote-access.md), never port forwarding on your router.services:kokon:- image: kokon- build:- context: ..- dockerfile: docker/Dockerfile+ # Published by each release; ":0.11" stays on 0.11.x instead of following new versions.+ image: ghcr.io/gabrielelozupone/kokon:latestcontainer_name: kokonrestart: unless-stoppedports:diff --git a/docs/docker.md b/docs/docker.mdindex 8a13b2c..2073aba 100644--- a/docs/docker.md+++ b/docs/docker.md@@ -14,10 +14,13 @@ be tested.## Start it-From a clone of this repository:+Each release publishes the image as `ghcr.io/gabrielelozupone/kokon`, so you need only the+compose file, no clone and no build:```bash-docker compose -f docker/compose.yaml up -d --build+mkdir kokon && cd kokon+curl -fsSLO https://raw.githubusercontent.com/GabrieleLozupone/kokon/master/docker/compose.yaml+docker compose up -ddocker exec -it kokon kokon-service --set-password # once; at least 8 characters```@@ -33,7 +36,7 @@ downloads the engine and the model (about 12 GB) into the container's data volum| `kokon-gallery` | `/gallery` | the images saved to the gallery |To keep the saved images in a folder of your own, replace the `kokon-gallery` line in-`docker/compose.yaml` with a folder Kokon can write to (it runs as user id 1000):+`compose.yaml` with a folder Kokon can write to (it runs as user id 1000):```bashmkdir -p ~/kokon-gallery && sudo chown 1000:1000 ~/kokon-gallery@@ -45,8 +48,21 @@ mkdir -p ~/kokon-gallery && sudo chown 1000:1000 ~/kokon-gallery```bashdocker logs -f kokon # what the service is doingdocker exec -it kokon kokon-service --set-password # a new password (every browser signs in again)-docker compose -f docker/compose.yaml down # stop (the volumes stay)-git pull && docker compose -f docker/compose.yaml up -d --build # update to a new version+docker compose down # stop (the volumes stay)+docker compose pull && docker compose up -d # update to a new version+```++The `latest` tag follows every release. To get only the fixes of one version, write for example+`ghcr.io/gabrielelozupone/kokon:0.11` in `compose.yaml` (it stays on 0.11.x); each release also+has its exact tag, such as `:0.11.0`.++## Build the image yourself++From a clone of this repository (takes a while: it compiles the UI and `kokon-service`):++```bash+docker build -f docker/Dockerfile -t ghcr.io/gabrielelozupone/kokon:latest .+docker compose -f docker/compose.yaml up -d```## Securitydiff --git a/docs/releasing.md b/docs/releasing.mdindex 7bd4ad5..a08f4b5 100644--- a/docs/releasing.md+++ b/docs/releasing.md@@ -61,7 +61,12 @@ all three from the same code.1. Copy its files and its `updater-<platform>.json` into the same `dist-release/`.2. Run the manifest step again.3. Upload with `gh release upload v0.9.1 <files> dist-release/latest.json --clobber`.-7. **MCP server** (after the GitHub release is out): `cd mcp && npm login && npm whoami && npm publish`+7. **Docker image**: publishing the release starts `.github/workflows/docker.yml`, which builds+ `docker/Dockerfile` and pushes `ghcr.io/gabrielelozupone/kokon` with the tags `<x.y.z>`, `<x.y>`+ and (not for a pre-release) `latest`. Check the run in the Actions tab. To build a tag again:+ `gh workflow run docker.yml -f tag=v<x.y.z>`. The first push creates the package as private:+ once, on GitHub → Packages → kokon → Package settings, set its visibility to **Public**.+8. **MCP server** (after the GitHub release is out): `cd mcp && npm login && npm whoami && npm publish`(`npm login` first: an expired login makes `npm publish` fail with a misleading **E404 Not Found**; it runs the build andtests first), then `mcp-publisher login github` and `mcp-publisher publish` from `mcp/` so theMCP Registry lists the new version. Glama (https://glama.ai/mcp/servers/GabrieleLozupone/kokon):diff --git a/marketing/release-notes-0.11.0.md b/marketing/release-notes-0.11.0.mdindex 48e7a8b..dc847de 100644--- a/marketing/release-notes-0.11.0.md+++ b/marketing/release-notes-0.11.0.md@@ -6,7 +6,7 @@ Use Kokon from your phone, tablet or another computer, in a browser. The images- **Safe by default**: the password is stored only as a hash, 5 wrong tries in a row make that device wait, and a browser can't touch files on the computer by path or change its folders, model files or network settings. Kokon's own token (desktop app, MCP server) still works only on the computer itself.- **From outside your home**: a short guide to [Tailscale](https://github.com/GabrieleLozupone/kokon/blob/master/docs/remote-access.md#from-outside-your-home-tailscale) (or another VPN). Never open Kokon's port on your router.- **In the browser**: add photos with the + button, by dropping files or by pasting; the download button saves results on the device you are using.-- **Docker for NVIDIA cards**: Kokon without a window, with the models, settings and gallery in volumes and an example `docker compose` file. Guide: [docs/docker.md](https://github.com/GabrieleLozupone/kokon/blob/master/docs/docker.md). An image for AMD and Intel cards (Vulkan) will follow.+- **Docker for NVIDIA cards**: Kokon without a window, as the image `ghcr.io/gabrielelozupone/kokon` (published with each release, no models inside: the setup downloads them once into a volume). Download `docker/compose.yaml`, run `docker compose up -d`, set the password. Guide: [docs/docker.md](https://github.com/GabrieleLozupone/kokon/blob/master/docs/docker.md). An image for AMD and Intel cards (Vulkan) will follow.- **Headless Linux**: `kokon-service --set-password`, then `kokon-service --persistent --remote`.- The MCP server finds the service on Linux too.