flux-2-klein
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseFlux 2 Klein — Pro Pack on RunComfy
Flux 2 Klein — RunComfy专业工具包
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.
bash
npx skills add agentspace-so/runcomfy-skills --skill flux-2-klein -gBlack Forest Labs推出的Flux 2 Klein(Flux 2的精简低延迟变体)托管在RunComfy模型API上——无需API密钥,支持异步REST调用。
bash
npx skills add agentspace-so/runcomfy-skills --skill flux-2-klein -gWhen 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.
Flux 2 Klein的核心优势是低延迟优先的创意迭代:亚秒级反馈支持实时艺术指导会话和快速产品可视化,这是批量式模型无法实现的。当迭代速度比最高分辨率更重要时选择它。
| 需求场景 | 推荐模型 |
|---|---|
| 实时/在线艺术指导会话 | Flux 2 Klein 4B |
| 快速迭代且最终输出细节丰富 | Flux 2 Klein 9B |
| 多参考品牌风格且视觉统一 | Flux 2 Klein |
| 2K–4K高清主视觉图、最大分辨率 | Seedream 5 |
| 严格遵循提示词且细节极致 | Flux 2 Pro |
| 嵌入文字、标识、多语言标牌 | GPT Image 2 |
| 超写实肖像 | Nano Banana Pro |
如果用户明确提到“Flux 2 Klein”/“BFL Klein”/“flux klein”,直接使用该模型。如果用户笼统提到“Flux 2”,先询问其需要Klein(高速)还是Pro(最高质量),再做默认选择。
Prerequisites
前置条件
- RunComfy CLI —
npm i -g @runcomfy/cli - RunComfy account — opens a browser device-code flow.
runcomfy login - CI / containers — set instead of
RUNCOMFY_TOKEN=<token>.runcomfy login
- RunComfy CLI — 执行安装
npm i -g @runcomfy/cli - RunComfy账户 — 执行会打开浏览器设备码登录流程
runcomfy login - CI/容器环境 — 设置环境变量替代
RUNCOMFY_TOKEN=<token>runcomfy login
Endpoints + input schema
端点与输入 schema
Two variants, same endpoint shape, same prompt grammar.
两个变体的端点结构和提示词语法一致。
blackforestlabs/flux-2-klein/9b/text-to-image
blackforestlabs/flux-2-klein/9b/text-to-imageblackforestlabs/flux-2-klein/9b/text-to-image
blackforestlabs/flux-2-klein/9b/text-to-imageThe fidelity-first variant. Use for polish / final output.
| Field | Type | Required | Default | Notes |
|---|---|---|---|---|
| string | yes | — | Up to ~512 tokens. Longer degrades. |
| int | no | 25 | 4–50. Step-distilled architecture — 4–8 enough for concepting; ~25 for polish; >25 buys little. |
| int | no | 1024 | 512–1536 typical. Aspect ratio capped at 16:9, max ~2K total. |
| int | no | 1024 | Match |
优先保证画质的变体,用于精细化处理/最终输出。
| 字段 | 类型 | 是否必填 | 默认值 | 说明 |
|---|---|---|---|---|
| 字符串 | 是 | — | 最多约512个token,过长会导致画质下降 |
| 整数 | 否 | 25 | 取值范围4–50。步数精简架构——4–8步足够用于概念构思;约25步用于精细化处理;超过25步提升有限 |
| 整数 | 否 | 1024 | 典型取值512–1536。宽高比上限为16:9,总像素约2K |
| 整数 | 否 | 1024 | 需与 |
blackforestlabs/flux-2-klein/4b/text-to-image
blackforestlabs/flux-2-klein/4b/text-to-imageblackforestlabs/flux-2-klein/4b/text-to-image
blackforestlabs/flux-2-klein/4b/text-to-imageThe latency-first variant. Sub-second 4-step inference. Use for live iteration / concepting.
Same field set as 9B. Default is effectively 4 — the variant is built for that step count.
steps优先保证低延迟的变体,4步推理可实现亚秒级输出,用于实时迭代/概念构思。
字段集合与9B变体一致,默认为4——该变体专为这个步数设计。
stepsReference 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 — pass it through the CLI verbatim. Reference-image use enables editing-style workflows without a separate endpoint.
/edit同一端点最多支持4张同时传入的参考图像,用于风格迁移/构图引导。JSON请求体中的具体字段名称可查看模型API页面——直接通过CLI传入即可。使用参考图像支持编辑类工作流,无需单独调用端点。
/editHow 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 / URL from the result into . Stdout is the result JSON. Stderr is progress.
*.runcomfy.net*.runcomfy.com--output-dirFor pipe-friendly usage:
bash
runcomfy --output json run blackforestlabs/flux-2-klein/4b/text-to-image \
--input '{"prompt":"..."}' --no-wait | jq -r .request_id快速概念构思(4B变体,亚秒级):
bash
runcomfy run blackforestlabs/flux-2-klein/4b/text-to-image \
--input '{"prompt": "<用户提示词>"}' \
--output-dir <绝对路径>精细化处理/最终输出(9B变体,约25步):
bash
runcomfy run blackforestlabs/flux-2-klein/9b/text-to-image \
--input '{
"prompt": "<用户提示词>",
"steps": 25,
"width": 1024,
"height": 1024
}' \
--output-dir <绝对路径>宽幅海报:
bash
runcomfy run blackforestlabs/flux-2-klein/9b/text-to-image \
--input '{"prompt": "<用户提示词>", "width": 1536, "height": 864}' \
--output-dir <绝对路径>CLI提交请求后,每2秒轮询一次直到任务完成,然后将结果中所有/的URL下载到目录。标准输出为结果JSON,标准错误输出为进度信息。
*.runcomfy.net*.runcomfy.com--output-dir管道友好型用法:
bash
runcomfy --output json run blackforestlabs/flux-2-klein/4b/text-to-image \
--input '{"prompt":"..."}' --no-wait | jq -r .request_idPrompting — 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 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.
"crisp typography, high-contrast label"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.
以下是经实践验证可提升输出质量的模型专属提示词模式。
主语优先的声明式语法:Flux 2 Klein的训练数据结构为*“主体 + 动作 + 场景 + 风格 + 光线 + 镜头 + 画质”*。将主体放在最前面,后面跟随指令。示例:。
"一只色彩鲜艳的蜂鸟正在吸食亮粉色木槿花的花蜜,清晨阳光下的虹彩羽毛,热带花园的柔和散景,微距摄影,极致清晰细节,电影级光线"具体描述优于华丽辞藻:“4K产品照片,柔光箱照明,反光桌面,35mm镜头,f/2.8”能产生可预测的优质输出,而“一张非常漂亮的产品图”则无法达到预期效果。
按阶段选择步数:
- 概念构思:使用4B变体,4–8步——亚秒级反馈支持实时探索
- 优化调整:仍使用4B变体,8–15步,锁定主体与构图
- 精细化处理:使用9B变体,约25步——提升纹理、微细节和精细排版
多参考图像风格统一:传入参考图像时,保持美学风格一致。在同一调用中混合水彩、写实、3D渲染风格会让模型产生混淆。所有参考图像需选择统一的视觉风格。
条件式编辑:先说明保留的内容,再描述修改的部分。例如:“保持参考图像的构图和光线不变,将背景从海滩改为山地工作室”。这种模式能稳定构图。
文字渲染(Klein搭载8B Qwen3嵌入器,效果尚可但不如GPT Image 2):添加,如果文字显示模糊,将步数提升至约25步。如果需要大量嵌入文字或多语言渲染,建议转而使用GPT Image 2。
"清晰排版,高对比度标签"反模式:
- 避免使用矛盾形容词,如“极简主义 + 华丽繁复”会相互抵消效果
- 提示词不要超过约512个token,模型画质会下降且无法优雅截断
- 不要要求4K分辨率,模型的分辨率上限约为2K
- 不要要求超宽比例(>16:9),模型会自动裁剪
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 |
| 使用场景 | 选择Flux 2 Klein的原因 |
|---|---|
| 实时艺术指导会话 | 4B变体的亚秒级反馈支持实时迭代 |
| 交互式产品可视化 | 快速生成UI预览和产品效果图,无需批量等待 |
| 多参考品牌风格统一 | 参考图像间的风格一致性强,可生成统一的资产包 |
| 快速构思→精细化处理工作流 | 4B变体用于探索,9B变体用于最终输出——全程使用相同的提示词语法 |
| 消费级GPU友好型推理 | 4B变体可在普通硬件上运行;适用于自托管对比,但RunComfy托管版本已足够好用 |
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 lightingProduct-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 photographyBrand-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模型页面示例(BFL官方示例):
一只色彩鲜艳的蜂鸟正在吸食亮粉色木槿花的花蜜,清晨阳光下的虹彩绿蓝宝石羽毛,热带花园的柔和散景背景,微距摄影,极致清晰细节,电影级光线产品照片模式:
哑光陶瓷杯放在回收木桌,左侧柔和的北向窗光,浅景深,50mm定焦镜头,f/2.0,中性背景,适合电商,4K产品摄影品牌风格统一的多参考示例:
保持参考图像的构图和光线不变,但瓶身标签改为蓝色配白色无衬线字体“AURA”;完全保留瓶身轮廓、桌面和阴影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.
- 分辨率上限约2K——如需更高原生分辨率,建议使用Seedream 5
- 宽高比上限16:9——极端宽/高比例会被裁剪
- 提示词上限约512个token——过长会导致画质下降,无法优雅截断
- 参考图像上限4张——超过4张会增加延迟并削弱引导效果
- 文字渲染——8B Qwen3嵌入器有一定效果,但GPT Image 2在嵌入文字精度上仍更胜一筹
Exit codes
退出码
The CLI uses sysexits-style codes:
runcomfy| code | meaning |
|---|---|
| 0 | success |
| 64 | bad CLI args |
| 65 | bad input JSON / schema mismatch (e.g. |
| 69 | upstream 5xx |
| 75 | retryable: timeout / 429 |
| 77 | not signed in or token rejected |
Full reference: docs.runcomfy.com/cli/troubleshooting.
runcomfy| 代码 | 含义 |
|---|---|
| 0 | 成功 |
| 64 | CLI参数错误 |
| 65 | 输入JSON错误/schema不匹配(例如 |
| 69 | 上游服务5xx错误 |
| 75 | 可重试:超时/429限流 |
| 77 | 未登录或令牌被拒绝 |
How it works
工作原理
- The skill invokes with a JSON body matching the schema.
runcomfy run blackforestlabs/flux-2-klein/<variant>/text-to-image - The CLI POSTs to with the user's bearer token.
https://model-api.runcomfy.net/v1/models/blackforestlabs/flux-2-klein/<variant>/text-to-image - The Model API returns a ; the CLI polls
request_idevery 2 seconds.GET .../requests/<id>/status - On terminal status, the CLI fetches and downloads any URL whose host ends with
GET .../requests/<id>/resultor.runcomfy.netinto.runcomfy.com. Other URLs are listed but not fetched.--output-dir - while polling sends
Ctrl-Cso you don't get billed for GPU you stopped.POST .../requests/<id>/cancel
- 该工具调用,传入符合schema的JSON请求体
runcomfy run blackforestlabs/flux-2-klein/<variant>/text-to-image - CLI将请求POST到,并携带用户的Bearer令牌
https://model-api.runcomfy.net/v1/models/blackforestlabs/flux-2-klein/<variant>/text-to-image - 模型API返回;CLI每2秒轮询一次
request_idGET .../requests/<id>/status - 任务完成后,CLI获取,并将所有主机后缀为
GET .../requests/<id>/result或.runcomfy.net的URL下载到.runcomfy.com目录。其他URL仅列出但不下载--output-dir - 轮询时按会发送
Ctrl-C请求,避免为已停止的GPU使用付费POST .../requests/<id>/cancel
What this skill is not
该工具不具备的能力
Not a self-hosted Flux runner. Not a capability grant — depends on a working RunComfy account. Not multi-tenant.
不是自托管的Flux运行器,依赖可用的RunComfy账户,不支持多租户。
Security & Privacy
安全与隐私
- Token storage: writes the API token to
runcomfy loginwith mode 0600 (owner-only read/write). Set~/.config/runcomfy/token.jsonenv var to bypass the file entirely in CI / containers.RUNCOMFY_TOKEN - Input boundary: the user prompt is passed as a JSON string to the CLI via . 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.
--input - 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 (request submission) and
model-api.runcomfy.net/*.runcomfy.net(download whitelist for generated outputs). No telemetry, no callbacks.*.runcomfy.com - Generated-file size cap: the CLI aborts any single download > 2 GiB to prevent disk-fill from a malicious or runaway model output.
- 令牌存储:会将API令牌写入
runcomfy login,权限为0600(仅所有者可读写)。在CI/容器环境中可设置~/.config/runcomfy/token.json环境变量,完全绕过文件存储RUNCOMFY_TOKEN - 输入边界:用户提示词通过作为JSON字符串传入CLI。CLI不会对提示词进行shell展开,而是直接通过HTTPS将JSON请求体传输给模型API。提示词内容不存在shell注入风险
--input - 第三方内容:传入的图像/蒙版/视频URL由RunComfy模型服务器获取,而非本地CLI。请将外部URL视为不可信;基于图像的提示词注入是所有图像编辑/视频编辑模型的已知风险
- 出站端点:仅与(提交请求)和
model-api.runcomfy.net/*.runcomfy.net(生成输出的下载白名单)通信。无遥测,无回调*.runcomfy.com - 生成文件大小限制:CLI会终止任何单个超过2 GiB的下载,防止恶意或异常模型输出占用磁盘空间