Phase 2: Image Generation · 50 min · Python · fal.ai API · Hugging Face Diffusers
The FLUX Model Family
FLUX.1 Pro for quality, FLUX.1 Dev for open-weights flexibility, FLUX.1 Schnell for speed — knowing which to use when is image generation engineering.
What you will learn
- Generate images with FLUX.1 Pro (API, highest quality), FLUX.1 Dev (open weights, non-commercial), and FLUX.1 Schnell (open weights, 1-4 step, Apache 2.0)
- Choose the right FLUX variant for speed, quality, or cost
- Understand FLUX.2 improvements: better prompt adherence and text rendering
- Compare FLUX vs SDXL: FLUX for quality and speed, SDXL for ecosystem (LoRAs, ControlNets)
Objective
Produce and compare image candidates against an explicit creative brief. In the paired studio lab, generate the same prompt with FLUX.1 Schnell (via fal.ai), FLUX.1 Dev (via Hugging Face), and FLUX.1 Pro (via fal.ai). Measure generation time, cost, and compare output quality. Write a decision guide for when to use each variant.
The Problem
A team uses FLUX.1 Pro for every image generation. At 10,000 images/day, they're spending $500/day on API calls ($0.05/image). They could use FLUX.1 Schnell at $0.003/image ($30/day) for 90% of their use cases and reserve Pro for hero images. But they don't know the difference between the variants, so they overpay by 16x.
FLUX model selection is a standard interview question because it tests whether you understand the speed-quality-cost trade-off — the core engineering decision in image generation.
What you'll build
Generate the same prompt with FLUX.1 Schnell, FLUX.1 Dev, and FLUX.1 Pro. Measure generation time, cost, and compare output quality. Write a decision guide for when to use each variant.
The Concept
The FLUX model family
FLUX.1 is developed by Black Forest Labs (BFL), founded by the original Stable Diffusion creators. There are three main variants:
FLUX.1 Schnell
The speed variant — distilled for 1-4 step generation.
| Property | Value |
|---|
| Architecture | DiT (Diffusion Transformer) |
| Steps | 1-4 (distilled) |
| Guidance | None needed (guidance_scale=0.0) |
| Speed | ~2 seconds (1024x1024) |
| Cost (fal.ai) | $0.003/image |
| License | Apache 2.0 (commercial use) |
| Weights | Open on Hugging Face |
| Best for | Bulk generation, rapid prototyping, pipelines |
# FLUX Schnell via fal.ai
import fal_client
result = fal_client.subscribe("fal-ai/flux/schnell", arguments={
"prompt": "a cat on a windowsill",
"num_inference_steps": 4,
"guidance_scale": 0.0,
"image_size": {"width": 1024, "height": 1024},
})
FLUX.1 Dev
The quality variant — open weights for self-hosting.
| Property | Value |
|---|
| Architecture | DiT |
| Steps | 20-50 (standard diffusion) |
| Guidance | 3.5 (CFG needed) |
| Speed | ~8 seconds (1024x1024) |
| Cost (fal.ai) | $0.025/image |
| License | Non-commercial (research only) |
| Weights | Open on Hugging Face |
| Best for | Research, self-hosting experiments, quality comparison |
FLUX.1 Pro
The production quality variant — API only.
| Property | Value |
|---|
| Architecture | DiT (larger than Dev) |
| Steps | 20-50 |
| Guidance | 3.5 |
| Speed | ~12 seconds (1024x1024) |
| Cost (fal.ai) | $0.05/image |
| License | Commercial (via API) |
| Weights | Closed (API only) |
| Best for | Hero images, print quality, final production output |
FLUX.2
The next generation (announced 2026):
- Better prompt adherence (especially long, complex prompts)
- Improved text rendering in images
- Better human anatomy (fewer extra fingers)
- Faster distilled variant
You need to generate 5,000 product images/day for an e-commerce site. Which FLUX variant should you use?
FLUX.1 Schnell is the right choice: $0.003/image × 5000 = $15/day (vs $250/day for Pro), 4 steps (~2s/image), and Apache 2.0 license allows commercial use. Product images don't need Pro-level quality — Schnell is more than sufficient. Reserve Pro for hero/marketing images where quality matters more than cost.
Decision framework
Is this a hero/marketing image where quality is critical?
→ YES: FLUX.1 Pro ($0.05, ~12s)
→ NO: Do you need commercial use?
→ YES: Is volume > 667 images/day?
→ YES: Self-host FLUX.1 Schnell (Apache 2.0, ~$0.01/image on H100)
→ NO: FLUX.1 Schnell via API ($0.003/image)
→ NO (research/non-commercial): FLUX.1 Dev (open weights, higher quality)
| Use Case | Variant | Cost/Image | Why |
|---|
| Bulk product images (5000/day) | Schnell | $0.003 | Speed + cost + commercial license |
| Hero marketing image | Pro | $0.05 | Maximum quality, low volume |
| Research / experimentation | Dev | Free (self-hosted) | Open weights, non-commercial |
| Real-time avatar | Schnell | $0.003 | 4 steps = ~2s latency |
| Print advertising | Pro | $0.05 | Print requires maximum resolution |
| Pipeline prototyping | Schnell | $0.003 | Fast iteration, then switch to Pro for final |
FLUX vs SDXL: when to use each
| Factor | FLUX | SDXL |
|---|
| Base quality | Higher | High (with LoRAs) |
| Speed | Faster (Schnell: 4 steps) | Slower (20-30 steps) |
| Text rendering | Good (Pro: excellent) | Poor |
| Prompt adherence | Better | Good |
| LoRA ecosystem | Growing | Massive (Civitai) |
| ControlNet | Emerging | Mature |
| License | Apache 2.0 (Schnell) | Open RAIL-M |
| VRAM | ~12GB (fp16) | ~8GB (fp16) |
Use FLUX when: quality and speed matter more than custom styles Use SDXL when: you need specific LoRAs, ControlNet, or lower VRAM
This lesson is free
You've read the first 3 sections. The rest covers Build, Check Yourself, Key Terms & Next. A free account opens all of it, with its practice questions and its lab. No card.
Create a free account — the opening phases of 29 of 35 courses, and the first lesson of every phase, are free, no credit card.
Browse all courses · View pricing · DeVenture Academy