FLUX 3 Dev API: Python Wrapper for Black Forest Labs' Fast, Low-Cost FLUX 3 Variant

July 23, 2026 · View on GitHub

Powered by MuAPI

PyPI version GitHub stars License: MIT Python 3.7+

A Python wrapper for FLUX 3 Dev — the faster, lower-cost variant of Black Forest Labs' newly announced FLUX 3 frontier model — delivered via muapi.ai. FLUX 3 Dev trades a small amount of peak fidelity for significantly reduced latency and cost, making it ideal for rapid iteration, prototyping, and high-volume generation — with a planned open-weight release later in 2026. This SDK also covers the full FLUX 3 family (flagship Text-to-Image, Image-to-Image editing, Text-to-Video, and Image-to-Video), all through the same client.

⚠️ Status: FLUX 3 is rolling out in phases. Black Forest Labs announced FLUX 3 on July 23, 2026. FLUX 3 Video and Action entered early access immediately; FLUX 3 Image (including Dev) is rolling out in the following weeks. Endpoints in this SDK will activate automatically on MuAPI as Black Forest Labs opens general availability — no code changes needed. Track live status at muapi.ai/flux-3.

🚀 Why Use FLUX 3 Dev?

FLUX 3 is Black Forest Labs' newest frontier model — a unified multimodal system jointly trained across image, video, and audio, extendable to action prediction for robotics. FLUX 3 Dev is its fast, affordable entry point:

  • Lower Latency & Cost: Trades a small amount of peak fidelity from the flagship model for significantly faster, cheaper generation.
  • Same Prompting Conventions: Uses the same prompt structure as flagship FLUX 3 — validate ideas cheaply, then re-run on the full model if needed.
  • Planned Open-Weight Release: Black Forest Labs has confirmed a faster, open-weight version of FLUX 3 is coming later in 2026.
  • Full FLUX 3 Family Access: This SDK also wraps FLUX 3 Text-to-Image, Image-to-Image, Text-to-Video, and Image-to-Video — one client for the whole model family.
  • Native Audio in Video: FLUX 3 Video variants can generate scene-appropriate synchronized audio directly alongside the clip.
  • Developer-First: Simple Python SDK on top of MuAPI's unified infrastructure — no separate account or waitlist needed once you have a MuAPI key.

🌟 Key Features

  • FLUX 3 Dev Text-to-Image: Fast, low-cost image generation via generate().
  • FLUX 3 Text-to-Image: Flagship higher-fidelity image generation via text_to_image().
  • FLUX 3 Image-to-Image: Instruction-driven editing with up to 4 reference images via image_to_image().
  • FLUX 3 Text-to-Video: Cinematic video with optional native synchronized audio via text_to_video().
  • FLUX 3 Image-to-Video: Animate a still image into video with optional native audio via image_to_video().
  • File Upload: Upload local images/videos directly using upload_file().
  • MCP Server: Use FLUX 3 Dev as a Model Context Protocol server for Claude Desktop, Cursor, and other MCP clients.

🛠 Installation

pip install flux-3-dev-api

From Source

git clone https://github.com/Anil-matcha/Flux-3-Dev-API.git
cd Flux-3-Dev-API
pip install -r requirements.txt

Configuration

Create a .env file in the root directory and add your MuAPI API key:

MUAPI_API_KEY=your_muapi_api_key_here

🤖 FLUX 3 Dev MCP Server

Use FLUX 3 Dev as an MCP (Model Context Protocol) server so AI clients (like Claude Desktop or Cursor) can directly invoke FLUX 3 generation tools.

Running the MCP Server

  1. Ensure MUAPI_API_KEY is set in your environment.
  2. Run the server:
    python3 mcp_server.py
    
  3. To test with the MCP Inspector:
    npx -y @modelcontextprotocol/inspector python3 mcp_server.py
    

💻 Quick Start (Python)

from flux3_dev_api import Flux3DevAPI

# Initialize the client
api = Flux3DevAPI()

# Generate an image with FLUX 3 Dev
print("Generating image with FLUX 3 Dev...")
submission = api.generate(
    prompt="A minimalist product shot of a ceramic mug on a wooden table, soft natural light",
    aspect_ratio="1:1",
    resolution="1k"
)

# Wait for completion
result = api.wait_for_completion(submission["request_id"])
print(f"Success! Output: {result['outputs'][0]}")

📡 API Endpoints & Reference

1. FLUX 3 Dev (Text-to-Image, fast/low-cost)

Endpoint: POST https://api.muapi.ai/api/v1/flux-3-dev

curl --location --request POST "https://api.muapi.ai/api/v1/flux-3-dev" \
  --header "Content-Type: application/json" \
  --header "x-api-key: YOUR_API_KEY" \
  --data-raw '{
      "prompt": "A minimalist product shot of a ceramic mug on a wooden table, soft natural light",
      "aspect_ratio": "1:1",
      "resolution": "1k"
  }'

