flux-kontext
prime-skills/runcomfy-agent-skills
Precise local image edits with Flux 1 Kontext Pro on RunComfy—single-reference, high-fidelity output.
What is flux-kontext?
Edit images with Black Forest Labs' Flux 1 Kontext Pro model hosted on RunComfy. Use this when you need precise, localized edits to a single image while preserving identity and fidelity—e.g., adding an object, swapping text, or changing clothing. Route to other models for batch edits, multilingual text, or generation from scratch.
- Perform single-reference precise local image edits with strong prompt control
- Preserve source identity (face, pose, clothing, framing) while applying targeted changes
- Handle brand-asset text and color swaps with explicit preservation instructions
- Support reproducible variants via seed parameter
- Execute edits via RunComfy CLI with minimal schema (prompt + image + optional aspect_ratio/seed)
How to install flux-kontext
npx skills add https://github.com/prime-skills/runcomfy-agent-skills --skill flux-kontext- RunComfy CLI: npm i -g @runcomfy/cli
- RunComfy account via runcomfy login (or RUNCOMFY_TOKEN env var for CI/containers)
How to use flux-kontext
- 1.Install the skill: npx skills add https://github.com/prime-skills/runcomfy-agent-skills --skill flux-kontext
- 2.Authenticate: runcomfy login (opens browser device-code flow)
- 3.Prepare a publicly accessible HTTPS image URL
- 4.Call the skill with a single declarative edit instruction and the image URL
- 5.Optionally specify aspect_ratio or seed for reproducibility
- 6.Retrieve the edited image from the output directory
Use cases
- Add or modify a single object in a portrait (e.g., 'add an orange umbrella in her left hand')
- Swap brand text or labels on product images while keeping bottle shape and lighting intact
- Change clothing or accessories on a person while preserving pose and facial features
- Iterate quickly on micro-edits to one image with short, declarative prompts
- Generate variant series of the same edit using seed for reproducibility
- Product photographers and e-commerce teams editing catalog images
- Brand and marketing teams making localized asset variations
- Designers iterating on single-image refinements
- Anyone needing high-fidelity preservation during targeted edits
flux-kontext FAQ
Use Flux Kontext for single-image precise local edits with high-fidelity preservation. Use Nano Banana Edit for batch edits (1–20 images), GPT Image 2 edit for multilingual/embedded text, and Flux 2 Klein for generation from scratch without a source image.
Lead with preservation ('Keep the person's face, pose, and clothing unchanged'), then state one declarative change in active voice ('Add an orange umbrella'). Avoid compound edits; split them into sequential passes if needed.
No. Flux Kontext accepts a single source image. For batch edits across multiple images, route to Nano Banana Edit instead.
Compound prompts (changing A, adding B, removing C in one instruction) cause drift. Split complex edits into sequential single-instruction passes—e.g., pass 1 changes background, pass 2 changes clothing.
Pass a seed value in the input JSON. The same seed with the same prompt and image will produce the same edit output.
Full instructions (SKILL.md)
Source of truth, from prime-skills/runcomfy-agent-skills.
name: flux-kontext
displayName: "Flux Kontext Pro — Pro Pack on RunComfy"
description: >
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.
homepage: https://www.runcomfy.com
license: MIT
Flux Kontext Pro — Pro Pack on RunComfy
runcomfy.com · Model page · GitHub
Black Forest Labs' Flux 1 Kontext Pro — single-reference precise local image edit — hosted on the RunComfy Model API. Strong prompt control, consistent outputs, high fidelity.
npx skills add agentspace-so/runcomfy-skills --skill flux-kontext -g
When to pick this model (vs siblings)
| You want | Use |
|---|---|
| Single-image precise local edit ("she's now holding X") | Flux Kontext |
| High-fidelity preservation of source identity | Flux Kontext |
| Batch edits across 1–20 images | Nano Banana Edit |
| Edit multilingual / embedded text in image | GPT Image 2 edit |
| Generate from scratch, no source image | Flux 2 Klein |
If the user said "Flux Kontext" / "kontext" / "BFL Kontext" explicitly, route here regardless.
Prerequisites
- RunComfy CLI —
npm i -g @runcomfy/cli - RunComfy account —
runcomfy loginopens a browser device-code flow. - CI / containers — set
RUNCOMFY_TOKEN=<token>instead ofruncomfy login.
Endpoints + input schema
blackforestlabs/flux-1-kontext/pro/edit
| Field | Type | Required | Default | Notes |
|---|---|---|---|---|
prompt | string | yes | — | Single declarative edit instruction. |
image | string | yes | — | Single source image URL (publicly fetchable HTTPS). |
aspect_ratio | enum | no | (input) | Pick from supported W:H options on the model page. |
seed | int | no | — | Reuse for variant comparisons. |
The schema is intentionally minimal — Kontext leans on prompt + single ref. For multi-image or web-grounded edits, route to Nano Banana Edit.
How to invoke
Default — local edit, preserve everything else:
runcomfy run blackforestlabs/flux-1-kontext/pro/edit \
--input '{
"prompt": "Keep the person'\''s face, pose, and clothing unchanged. Add an orange umbrella in her left hand and a slight smile.",
"image": "https://.../portrait.jpg"
}' \
--output-dir <absolute/path>
With seed for reproducible variant series:
runcomfy run blackforestlabs/flux-1-kontext/pro/edit \
--input '{
"prompt": "Keep the bottle, label, and lighting unchanged. Replace the brand text on the label from \"ALPHA\" to \"AURA\".",
"image": "https://.../bottle.jpg",
"seed": 42
}' \
--output-dir <absolute/path>
Prompting — what actually works
One declarative instruction. Kontext shines on prompts shaped like the docs example: "She is now holding an orange umbrella and smiling". Imperative mood, single change.
Preservation first. Lead with "Keep [identity / pose / framing / brand] unchanged." Then the change. Models honor what's stated up front.
Single ref only — pick the right one. No multi-image fanout here. If you have multiple references, decide which is primary and pass that one. For multi-image flows, route to Nano Banana Edit.
Iterate on small changes. If Kontext drifts, split a compound edit into sequential single-instruction passes (pass 1: change background, pass 2: change clothing).
Aspect ratio — pick from the supported enum. Out-of-list values 422 or crop.
Anti-patterns:
- Compound prompts ("change A and add B and remove C") → drift.
- Trying to fan out to multiple source images → wrong model (use Nano Banana Edit).
- Prompts written in passive voice → less reliable.
- Asking for novel composition without a source image → wrong model (use Flux 2 Klein t2i).
Where it shines
| Use case | Why Flux Kontext |
|---|---|
| Single-shot precise local edit | Specifically designed for this; high fidelity |
| Preserve source identity through targeted change | Strong preservation under explicit instruction |
| Brand-asset text or color swap | Quoted text + preservation lead-in works well |
| Quick iteration on one image | Short prompts + single ref = fast result loop |
Sample prompts (verified to produce strong results)
Page example:
She is now holding an orange umbrella and smiling
Preservation-led brand edit:
Keep the bottle silhouette, table, and lighting exactly as in the input.
Replace only the brand text on the label, from "ALPHA" to "AURA".
Same font weight, white on black, centered.
Compositional micro-edit:
Keep the person's face, pose, and clothing unchanged. Add a leather
shoulder bag, dark brown, hanging on the right shoulder.
Limitations
- Single source image only. For multi-image flows, use Nano Banana Edit (1–20).
- Public RunComfy docs are minimal — schema fields beyond prompt + image + aspect_ratio + seed may exist; check the model page for the latest field list.
- Compound prompts drift — split into sequential passes.
- For multilingual / embedded text editing, GPT Image 2 edit usually wins.
Exit codes
| code | meaning |
|---|---|
| 0 | success |
| 64 | bad CLI args |
| 65 | bad input JSON / schema mismatch |
| 69 | upstream 5xx |
| 75 | retryable: timeout / 429 |
| 77 | not signed in or token rejected |
Full reference: docs.runcomfy.com/cli/troubleshooting.
How it works
The skill invokes runcomfy run blackforestlabs/flux-1-kontext/pro/edit with a JSON body matching the schema. 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.
Security & Privacy
- Token storage:
runcomfy loginwrites the API token to~/.config/runcomfy/token.jsonwith mode 0600 (owner-only read/write). SetRUNCOMFY_TOKENenv var to bypass the file entirely in CI / containers. - Input boundary: the user prompt is passed as a JSON string to the CLI via
--input. The CLI does NOT shell-expand the prompt; it transmits the JSON body directly to the Model API over HTTPS. No shell injection surface from prompt content. - Third-party content: image / mask / video URLs you pass are fetched by the RunComfy model server, not by the CLI on your machine. Treat external URLs as untrusted; image-based prompt injection is a known risk for any image-edit / video-edit model.
- Outbound endpoints: only
model-api.runcomfy.net(request submission) and*.runcomfy.net/*.runcomfy.com(download whitelist for generated outputs). No telemetry, no callbacks. - Generated-file size cap: the CLI aborts any single download > 2 GiB to prevent disk-fill from a malicious or runaway model output.
Related skills
More from prime-skills/runcomfy-agent-skills and the wider catalog.

gpt-image-2
Generate and edit images with OpenAI GPT Image 2 on RunComfy—no API key needed.

gpt-image-edit
Edit images with OpenAI GPT Image 2 on RunComfy—preserves identity and handles multilingual text in images.

happyhorse-1-0
#1 ranked text-to-video model with native 1080p, synchronized audio, and multi-shot character consistency.

image-edit
Smart router matching image edits to the right RunComfy model—batch, text, composition, or mask-driven.

image-inpainting
Mask-driven image inpainting for object removal, watermark cleanup, and region replacement via RunComfy CLI.

image-outpainting
Extend image canvas, change aspect ratio, and uncrop photos while preserving original content via RunComfy.