今日已更新 287 条资讯 | 累计 22923 条内容
关于我们

Teaching Kiro to Paint: A Stateful Image-Editing Skill Built on Gemini's Interactions API and MCP

xbill 2026年07月23日 08:31 0 次阅读 来源:Dev.to

TL;DR: nb2lite-skill-kiro wraps Google's gemini-3.1-flash-lite-image model (NB2Lite) in a tiny FastMCP server and packages it as a Kiro skill. You type "generate an image of a cyberpunk kitchen" into Kiro, and it just... does it. Then you say "add a neon RAMEN sign" and it edits the same image without re-prompting the whole scene. Oh, and the cover image of this article? Generated by the thing the article is about — dogfooding all the way down. More on that at the end. Background: why another image tool? Most image-generation workflows are stateless . You send a prompt, you get pixels back, and the model immediately forgets everything. Want to tweak the result? You re-describe the entire scene and pray the character, lighting, and composition survive the round trip. (Narrator: they don't.) Google's NB2Lite — the friendly nickname for gemini-3.1-flash-lite-image — takes a different approach. It's a high-efficiency image model with sub-2-second generations, solid text rendering in 25+ languages, and — the headline feature — support for the stateful Interactions API , which lets you iterate on an image across multiple turns while the model keeps the visual context server-side. This repo glues that capability into Kiro , so your coding agent can generate and iteratively refine images as a natural part of a session. It ships as two things in one repo: A Model Context Protocol (MCP) server ( nb2lite-agent , a single-file FastMCP app in server.py ) exposing exactly four tools. A Kiro skill ( nb2lite-image ) that teaches Kiro when and how to use those tools well. The Interactions API: images with a memory The Interactions API is Gemini's stateful endpoint. The core loop looks like this: You call client.interactions.create(...) with a prompt and store=True . The response includes an interaction_id — a handle to the turn's visual context, persisted on Google's servers. On the next call, you pass previous_interaction_id , and the model edits the existing canvas — preserving ch

本文内容来源于互联网,版权归原作者所有
查看原文