# Flux 2 Klein > Genera imágenes con Flux 2 Klein (la variante rápida y destilada de Flux 2 de Black Forest Labs) en RunComfy, con los patrones de prompting documentados del modelo para lograr mejores resultados que un prompting ingenuo. Fuente: https://skillsagentes.com/skills/prime-skills/runcomfy-agent-skills/flux-2-klein Markdown: https://skillsagentes.com/skills/prime-skills/runcomfy-agent-skills/flux-2-klein.md Repositorio: https://github.com/prime-skills/runcomfy-agent-skills Autor: prime-skills Licencia: MIT Actualizado: hace 4 meses Coste de contexto: 190 tok instalada, 2.9k tok al activarse, 2.9k tok con todos los archivos del bundle Bundle: 1 archivo, 11 KB Permisos que pide: ninguno declarado ## Instalación Un skill son archivos markdown: los mismos archivos valen para cualquier agente y lo único que cambia es el directorio de destino, es decir la bandera `--agent`. Añade `-g` para instalarlo en todos los proyectos de la máquina. ```bash # Claude Code npx -y skills add prime-skills/runcomfy-agent-skills --skill flux-2-klein --agent claude-code # Cursor npx -y skills add prime-skills/runcomfy-agent-skills --skill flux-2-klein --agent cursor # Codex npx -y skills add prime-skills/runcomfy-agent-skills --skill flux-2-klein --agent codex # Gemini CLI npx -y skills add prime-skills/runcomfy-agent-skills --skill flux-2-klein --agent gemini # Windsurf npx -y skills add prime-skills/runcomfy-agent-skills --skill flux-2-klein --agent windsurf # Cline npx -y skills add prime-skills/runcomfy-agent-skills --skill flux-2-klein --agent cline ``` ## Qué hace - Genera imágenes con Flux 2 Klein (variante rápida de Flux 2 de Black Forest Labs) usando la RunComfy CLI local - Aplica patrones de prompting específicos del modelo: gramática subject-first, estrategia de step-count y alineación de referencias múltiples - Elige entre las variantes 9B (calidad/polish) y 4B (latencia/concepting) según la necesidad - Enruta a Flux 2 Pro, Seedream 5 o GPT Image 2 cuando el caso de uso excede las capacidades de Klein ## Cuándo usarla - El usuario pide explícitamente 'flux 2 klein', 'flux-2-klein', 'flux klein' o 'BFL flux 2' - Se necesita iteración rápida en sesiones de dirección de arte en vivo o previsualización de producto - Se requiere estilo consistente de marca con hasta 4 imágenes de referencia simultáneas - El usuario dice 'Flux 2' de forma genérica (preguntar si quiere Klein o Pro antes de asumir) ## Cuándo no - Se necesita resolución nativa 2K-4K máxima o texto/logos multilingües precisos (usar Seedream 5 o GPT Image 2) - Se requiere máxima adherencia al prompt y detalle extremo (usar Flux 2 Pro) - Se busca un retrato hiperrealista (usar Nano Banana Pro) ## Qué la activa - "Genera con Flux 2 Klein un colibrí volando junto a un hibisco rosa, iluminación cinematográfica" - "Usa Flux Klein 4B para iterar rápido sobre este diseño de producto" - "Crea con flux-2-klein una foto de producto de una taza de cerámica con luz suave" - "Necesito variaciones rápidas de estilo de marca con 4 imágenes de referencia usando BFL flux 2" ## Antes de instalar - Requiere la RunComfy CLI instalada (`npm i -g @runcomfy/cli`) y una cuenta RunComfy autenticada vía `runcomfy login` o la variable `RUNCOMFY_TOKEN`. - Necesita en el PATH: jq, npx ## Archivos - SKILL.md — 11 KB ## SKILL.md Reproducido tal cual desde prime-skills/runcomfy-agent-skills bajo MIT. Esta sección es el documento original y está en inglés. # Flux 2 Klein — Pro Pack on RunComfy [runcomfy.com](https://www.runcomfy.com/?utm_source=skills.sh&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=skills.sh&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=skills.sh&utm_medium=skill&utm_campaign=flux-2-klein) · [GitHub](https://github.com/agentspace-so/runcomfy-skills/tree/main/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. ```bash npx skills add agentspace-so/runcomfy-skills --skill flux-2-klein -g ``` ## 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=` 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=skills.sh&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": ""}' \ --output-dir ``` **Polish / final (9B, ~25 steps):** ```bash runcomfy run blackforestlabs/flux-2-klein/9b/text-to-image \ --input '{ "prompt": "", "steps": 25, "width": 1024, "height": 1024 }' \ --output-dir ``` **Wide-format poster:** ```bash runcomfy run blackforestlabs/flux-2-klein/9b/text-to-image \ --input '{"prompt": "", "width": 1536, "height": 864}' \ --output-dir ``` 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=skills.sh&utm_medium=skill&utm_campaign=flux-2-klein). ## How it works 1. The skill invokes `runcomfy run blackforestlabs/flux-2-klein//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//text-to-image` with the user's bearer token. 3. The Model API returns a `request_id`; the CLI polls `GET .../requests//status` every 2 seconds. 4. On terminal status, the CLI fetches `GET .../requests//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//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. ## 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. ## Dónde encaja - Categoría: [Diseño y UI](https://skillsagentes.com/categorias/diseno-ui.md) — Sistemas de diseño, trabajo con componentes y acabado visual. - Creador: [prime-skills](https://skillsagentes.com/creators/prime-skills.md) — 30 skills en el directorio - [Todas las skills](https://skillsagentes.com/skills.md) - [Ranking de instalaciones](https://skillsagentes.com/ranking.md) ## Otras skills del mismo repositorio - [Ai Music](https://skillsagentes.com/skills/prime-skills/runcomfy-agent-skills/ai-music.md): Genera música con IA en RunComfy mediante la CLI `runcomfy`, enrutando entre ElevenLabs AI Music Generation (voz premium 44.1 kHz) y ACE Step / ACE Step 1.5 (código abierto, mucho más barato), más inpaint y outpaint de audio. - [Ace Step](https://skillsagentes.com/skills/prime-skills/runcomfy-agent-skills/ace-step.md): Genera, inpaint y outpaint música con ACE Step de StepFun-AI en RunComfy vía la CLI `runcomfy`: composición por tags, letras multilingües, hasta 4 min, desde $0.0002/s. - [Video Outpainting](https://skillsagentes.com/skills/prime-skills/runcomfy-agent-skills/video-outpainting.md): Outpainting de video vía el CLI `runcomfy`: extiende el lienzo espacial, cambia la relación de aspecto (9:16 a 16:9 o viceversa) preservando la acción central, usando Wan 2-7 edit-video o flujos ComfyUI dedicados. - [Video Extend](https://skillsagentes.com/skills/prime-skills/runcomfy-agent-skills/video-extend.md): Extiende o continúa un clip de video existente en RunComfy vía la CLI runcomfy, usando los endpoints extend-video y fast/extend-video de Google Veo 3-1. - [Image Outpainting](https://skillsagentes.com/skills/prime-skills/runcomfy-agent-skills/image-outpainting.md): Outpainting de imágenes en RunComfy vía el CLI `runcomfy`: extiende el lienzo, cambia el aspect ratio y rellena lo que la cámara no captó, preservando el contenido original. ## Skills relacionadas - [Design Review](https://skillsagentes.com/skills/garrytan/gstack/design-review.md): Ojo de diseñador para QA: detecta inconsistencias visuales, problemas de espaciado y jerarquía, patrones de "AI slop" e interacciones lentas — y luego los corrige. - [Slides](https://skillsagentes.com/skills/nextlevelbuilder/ui-ux-pro-max-skill/slides.md): Crea presentaciones HTML estratégicas con Chart.js, design tokens, layouts responsivos, fórmulas de copywriting y estrategias contextuales de diapositivas. - [Ui Styling](https://skillsagentes.com/skills/nextlevelbuilder/ui-ux-pro-max-skill/ui-styling.md): Crea interfaces bellas y accesibles con componentes shadcn/ui (sobre Radix UI + Tailwind), estilos utility-first de Tailwind CSS y diseños visuales basados en canvas. - [Brand](https://skillsagentes.com/skills/nextlevelbuilder/ui-ux-pro-max-skill/brand.md): Voz de marca, identidad visual, frameworks de mensajería y gestión de assets para contenido de marca, tono, materiales de marketing y cumplimiento de estilo. - [Image Generation](https://skillsagentes.com/skills/bytedance/deer-flow/image-generation.md): Se usa cuando el usuario pide generar, crear, imaginar o visualizar imágenes: personajes, escenas, productos o cualquier contenido visual. Admite prompts estructurados e imágenes de referencia. --- Skills Agentes · [Índice de páginas en markdown](https://skillsagentes.com/sitemap.md) · [Inicio](https://skillsagentes.com/index.md)