[Integrations](https://spiral.ai/integrations) › [Codex](https://spiral.ai/integrations/codex) › [FLUX.2 Klein 9B Base](https://spiral.ai/integrations/codex/flux-2-klein-9b-base)

# How to Use FLUX.2 Klein 9B Base in Codex

FLUX.2 Klein 9B Base turns written scenes into images with more visual diversity than distilled Klein models. Unlike FLUX.2 Klein 9B Base LoRA, it works without custom LoRA adapters.

|  |  |
| --- | --- |
| Model | FLUX.2 Klein 9B Base |
| Available through | fal |
| Category | Image |
| Price | $0.011297 per megapixel. `image_size` presets count as 1 MP; custom sizes round up to whole megapixels. Billed on `num_images`, default 1. |
| Returns | image |
| Runs | In the background |
| Setup | About 2 minutes, no API key |

## Prompts to try with FLUX.2 Klein 9B Base in Codex

- Read the homepage copy and use FLUX.2 Klein 9B Base to generate a 1024 by 1024 editorial photograph of a bicycle mechanic adjusting a wheel beside a workshop window. Place the mechanic on the right, with open wall space on the left for the page headline.
- Use FLUX.2 Klein 9B Base to create a 1024 by 1024 image for the coffee subscription page: an overhead photograph of roasted beans, a metal scoop, and a folded linen cloth on a wooden table. Match the scene's mood to the page copy.
- Use FLUX.2 Klein 9B Base to create a 1024 by 1024 product concept image for the outdoor shop: a cobalt blue enamel mug in color #0047AB on a weathered camp table, photographed at eye level in soft morning light.
- Use FLUX.2 Klein 9B Base to generate a 1024 by 1024 poster concept for the community garden page. Show a hand holding a seedling, with the exact headline 'GROW TOGETHER' across the top in large dark lettering; flag any spelling errors for review.
- Generate a product photo with FLUX.2 Klein 9B Base: a matte black water bottle on wet slate, soft morning light, 1:1. Tell me the price first. Save the result in ./assets.

## How to set up FLUX.2 Klein 9B Base in Codex

Pick the way that suits you. Each takes about two minutes.

### Use Spiral's MCP server

1. **Add the hosted server**

```bash
codex mcp add spiral --url https://api.spiral.ai/mcp
```

2. **Sign in**: Codex opens the browser: sign in to Spiral and click Authorize. No API key. `codex mcp list` then shows Spiral.

```bash
codex mcp login spiral
```

### Use the Spiral skill

1. **Send Codex this message**: Your agent reads Spiral's skill and sets itself up.

```
set up https://spiral.ai/SKILL.md
```

2. **Sign in or paste a key**: Approve Spiral in the browser, or give the agent a key from the console.

### Use the Spiral CLI

1. **Install and sign in**: Installs the Spiral CLI, signs you in and adds its skill to your coding agents.

```bash
npx -y spiral-cli@latest init
```

### Call the Spiral API

1. **Create an API key**: In the console, under API keys.

2. **Run FLUX.2 Klein 9B Base**: One request; the result comes back by polling or a webhook.

```bash
curl https://api.spiral.ai/v1/runs \
  -H "Authorization: Bearer $SPIRAL_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "provider": "fal",
    "model": "fal-ai/flux-2/klein/9b/base",
    "input": {
      "prompt": "A cyberpunk samurai standing in neon-lit Tokyo street at night, rain-soaked pavement reflecting holographic advertisements in pink and blue, steam rising from…"
    }
  }'
```

Then paste one of the prompts above: Codex finds FLUX.2 Klein 9B Base on Spiral, shows the price and runs it.

Setup guide in the docs: https://spiral.ai/docs/quickstarts/codex

## FLUX.2 Klein 9B Base tools and prices

- [FLUX.2 \[klein\] 9B Base · Text to Image](https://spiral.ai/tools/fal/fal-ai/flux-2/klein/9b/base) (fal): $0.011297 per megapixel. `image_size` presets count as 1 MP; custom sizes round up to whole megapixels. Billed on `num_images`, default 1.

## Settings you can ask for

| Setting | Allowed values | Default | Description |
| --- | --- | --- | --- |
| negative_prompt |  |  | Negative prompt for classifier-free guidance. Describes what to avoid in the image. |
| guidance_scale | 0 to 20 | 5 | Guidance scale for classifier-free guidance. |
| seed |  | — | The seed to use for the generation. If not provided, a random seed will be used. |
| num_inference_steps | 4 to 50 | 28 | The number of inference steps to perform. |
| image_size |  | landscape_4_3 | The size of the image to generate. |
| num_images | 1 to 4 | 1 | The number of images to generate. |

## What can you do with FLUX.2 Klein 9B Base in Codex?

Create original artwork from a project's written content and design requirements. A coding agent can turn those requirements into detailed scene prompts and place the selected images in the project.

### Website artwork from a written brief

Generate a photographic or illustrated scene with the subject placed away from the area reserved for a headline. Explore several compositions before choosing artwork for the page.

### Product concept images

Describe a proposed product's shape, materials, color, and studio lighting. Use the images to discuss a design direction before arranging a real shoot.

### Editorial illustrations

Turn an article's central idea into a specific visual scene. Name the medium, focal subject, and mood so the image serves the story.

### Photography mood boards

Explore a planned shoot through descriptions of lenses, lighting, framing, and textures. Compare close-ups, environmental scenes, and different lighting directions.

### Poster concepts

Draft a poster around one short headline and a clearly described illustration. Specify where the lettering belongs, then proofread the generated text.

### Color direction studies

Compare product or scene concepts by assigning hex colors to named surfaces. Review the rendered colors before approving a direction.

### Campaign concept exploration

Generate alternative scenes from the same campaign brief, changing the setting or composition. Use the results to select a visual direction for further production.

## Overview

- [fal](https://spiral.ai/providers/fal)
- [All Codex guides](https://spiral.ai/integrations/codex)

## FLUX.2 Klein 9B Base in other agents

- [Amp](https://spiral.ai/integrations/amp/flux-2-klein-9b-base)
- [ChatGPT](https://spiral.ai/integrations/chatgpt/flux-2-klein-9b-base)
- [Claude](https://spiral.ai/integrations/claude-desktop/flux-2-klein-9b-base)
- [Claude Code](https://spiral.ai/integrations/claude-code/flux-2-klein-9b-base)
- [Cline](https://spiral.ai/integrations/cline/flux-2-klein-9b-base)
- [Cursor](https://spiral.ai/integrations/cursor/flux-2-klein-9b-base)
- [Devin](https://spiral.ai/integrations/devin/flux-2-klein-9b-base)
- [dots](https://spiral.ai/integrations/dots/flux-2-klein-9b-base)
- [Factory Droid](https://spiral.ai/integrations/factory-droid/flux-2-klein-9b-base)
- [Gemini](https://spiral.ai/integrations/gemini/flux-2-klein-9b-base)
- [Gemini CLI](https://spiral.ai/integrations/gemini-cli/flux-2-klein-9b-base)
- [Google Antigravity](https://spiral.ai/integrations/antigravity/flux-2-klein-9b-base)
- [goose](https://spiral.ai/integrations/goose/flux-2-klein-9b-base)
- [Grok](https://spiral.ai/integrations/grok/flux-2-klein-9b-base)
- [Grok Build](https://spiral.ai/integrations/grok-build/flux-2-klein-9b-base)
- [Hermes](https://spiral.ai/integrations/hermes/flux-2-klein-9b-base)
- [Instinct](https://spiral.ai/integrations/instinct/flux-2-klein-9b-base)
- [Manus](https://spiral.ai/integrations/manus/flux-2-klein-9b-base)
- [Muse](https://spiral.ai/integrations/muse/flux-2-klein-9b-base)
- [Muse Code](https://spiral.ai/integrations/muse-code/flux-2-klein-9b-base)
- [n8n](https://spiral.ai/integrations/n8n/flux-2-klein-9b-base)
- [Notion](https://spiral.ai/integrations/notion/flux-2-klein-9b-base)
- [OpenClaw](https://spiral.ai/integrations/openclaw/flux-2-klein-9b-base)
- [opencode](https://spiral.ai/integrations/opencode/flux-2-klein-9b-base)
- [Perplexity](https://spiral.ai/integrations/perplexity/flux-2-klein-9b-base)
- [Raycast](https://spiral.ai/integrations/raycast/flux-2-klein-9b-base)
- [VS Code](https://spiral.ai/integrations/vscode/flux-2-klein-9b-base)
- [Windsurf](https://spiral.ai/integrations/windsurf/flux-2-klein-9b-base)
- [Zapier](https://spiral.ai/integrations/zapier/flux-2-klein-9b-base)

## More Codex guides

- [FLUX.2 Klein 9B](https://spiral.ai/integrations/codex/flux-2-klein-9b)
- [FLUX.2 Klein 9B Base LoRA](https://spiral.ai/integrations/codex/flux-2-klein-9b-base-lora)
- [FLUX.2 Klein 4B LoRA](https://spiral.ai/integrations/codex/flux-2-klein-4b-lora)
- [FLUX.2 Klein 9B LoRA](https://spiral.ai/integrations/codex/flux-2-klein-9b-lora)
- [FLUX.2 Klein 4B Base LoRA](https://spiral.ai/integrations/codex/flux-2-klein-4b-base-lora)
- [FLUX.2 LoRA](https://spiral.ai/integrations/codex/flux-2-lora)

## Questions about FLUX.2 Klein 9B Base in Codex

**Can Codex use FLUX.2 Klein 9B Base?**

Yes. Add Spiral to Codex as an MCP server, and Codex can find and run FLUX.2 Klein 9B Base like any built-in tool.

**How much does FLUX.2 Klein 9B Base cost in Codex?**

$0.011297 per megapixel. `image_size` presets count as 1 MP; custom sizes round up to whole megapixels. Billed on `num_images`, default 1. You pay from your Spiral balance as you go, with no subscription, and a failed run is not charged. Your Codex plan is separate.

**Do I need a fal account to use FLUX.2 Klein 9B Base in Codex?**

No. Spiral runs FLUX.2 Klein 9B Base on its own fal account. You sign in to Spiral once and never paste a key.

**How long does it take to set up FLUX.2 Klein 9B Base in Codex?**

About two minutes: add the hosted server, then sign in.

**Does Codex wait while FLUX.2 Klein 9B Base runs?**

FLUX.2 Klein 9B Base runs in the background. Codex starts the run, checks on it and gives you the image when it's ready.

**What is FLUX.2 Klein 9B Base good at?**

Use it to explore different visual directions from a written brief, including photographic scenes and illustrated concepts. Black Forest Labs reports greater output diversity than with distilled Klein models.

**How is Base different from distilled Klein?**

Base keeps the undistilled model for creative exploration and customization. Distilled Klein is the speed-focused choice; Base favors flexibility and visual diversity.

**How should I write a prompt?**

Write a short scene description that names the subject, setting, composition, and lighting. Klein does not automatically expand a vague prompt, so include the details that should appear in the image.

**Can I trust text inside the image?**

Check every word before using it. Lettering can be inaccurate or distorted, so treat text-heavy output as a draft that needs review.

**What resolution and settings should I test first?**

A useful starting experiment is the maker's example: 1024 by 1024 pixels, 50 inference steps, and guidance of 4.0. Treat that as a baseline to compare with your results, rather than a guarantee of the best image.

