Klad 开源绘画应用让编码智能体直接执笔作画

原标题:Show HN: Klad, a paint app your coding agent can drive (source-available)
62AI 研判分

Klad 是一款源码可得的 2D 绘画与动画应用,人类用画笔在编辑器里作画,编码智能体则通过 klad 命令行使用同一套笔刷、同一张画布作画,双方笔触实时可见。它不依赖图像生成模型,每一笔都保留路径、压感、笔刷与颜色等可编辑属性,因此可以精确修改单根线条而非反复重绘碰运气。

报道正文

本文目录3 个章节

klad

The hero of klad.studio: a terminal beside the klad editor. An agent paints a sprout creature stroke by stroke through the klad command line; in the editor its leaves are recoloured, its mouth bent into a smile, a smudge moved and its blush blended; then the agent puts its parts in groups, keys them, and the creature walks while the editor's timeline plays

Give your agent real brushes. klad is a 2D painting and animation app you share with a coding agent. You paint in the editor with a pen. The agent paints through the klad command line, with the same brushes, on the same drawing, and each of you sees the other's strokes instantly.

There is no image model in klad. Your agent (Claude Code, Codex, anything that can run commands) decides what to paint; klad gives it brushes, layers and a timeline. Whatever either of you puts down stays what it was: a stroke with its path, pressure, brush and colour, a shape with its points, a fill with its region. So there's no rerolling and hoping for the best: if one leaf looks off, you fix that leaf.

Asked for "a little sprout creature for my game", the agent paints 4,344 strokes and fills. You change them: recolour the leaves, bend the mouth, move a smudge, blend the blush. Then the agent animates it: the creature's parts go into five groups, 205 keys move them, and no frame is painted again.

|---|---| | A night scene: a hooded traveller holds a lantern on a pole out to a ruined stone arch, a small sprout creature following | Twelve game props: a chest, a crate, a barrel, a torch, a potion, a key, a shield, a signpost, rope, a bedroll, mushrooms and a waystone |

Drawings made with Claude Fable 5.2: the creature, the scene and the prop kit were painted stroke by stroke through the klad command line.

  • Site and guides: klad.studio, with these drawings replayed stroke by stroke.
  • Licence: source-available, not open source. Free to build and use for yourself, and inside a company with less than 500,000 euros a year in revenue. See Licence.
  • Runs on: macOS (pen pressure and tilt). It also builds and passes its tests on Linux and Windows, checked on every change; the editor starts on Linux with the mouse for now, and nobody has drawn with it on Windows yet.
  • Status: early. This is the first public version, and you build it yourself: see From source.

Why not just generate the picture?

An image generator hands you pixels, and the only edit left is another roll of the dice. klad keeps every stroke and every fill as data: where it went, how hard it was pressed, its brush and its colour. Pick any of them hours later, yours or the agent's, and recolour it, bend it, move it or delete it.

  • It's paint, not just vectors. A stroke keeps its path and pressure like a vector does, and still lands as paint. Loaded oil leaves ridges that catch the light, and smudge drags the paint already on the layer. The smudge stays a stroke too: move it later and klad blends it again where it lands.
  • It can also do just vectors. Shapes with editable points, gradients, glows and real text in about fifty open fonts that come with it, for posters, covers and cards.
  • It's a full painting and animation app. Two dozen brushes and a brush editor, layers, masks, clipping, effects, a timeline with onion skins and clips, in-betweens made from your key drawings, bones with IK, and exports as PNGs, sprite sheets or straight into Godot.
  • Your drawings stay yours. A drawing is a folder of plain files on your computer, and klad needs no account. It only looks for a new version once a day, and you can turn that off. An edit changes only the files of what it edits, so drawings live well in git.

Working with your agent

  1. Ask. Tell your agent what the drawing needs, in plain words: a lantern for the inn, lit from the left, on its own layer.
  2. Watch. It paints through the klad command line, and its strokes show up in your editor about a second later.
  3. Point. Pin a note on the canvas or select the part you mean ("more moss on this side"). The agent reads both.
  4. Take over. Repaint whatever you like by hand, the agent's strokes as much as your own. Its strokes are marked as its own and every change is one step in a shared history, so you can undo any of it.

The prompt to start with is under Try it. klad skill prints the agent skill in docs/skill/SKILL.md: how to look at a drawing, change it and check the result. A second one, klad skill drawing (docs/skill/drawing/SKILL.md), teaches the craft: planning a picture, light on form, values, edges, colour, materials and how to judge the result. Both are MIT, so use them with any agent and any tool. Open the drawing to watch and draw along:

What an agent paints depends on the agent and on how much you steer it. The skills teach it the tool and some craft; the pen in your hand does the rest.

For developers: the drawing is data

Everything you can do in the editor has a klad command too, so a script or an agent works on the same drawing you have open. It reads strokes as JSON, changes any of them by its address and applies batches of edits as JSON ops.

ToIn the editorFrom a script or an agent
PaintB and a pen with pressureklad stroke art.klad l4 --brush oil --path 'M100 400 C 300 200 500 600 700 400'
Change a stroke laterS to pick it, then recolour, resize or move; A bends its pathklad set art.klad c4:s12 size=3.5 color=#3355aa
Read what is therePoint at it with Sklad strokes art.klad l4 --json
Flat colourG, filling against the lines layerklad fill art.klad l2 --at 820,640 --ref lines --gap 4 --color skin
Point at somethingN pins a note, S selectsklad notes art.klad, klad selection art.klad
In-betweensThe in-between windowklad inbetween art.klad --layers lines,colour --from 0 --to 6
Exportcmd E, or export to Godot from a clipklad export art.klad --godot ../game/art
Undocmd Z, or the History paneklad undo art.klad

The file format is documented down to the byte under the MIT licence (docs/format.md), so other apps and engines can read and write klad drawings with or without klad.

(注:更多技术实现细节与完整 API 文档请查阅原项目 README)


作者发帖说明(HN):

I've been developing applications for a long time and have turned to game development as well lately. One of the things that frustrated me the most was that using AI agents for game development is very annoying in the art department. Your only options right now are to either use an image genAI model and roll the dice every time you want to make an edit, or have your agent draw with something like vectors.

I was looking for an application that would allow me to ask an agent to make a first draft of whatever art I needed with actual brushes, and then be able to go in myself and edit every last stroke or layer that it created.

Klad is that application. Written in Rust, it can be fully controlled by an agent through the CLI, and every function is available in a nice UI as well: a brush engine, frame-by-frame animation (and bones/IK), vectors, text layers, colours, layer effects, infinite undo (even after re-opening the file!),…

Why I think it's useful for a wider audience: Adobe showed agents editing Photoshop files at MAX this week, with a private beta planned for early 2027.

Klad is built on the same core idea, with editable paint strokes as core architecture, and it works today.

Clone the repo to try it out: https://github.com/klad-app/klad

You can basically point Claude to the repo, ask it to build it, and pick up the drawing skills. Then ask it to make any drawing you want! (After that, you or the agent can change absolutely every br...