运行时依赖
安装命令
点击复制技能文档
🎨 Flux Kontext Pro — RunComfy Pro Pack runcomfy.com · docs · Model page Black Forest Labs 的 Flux 1 Kontext Pro:单参考精准局部图像编辑,托管于 RunComfy Model API。强提示控制、输出一致、高保真。
何时选它(对比同系)
- 想要“单图精准局部编辑”(如“她现在拿着 X”)→ Flux Kontext ✓
- 高保真保留原图身份 → Flux Kontext ✓
- 批量编辑 1–20 张图 → Nano Banana Edit
- 编辑多语言/内嵌文字 → GPT Image 2 edit
- 无源图从头生成 → Flux 2 Klein
用户明确说“Flux Kontext”/“kontext”/“BFL Kontext”时,直接路由至此。
前置条件
- RunComfy CLI:npm i -g @runcomfy/cli
- RunComfy 账号:runcomfy login 打开浏览器设备码登录
- CI/容器:设 RUNCOMFY_TOKEN=,无需 runcomfy login
接口 + 输入 schema blackforestlabs/flux-1-kontext/pro/edit 字段 类型 必填 默认 说明 prompt string 是 — 单条声明式编辑指令 image string 是 — 单张公开 HTTPS 源图 URL aspect_ratio enum 否 — 模型页支持的宽高比 seed int 否 — 复现用种子
schema 极简,仅依赖 prompt + 单参考。多图/联网编辑请用 Nano Banana Edit。
调用示例 默认局部编辑,其余保留: 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 <绝对路径>
带 seed 做可复现变体: 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 <绝对路径>
提示技巧
- 一条声明句,祈使语气,先保后改:“Keep … unchanged. Add …”
- 仅单参考;多图请用 Nano Banana Edit
- 复合改动易漂移,拆多次单步迭代
- 宽高比只能选枚举值,否则裁剪
反模式
- 复合 prompt(“改 A 并加 B 再删 C”)→ 漂移
- 多图源扩散 → 错模型
- 被动语态 → 不可靠
- 无源图新构图 → 错模型
擅长场景
- 单步精准局部编辑
- 身份高保真
- 品牌文字/色值替换
- 单图快速迭代
示例提示(已验证)
- She is now holding an orange umbrella and smiling
- 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.
- Keep the person's face, pose, and clothing unchanged. Add a leather shoulder bag, dark brown, hanging on the right shoulder.
限制
- 仅单源图;多图流用 Nano Banana Edit
- 公开文档极简,额外字段以模型页为准
- 复合 prompt 易漂移,多语言字编优先 GPT Image 2 edit
退出码 0 成功 64 CLI 参数错误 65 输入 JSON/schema 不符 69 上游 5xx 75 可重试:超时/429 77 未登录或 token 被拒
完整参考:docs.runcomfy.com/cli/troubleshooting
工作原理 技能执行 runcomfy run blackforestlabs/flux-1-kontext/pro/edit,CLI 向 https://model-api.runcomfy.net/v1/models/blackforestlabs/flux-1-kontext/pro/edit POST,轮询并下载结果到 --output-dir。Ctrl-C 可取消远程任务。
安全与隐私 本技能仅