flux-kontext
Edit images with Flux 1 Kontext Pro (Black Forest Labs' precise local image-edit model) on RunComfy — bundled with the model's documented prompting patterns so the skill gets sharper output than naive prompting against the same model. Documents Flux Kontext's strengths (single-reference precise local edits, strong prompt control, consistent high-fidelity outputs), the schema (single image + prompt), and when to route to Nano Banana Edit / GPT Image 2 edit / Flux 2 Klein instead. Calls `runcomfy run blackforestlabs/flux-1-kontext/pro/edit` through the local RunComfy CLI. Triggers on "flux kontext", "flux-kontext", "flux 1 kontext", "kontext", "BFL kontext", or any explicit ask to edit with this model.
1How It Works & Mechanism
Implemented via a "zero-code + external CLI delegation" pattern: the flux-kontext/ directory contains only a single SKILL.md without any scripts; the sole action is directing the host agent to execute `runcomfy run blackforestlabs/flux-1-kontext/pro/edit` via Bash, packing the prompt and source image into JSON and passing it to the external CLI via `--input`. The incremental value of this skill lies not in code, but in solidifying the model schema, prompting methodologies, and routing boundaries into documentation that agents can directly follow.
The skill invokes `runcomfy run blackforestlabs/flux-1-kontext/pro/edit` with a JSON body matching the schema.
Capabilities are entirely delivered by the remote model: the CLI POSTs JSON to the RunComfy Model API, polls request status, and downloads artifacts from whitelisted `.runcomfy.net` / `.runcomfy.com` URLs into `--output-dir`; `Ctrl-C` cancels remote requests before exit.
The CLI POSTs to `https://model-api.runcomfy.net/v1/models/blackforestlabs/flux-1-kontext/pro/edit`, polls the request, fetches the result, and downloads any `.runcomfy.net`/`.runcomfy.com` URL into `--output-dir`. `Ctrl-C` cancels the remote request before exit.
The input schema is intentionally minimal: containing only four fields—prompt (required), image (required, single publicly fetchable HTTPS URL), aspect_ratio, and seed—directly encoding the model's positioning for "single-reference local editing" into the input shape, while explicitly excluding multi-image/multi-reference needs.
| `image` | string | yes | — | Single source image URL (publicly fetchable HTTPS). |
The core of the documentation focuses on prompting strategies rather than API parameters: requiring preservation-first (first state what remains unchanged, then specify modifications), single imperative instructions, and decomposing compound edits into successive multi-pass workflows.
**Preservation first.** Lead with `"Keep [identity / pose / framing / brand] unchanged."` Then the change. Models honor what's stated up front.
The routing table encodes "when not to use it" directly into the skill: multi-image batching → Nano Banana Edit, in-image multilingual/embedded text → GPT Image 2 edit, text-to-image from scratch without a source image → Flux 2 Klein; it also dictates unconditional routing to this skill if the user explicitly names it.
| Batch edits across 1–20 images | Nano Banana Edit |
Failure surfaces are defined using a sysexits-style exit code table, delegating retry decisions to the agent: 75 = retriable (timeout/429), 77 = unauthenticated or token rejected, 65 = input JSON/schema mismatch.
| 75 | retryable: timeout / 429 | | 77 | not signed in or token rejected |
Self-declared limitations: single source image ceiling, public documentation schema may be incomplete, compound prompts cause drift, multilingual embedded text should use an alternative model.
- **Single source image only.** For multi-image flows, use Nano Banana Edit (1–20).
2Core Capabilities
3External Dependencies
| Kind | Dependency / Endpoint |
|---|---|
| cli | runcomfy(RunComfy 官方 CLI) |
| package | @runcomfy/cli(npm 全局包) |
| package | npx skills(skills.sh 安装器) |
| api | RunComfy Model API(Flux 1 Kontext Pro /edit) |
| network | RunComfy 产物下载白名单 |
| network | 用户传入的源图 URL(由 RunComfy 服务器抓取,非本机) |
| network | RunComfy 站点/文档(文档引用,非运行时调用) |
| network | GitHub(技能源码链接) |
4Recommended Governance & Evidence
- scripts/: Execute local scripts or commands: (Skill itself contains no scripts) Host agent executes out-of-repo CLI via Bash: `runcomfy run <vendor>/<model>/<endp
- 网络端点: Declare external network access: POST https://model-api.runcomfy.net/v1/models/blackforestlabs/flux-1-kontex
- 本地工作目录: File I/O and artifact generation: Generated artifacts are downloaded by the external CLI and written to `--output-dir` (documentation states aborts when single file > 2 GiB to prevent disk saturation)
5Second-Pass Verification
- [ok] skill 目录内容 = 仅 SKILL.md(无脚本/引用/模板) — git ls-tree HEAD 与 ls -a 双向核实:flux-kontext/ 下仅 SKILL.md;仓库根为 LICENSE + README.md + 31 个技能目录,无 plugins/、.claude/、scripts/。
- [ok] 外部依赖条目逐个回查调用点 — runcomfy CLI 调用点 2 处(How to invoke 两个示例)、npm 安装 1 处(Prerequisites)、npx skills 1 处(安装行)、model-api 端点 1 处(How it works)、白名单与第三方 URL 抓取各 1 处(Security & Privacy)、文档/模型页/GitHub/skills.sh 链接多处——均实读命中。
- [unlocatable] Security & Privacy 的技术断言可在本仓证实 — token.json 权限 0600、2 GiB 下载上限、CLI 不做 shell 展开、下载白名单、退出码语义,描述的都是仓外 @runcomfy/cli 的行为;仓库内既无 CLI 源码也无版本 pin 引用,只能作为文档自述引用,不能坐实。同仓 runcomfy-cli/SKILL.md 有同一套自述,属同源转述而非独立证据。
- [discrepancy] 安装一行与 GitHub 链接指向旧仓 agentspace-so/runcomfy-skills — SKILL.md 写 `npx skills add agentspace-so/runcomfy-skills --skill flux-kontext -g` 与 github.com/agentspace-so/runcomfy-skills,而本仓储物 pin 在 prime-skills/runcomfy-agent-skills(README 也用 runcomfy-agent-skills)。gh api 核实:agentspace-so/runcomfy-skills 仍存在(5★、最后推送 2026-04-29、同样含 flux-kontext 等目录),是另一份较旧的仓;prime-skills/runcomfy-agent-skills 与 agentspace-so/runcomfy-agent-skills 返回相同 stats、full_name 均为 prime-skills/runcomfy-agent-skills(同一仓的新名)。结论:按文档安装可能装到旧版内容。
- [discrepancy] aspect_ratio 未给枚举值(与同族其他技能不一致) — 本技能写 'Pick from supported W:H options on the model page.'——同仓 happyhorse-1-0/wan-2-7/seedance-v2/gpt-image-edit 都列全了枚举。属于文档详略不一致(未到『错误』程度,但 agent 无法据此校验取值)。
- [ok] prompt 注入面 vs 文档自述 — 正文 'The CLI does NOT shell-expand the prompt' 与 'No shell injection surface from prompt content' 一致陈述;图像侧注入风险在 Limitations/Security 段有自认,未见淡化。
- [ok] 被点名的兄弟技能目录是否真实存在 — nano-banana-edit/、gpt-image-2/、flux-2-klein/ 三个目录经 ls 与 git ls-tree 核实均存在,路由建议不是死链。
- [ok] 无凭证/写入代码路径 — SKILL.md 中 RUNCOMFY_TOKEN 与 token.json 仅出现在 Prerequisites 第 3 条与 Security & Privacy 的 token storage 说明里,均是对 CLI 行为的转述;文件内无 write/save/append 指令指向本地路径,除 --output-dir 产物落地外无写入动作。
6Verdict & Scenarios
8c2a39b4f92f3d82…