Python wrapper for Black Forest Labs' FLUX 3 Dev API, available now — fast, low-cost FLUX 3 variant, plus the full FLUX 3 family (Text-to-Image, Image-to-Image, Text-to-Video, Image-to-Video).
182
stars
21
commits
Python
primary language
Aug 28, 2026
updated
A Python wrapper for FLUX 3 Dev — the faster, lower-cost variant of Black Forest Labs' 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 an open-weight release planned for later in 2026. This SDK also covers the full FLUX 3 family through the same client.
⚠️ Status: FLUX 3 Text-to-Video and Image-to-Video are live now on MuAPI. FLUX 3 Dev, flagship Text-to-Image, and Image-to-Image (the three endpoints this repo is named after) are still coming soon — they're wired into this SDK ahead of launch, but the underlying MuAPI routes aren't enabled yet and calls to
generate()/text_to_image()/image_to_image()will fail until Black Forest Labs opens general availability. See muapi.ai/flux-3 for current status of every FLUX 3 endpoint.MuAPI's FLUX 3 video API has also expanded beyond Text-to-Video/Image-to-Video since this SDK was written — Start-End-to-Video, Video Extend, Video Upscaler, and fast draft modes are live too. This repo doesn't wrap those; see flux-3-video-api (all seven live video endpoints), flux-3-video-edit (Video Extend), and flux-3-video-upscaler if you need those.
📺 FLUX 3 API: Image & Video Generation from One Multimodal Model →
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:
generate().text_to_image().image_to_image().text_to_video().image_to_video().upload_file().pip install flux-3-dev-api
git clone https://github.com/Anil-matcha/Flux-3-Dev-API.git
cd Flux-3-Dev-API
pip install -r requirements.txt
Create a .env file in the root directory and add your MuAPI API key:
MUAPI_API_KEY=your_muapi_api_key_here
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.
MUAPI_API_KEY is set in your environment.python3 mcp_server.py
npx -y @modelcontextprotocol/inspector python3 mcp_server.py
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]}")
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])
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",
)
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",
)
Endpoint: POST https://api.muapi.ai/api/v1/flux-3-text-to-video · $0.25/sec @720p, $0.42/sec @1080p
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,
)
Endpoint: POST https://api.muapi.ai/api/v1/flux-3-image-to-video · $0.25/sec @720p, $0.42/sec @1080p
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",
"image_url": "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",
image_url="https://example.com/product.jpg",
duration=5,
generate_audio=True,
)
This SDK only wraps Text-to-Video and Image-to-Video. MuAPI's FLUX 3 video API also includes these live endpoints, covered by sibling projects:
| Endpoint | What it does | SDK |
|---|---|---|
flux-3-text-to-video-draft | Fast, lower-cost draft mode of Text-to-Video ($0.09/sec flat) | flux-3-video-api |
flux-3-start-end-to-video | Video transition between a start and end keyframe | flux-3-video-api |
flux-3-video-extend | Continue an existing clip with new prompt-guided motion | flux-3-video-edit, flux-3-video-api |
flux-3-video-extend-draft | Fast, lower-cost draft mode of Video Extend ($0.09/sec flat) | flux-3-video-api |
flux-3-video-upscaler | Upscale any video beyond its native resolution | flux-3-video-upscaler |
| Method | Parameters | Status | Description |
|---|---|---|---|
generate | prompt, aspect_ratio, resolution | 🕒 Coming soon | FLUX 3 Dev — fast, low-cost text-to-image. |
text_to_image | prompt, aspect_ratio, resolution | 🕒 Coming soon | Flagship FLUX 3 text-to-image (higher fidelity than Dev). |
image_to_image | prompt, images_list, aspect_ratio, resolution | 🕒 Coming soon | FLUX 3 instruction-driven image editing (up to 4 reference images). |
text_to_video | prompt, aspect_ratio, resolution, duration, generate_audio | ✅ Live | FLUX 3 text-to-video with optional native synchronized audio. $0.25/sec @720p, $0.42/sec @1080p. |
image_to_video | prompt, image_url, aspect_ratio, resolution, duration, generate_audio | ✅ Live | FLUX 3 image-to-video with optional native synchronized audio. $0.25/sec @720p, $0.42/sec @1080p. |
upload_file | file_path | Upload a local file (image or video) to MuAPI for use in generation tasks. | |
get_result | request_id | Check task status for a FLUX 3 generation. | |
wait_for_completion | request_id, poll_interval, timeout | Blocking helper that polls until the task completes. |
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.
21 commits
Python
100.0%
Python wrapper for Black Forest Labs' FLUX 3 Dev API, available now — fast, low-cost FLUX 3 variant, plus the full FLUX 3 family (Text-to-Image, Image-to-Image, Text-to-Video, Image-to-Video).
182
stars
21
commits
Python
primary language
Aug 28, 2026
updated
A Python wrapper for FLUX 3 Dev — the faster, lower-cost variant of Black Forest Labs' 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 an open-weight release planned for later in 2026. This SDK also covers the full FLUX 3 family through the same client.
⚠️ Status: FLUX 3 Text-to-Video and Image-to-Video are live now on MuAPI. FLUX 3 Dev, flagship Text-to-Image, and Image-to-Image (the three endpoints this repo is named after) are still coming soon — they're wired into this SDK ahead of launch, but the underlying MuAPI routes aren't enabled yet and calls to
generate()/text_to_image()/image_to_image()will fail until Black Forest Labs opens general availability. See muapi.ai/flux-3 for current status of every FLUX 3 endpoint.MuAPI's FLUX 3 video API has also expanded beyond Text-to-Video/Image-to-Video since this SDK was written — Start-End-to-Video, Video Extend, Video Upscaler, and fast draft modes are live too. This repo doesn't wrap those; see flux-3-video-api (all seven live video endpoints), flux-3-video-edit (Video Extend), and flux-3-video-upscaler if you need those.
📺 FLUX 3 API: Image & Video Generation from One Multimodal Model →
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:
generate().text_to_image().image_to_image().text_to_video().image_to_video().upload_file().pip install flux-3-dev-api
git clone https://github.com/Anil-matcha/Flux-3-Dev-API.git
cd Flux-3-Dev-API
pip install -r requirements.txt
Create a .env file in the root directory and add your MuAPI API key:
MUAPI_API_KEY=your_muapi_api_key_here
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.
MUAPI_API_KEY is set in your environment.python3 mcp_server.py
npx -y @modelcontextprotocol/inspector python3 mcp_server.py
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]}")
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])
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",
)
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",
)
Endpoint: POST https://api.muapi.ai/api/v1/flux-3-text-to-video · $0.25/sec @720p, $0.42/sec @1080p
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,
)
Endpoint: POST https://api.muapi.ai/api/v1/flux-3-image-to-video · $0.25/sec @720p, $0.42/sec @1080p
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",
"image_url": "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",
image_url="https://example.com/product.jpg",
duration=5,
generate_audio=True,
)
This SDK only wraps Text-to-Video and Image-to-Video. MuAPI's FLUX 3 video API also includes these live endpoints, covered by sibling projects:
| Endpoint | What it does | SDK |
|---|---|---|
flux-3-text-to-video-draft | Fast, lower-cost draft mode of Text-to-Video ($0.09/sec flat) | flux-3-video-api |
flux-3-start-end-to-video | Video transition between a start and end keyframe | flux-3-video-api |
flux-3-video-extend | Continue an existing clip with new prompt-guided motion | flux-3-video-edit, flux-3-video-api |
flux-3-video-extend-draft | Fast, lower-cost draft mode of Video Extend ($0.09/sec flat) | flux-3-video-api |
flux-3-video-upscaler | Upscale any video beyond its native resolution | flux-3-video-upscaler |
| Method | Parameters | Status | Description |
|---|---|---|---|
generate | prompt, aspect_ratio, resolution | 🕒 Coming soon | FLUX 3 Dev — fast, low-cost text-to-image. |
text_to_image | prompt, aspect_ratio, resolution | 🕒 Coming soon | Flagship FLUX 3 text-to-image (higher fidelity than Dev). |
image_to_image | prompt, images_list, aspect_ratio, resolution | 🕒 Coming soon | FLUX 3 instruction-driven image editing (up to 4 reference images). |
text_to_video | prompt, aspect_ratio, resolution, duration, generate_audio | ✅ Live | FLUX 3 text-to-video with optional native synchronized audio. $0.25/sec @720p, $0.42/sec @1080p. |
image_to_video | prompt, image_url, aspect_ratio, resolution, duration, generate_audio | ✅ Live | FLUX 3 image-to-video with optional native synchronized audio. $0.25/sec @720p, $0.42/sec @1080p. |
upload_file | file_path | Upload a local file (image or video) to MuAPI for use in generation tasks. | |
get_result | request_id | Check task status for a FLUX 3 generation. | |
wait_for_completion | request_id, poll_interval, timeout | Blocking helper that polls until the task completes. |
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.
21 commits
Python
100.0%