Kokon

io.github.GabrieleLozupone由 GitHub 帳號 GabrieleLozupone 發布v0.12.0更新於 Nov 7, 2026

Generate and edit images offline with Qwen-Image 2.1 on your GPU. Needs the Kokon desktop app.

已驗證STDIO僅桌面媒體與設計AI 與機器學習

概覽

AI 產生的概覽

Kokon 讓助理透過 Kokon 桌面應用程式,在使用者自己的 GPU 上離線以 Qwen-Image 2.1 生成與編輯圖片。

可以做什麼
  • 依文字提示生成圖片,可搭配最多 10 張參考圖
  • 依指令編輯單張圖片,或以最多 9 張其他圖片輔助編輯第 1 張圖
  • 對遮罩區域進行局部重繪,並向畫面外延伸
  • 放大圖片(預設 2 倍,最高 8192 像素)
  • 讀取圖片尺寸、類型與 Kokon 生成中繼資料,並查看引擎狀態、GPU、VRAM 與工作佇列
適用情境
適合希望助理在本機生成或修圖、不依賴雲端 API 的情境,例如為 README 製作主視覺、清除背景雜物、合成產品或人物畫面、放大既有圖片。
執行需求
以 npx 啟動的本機 stdio 程序,需要 Node.js 22 或更新版本(也可使用應用程式內附的獨立執行檔)。需要 Kokon 桌面應用程式,首次開啟並完成設定以下載模型:Windows 需 12 GB 以上 VRAM 的 GPU,或 Apple Silicon Mac 需 16 GB 以上(測試版)。不需 API 金鑰,引擎在 127.0.0.1 上隨需啟動。選用環境變數 QLS_MCP_ALLOWED_DIRS 可列出額外可讀寫的資料夾。
安裝前請注意
檔案讀寫僅限專案資料夾、Kokon 輸出資料夾以及 QLS_MCP_ALLOWED_DIRS 列出的資料夾,擴大該變數會讓助理存取更多磁碟內容。工具會寫入新的圖片檔案,但不會覆寫既有檔案。首次呼叫約需一分鐘載入模型;預設不會把圖片回傳給模型,除非設定 include_preview。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Kokon,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

kokon-mcp

MCP server for Kokon. It lets Claude Code, Cursor, Claude Desktop and other MCP clients generate and edit images with Qwen-Image 2.1, running offline on your own GPU. No API key, no cloud. Everything stays on 127.0.0.1.

Requires the Kokon desktop app (Windows with a 12 GB+ GPU: NVIDIA, or AMD/Intel in beta; or an Apple Silicon Mac, beta, 16 GB+). Download it from kokon.app, open it once and finish the setup so the model is downloaded. This package is only the bridge between your AI agent and the app. The app doesn't need to be open: the server starts the engine on demand.

Setup

Claude Code:

bash
claude mcp add --scope user kokon -- npx -y kokon-mcp

Any client that takes the standard JSON config (.mcp.json, Claude Desktop, Cursor...):

json
{  "mcpServers": {    "kokon": {      "type": "stdio",      "command": "npx",      "args": ["-y", "kokon-mcp"]    }  }}

Needs Node.js 22 or newer. The Kokon installer also ships the same server as a standalone executable (kokon-mcp.exe / kokon-mcp inside the app), if you prefer not to use Node. See the main README.

Then ask: "Generate a hero image for this README and save it in docs/" or "Remove the background clutter from screenshot.png". The first call takes about a minute while the model loads.

Tools

Prompts are used exactly as your assistant writes them: Kokon's own prompt writer (Prompt+) does not run for MCP, so the assistant writes the full description. The tool descriptions tell it how.

ToolWhat it does
generate_imageText to image, optionally with up to 10 reference images (a person, a product, a style) in a new scene. Size chosen automatically, or set width/height or aspect ratio.
edit_imageEdit an image with an instruction. Keeps its size; never overwrites the input.
edit_imagesEdit image 1 with the help of up to 9 more images ("image 1", "image 2"...).
inpaint_imageChange only a masked area: edit, remove, replace or add something.
outpaint_imageExtend an image beyond its borders.
upscale_imageEnlarge an image (default 2x, up to 8192 px).
get_image_infoSize, type and, for Kokon images, the prompt, seed and settings.
get_generator_statusEngine state, GPU, VRAM and job queue.

