Skip to content

armgit / kokon

Public Imported from GitHub
0

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.

Issue forms, contributing guide, security policy, complete NOTICE

Gabriele Lozupone6dddf8f4d162
diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml
new file mode 100644
index 0000000..0cf2598
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug_report.yml
@@ -0,0 +1,90 @@
+name: Bug report
+description: Something in Kokon doesn't work as it should.
+labels: ["bug"]
+body:
+ - type: markdown
+ attributes:
+ value: |
+ Thanks for taking the time to report this. If the problem is with installing, the setup
+ screen or the model downloads, please use **Install or setup problem** instead.
+
+ - type: input
+ id: version
+ attributes:
+ label: Kokon version
+ description: Settings → General shows it.
+ placeholder: "0.9.0"
+ validations:
+ required: true
+
+ - type: dropdown
+ id: os
+ attributes:
+ label: Operating system
+ options:
+ - Windows 11
+ - Windows 10
+ - macOS 26 (Apple Silicon)
+ - Other
+ validations:
+ required: true
+
+ - type: dropdown
+ id: engine
+ attributes:
+ label: Engine
+ options:
+ - CUDA (NVIDIA)
+ - Vulkan (AMD, Intel or NVIDIA)
+ - Metal (Mac)
+ - Not sure
+ validations:
+ required: true
+
+ - type: input
+ id: gpu
+ attributes:
+ label: GPU and memory
+ description: Graphics card and VRAM, or Mac chip and unified memory. Add the driver version if you know it.
+ placeholder: "RTX 4070 12 GB, driver 581.xx / M2 Pro, 16 GB"
+ validations:
+ required: true
+
+ - type: textarea
+ id: steps
+ attributes:
+ label: Steps to reproduce
+ description: What did you do? Include the mode (create, edit, brush edit, expand, upscale) and the quality preset. You don't have to share your prompt or photo.
+ placeholder: |
+ 1. Open a photo
+ 2. Type "..." and press Enter
+ 3. ...
+ validations:
+ required: true
+
+ - type: textarea
+ id: expected
+ attributes:
+ label: What you expected
+ validations:
+ required: true
+
+ - type: textarea
+ id: actual
+ attributes:
+ label: What happened instead
+ description: Error messages, screenshots, or how the result looked wrong.
+ validations:
+ required: true
+
+ - type: textarea
+ id: diagnostics
+ attributes:
+ label: Diagnostics
+ description: |
+ Open **Settings → Diagnostics**, click **Copy** and paste it here. If the app won't open,
+ attach the latest log from `%LOCALAPPDATA%\KokonData\logs` (Mac:
+ `~/Library/Application Support/KokonData/logs`). Logs never contain your prompts.
+ render: text
+ validations:
+ required: true
diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml
new file mode 100644
index 0000000..6229baf
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/config.yml
@@ -0,0 +1,8 @@
+blank_issues_enabled: false
+contact_links:
+ - name: Questions and ideas
+ url: https://github.com/GabrieleLozupone/kokon/discussions
+ about: Ask how to do something, share results, or talk about an idea.
+ - name: Security issue
+ url: https://github.com/GabrieleLozupone/kokon/security/advisories/new
+ about: Please report vulnerabilities privately, not in a public issue.
diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml
new file mode 100644
index 0000000..2bdca19
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/feature_request.yml
@@ -0,0 +1,31 @@
+name: Feature request
+description: Suggest something Kokon should do.
+labels: ["enhancement"]
+body:
+ - type: markdown
+ attributes:
+ value: |
+ Kokon tries to stay simple: describe a change, get a good result. Ideas that fit that are
+ the most likely to land. For open-ended ideas, a
+ [discussion](https://github.com/GabrieleLozupone/kokon/discussions) may be a better start.
+
+ - type: textarea
+ id: problem
+ attributes:
+ label: What are you trying to do?
+ description: The task or the problem, not the solution yet.
+ validations:
+ required: true
+
+ - type: textarea
+ id: idea
+ attributes:
+ label: What would help
+ description: How you imagine it working in the app, the MCP server or the API.
+ validations:
+ required: true
+
+ - type: textarea
+ id: alternatives
+ attributes:
+ label: Anything you tried instead
diff --git a/.github/ISSUE_TEMPLATE/install_problem.yml b/.github/ISSUE_TEMPLATE/install_problem.yml
new file mode 100644
index 0000000..b2b562d
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/install_problem.yml
@@ -0,0 +1,62 @@
+name: Install or setup problem
+description: The installer, the setup screen, a model download, SmartScreen or Gatekeeper got in the way.
+labels: ["install"]
+body:
+ - type: markdown
+ attributes:
+ value: |
+ Before you open an issue, two common cases:
+
+ - **Windows: "Windows protected your PC".** Click **More info → Run anyway**. Kokon is new,
+ so SmartScreen has no download history for it yet.
+ - **macOS: "Kokon cannot be opened".** Try to open it once, then go to **System Settings →
+ Privacy & Security** and click **Open Anyway**. Kokon is not notarized by Apple.
+
+ - type: dropdown
+ id: stage
+ attributes:
+ label: Where did it go wrong?
+ options:
+ - Running the installer / opening the app the first time
+ - SmartScreen or Gatekeeper won't let it run
+ - Setup screen (GPU detection, preset choice)
+ - Model or engine download (failed, stuck, checksum error)
+ - First image after setup
+ - Update to a new version
+ - Something else
+ validations:
+ required: true
+
+ - type: input
+ id: version
+ attributes:
+ label: Kokon version
+ placeholder: "0.9.0"
+ validations:
+ required: true
+
+ - type: input
+ id: system
+ attributes:
+ label: OS and hardware
+ description: Windows or macOS version, GPU and VRAM (or Mac chip and memory), engine if you know it (CUDA, Vulkan, Metal).
+ placeholder: "Windows 11, RX 7800 XT 16 GB, Vulkan"
+ validations:
+ required: true
+
+ - type: textarea
+ id: what
+ attributes:
+ label: What happened
+ description: The exact message, which file failed (the setup screen names it), and a screenshot if you can.
+ validations:
+ required: true
+
+ - type: textarea
+ id: diagnostics
+ attributes:
+ label: Diagnostics or log (if the app opens)
+ description: |
+ **Settings → Diagnostics → Copy**, or the latest log from `%LOCALAPPDATA%\KokonData\logs`
+ (Mac: `~/Library/Application Support/KokonData/logs`).
+ render: text
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
new file mode 100644
index 0000000..2bfb300
--- /dev/null
+++ b/.github/pull_request_template.md
@@ -0,0 +1,16 @@
+## What and why
+
+<!-- What does this change, and what problem does it solve? Link the issue: "Fixes #123". -->
+
+## How I tested it
+
+<!-- Commands you ran, and the platform/GPU if you tried it in the app. -->
+
+- [ ] `cargo test -p qls-core`
+- [ ] `npm test` (UI logic)
+- [ ] `cd mcp && npm test` (only if `mcp/` changed)
+- [ ] Tried it in the app (`npx tauri dev`), if it changes behavior or the UI
+
+## Notes
+
+<!-- Screenshots for UI changes, anything reviewers should look at closely, follow-ups. -->
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 0000000..c3d757d
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,99 @@
+# Contributing to Kokon
+
+Thanks for helping. Bug reports, docs fixes, example prompts and pull requests are all welcome.
+Kokon is a small project maintained by one person, so short, focused changes are the easiest to
+review.
+
+## Before you start
+
+- **Bugs and install problems:** open an issue with the template. The **Settings → Diagnostics →
+ Copy** output saves a lot of back-and-forth.
+- **New features or larger changes:** open an issue or a
+ [discussion](https://github.com/GabrieleLozupone/kokon/discussions) first, so we can agree on
+ the approach before you write the code.
+- **Security issues:** don't open a public issue; see [SECURITY.md](SECURITY.md).
+
+## Build from source
+
+**Windows:** Rust (stable, MSVC), Node 22+, Visual Studio Build Tools and WebView2.
+
+```powershell
+npm install
+npx tauri dev # run the desktop app in development
+powershell -ExecutionPolicy Bypass -File scripts\build-release.ps1 # installer
+```
+
+**Mac (Apple Silicon, macOS 26+):** Xcode Command Line Tools, Rust and Node 22+.
+
+```bash
+bash scripts/dev/mac-dev.sh --check # check the prerequisites
+bash scripts/dev/mac-dev.sh # build and run the app in development
+bash scripts/build-release-mac.sh # Kokon.app + .dmg in dist-release/
+```
+
+To generate images you need the models. The app's first-run setup screen downloads them, or you
+can point it at an existing stable-diffusion.cpp folder. Most code changes (planner, geometry,
+UI logic, MCP) can be tested without a GPU through the unit tests.
+
+Publishing a release is described in [docs/releasing.md](docs/releasing.md) and is done by the
+maintainer.
+
+## Tests
+
+Run these before opening a pull request:
+
+```bash
+cargo test -p qls-core # Rust core: geometry, planner, imaging, catalog, store
+npm test # UI logic (vitest)
+cd mcp && npm test # MCP server, including a stdio protocol test
+```
+
+The MCP server has its own `package.json`: run `npm install` in `mcp/` once before its tests.
+
+## Where things live
+
+- `crates/qls-core`: all the logic (geometry, imaging, planner, inference adapter, job queue,
+ gallery, pinned downloads in `catalog.rs`).
+- `crates/qls-service`: the local HTTP service on `127.0.0.1`.
+- `src-tauri/` and `src/`: the desktop shell (Rust) and the UI (React + TypeScript).
+- `mcp/`: the MCP server (TypeScript, official SDK).
+
+[docs/engineering-notes.md](docs/engineering-notes.md) has a module map and the measured backend
+facts behind each default. Internal names such as `qls-core` and `QLS_*` come from the project's
+working title and are kept on purpose.
+
+## Code style
+
+- Follow the style of the file you are editing. Rust: `cargo fmt` defaults. TypeScript: strict
+ mode, function components and hooks.
+- Keep logic in `qls-core` (or `src/lib/logic.ts` for the UI) where it can be unit-tested, and
+ keep the service, the app shell and the MCP server thin.
+- Only `sdcpp.rs` should know sd-server's request format.
+- Add or update a test for behavior you change.
+- Comments explain *why*, especially for defaults that come from measurements. If you change a
+ measured default (sizes, memory budget, backend flags), say what you measured it on.
+- UI text and docs: plain, short English.
+
+## Good places to start
+
+Issues labeled
+[good first issue](https://github.com/GabrieleLozupone/kokon/labels/good%20first%20issue) are
+picked to be approachable. Also welcome:
+
+- **Docs:** clearer install steps, FAQ entries, fixes to anything that is wrong or out of date.
+- **Example prompts:** prompts that work well, with before/after results
+ ([docs/showcase-prompts.md](docs/showcase-prompts.md)).
+- **Hardware reports:** how Kokon runs on AMD and Intel cards (Vulkan) or on Macs other than
+ an M2 Pro. These are still unverified.
+- **Small UI fixes:** layout glitches, keyboard shortcuts, accessibility labels.
+- **Translations:** the UI is English only today. Please open an issue before starting, since
+ there is no translation system yet.
+
+## Licenses
+
+By contributing, you agree that your contribution is licensed under the
+[GNU Affero General Public License v3.0](LICENSE) (AGPL-3.0-only), like the rest of Kokon's code.
+
+Model weights are not part of this repository. Kokon downloads them from their authors, and
+they keep their own licenses (see [NOTICE](NOTICE)). Please don't commit model files or other
+large binaries.
diff --git a/NOTICE b/NOTICE
index 3cb9c7c..b56f2f3 100644
--- a/NOTICE
+++ b/NOTICE
@@ -5,3 +5,46 @@ This product is licensed under the GNU Affero General Public License, version 3
Model weights and the upscaler that Kokon downloads at setup are not part of this product;
they come from their authors under their own licenses (see the README).
+
+
+Third-party software included in the Kokon installer
+----------------------------------------------------
+
+- Tauri and its plugins (https://tauri.app), Apache-2.0 OR MIT.
+- React and React DOM (https://react.dev), MIT.
+- Lucide icons, lucide-react (https://lucide.dev), ISC.
+- Inter typeface by The Inter Project Authors (https://github.com/rsms/inter),
+ SIL Open Font License 1.1, through @fontsource-variable/inter.
+- SQLite (https://sqlite.org), public domain, built into the gallery through rusqlite.
+- Node.js runtime (https://nodejs.org), embedded in kokon-mcp as a single executable
+ application; see https://github.com/nodejs/node/blob/main/LICENSE.
+- Model Context Protocol TypeScript SDK (https://github.com/modelcontextprotocol/typescript-sdk)
+ and Zod (https://zod.dev), MIT, bundled in kokon-mcp.
+- Other Rust crates and npm packages, each under its own license as listed in Cargo.lock,
+ package-lock.json and mcp/package-lock.json.
+
+
+Downloaded by the setup screen (not part of this product)
+---------------------------------------------------------
+
+Every file is pinned by URL, size and SHA-256 in crates/qls-core/src/catalog.rs.
+
+- stable-diffusion.cpp by leejet (https://github.com/leejet/stable-diffusion.cpp), MIT,
+ release master-929-3f8527a: CUDA 12, Vulkan or Metal build.
+- ggml by the ggml authors (https://github.com/ggml-org/ggml), MIT, included in the
+ stable-diffusion.cpp builds.
+- NVIDIA CUDA 12 runtime and cuBLAS DLLs (NVIDIA cards only), redistributed in the
+ stable-diffusion.cpp release; see https://docs.nvidia.com/cuda/eula/.
+- Qwen-Image 2.1 Turbo by the Qwen team (https://huggingface.co/Qwen/Qwen-Image-2.1-Turbo),
+ same license as Qwen-Image 2.1 (https://huggingface.co/Qwen/Qwen-Image-2.1); see those
+ model pages for the terms. Downloaded as the GGUF conversion by DogukanUrker
+ (https://huggingface.co/DogukanUrker/Qwen-Image-2.1-Turbo-GGUF).
+- Qwen-Image 2.1 VAE, from https://huggingface.co/Comfy-Org/Qwen-Image-2.1; see
+ https://huggingface.co/Qwen/Qwen-Image-2.1 for the terms.
+- Qwen3-VL 8B Instruct text encoder and vision projector by the Qwen team, from
+ https://huggingface.co/Qwen/Qwen3-VL-8B-Instruct-GGUF; see that page for the terms.
+- 4x-UltraSharp upscaler by Kim2091 (optional), CC BY-NC-SA 4.0 (non-commercial), from
+ https://huggingface.co/uwg/upscaler.
+
+Selectable in Settings but not downloaded by Kokon: 4x_NMKD-Superscale-SP_178000_G by NMKD,
+placed by hand from https://huggingface.co/uwg/upscaler; see that page for the terms.
diff --git a/SECURITY.md b/SECURITY.md
new file mode 100644
index 0000000..c9cd583
--- /dev/null
+++ b/SECURITY.md
@@ -0,0 +1,41 @@
+# Security policy
+
+## Reporting a vulnerability
+
+Please report security problems privately through GitHub's private vulnerability reporting:
+open the repository's **Security** tab and click **Report a vulnerability**
+(https://github.com/GabrieleLozupone/kokon/security/advisories/new). Don't open a public
+issue for them.
+
+Include what you found, how to reproduce it, and the Kokon version and OS. Kokon is maintained
+by one person: expect a first reply within about a week. Fixes ship through the in-app updater,
+and you'll be credited in the advisory unless you prefer not to be.
+
+## Supported versions
+
+Only the latest release gets security fixes.
+
+## What Kokon exposes
+
+Useful context for reports:
+
+- **Network.** Kokon makes two kinds of outgoing request: during setup, downloads from
+ `github.com` (the stable-diffusion.cpp release) and `huggingface.co` (the models); and, at
+ most once a day unless turned off, a fetch of `latest.json` from this repository's latest
+ GitHub release to check for a new version. Update installers are downloaded only when the user
+ clicks **Update**, and installed only if their signature matches the public key built into the
+ app. Every model and engine download is checked against a pinned SHA-256
+ (`crates/qls-core/src/catalog.rs`). Nothing about the user or their images is sent.
+- **Local API.** `kokon-service` listens on `127.0.0.1` only (port 39151 by default) and needs
+ a bearer token from `KokonData/service.json` for every call except `/ping`. Requests that carry a browser `Origin`
+ header are refused. `sd-server` listens on `127.0.0.1:39150`.
+- **MCP server.** `kokon-mcp` runs over stdio. Reads and writes are limited to the project
+ folder, Kokon's output folder and folders in `QLS_MCP_ALLOWED_DIRS`, and existing files are
+ never overwritten.
+
+Examples of things worth reporting: a way to reach the API from a web page or another user
+account, a path that escapes the allowed folders, an update or download that is accepted
+without a valid signature or checksum, or data leaving the machine that the README says doesn't.
+
+Problems in stable-diffusion.cpp, Tauri or the model weights themselves are best reported to
+those projects; if they affect Kokon, a heads-up here is still welcome.
diff --git a/marketing/release-notes-0.9.0.md b/marketing/release-notes-0.9.0.md
new file mode 100644
index 0000000..d476fc7
--- /dev/null
+++ b/marketing/release-notes-0.9.0.md
@@ -0,0 +1,58 @@
+First public beta of Kokon: edit and create photos by describing the change, on your own GPU, with Qwen-Image 2.1 Turbo. One installer, no Python, no cloud.
+
+Kokon is a native desktop app built on [stable-diffusion.cpp](https://github.com/leejet/stable-diffusion.cpp). It picks the mode, the working size and the memory settings for you, and includes an MCP server and a local HTTP API so AI agents can create and edit images on your machine.
+
+## Download
+
+| | File |
+| --- | --- |
+| **Windows 10/11** | `Kokon_0.9.0_x64-setup.exe` (installs for your user only, no admin rights) |
+| **Mac (Apple Silicon, beta)** | coming to this release shortly |
+
+On first launch Kokon detects your graphics card (or your Mac's chip and memory), recommends a model preset and downloads about 12 GB of models once. Downloads resume if interrupted and every file is checked against its SHA-256. After that Kokon works offline.
+
+## Highlights
+
+- **Create, edit, combine:** a sentence makes a new image; a photo plus a sentence edits it, keeping its size and aspect ratio; several photos can be combined ("image 1", "image 2").
+- **Brush edits:** paint an area and choose Change, Remove, Replace or Add. Kokon marks the area on a second reference image so the model knows exactly where to work.
+- **Expand** (outpainting) by dragging the edges, and **upscale** to 2×, 4K or a custom width with an ESRGAN upscaler.
+- **Qwen's official 8-step Qwen-Image 2.1 Turbo** model for every preset, with three quality presets: Fast (~1 MP, default), Balanced (~1.5K) and Quality (native 2K).
+- **Before/after** compare (Slider, Flicker, Changes), undo/redo between versions, and a gallery that keeps every image's full recipe (also embedded in the PNG).
+- **iPhone photos:** HEIC opens directly; HDR gain-map photos can be saved as Ultra HDR JPEG.
+- **Private by design:** no account, no uploads, no telemetry. Private mode keeps nothing.
+- **Time estimates** that learn your machine's speed after the first image.
+- **MCP server** (`kokon-mcp`) for Claude Code, Cursor and other MCP hosts, plus a token-protected HTTP API on `127.0.0.1`. Tools: `generate_image`, `edit_image`, `edit_images`, `inpaint_image`, `outpaint_image`, `upscale_image`, `get_image_info`, `get_generator_status`.
+- **One-click updates:** Kokon checks once a day for a new version (you can turn this off) and installs it, after verifying its signature, when you click **Update**.
+
+## Requirements
+
+- **Windows + NVIDIA:** 12 GB VRAM or more (RTX 3060 12 GB, 4070 and up; 16 GB+ recommended), CUDA engine. 16 GB RAM, 15 GB free disk.
+- **Windows + AMD or Intel:** 12 GB VRAM or more, Vulkan engine (beta). Integrated graphics are not supported.
+- **Mac:** Apple Silicon (M1 or newer), macOS 26, 16 GB unified memory minimum, 32 GB or more recommended (beta).
+
+## Known limitations
+
+- **AMD and Intel are unverified.** The Vulkan engine works on NVIDIA cards, but nobody has tried it on a real AMD or Intel card yet. It is slower than CUDA, and its first image takes longer. Please report how it goes.
+- **Macs are slow.** On a 16 GB M2 Pro a 1-megapixel image takes about 4 minutes, in the lightest mode. Chips with more GPU cores and 32 GB or more should be faster, and get native 2K. So far the Mac build has been tested only on a 16 GB M2 Pro.
+- **8 GB cards** are not supported: 12 GB is the smallest size Kokon is designed for.
+- **No Linux build** yet.
+
+## Model licenses
+
+Kokon's code is Apache 2.0. The models are downloaded from their authors and keep their own licenses: Qwen-Image 2.1 Turbo has the same license as [Qwen-Image 2.1](https://huggingface.co/Qwen/Qwen-Image-2.1) (see the [Turbo model page](https://huggingface.co/Qwen/Qwen-Image-2.1-Turbo)), the Qwen3-VL text encoder is from [Qwen/Qwen3-VL-8B-Instruct-GGUF](https://huggingface.co/Qwen/Qwen3-VL-8B-Instruct-GGUF), and the optional 4x-UltraSharp upscaler is CC BY-NC-SA 4.0 (non-commercial only). Check them before commercial use. Details in [NOTICE](https://github.com/GabrieleLozupone/kokon/blob/master/NOTICE).
+
+## First launch
+
+- **Windows:** SmartScreen may say "Windows protected your PC" because the app is new and has no download history yet. Click **More info → Run anyway**. You can check the installer against the SHA-256 below.
+- **Mac:** Kokon is not notarized by Apple, so macOS blocks it the first time. Try to open it once, then go to **System Settings → Privacy & Security** and click **Open Anyway**. In-app updates don't trigger this again.
+
+## Checksum
+
+```
+SHA-256 Kokon_0.9.0_x64-setup.exe
+e27b4a8b779644232443e6b3bedfe4b009c30d511b682822cea51aeccd42a608
+```
+
+## Feedback
+
+This is a beta, built by one person with the help of AI. Please report problems, and how Kokon runs on your GPU or Mac, in [Issues](https://github.com/GabrieleLozupone/kokon/issues). For questions and ideas, use [Discussions](https://github.com/GabrieleLozupone/kokon/discussions).