Generate images with Flux 2 Klein (Black Forest Labs' distilled fast variant of Flux 2) on RunComfy — bundled with the model's documented prompting patterns...
---
name: flux-2-klein
displayName: "🫧 Flux 2 Klein — Pro Pack on RunComfy"
description: >
Generate images with Flux 2 Klein (Black Forest Labs' distilled fast
variant of Flux 2) 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 2 Klein's strengths
(sub-second latency, multi-reference brand styling, declarative
subject-first prompts), the step-count strategy (4–8 for fast
iteration, ~25 for polish), the 9B vs 4B variant trade-off, and when
to route to Flux 2 Pro / Seedream 5 / GPT Image 2 instead. Calls
`runcomfy run blackforestlabs/flux-2-klein/9b/text-to-image` (or
`/4b/`) through the local RunComfy CLI. Triggers on "flux 2 klein",
"flux-2-klein", "flux klein", "BFL flux 2", or any explicit ask to
generate with this model.
emoji: "🫧"
homepage: https://www.runcomfy.com
license: MIT
clawdis:
requires:
bins:
- runcomfy
env:
- RUNCOMFY_TOKEN
config:
- ~/.config/runcomfy
---
# 🫧 Flux 2 Klein — Pro Pack on RunComfy
[runcomfy.com](https://www.runcomfy.com/?utm_source=clawhub&utm_medium=skill&utm_campaign=flux-2-klein) · [9B model](https://www.runcomfy.com/models/blackforestlabs/flux-2-klein/9b/text-to-image?utm_source=clawhub&utm_medium=skill&utm_campaign=flux-2-klein) · [4B model](https://www.runcomfy.com/models/blackforestlabs/flux-2-klein/4b/text-to-image?utm_source=clawhub&utm_medium=skill&utm_campaign=flux-2-klein) · [docs](https://docs.runcomfy.com/cli/introduction?utm_source=clawhub&utm_medium=skill&utm_campaign=flux-2-klein)
Black Forest Labs' **Flux 2 Klein** (the distilled, low-latency variant of Flux 2) hosted on the **RunComfy Model API** — no API key, async REST.
## When to pick this model (vs siblings)
Flux 2 Klein's distinct strength is **latency-first creative iteration**: sub-second feedback enables live art-direction sessions and rapid product visualization that batch-style models can't sustain. Pick it when **iteration speed matters more than ceiling resolution**.
| You want | Use |
|---|---|
| Real-time / live art-direction sessions | **Flux 2 Klein 4B** ✓ |
| Fast iteration with strong detail at the end | **Flux 2 Klein 9B** ✓ |
| Multi-reference brand styling with consistent looks | **Flux 2 Klein** ✓ |
| 2K–4K hero images, max resolution | Seedream 5 |
| Maximum prompt adherence + extreme detail | Flux 2 Pro |
| Embedded text, logos, multilingual signage | GPT Image 2 |
| Hyperrealistic portrait | Nano Banana Pro |
If the user said "Flux 2 Klein" / "BFL Klein" / "flux klein" explicitly, route here regardless. If they said "Flux 2" generically, ask whether they want **Klein** (fast) or **Pro** (max quality) before defaulting.
## Prerequisites
1. **RunComfy CLI** — `npm i -g @runcomfy/cli`
2. **RunComfy account** — `runcomfy login` opens a browser device-code flow.
3. **CI / containers** — set `RUNCOMFY_TOKEN=<token>` instead of `runcomfy login`.
## Endpoints + input schema
Two variants, same endpoint shape, same prompt grammar.
### `blackforestlabs/flux-2-klein/9b/text-to-image`
The fidelity-first variant. Use for polish / final output.
| Field | Type | Required | Default | Notes |
|---|---|---|---|---|
| `prompt` | string | yes | — | Up to ~512 tokens. Longer degrades. |
| `steps` | int | no | 25 | 4–50. **Step-distilled architecture** — 4–8 enough for concepting; ~25 for polish; >25 buys little. |
| `width` | int | no | 1024 | 512–1536 typical. **Aspect ratio capped at 16:9**, max ~2K total. |
| `height` | int | no | 1024 | Match `width`'s aspect intent. |
### `blackforestlabs/flux-2-klein/4b/text-to-image`
The latency-first variant. Sub-second 4-step inference. Use for live iteration / concepting.
Same field set as 9B. Default `steps` is effectively 4 — the variant is built for that step count.
### Reference images (both variants)
Up to **4 simultaneous reference images** are supported on the same endpoint for style transfer / guided composition. The exact field name in the JSON body is documented on the [model's API tab](https://www.runcomfy.com/models/blackforestlabs/flux-2-klein/9b/text-to-image?utm_source=clawhub&utm_medium=skill&utm_campaign=flux-2-klein) — pass it through the CLI verbatim. Reference-image use enables editing-style workflows without a separate `/edit` endpoint.
## How to invoke
**Fast concepting (4B, sub-second):**
```bash
runcomfy run blackforestlabs/flux-2-klein/4b/text-to-image \
--input '{"prompt": "<user prompt>"}' \
--output-dir <absolute/path>
```
**Polish / final (9B, ~25 steps):**
```bash
runcomfy run blackforestlabs/flux-2-klein/9b/text-to-image \
--input '{
"prompt": "<user prompt>",
"steps": 25,
"width": 1024,
"height": 1024
}' \
--output-dir <absolute/path>
```
**Wide-format poster:**
```bash
runcomfy run blackforestlabs/flux-2-klein/9b/text-to-image \
--input '{"prompt": "<user prompt>", "width": 1536, "height": 864}' \
--output-dir <absolute/path>
```
The CLI submits, polls every 2s until terminal, then downloads any `*.runcomfy.net` / `*.runcomfy.com` URL from the result into `--output-dir`. Stdout is the result JSON. Stderr is progress.
For pipe-friendly usage:
```bash
runcomfy --output json run blackforestlabs/flux-2-klein/4b/text-to-image \
--input '{"prompt":"..."}' --no-wait | jq -r .request_id
```
## Prompting — what actually works
These are model-specific patterns that empirically improve output quality.
**Subject-first declarative grammar.** The structure Flux 2 Klein was trained on is *"Subject + action + scene + style + lighting + camera + quality"*. Front-load the subject; trail with directives. Example: `"A vibrant hummingbird mid-flight sipping nectar from a bright pink hibiscus, iridescent feathers in morning sun, soft bokeh tropical garden, macro photography, razor-sharp detail, cinematic lighting"`.
**Specificity wins over flowery language.** "4k product photo, softbox lighting, reflective table, 35mm, f/2.8" guides predictably. "A really pretty product image" doesn't.
**Step-count by phase.**
- **Concepting**: 4–8 steps on the 4B variant — sub-second feedback for live exploration.
- **Refinement**: 8–15 steps still on 4B, locking in subject + framing.
- **Polish**: ~25 steps on the 9B variant — texture, microdetail, fine typography.
**Multi-reference alignment.** When passing reference images, **keep their aesthetics aligned**. Mixing a watercolor + a photoreal + a 3D render in the same call confuses the editor. Pick one consistent visual register across all refs.
**Conditional edits**: state what stays, then what changes. *"Same composition and lighting as reference, but change the background from beach to mountain studio."* This pattern holds composition stable.
**For text rendering** (Klein has the 8B Qwen3 embedder, decent but not GPT Image 2 territory): add `"crisp typography, high-contrast label"` and bump steps to ~25 if the text comes out soft. For heavy in-image text or multilingual rendering, route to GPT Image 2 instead.
**Anti-patterns**:
- Don't conflict adjectives. "minimalist + ornate" cancels.
- Don't exceed ~512 tokens. The model degrades, doesn't truncate gracefully.
- Don't ask for 4K — the model's resolution ceiling is ~2K.
- Don't ask for ultra-wide (>16:9) — the model crops.
## Where it shines
| Use case | Why Flux 2 Klein |
|---|---|
| **Live art-direction sessions** | Sub-second feedback (4B) enables real-time iteration |
| **Interactive product visualization** | Fast UI previews and product comps without batch waits |
| **Multi-reference brand styling** | Strong style consistency across references for unified asset packs |
| **Rapid concepting → polish workflow** | 4B for exploration, 9B for the final pass — same prompt grammar throughout |
| **Consumer-GPU-friendly inference** | 4B variant runs on modest hardware; relevant for self-host comparisons but RunComfy-hosted is fine |
## Sample prompts (verified to produce strong results)
**From the model page (BFL example):**
```
A vibrant hummingbird mid-flight sipping nectar from a bright pink hibiscus
flower, iridescent emerald and sapphire feathers catching the morning sun,
soft bokeh tropical garden background, macro photography, razor-sharp
detail, cinematic lighting
```
**Product-photo pattern:**
```
A matte ceramic mug on a reclaimed-wood table, soft northern window light
from the left, shallow depth of field, 50mm prime, f/2.0, neutral
background, e-commerce ready, 4K product photography
```
**Brand-consistent pair (multi-ref):**
```
Same composition and lighting as the reference image, but the bottle
label is now blue with white sans-serif typography reading "AURA";
keep the bottle silhouette, table, and shadow exactly as in the reference
```
## Limitations
- **Resolution ceiling ~2K** — for higher native res, route to Seedream 5.
- **Aspect ratio cap 16:9** — extreme wide/tall ratios get cropped.
- **Prompt cap ~512 tokens** — longer degrades quality; doesn't truncate gracefully.
- **Reference image cap 4** — more than 4 increases latency and dilutes guidance.
- **Text rendering** — the 8B Qwen3 embedder helps but GPT Image 2 still wins for embedded text precision.
## Exit codes
The `runcomfy` CLI uses sysexits-style codes:
| code | meaning |
|---|---|
| 0 | success |
| 64 | bad CLI args |
| 65 | bad input JSON / schema mismatch (e.g. `width: 4096` would 422) |
| 69 | upstream 5xx |
| 75 | retryable: timeout / 429 |
| 77 | not signed in or token rejected |
Full reference: [docs.runcomfy.com/cli/troubleshooting](https://docs.runcomfy.com/cli/troubleshooting?utm_source=clawhub&utm_medium=skill&utm_campaign=flux-2-klein).
## How it works
1. The skill invokes `runcomfy run blackforestlabs/flux-2-klein/<variant>/text-to-image` with a JSON body matching the schema.
2. The CLI POSTs to `https://model-api.runcomfy.net/v1/models/blackforestlabs/flux-2-klein/<variant>/text-to-image` with the user's bearer token.
3. The Model API returns a `request_id`; the CLI polls `GET .../requests/<id>/status` every 2 seconds.
4. On terminal status, the CLI fetches `GET .../requests/<id>/result` and downloads any URL whose host ends with `.runcomfy.net` or `.runcomfy.com` into `--output-dir`. Other URLs are listed but not fetched.
5. `Ctrl-C` while polling sends `POST .../requests/<id>/cancel` so you don't get billed for GPU you stopped.
## What this skill is not
Not a self-hosted Flux runner. Not a capability grant — depends on a working RunComfy account. Not multi-tenant.
---
## About RunComfy
[**RunComfy**](https://www.runcomfy.com/?utm_source=clawhub&utm_medium=skill&utm_campaign=flux-2-klein) is a hosted platform for running AI media models — image, video, audio. The Model API exposes a catalog of models behind a single async REST endpoint: submit a request, poll status, fetch results. No deployment, no GPU rental, no separate provider keys. Models on RunComfy include Black Forest Labs **Flux 2 Klein** (and Pro/Turbo/Flash/Kontext), OpenAI **GPT Image 2**, ByteDance **Seedance** and **Seedream**, Google **Nano Banana 2**, Wan **2.7**, and many more. The [`runcomfy` CLI](https://docs.runcomfy.com/cli/introduction?utm_source=clawhub&utm_medium=skill&utm_campaign=flux-2-klein) wraps the API for shell / agent use, with sysexits-style exit codes, JSON output mode, and auto-download of generated files. See the full [models catalog](https://www.runcomfy.com/models?utm_source=clawhub&utm_medium=skill&utm_campaign=flux-2-klein).
## Security & Privacy
- **Token storage**: `runcomfy login` writes the API token to `~/.config/runcomfy/token.json` with mode 0600 (owner-only read/write). Set `RUNCOMFY_TOKEN` env 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.
don't have the plugin yet? install it then click "run inline in claude" again.
runcomfy.com · 9B model · 4B model · docs
generate images with Black Forest Labs' Flux 2 Klein (distilled, low-latency variant of Flux 2) via the RunComfy Model API. use this when iteration speed matters more than final resolution: sub-second feedback on the 4B variant enables live art-direction sessions and rapid product visualization. use Flux 2 Klein when you need multi-reference brand styling, fast concepting followed by polish passes, or real-time creative direction. skip this if you need 4K hero images (use Seedream 5), maximum prompt adherence (use Flux 2 Pro), embedded text or logos (use GPT Image 2), or hyperrealistic portraiture (use Nano Banana Pro).
npm i -g @runcomfy/cli. required to submit jobs to the model API.runcomfy login, which opens a browser device-code flow and writes the token to ~/.config/runcomfy/token.json (mode 0600, owner-only). for CI/containers, set RUNCOMFY_TOKEN=<token> env var instead.| field | type | required | default | notes |
|---|---|---|---|---|
prompt |
string | yes | , | up to ~512 tokens. subject-first declarative grammar works best. longer prompts degrade quality without graceful truncation. |
steps |
int | no | 25 (9B) / 4 (4B) | 4-50 range. step-distilled architecture: 4-8 for concepting, ~25 for polish, >25 buys minimal quality gain. 4B variant is trained for 4-step inference. |
width |
int | no | 1024 | 512-1536 typical. aspect ratio capped at 16:9 max. |
height |
int | no | 1024 | match width's aspect intent. aspect ratio cap enforced. |
reference_images |
array (up to 4 URLs) | no | , | optional style transfer / guided composition. exact JSON field name documented on the model's RunComfy API tab. keep reference aesthetics aligned (don't mix watercolor + photoreal + 3D render in same call). |
runcomfy CLI in $PATHRUNCOMFY_TOKEN env var or ~/.config/runcomfy/token.json)--output-dir (relative paths may fail in some execution contexts)model-api.runcomfy.net and *.runcomfy.net / *.runcomfy.com (for result download)parse the user request and determine variant: if the user explicitly says "klein", "flux 2 klein", "flux klein", or "BFL klein", route here. if they say "flux 2" generically without qualifier, ask whether they want Klein (fast iteration) or Pro (max quality) before defaulting. input: user prompt. output: confirmed variant choice (4B or 9B) and user intent (concepting, iteration, or final polish).
structure the prompt using subject-first declarative grammar: lead with the subject, then action, scene, style, lighting, camera, quality. avoid conflicting adjectives. cap at ~512 tokens. example: "A vibrant hummingbird mid-flight sipping nectar from a bright pink hibiscus, iridescent feathers in morning sun, soft bokeh tropical garden, macro photography, razor-sharp detail, cinematic lighting". input: raw user prompt. output: reformatted prompt string fitting the grammar.
select step count based on user intent: for live concepting / exploration, use 4-8 steps on the 4B variant. for refinement and lock-in, use 8-15 steps on 4B. for final polish with texture and microdetail, use ~25 steps on 9B. input: user phase (concepting/refinement/polish) and variant choice. output: step count integer.
select dimensions and validate aspect ratio: ask for desired width/height or infer from context (portrait, landscape, square, wide poster). enforce aspect ratio <= 16:9. cap width at 1536, height at 1024 for landscape. input: user dimension request or implied by use case. output: validated width/height integers.
prepare reference images if applicable: collect up to 4 reference image URLs. validate that all references share a consistent visual aesthetic (all watercolor, all photoreal, all 3D, etc.). keep a list of URLs. input: user reference images (URLs or paths). output: array of 0-4 reference image URLs ready for the API call.
construct the runcomfy JSON body: build the --input JSON string with prompt, steps, width, height, and optional reference_images array. validate that the JSON is well-formed and schema-compliant (no width > 1536, no steps < 4 or > 50, no reference_images > 4). input: all parameters from steps 2-5. output: valid JSON string ready for CLI --input flag.
invoke the runcomfy CLI: execute runcomfy run blackforestlabs/flux-2-klein/<variant>/text-to-image --input '<json>' --output-dir <absolute/path>. the CLI POSTs to the RunComfy Model API, polls every 2 seconds for completion, and on terminal status downloads any *.runcomfy.net / *.runcomfy.com URLs into the output directory. input: JSON body, output directory path, variant choice (9b or 4b). output: exit code (0 = success, non-zero = failure), stdout JSON with request metadata and result URLs, stderr with polling progress.
handle the result: on exit code 0, parse the stdout JSON for the generated image URL(s) and file path(s) in the output directory. validate that at least one image file exists on disk. on non-zero exit, log the exit code and stderr for debugging. input: exit code and stdout/stderr from the CLI. output: generated image file path or error message.
validate output quality (manual/heuristic step if user is present): if the user wants to iterate, loop back to step 2 with a refined prompt or different step count. if satisfied, deliver the file path and confirm. input: generated image. output: user confirmation or request to re-run.
"flux 2" mentioned generically (no "klein" or "pro" qualifier): ask the user whether they want Klein (fast iteration, sub-second on 4B) or Pro (max quality, slower). default to Klein if the user doesn't specify within 30 seconds.
user requests embedded text, logos, or multilingual signage: route to GPT Image 2 instead. Flux 2 Klein's 8B Qwen3 embedder is decent but not competitive for in-image typography.
user requests 4K or higher native resolution: route to Seedream 5 or Seedream 6. Flux 2 Klein's ceiling is ~2K native.
user requests extreme aspect ratio (wider than 16:9 or taller than 4:3): inform the user that Klein enforces <= 16:9 aspect ratio and will crop extreme ratios. offer to reframe with a 16:9 aspect ratio or route to a different model.
user provides reference images with conflicting aesthetics (watercolor + photoreal + 3D render): warn the user that mixing visual registers confuses the style transfer. ask them to pick one consistent aesthetic or use only the most important reference.
runcomfy CLI returns exit code 77 (not signed in or token rejected): guide the user to run runcomfy login or set RUNCOMFY_TOKEN env var. exit without retry.
runcomfy CLI returns exit code 75 (retryable: timeout or 429 rate limit): wait 10-30 seconds and retry the same command once. if it fails again, inform the user that RunComfy is overloaded and suggest trying again in a few minutes.
runcomfy CLI returns exit code 69 (upstream 5xx): log the error and inform the user that RunComfy's infrastructure is degraded. suggest trying again after 5 minutes.
runcomfy CLI returns exit code 65 (bad input JSON / schema mismatch): log the full --input JSON and stderr. ask the user to validate dimensions (width <= 1536, height <= 1024, aspect ratio <= 16:9), step count (4-50), and prompt length (<= ~512 tokens). correct and retry.
runcomfy CLI returns exit code 64 (bad CLI args): this indicates a local bug in the skill. log the full command and exit. do not retry.
user hits prompt token limit (prompt degrades over ~512 tokens): offer to truncate or simplify the prompt. rerun with the shortened version.
user wants to iterate quickly (multiple rounds of refinement): default to 4B variant with 4-8 steps per round. once satisfied with composition, switch to 9B with ~25 steps for the final pass.
user explicitly requests 4B variant: honor it, even if they didn't ask for speed. set default steps to 4 and warn that output will be lower detail than 9B.
Ctrl-C during polling: the CLI sends POST .../requests/<id>/cancel to cancel the job server-side. this prevents billing for GPU time after the user stops waiting. inform the user the job was cancelled.
on success (exit code 0):
<absolute/path>/<request-id>_<image-index>.png (or .webp, depending on RunComfy's output format at the time of generation).{"request_id": "...", "status": "completed", "result": {"images": [{"url": "...", "local_path": "..."}]}}.on authentication failure (exit code 77):
~/.config/runcomfy/token.json is missing, invalid, or expired.on input validation failure (exit code 65):
on rate limit / timeout (exit code 75):
on upstream failure (exit code 69):
the user knows the skill worked when:
runcomfy run command exits with code 0 (success).--output-dir with a readable size > 1 KiB.the skill failed if:
| you want | use instead |
|---|---|
| Real-time / live art-direction sessions | Flux 2 Klein 4B (this skill) ✓ |
| Fast iteration with strong detail at the end | Flux 2 Klein 9B (this skill) ✓ |
| Multi-reference brand styling with consistent looks | Flux 2 Klein (this skill) ✓ |
| 2K, 4K hero images, max resolution | Seedream 5 or Seedream 6 |
| Maximum prompt adherence + extreme detail | Flux 2 Pro (use Flux 2 Pro skill if available) |
| Embedded text, logos, multilingual signage | GPT Image 2 |
| Hyperrealistic portrait | Nano Banana Pro |
Flux 2 Klein responds best to the structure: subject + action + scene + style + lighting + camera + quality. lead with the subject. example:
A vibrant hummingbird mid-flight sipping nectar from a bright pink hibiscus
flower, iridescent emerald and sapphire feathers catching the morning sun,
soft bokeh tropical garden background, macro photography, razor-sharp
detail, cinematic lighting
concrete directives beat vague praise. "4k product photo, softbox lighting, reflective table, 35mm, f/2.8" guides predictably. "A really pretty product image" doesn't.
when passing reference images (up to 4), keep their aesthetics aligned. don't mix watercolor + photoreal + 3D render in the same call. pick one consistent visual register. example:
Same composition and lighting as reference, but change the background
from beach to mountain studio.
state what stays, then what changes. the model holds stable composition when you explicitly anchor it.
Flux 2 Klein has the 8B Qwen3 embedder (decent, not GPT Image 2 territory). for light text, add "crisp typography, high-contrast label" and bump steps to ~25. for heavy in-image text or multilingual rendering, route to GPT Image 2.
BFL example (hummingbird, macro):
A vibrant hummingbird mid-flight sipping nectar from a bright pink hibiscus
flower, iridescent emerald and sapphire feathers catching the morning sun,
soft bokeh tropical garden background, macro photography, razor-sharp
detail, cinematic lighting
product-photo pattern (matte ceramics):
A matte ceramic mug on a reclaimed-wood table, soft northern window light
from the left, shallow depth of field, 50mm prime, f/2.0, neutral
background, e-commerce ready, 4K product photography
brand-consistent multi-reference (bottle label):
Same composition and lighting as the reference image, but the bottle
label is now blue with white sans-serif typography reading "AURA";
keep the bottle silhouette, table, and shadow exactly as in the reference