Behavior and safety

  • Every result returns the absolute path of the saved file, its size, seed and metadata.
  • Reads and writes are limited to the project folder (CLAUDE_PROJECT_DIR or the working directory), Kokon's output folder and folders listed in QLS_MCP_ALLOWED_DIRS (separated by semicolons). Existing files are never overwritten.
  • Images are not sent back to the model by default. Pass include_preview: true for a small JPEG.
  • Progress is reported through MCP progress notifications.

License

AGPL-3.0-only. The Qwen-Image 2.1 model weights the app downloads are under the Qwen Research License (non-commercial). Source: github.com/GabrieleLozupone/kokon.

來源:mcp/README.md,提交 e411d96

工具

8

generate_image

Generate image

Generate an image from a text prompt with the local Qwen-Image 2.1 model, optionally using reference images (a person, a product, a style) in a new scene. Write the full, detailed prompt yourself (see the prompt field): it is used as is. Dimensions are chosen automatically (aspect ratio can be inferred from the prompt, e.g. '16:9 hero image') unless width/height or aspect_ratio are given. Returns the absolute path of the saved PNG. Runs fully offline; typically 45 s–4 min.

輸入參數seedwidthheightprompt必填qualityoutput_pathaspect_ratioinclude_previewreference_images

edit_image

Edit image

Edit an existing image with a natural-language instruction (e.g. 'make the background nighttime, keep the foreground unchanged'). Preserves the input's width, height and aspect ratio by default. The input file is never overwritten.

輸入參數seedprompt必填qualityimage_path必填output_pathinclude_previewpreserve_dimensions

edit_images

Edit with multiple references

Edit image 1 with the help of other images (up to 10 in all) and an instruction, e.g. put the product from image 2 in the hand of the person in image 1. Order matters: refer to them as image 1, image 2, ... in the prompt. The output follows image 1's aspect ratio unless width/height or aspect_ratio are given. For a new scene that only uses the images as references, use generate_image with reference_images.

輸入參數seedwidthheightprompt必填qualityimage_paths必填output_pathaspect_ratioinclude_preview

outpaint_image

Expand image (outpaint)

Extend an image beyond its borders. Give the expansion per side in pixels or percent; the canvas, mask and model-aligned sizes are built automatically and the original pixels are preserved exactly.

輸入參數topleftseedrightunitsbottomprompt必填qualityimage_path必填output_pathinclude_preview

inpaint_image

Inpaint image

Change only the masked area of an image (mask: white = change, black = keep): edit it, remove what is there, replace it, or add something inside it. The model is shown the area marked on a copy of the image; pixels outside the mask are preserved exactly.

輸入參數seedactionpromptqualitymask_path必填image_path必填output_pathinclude_preview

upscale_image

Upscale image

Enlarge an image (default 2x, or to a width/height up to 8192 px). Runs the upscaler model chosen in Kokon (Superscale-SP by default; seconds on a PC GPU, longer on a Mac; adds no new content). Saves a new file; the input is never overwritten.

輸入參數scalewidthheightimage_path必填output_pathinclude_preview

get_image_info

Image info

Width, height, aspect ratio, file type and, for images made by Kokon, the generation metadata (prompt, seed, model, steps...).

輸入參數image_path必填

get_generator_status

Generator status

Whether the local inference server is running and the model loaded, GPU and VRAM, the active job and the queue.

無需輸入參數。

版本歷史

8
  1. v0.12.0最新Nov 5, 2026
  2. v0.11.1Oct 29, 2026
  3. v0.11.0Oct 25, 2026
  4. v0.10.2Oct 23, 2026
  5. v0.10.1Oct 22, 2026
  6. v0.10.0Oct 20, 2026
  7. v0.9.4Oct 16, 2026
  8. v0.9.1Oct 12, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分