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

# Black Forest Labs (FLUX) Setup

> Connect Black Forest Labs (FLUX) to MagicAds — an Image Studio provider with multi-reference conditioning for strong character and brand consistency.

## Introduction

Black Forest Labs (FLUX) is an **Image Studio** provider — it drives AI image generation with multi-reference conditioning for strong character and brand consistency. It does **not** power copy or video; use other providers for those.

This guide walks you through getting a Black Forest Labs key, adding it in MagicAds, and the model it unlocks.

## How keys are stored

All AI provider keys live in the **AI Settings** screen and are stored **encrypted** in the database. There are no `.env` edits — keys are injected into the drivers at runtime. Users never supply their own key; every generation runs on the admin's key.

<Note>
  A model only becomes available to users when **both** are true: the Black Forest Labs API key is saved **and** the model is **enabled** in the vendor modal.
</Note>

## Before you start

* Admin access to your MagicAds platform.
* A Black Forest Labs account with billing/credits set up.

## Part 1 — Get your Black Forest Labs API key

<Steps>
  <Step title="Open the BFL dashboard">
    Go to the [Black Forest Labs dashboard](https://dashboard.bfl.ai/) and register or sign in. BFL organizes access by **Organizations and Projects** — a new account sets up a default one for you.
  </Step>

  <Step title="Add billing / credits">
    Add a payment method or top up credits so your key can make calls. BFL charges you directly for usage — separate from your MagicAds platform credits.
  </Step>

  <Step title="Create an API key">
    Open the **Keys** section and click **Add Key**. Copy the generated key.

    <Warning>
      The key is shown **only once**. Copy it immediately and store it somewhere safe.
    </Warning>
  </Step>

  <Step title="Confirm model access">
    Make sure your account has credits for the **FLUX.2 Pro** model.
  </Step>
</Steps>

## Part 2 — Add the key in MagicAds

<Steps>
  <Step title="Open AI Settings">
    In your platform, go to **Admin → AI Settings**.
  </Step>

  <Step title="Open the Black Forest Labs vendor">
    Click the **Black Forest Labs** vendor card to open its configuration modal.
  </Step>

  <Step title="Paste the key">
    Paste your API key into the **API key** field. Leaving it blank keeps the existing key unchanged.
  </Step>

  <Step title="Enable the model">
    Toggle on **FLUX.2 Pro** and set its **credit cost** (what a user is charged per generation).
  </Step>

  <Step title="Save">
    Click **Save**. The vendor card shows as connected and FLUX appears in the Image Studio.
  </Step>
</Steps>

<Note>
  There is no "test connection" button. To verify, enable the model and run a quick generation in the Image Studio.
</Note>

## Part 3 — Supported models

### Image Studio

| Model      | Model ID     | Tier | Default credits | Best for                                                                                                                                                           |
| ---------- | ------------ | ---- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| FLUX.2 Pro | `flux-2-pro` | Mid  | 1               | Multi-reference conditioning (up to 8 source images) for character + brand consistency, photoreal at 4MP, deterministic outputs. Up to 2048px. Good in-image text. |

**Reference-image input:** FLUX.2 Pro is one of the engines that accepts reference images (alongside Google Nano Banana 2 and OpenAI GPT Image 2), so users can condition outputs on a product shot, brand logo, or character.

FLUX provides **image models only** here — no copy or video.

<Note>
  The credit cost shown is the seeded default. You can change it in the vendor modal. It's what your platform charges users in credits — not BFL's price.
</Note>

## Part 4 — Make FLUX the default image model (optional)

In the global section of **AI Settings** you can set the **default image model** to FLUX.2 Pro so it's pre-selected for users. You can also toggle the Image Studio on/off and control free-tier access there.

## Troubleshooting

| Symptom                               | Likely cause                                                    | Fix                                                                                 |
| ------------------------------------- | --------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| FLUX doesn't appear in Image Studio   | Key missing or model disabled                                   | Add the key in the Black Forest Labs vendor modal and enable FLUX.2 Pro, then Save. |
| "The payload is invalid." on generate | Saved key can't be decrypted (e.g. after an environment change) | Re-enter the key in AI Settings and Save to refresh it.                             |
| BFL API errors / 401                  | Invalid key or no billing                                       | Re-check the key and billing in the BFL dashboard.                                  |
| Looking for FLUX copy/video           | Not supported                                                   | FLUX is image-only here; use another provider for copy or video.                    |

<Note>
  Keys are stored encrypted and applied at runtime. No `.env` changes or commands are needed after saving.
</Note>
