> ## Documentation Index
> Fetch the complete documentation index at: https://runcrate.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# FLUX.2 Image Generation API

> Generate up to 4MP images with FLUX.2 Pro, Max, and Dev. Multi-reference generation, higher detail, and improved prompt adherence over FLUX.1.

export const RuncrateStyles = () => {
  if (typeof document !== 'undefined' && !document.getElementById('runcrate-overrides')) {
    const s = document.createElement('style');
    s.id = 'runcrate-overrides';
    s.textContent = `
      /* Match Runcrate's rounding scale (--radius: 0.75rem) */
      .rounded-sm { border-radius: 0.5rem !important; }   /* 8px */
      .rounded-md { border-radius: 0.625rem !important; } /* 10px */
      .rounded-lg { border-radius: 0.75rem !important; }  /* 12px */
      .rounded-l-sm { border-top-left-radius: 0.5rem !important; border-bottom-left-radius: 0.5rem !important; }
      .rounded-r-sm { border-top-right-radius: 0.5rem !important; border-bottom-right-radius: 0.5rem !important; }
      .rounded-l-md { border-top-left-radius: 0.625rem !important; border-bottom-left-radius: 0.625rem !important; }
      .rounded-r-md { border-top-right-radius: 0.625rem !important; border-bottom-right-radius: 0.625rem !important; }
      .rounded-l-lg { border-top-left-radius: 0.75rem !important; border-bottom-left-radius: 0.75rem !important; }
      .rounded-r-lg { border-top-right-radius: 0.75rem !important; border-bottom-right-radius: 0.75rem !important; }

      /* Cards: never pure white in light mode */
      .card { background-color: #fcfcfc !important; border-radius: 0.75rem !important; }
      html.dark .card { background-color: #141414 !important; }

      /* Docs hero box */
      .rc-hero { background-color: #fcfcfc; border: 1px solid #e0e0e0; }
      html.dark .rc-hero { background-color: #141414; border-color: #242424; }
      html.dark .rc-hero h1 { color: #f5f5f5; }

      /* Runcrate scrollbar — thin, transparent track, hide-until-hover thumb */
      ::-webkit-scrollbar { width: 6px; height: 6px; background-color: transparent; }
      ::-webkit-scrollbar-track { background-color: transparent; }
      ::-webkit-scrollbar-thumb { background-color: rgba(155, 155, 155, 0.5); border-radius: 10px; transition: opacity 0.3s ease; opacity: 0; }
      ::-webkit-scrollbar-thumb:hover { background-color: rgba(155, 155, 155, 0.7); }
      *:hover::-webkit-scrollbar-thumb,
      *:focus::-webkit-scrollbar-thumb,
      *:active::-webkit-scrollbar-thumb { opacity: 1; }
      * { scrollbar-width: thin; scrollbar-color: rgba(155, 155, 155, 0.5) transparent; }
    `;
    document.head.appendChild(s);
  }
  return null;
};

<RuncrateStyles />

FLUX.2 is Black Forest Labs' next-generation image model. Up to 4-megapixel output, multi-reference image support, better text rendering, and tighter prompt adherence.

## Available models

| Model          | Resolution | Speed  | Best for                     |
| -------------- | ---------- | ------ | ---------------------------- |
| **FLUX.2 Pro** | Up to 4MP  | Medium | Production assets, marketing |
| **FLUX.2 Max** | Up to 4MP  | Slower | Maximum quality, hero images |
| **FLUX.2 Dev** | Up to 4MP  | Fast   | Prototyping, open weights    |

***

## Basic generation

<CodeGroup>
  ```python Python theme={"theme":"github-dark"}
  from runcrate import Runcrate

  client = Runcrate(api_key="rc_live_YOUR_API_KEY")
  image = client.models.generate_image(
      model="black-forest-labs/FLUX.2-pro",
      prompt="A minimalist desk setup with mechanical keyboard, ultrawide monitor, warm desk lamp, shot from above",
      aspect_ratio="16:9",
  )
  image.data[0].save("desk-setup.png")
  ```

  ```typescript TypeScript theme={"theme":"github-dark"}
  import Runcrate from '@runcrate/sdk';

  const rc = new Runcrate({ apiKey: 'rc_live_YOUR_API_KEY' });
  const image = await rc.models.generateImage({
    model: 'black-forest-labs/FLUX.2-pro',
    prompt: 'A minimalist desk setup with mechanical keyboard, ultrawide monitor, warm desk lamp',
    aspectRatio: '16:9',
  });
  await image.save('desk-setup.png');
  ```

  ```typescript Vercel AI SDK theme={"theme":"github-dark"}
  import { runcrate } from '@runcrate/ai';
  import { generateImage } from 'ai';

  const { image } = await generateImage({
    model: runcrate.imageModel('black-forest-labs/FLUX.2-pro'),
    prompt: 'Minimalist desk setup with mechanical keyboard, ultrawide monitor',
    size: '1792x1024',
  });
  ```
</CodeGroup>

***

## High-resolution 4MP

```python theme={"theme":"github-dark"}
from runcrate import Runcrate

client = Runcrate(api_key="rc_live_YOUR_API_KEY")
image = client.models.generate_image(
    model="black-forest-labs/FLUX.2-max",
    prompt="Macro photograph of morning dew on a spider web, bokeh background, golden hour",
    width=2048, height=2048,
)
image.data[0].save("dew-macro-4mp.png")
```

***

## Multi-reference generation

Pass up to 8 reference images to guide style or composition:

```python theme={"theme":"github-dark"}
from runcrate import Runcrate

client = Runcrate(api_key="rc_live_YOUR_API_KEY")
image = client.models.generate_image(
    model="black-forest-labs/FLUX.2-pro",
    prompt="Product hero image for premium headphones, same lighting as references",
    input_images=["./brand-ref-1.png", "./brand-ref-2.png", "./product-angle.png"],
)
image.data[0].save("headphones-hero.png")
```

***

## Fast iteration with Dev

```python theme={"theme":"github-dark"}
from runcrate import Runcrate

client = Runcrate(api_key="rc_live_YOUR_API_KEY")
for variation in ["morning light", "sunset", "overcast", "night"]:
    image = client.models.generate_image(
        model="black-forest-labs/FLUX.2-dev",
        prompt=f"Modern glass house in the mountains, {variation}, architectural photography",
        seed=42,
    )
    image.data[0].save(f"house-{variation.replace(' ', '-')}.png")
```

***

## Tips

* **Start with Dev, finish with Max.** Dev is faster and cheaper for iteration.
* **Aspect ratio vs dimensions.** Use `aspect_ratio` for standard ratios, `width`/`height` for exact pixels up to 4MP.
* **Multi-reference.** Up to 8 images. More references = slower but more consistent style.
* **Seed.** Same seed + same prompt + same model = same image.
