Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Build Flux txt2img workflows — Flux.1 Dev (SRPO), Flux 2 Klein 9B, Turbo LoRAs, FluxGuidance, and DualCLIPLoader patterns
.claude/skills/artokun-flux-txt2img/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 97% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 120% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 97% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 124% | 0% |
| case-11 | ✗→✓ | ▲ Improved | 94% | 0% |
Flux is a guidance-distilled diffusion model family from Black Forest Labs. It uses a separate FluxGuidance node instead of KSampler CFG (which must always be 1.0). Three variants are available locally:
flux2-vae.safetensors. Fast 4-step generation.| Component | Node | Model | Notes | |-----------|------|-------|-------| | UNET | UNETLoader | flux.1-dev-SRPO-BFL-bf16.safetensors | 22.7GB, BF16 only — FP8 produces broken results | | CLIP | DualCLIPLoader (type=flux) | clip_name1: t5xxl_fp8_e4m3fn.safetensors, clip_name2: clip_l.safetensors | T5XXL (4.7GB) + CLIP-L (235MB) | | VAE | VAELoader | ae.safetensors | Standard Flux VAE (320MB). Z-Image uses the same VAE architecture but different weights — its VAE is a separate file (z-image-ae.safetensors), not this one |
| Component | Node | Model | Notes | |-----------|------|-------|-------| | UNET | UNETLoader | bigLove_klein1.safetensors | 17.3GB, Klein 9B variant | | CLIP | CLIPLoader (type=flux2) | qwen_3_8b_fp8mixed.safetensors | Qwen3-8B in text_encoders/ (8.3GB). Use flux2, NOT flux — both exist in the enum and flux fails at the sampler | | VAE | VAELoader | flux2-vae.safetensors | Flux 2 specific VAE (321MB) |
Klein 9B vs Flux.1 Dev: Klein uses Qwen3-8B text encoder (not T5XXL + CLIP-L). It has a different VAE (flux2-vae.safetensors). 9B distilled runs in 4 steps; 9B base needs ~50 steps at CFG 5.0. Fits in ~20GB VRAM with FP8.
| Component | Node | Model | Notes | |-----------|------|-------|-------| | LoRA | LoraLoaderModelOnly | flux2-turbo-lora.safetensors | 2.6GB, strength 1.0 | | Alt LoRA | LoraLoaderModelOnly | Flux2TurboComfyv2.safetensors | Community variant, same size |
Provides separate prompt fields for each text encoder:
json{ "class_type": "CLIPTextEncodeFlux", "inputs": { "clip": ["<dual_clip>", 0], "clip_l": "short prompt for CLIP-L", "t5xxl": "detailed description for T5XXL", "guidance": 3.5 } }
clip_l captures key semantic features. t5xxl expands and refines descriptions. For simple use, put the same prompt in both fields. Guidance is built into this node — no separate FluxGuidance needed.
If using standard CLIPTextEncode instead of CLIPTextEncodeFlux, apply guidance separately:
json{ "class_type": "FluxGuidance", "inputs": { "conditioning": ["<clip_text_encode>", 0], "guidance": 3.5 } }
| Scenario | Guidance | Notes | |----------|----------|-------| | Short prompts | 3.5–4.0 | Tighter prompt adherence | | Long/complex prompts | 1.0–1.5 | More creative freedom | | Realism | 2.5 | Less glossy skin, richer detail | | Standard | 3.5 | Default for most use cases |
Flux does NOT support traditional negative prompts (guidance-distilled, CFG=1.0). Use ConditioningZeroOut:
json{ "class_type": "ConditioningZeroOut", "inputs": { "conditioning": ["<positive_cond>", 0] } }
Or simply use an empty CLIPTextEncode for the negative input.
| Parameter | Standard | Notes | |-----------|----------|-------| | steps | 20 | Range: 20–28 | | cfg | 1.0 | Always 1.0 — guidance is via FluxGuidance | | sampler_name | ipndm | Author-recommended for SRPO | | scheduler | beta | Author-recommended for SRPO | | guidance | 3.5 | Via CLIPTextEncodeFlux or FluxGuidance | | denoise | 1.0 | |
SRPO note: The ipndm/beta combo is specifically recommended by the SRPO author. Standard Flux settings (euler/simple) also work but ipndm/beta gives better results with this fine-tune.
| Parameter | Value | Notes | |-----------|-------|-------| | steps | 4 | Distilled model, 4 steps is optimal | | cfg | 1.0 | Always 1.0 | | sampler_name | euler | | | scheduler | simple | | | denoise | 1.0 | |
| Parameter | Value | Notes | |-----------|-------|-------| | steps | 50 | Full quality | | cfg | 5.0 | Higher CFG for base model | | sampler_name | euler | | | scheduler | simple | |
| Parameter | Value | Notes | |-----------|-------|-------| | steps | 4 | Turbo-distilled | | cfg | 1.0 | | | sampler_name | euler | | | scheduler | simple | | | lora_strength | 1.0 | |
| Aspect | Resolution | Megapixels | |--------|-----------|------------| | Square | 1024x1024 | 1.0MP | | Portrait 3:4 | 896x1152 | 1.0MP | | Landscape 4:3 | 1152x896 | 1.0MP | | Landscape 16:9 | 1344x768 | 1.0MP | | Portrait 9:16 | 768x1344 | 1.0MP |
Flux operates at ~1 megapixel natively. Dimensions should be multiples of 8.
Natural language descriptions. No quality tags needed (unlike SDXL/Illustrious). Detailed, descriptive prompts work best.
Good: "A young woman with auburn hair sits at a sunlit cafe in Paris, wearing a cream linen blazer, soft bokeh background, shot on Sony A7III 85mm f/1.4"
Bad: "masterpiece, best quality, 1girl, cafe, paris"json{ "1": { "class_type": "UNETLoader", "inputs": { "unet_name": "flux.1-dev-SRPO-BFL-bf16.safetensors", "weight_dtype": "default" }}, "2": { "class_type": "DualCLIPLoader", "inputs": { "clip_name1": "t5xxl_fp8_e4m3fn.safetensors", "clip_name2": "clip_l.safetensors", "type": "flux" }}, "3": { "class_type": "VAELoader", "inputs": { "vae_name": "ae.safetensors" }}, "4": { "class_type": "CLIPTextEncodeFlux", "inputs": { "clip": ["2", 0], "clip_l": "<short prompt>", "t5xxl": "<detailed prompt>", "guidance": 3.5 }}, "5": { "class_type": "ConditioningZeroOut", "inputs": { "conditioning": ["4", 0] }}, "6": { "class_type": "EmptyLatentImage", "inputs": { "width": 896, "height": 1152, "batch_size": 1 }}, "7": { "class_type": "KSampler", "inputs": { "model": ["1", 0], "positive": ["4", 0], "negative": ["5", 0], "latent_image": ["6", 0], "seed": 42, "steps": 20, "cfg": 1, "sampler_name": "ipndm", "scheduler": "beta", "denoise": 1 }}, "8": { "class_type": "VAEDecode", "inputs": { "samples": ["7", 0], "vae": ["3", 0] }}, "9": { "class_type": "SaveImage", "inputs": { "images": ["8", 0], "filename_prefix": "flux_srpo" }} }
json{ "1": { "class_type": "UNETLoader", "inputs": { "unet_name": "bigLove_klein1.safetensors", "weight_dtype": "default" }}, "2": { "class_type": "CLIPLoader", "inputs": { "clip_name": "qwen_3_8b_fp8mixed.safetensors", "type": "flux2" }}, "3": { "class_type": "VAELoader", "inputs": { "vae_name": "flux2-vae.safetensors" }}, "4": { "class_type": "CLIPTextEncode", "inputs": { "clip": ["2", 0], "text": "<prompt>" }}, "5": { "class_type": "ConditioningZeroOut", "inputs": { "conditioning": ["4", 0] }}, "6": { "class_type": "EmptyFlux2LatentImage", "inputs": { "width": 1024, "height": 1024, "batch_size": 1 }}, "7": { "class_type": "KSampler", "inputs": { "model": ["1", 0], "positive": ["4", 0], "negative": ["5", 0], "latent_image": ["6", 0], "seed": 42, "steps": 4, "cfg": 1, "sampler_name": "euler", "scheduler": "simple", "denoise": 1 }}, "8": { "class_type": "VAEDecode", "inputs": { "samples": ["7", 0], "vae": ["3", 0] }}, "9": { "class_type": "SaveImage", "inputs": { "images": ["8", 0], "filename_prefix": "flux_klein" }} }
Klein note: Uses single CLIPLoader (not DualCLIPLoader) with type: "flux2" and the Qwen3-8B text encoder from text_encoders/. The CLIP loader path resolves from models/text_encoders/.
Two Flux-2-specific gotchas (both fail at the KSampler, not at the loader, so the error points at the wrong node):
type must be flux2, not flux. Both values exist in the CLIPLoader enum, so flux loads without complaint and then dies during sampling.EmptyFlux2LatentImage, not EmptyLatentImage — Flux 2 uses a different latent channel count.qwen_3_8b* from Comfy-Org/vae-text-encorder-for-flux-klein-9b). The similarly-named qwen_3_4b ships in the klein-4b repo and is for the 4B model. Mismatching them raises mat1 and mat2 shapes cannot be multiplied (512x7680 and 12288x4096) — 7680 = 2560x3 (4B hidden size) vs 12288 = 4096x3 (8B) — which reads as a confusing CLIP error rather than a wrong-file error.json{ "1": { "class_type": "UNETLoader", "inputs": { "unet_name": "flux.1-dev-SRPO-BFL-bf16.safetensors", "weight_dtype": "default" }}, "2": { "class_type": "LoraLoaderModelOnly", "inputs": { "model": ["1", 0], "lora_name": "flux2-turbo-lora.safetensors", "strength_model": 1.0 }}, "3": { "class_type": "DualCLIPLoader", "inputs": { "clip_name1": "t5xxl_fp8_e4m3fn.safetensors", "clip_name2": "clip_l.safetensors", "type": "flux" }}, "4": { "class_type": "VAELoader", "inputs": { "vae_name": "ae.safetensors" }}, "5": { "class_type": "CLIPTextEncodeFlux", "inputs": { "clip": ["3", 0], "clip_l": "<short prompt>", "t5xxl": "<detailed prompt>", "guidance": 3.5 }}, "6": { "class_type": "ConditioningZeroOut", "inputs": { "conditioning": ["5", 0] }}, "7": { "class_type": "EmptyLatentImage", "inputs": { "width": 1024, "height": 1024, "batch_size": 1 }}, "8": { "class_type": "KSampler", "inputs": { "model": ["2", 0], "positive": ["5", 0], "negative": ["6", 0], "latent_image": ["7", 0], "seed": 42, "steps": 4, "cfg": 1, "sampler_name": "euler", "scheduler": "simple", "denoise": 1 }}, "9": { "class_type": "VAEDecode", "inputs": { "samples": ["8", 0], "vae": ["4", 0] }}, "10": { "class_type": "SaveImage", "inputs": { "images": ["9", 0], "filename_prefix": "flux_turbo" }} }
Apply Flux LoRAs with LoraLoaderModelOnly between UNET and KSampler:
json{ "class_type": "LoraLoaderModelOnly", "inputs": { "model": ["<unet_or_previous_lora>", 0], "lora_name": "<lora_file>.safetensors", "strength_model": 1.0 } }
Klein 9B LoRAs go in loras/Flux.2 Klein 9B/ subfolder:
klein_slider_detail.safetensors — Detail slider LoRA| Model | VRAM | Notes | |-------|------|-------| | SRPO BF16 + DualCLIP | ~24GB | Fills RTX 4090 exactly. Must use BF16 — FP8 is broken for SRPO | | Klein 9B FP8 + Qwen3-8B | ~20GB | Fits comfortably on 4090 | | SRPO + Turbo LoRA | ~24GB | Same as SRPO base |
clear_vram before switching to Flux from another model familyCLIPTextEncodeFlux or FluxGuidance| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 15,829 | 10,661 | -33% | 1 | 1 | 0% | 3,374 | 6,654 | +97% | 0 | 0 | — |
case-02 | fail→pass | 13,517 | 10,064 | -26% | 1 | 1 | 0% | 2,856 | 6,292 | +120% | 0 | 0 | — |
case-03 | fail→pass | 16,409 | 9,263 | -44% | 1 | 1 | 0% | 3,166 | 6,236 | +97% | 0 | 0 | — |
case-04 | fail→fail | 16,793 | 20,735 | +23% | 1 | 1 | 0% | 3,597 | 8,422 | +134% | 0 | 0 | — |
case-05 | pass→pass | 18,799 | 16,448 | -13% | 1 | 1 | 0% | 3,744 | 7,484 | +100% | 0 | 0 | — |
case-06 | pass→pass | 14,916 | 16,385 | +10% | 1 | 1 | 0% | 2,629 | 7,497 | +185% | 0 | 0 | — |
case-07 | fail→pass | 12,989 | 4,271 | -67% | 1 | 1 | 0% | 2,228 | 4,985 | +124% | 0 | 0 | — |
case-08 | pass→pass | 17,447 | 12,977 | -26% | 1 | 1 | 0% | 2,626 | 6,076 | +131% | 0 | 0 | — |
case-09 | fail→fail | 14,442 | 5,089 | -65% | 1 | 1 | 0% | 2,099 | 5,025 | +139% | 0 | 0 | — |
case-10 | pass→pass | 6,906 | 3,243 | -53% | 1 | 1 | 0% | 1,044 | 4,768 | +357% | 0 | 0 | — |
case-11 | fail→pass | 14,898 | 2,758 | -81% | 1 | 1 | 0% | 2,435 | 4,725 | +94% | 0 | 0 | — |
case-12 | fail→pass | 15,010 | 5,035 | -66% | 1 | 1 | 0% | 2,441 | 5,282 | +116% | 0 | 0 | — |
case-13 | fail→pass | 11,486 | 2,009 | -83% | 1 | 1 | 0% | 1,823 | 4,565 | +150% | 0 | 0 | — |
case-14 | pass→pass | 12,273 | 4,235 | -65% | 1 | 1 | 0% | 2,206 | 4,921 | +123% | 0 | 0 | — |
case-15 | fail→pass | 7,286 | 2,585 | -65% | 1 | 1 | 0% | 1,546 | 4,705 | +204% | 0 | 0 | — |
case-16 | pass→pass | 4,352 | 2,396 | -45% | 1 | 1 | 0% | 704 | 4,677 | +564% | 0 | 0 | — |
case-17 | fail→pass | 10,645 | 2,366 | -78% | 1 | 1 | 0% | 1,451 | 4,605 | +217% | 0 | 0 | — |
case-18 | fail→pass | 10,022 | 2,508 | -75% | 1 | 1 | 0% | 1,685 | 4,718 | +180% | 0 | 0 | — |
case-19 | pass→pass | 7,823 | 5,032 | -36% | 1 | 1 | 0% | 1,357 | 5,116 | +277% | 0 | 0 | — |
case-20 | fail→pass | 8,305 | 2,120 | -74% | 1 | 1 | 0% | 1,278 | 4,614 | +261% | 0 | 0 | — |
case-21 | fail→pass | 12,520 | 7,153 | -43% | 1 | 1 | 0% | 1,915 | 5,237 | +173% | 0 | 0 | — |
case-22 | fail→pass | 19,370 | 12,029 | -38% | 1 | 1 | 0% | 3,160 | 6,385 | +102% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +59 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.