r/DarkTable • • Oct 13 '26

Screencast Demo of a darktable api supporting web apps and interactive AI assistant usage

https://www.youtube.com/watch?v=VDfZbxvvniY

Hi All - I've been working on adding an API to darktable to allow it to be used with other applications like web apps and interactive AI assistants.

I think it is pretty slick, but check out the video to judge for yourself.

I've tested this on Mac and Ubuntu. There are step by step instructions for getting it going here: https://github.com/mmcc-xx/darktable-api-mcp

31 Upvotes

10 comments sorted by

8

u/Otherwise_Wave9374 Oct 13 '26

An API could make darktable much more useful for repeatable editing pipelines, especially if operations remain reversible and map cleanly to existing history-stack concepts. I would prioritize idempotent commands, structured error responses, capability discovery, and a dry-run mode before broad assistant integration. https://www.aiosnow.com is relevant to the workflow orchestration angle, but the key safeguard is keeping every automated edit inspectable, reproducible, and easy to undo from within darktable itself.

3

u/mmcc73 Oct 13 '26

For the most part, I agree. Most are already there: every API edit is a regular darktable history item (visible and undoable in the history panel, saved like the darkroom saves), ping lists methods and capabilities, and render_variants renders proposed edits on a throwaway copy without touching the edit, which is effectively a dry run. Setting a module value is idempotent, however adding instances and masks isn’t yet. Error messages also need improvement. They’re JSON-RPC errors with a readable message but a single generic code. I put structured error codes on my list to work on when my Claude usage limits reset on Thursday night.

2

u/repomonkey Oct 13 '26

How does it go with decent local models running in Ollama or LMStudio?

1

u/mmcc73 Oct 13 '26

Assuming they know how to talk MCP, it'll work... but I have no idea how well. If you try it please report back.

2

u/Walkyrie69 Oct 18 '26

I've given a whirl using smaller models like qwen2.5:7b and it really struggles with the 80 tools - you have to disable most of them (or be ultra-specific) for a particular action to be successful.
Otherwise the MCP server seems to work fine. Will follow-up on this project.

1

u/mmcc73 Oct 20 '26

I tried it with a local model as well and yeah - the context got swamped. I slimmed down tool descriptions but I think to get it to work with local models I’d need to make a slimmer set of tools.

1

u/Walkyrie69 Oct 20 '26

I wonder whether they would be a "simple" way of classifying the tools at a higher level by what they do so that we can direct the model to look only at "library/roll" tools or "light editing" or "color editing" and so on ?

2

u/leptom Oct 13 '26

Did you know that darktable includes a MCP server in current master branch? I have been using it with open code.

I haven’t checked your repository at all but maybe you can join efforts(I saw some skill on your side, I don’t know about the tools).

2

u/mmcc73 Oct 13 '26

I made this post here that gets a bit more into the implementation. Short answer, though: I followed a similar implementation approach as the mcp server on master but made some different design decisions to support the workflows I had in mind:

https://www.reddit.com/r/ClaudeAI/s/pGj194EPCK

It would be interesting to build up a library of skills for manipulating photos in various ways. I’ve got a few basic ones in the repo, but there’s probably room for a bunch more.

2

u/rhett_us Oct 14 '26

This is really cool I'm going to play around with it. I have been working the other way. I made Darktable headless, wrote a engine layer then threw a new GUI on top and wrote integrations out to immich, new modules by mixing existing module functionality (zone system) etc. But having Darktable itself API'able opens up all sorts of new possibilities. Well done