anastasiyaw/codex-claude-code-config/flux2-klein-prompting
Claude Code and agent skill by anastasiyaw/codex-claude-code-config
- community
Checking that the SKILL.md file is still in the repository.
Expert prompt engineering for FLUX.2 [klein] image generation and editing model. Use this skill whenever the user wants to create prompts for FLUX.2 [klein], generate images, edit photos with the klein model, work with multi-reference image editing, or needs templates for T2I/I2I tasks. Trigger for any mention of: FLUX.2, flux klein, BFL API, image editing prompts, text-to-image prompts for FLUX, product mockups, poster generation, UI mockups, sticker packs, character design, seamless textures, or any request to write/improve/translate prompts for FLUX-family models. Also trigger when user asks about guidance_scale, inference steps, distilled vs base modes, or multi-reference workflows. Do NOT use for training a FLUX.2 Klein / Qwen-Edit LoRA (use flux2-lora-training), nor for reconstructing a prompt FROM an existing source image (use forensic-prompt-compiler); this skill is for authoring generation/edit prompts only.
Install
npx vskill@latest install anastasiyaw/codex-claude-code-config/flux2-klein-promptingSKILL.md
FLUX.2 [klein] — Prompt Engineering Guide
Core principle: prose, not tags
BFL guidance favors a concrete natural-language description over an ambiguous bag of tags. State who/what is in the image, where, style, materials/light/camera and — for editing — the properties to preserve. Prompt shape is a starting point, not a quality guarantee; assess the result against the requested edit.
Model variants quick reference
| Axis | Options | Notes | |
|---|---|---|---|
| Size | 4B / 9B | 9B better for complex instructions; 4B fastest | |
| Mode | Distilled / Base | Use the exact model-card or serving API settings; step/CFG values are implementation-specific | |
| License | 4B Apache-2.0 / 9B Non-Commercial | Check before commercial use | |
| Task | T2I / Edit (I2I) / Multi-reference | The current BFL image-editing guide documents up to 8 references via API (10 in playground); re-check the selected endpoint schema before use |
9B uses Qwen3 8B text embedder → solid multilingual support (Russian works natively).
Prompt structure
T2I (text-to-image)
- Subject — who/what, key attributes
- Scene/context — where, time of day, surroundings
- Composition — framing, angle, background
- Light/materials — source, softness, reflections, texture
- Style/genre — photorealism, illustration, catalog, poster, UI
- Text in image (if needed) — exact string in quotes + position/font
Edit (I2I, no mask)
- Base anchor — "This exact image but…"
- What to change — object / background / text / color / material
- What to preserve — face, lighting, style, perspective, brand elements
- Multi-reference — reference by "image 2 / image 3", keep prompt concise
Key rules
Text in image → always in straight quotes, specify position. Without this: garbled glyphs.
Negatives → positives → don't say "don't change X", say "preserve X"
Multi-reference → simplify text, use explicit indexing
Choose distilled or base only after the task’s quality/latency requirement and the exact model card are known; neither is an automatic “preview” or “final” mode.
Ready-to-use templates (Russian)
Photorealistic object
Product mockup / e-commerce
Logo / icon
Character design
Sticker pack (6 emotions)
Poster with readable text
UI mockup (mobile)
Seamless texture
Edit: replace / recolor / swap background
Edit: add text to sign/label
Edit: multi-reference character swap
API parameters
Recommended defaults (from official BFL HF Spaces)
| Mode | Settings | Use for | |
|---|---|---|---|
| Distilled / Base | Read the exact checkpoint or API reference | Choose from the requested fidelity, latency and cost constraints |
BFL API constraints (klein endpoints)
- Endpoint fields, size limits, reference-image count and result-URL lifetime
are API-version facts. Read the current endpoint reference before constructing a request; do not infer them from a local pipeline or another FLUX endpoint.
Available API fields (klein)
Do not maintain a local fixed field list. Copy the request schema from the current BFL API reference for the selected endpoint; multi-reference capacity, endpoint names and optional fields change independently of this skill.
Python: BFL API (async polling)
Illustrative request shape only: copy the current selected-endpoint example from BFL before use. This snippet does not establish that its endpoint or fields are currently supported.
Python: local Diffusers
Illustrative pipeline shape only. The shown step/guidance values are not a recommended default; verify the installed pipeline and selected model card.
Troubleshooting
| Problem | Cause | Fix | |
|---|---|---|---|
| Garbled text / glyphs | Text not quoted explicitly | Exact string in quotes; say "no other text" | |
| Blurry / artifacts | Selected configuration may be too aggressive for the task | Compare a small, pinned parameter change on the accepted visual criteria; do not assume a universal step count or mode | |
| Style drift in edit | Missing preservation clause | Always add "Сохрани: свет/лицо/композицию" | |
| Multi-reference "soup" | Overloaded prompt + conflicting refs | Simplify text; use "image 1 / image 2" indexing | |
| Wrong resolution | Input not multiple of 16 | Pre-resize input to ×16, ≤4MP |
Iteration workflow
- Write scene in prose (one paragraph)
- Create a controlled candidate using parameters supported by the selected
checkpoint or API, and record them with the output.
- Fix the seed when the runner supports it and record the model revision,
Diffusers/PyTorch version, hardware, dtype and scheduler. A seed makes a controlled comparison within that recorded stack; it is not a cross-version or cross-hardware reproducibility guarantee. Pick 1–2 directions against the task's actual criteria.
- Refine prompt: add specifics, quote text, remove filler adjectives.
- Edit iterations: one change per step, state what must be preserved, and keep
only variants that pass the requested fidelity checks.
Quality metrics (for A/B testing)
- CLIPScore — prompt↔image alignment (reference-free)
- FID — realism vs real image distribution
- Human rating — separate scales for: (a) prompt adherence, (b) quality/realism, (c) text readability, (d) preservation of unchanged parts in edit
Official sources
- Model page: https://bfl.ai/models/flux-2-klein
- Prompting guide: https://docs.bfl.ml/guides/prompting_guide_flux2_klein
- Image editing guide: https://docs.bfl.ai/flux_2/flux2_image_editing
- API reference 4B: https://docs.bfl.ai/api-reference/models/generate-or-edit-an-image-with-flux2-%5Bklein-4b%5D
- HF model card 4B: https://huggingface.co/black-forest-labs/FLUX.2-klein-4B
- HF model card 9B: https://huggingface.co/black-forest-labs/FLUX.2-klein-9B
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/ai-ml/flux2-klein-prompting/SKILL.md
Popularity
- Repository stars
- 150
- Repository forks
- 24
- 7-day trend score
- 25
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/anastasiyaw/codex-claude-code-config/flux2-klein-prompting)