Python SDK:

submission = api.generate(
    prompt="A minimalist product shot of a ceramic mug on a wooden table, soft natural light",
    aspect_ratio="1:1",
    resolution="1k",
)
result = api.wait_for_completion(submission["request_id"])
print(result["outputs"][0])

2. FLUX 3 Text-to-Image (flagship)

Endpoint: POST https://api.muapi.ai/api/v1/flux-3-text-to-image

curl --location --request POST "https://api.muapi.ai/api/v1/flux-3-text-to-image" \
  --header "Content-Type: application/json" \
  --header "x-api-key: YOUR_API_KEY" \
  --data-raw '{
      "prompt": "A hyperrealistic portrait of an astronaut standing on red Martian dunes at golden hour",
      "aspect_ratio": "16:9",
      "resolution": "2k"
  }'

Python SDK:

submission = api.text_to_image(
    prompt="A hyperrealistic portrait of an astronaut standing on red Martian dunes at golden hour",
    aspect_ratio="16:9",
    resolution="2k",
)

3. FLUX 3 Image-to-Image (Edit)

Endpoint: POST https://api.muapi.ai/api/v1/flux-3-image-to-image

curl --location --request POST "https://api.muapi.ai/api/v1/flux-3-image-to-image" \
  --header "Content-Type: application/json" \
  --header "x-api-key: YOUR_API_KEY" \
  --data-raw '{
      "prompt": "Replace the background with a neon-lit city street at night, keep the subject unchanged",
      "images_list": ["https://example.com/input.jpg"],
      "aspect_ratio": "1:1"
  }'

Python SDK:

submission = api.image_to_image(
    prompt="Replace the background with a neon-lit city street at night, keep the subject unchanged",
    images_list=["https://example.com/input.jpg"],
    aspect_ratio="1:1",
)

4. FLUX 3 Text-to-Video

Endpoint: POST https://api.muapi.ai/api/v1/flux-3-text-to-video

curl --location --request POST "https://api.muapi.ai/api/v1/flux-3-text-to-video" \
  --header "Content-Type: application/json" \
  --header "x-api-key: YOUR_API_KEY" \
  --data-raw '{
      "prompt": "A drone shot glides over a bioluminescent forest at night, fireflies drifting between glowing trees",
      "aspect_ratio": "16:9",
      "resolution": "1080p",
      "duration": 6,
      "generate_audio": true
  }'

Python SDK:

submission = api.text_to_video(
    prompt="A drone shot glides over a bioluminescent forest at night, fireflies drifting between glowing trees",
    aspect_ratio="16:9",
    resolution="1080p",
    duration=6,
    generate_audio=True,
)

5. FLUX 3 Image-to-Video

Endpoint: POST https://api.muapi.ai/api/v1/flux-3-image-to-video

curl --location --request POST "https://api.muapi.ai/api/v1/flux-3-image-to-video" \
  --header "Content-Type: application/json" \
  --header "x-api-key: YOUR_API_KEY" \
  --data-raw '{
      "prompt": "The camera slowly pushes in as steam rises from the coffee cup",
      "images_list": ["https://example.com/product.jpg"],
      "duration": 5,
      "generate_audio": true
  }'

Python SDK:

submission = api.image_to_video(
    prompt="The camera slowly pushes in as steam rises from the coffee cup",
    images_list=["https://example.com/product.jpg"],
    duration=5,
    generate_audio=True,
)

📖 Method Reference

MethodParametersDescription
generateprompt, aspect_ratio, resolutionFLUX 3 Dev — fast, low-cost text-to-image.
text_to_imageprompt, aspect_ratio, resolutionFlagship FLUX 3 text-to-image (higher fidelity than Dev).
image_to_imageprompt, images_list, aspect_ratio, resolutionFLUX 3 instruction-driven image editing (up to 4 reference images).
text_to_videoprompt, aspect_ratio, resolution, duration, generate_audioFLUX 3 text-to-video with optional native synchronized audio.
image_to_videoprompt, images_list, aspect_ratio, resolution, duration, generate_audioFLUX 3 image-to-video with optional native synchronized audio.
upload_filefile_pathUpload a local file (image or video) to MuAPI for use in generation tasks.
get_resultrequest_idCheck task status for a FLUX 3 generation.
wait_for_completionrequest_id, poll_interval, timeoutBlocking helper that polls until the task completes.

🔗 Official Resources

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.


Keywords: FLUX 3 API, FLUX 3 Dev, FLUX 3 Dev API, Black Forest Labs FLUX 3, FLUX 3 Python SDK, FLUX 3 text to image, FLUX 3 image to image, FLUX 3 text to video, FLUX 3 image to video, FLUX multimodal model, AI image generation API, AI video generation API, MuAPI, Python image generation SDK, open-weight FLUX.