FLUX 3.1 Image: 4K Multimodal Generation & Mask Editing API

FLUX 3.1 Image by Black Forest Labs delivers text-to-image generation and precision editing from 1 MP in 3 seconds ($0.015 in fast mode) up to 16 MP / 4K in under 15 seconds. Moving up 14 places in third-party Elo rankings past Nano Banana 2.1, it adds brush mask editing, hex color locking, bounding-box placement, and 6-image reference fusion.
FLUX 3.1 Image: 4K Multimodal Generation & Mask Editing API: FLUX 3.1 Image by Black Forest Labs delivers text-to-image generation and precision editing from 1 MP in 3 seconds ($0.015 in fast mode) up to 16 MP / 4K in under 15 seconds. Moving up 14 places in third-party Elo rankings past Nano Banana 2.1, it adds brush mask editing, hex color locking, bounding-box placement, and 6-image reference fusion. Designed as a zero-dependency, open-source TypeScript architecture under the MIT License with native Model Context Protocol (MCP) support and deterministic phase state machines.
- Sub-3s 1 MP to <15s 4K (16 MP): Renders 4736×3552 assets natively without external upscalers, preserving fine skin, fabric, and lettering detail.
- Deterministic Mask & Bounding-Box Edits: Restricts pixel modifications strictly to brush masks or spatial bounding boxes while locking surrounding pixels and hex colors (#0f0787, #8bc4bb).
- Two Predictable API Tiers: Fast mode runs at $0.015 per 1 MP image for high-throughput batch runs; Quality mode runs at $0.030 per 1 MP for typography and multi-reference consistency.
- Up to 6 Reference Images + Text Translation: Combines up to six reference textures/objects or translates signage copy in-place while matching existing fonts.
import { createAgent } from '@smoke-monkey/harness';// Orchestrate masked product recoloring and 4K rendering with FLUX 3.1 Imageconst agent = createAgent({agentId: 'flux-3-1-creative-agent',provider: 'anthropic',model: 'claude-sonnet-4-5',workspacePath: process.cwd(),mcpServers: {bflImage: {command: 'npx',args: ['-y', '@smoke-monkey/mcp-bfl-flux', '--model', 'flux-3.1-image'],env: {BFL_API_KEY: process.env.BFL_API_KEY || '',FLUX_MODE: 'quality',FLUX_MAX_MEGAPIXELS: '16',},},},permissions: {read_file: 'allow',write_file: 'allow',run_command: 'ask',},});async function main() {const result = await agent.run('Apply the matte-black jacket mask edit on hero-input.png, lock brand hex #0f0787, and export at 4K.');console.log('Visual Pipeline Complete:', result.summary);}main().catch(console.error);
Watch: Related Video Guides
How To Try Black Forest Labs Flux 3 Image Klein (Easy Guide)
FLUX 3.1 Image Is Here: Beats Nano Banana 2.1 on Third-Party Elo, 1MP in 2.7s for $0.015
What Is FLUX 3.1 Image and How Does It Compare to Prior Diffusion APIs?
FLUX 3.1 Image is Black Forest Labs' unified text-to-image and instruction-based editing model supporting native outputs up to 16 MP (4K). Climbing 14 spots in third-party Elo benchmarks ahead of Nano Banana 2.1, it replaces multi-stage inpainting + ControlNet + upscaler chains with single-call masked, hex-locked, and multi-reference synthesis.
For developer pipelines, input reference images are included at no extra per-input surcharge in both pricing tiers, eliminating hidden token inflation when passing 2 to 6 style, product, or texture references.
| Capability / Metric | FLUX 3.1 Fast Mode | FLUX 3.1 Quality Mode | Engineering Trade-Off |
|---|---|---|---|
| 1 MP Pricing (Input Images Included) | $0.015 / image | $0.030 / image | 2x cost for typography & strict multi-ref fidelity |
| 1 MP Generation Latency | ~2.7–3.0 s | Interactive (<5 s) | Ideal for agentic UI previews and batch catalogs |
| Maximum Native Resolution | Up to 16 MP (4K) | Up to 16 MP (4736×3552) in <15 s | Zero external ESRGAN upscaler artifacts |
| Editing Primitives | Masks, bounding boxes, hex codes | Masks, boxes, hex codes, 6-image fusion, text translation | Preserves unmasked background pixels verbatim |
Automating Masked Edits and Hex Color Locking in Production Scripts
When integrating FLUX 3.1 Image into CI/CD design pipelines or e-commerce catalog agents, isolate localized revisions with binary masks and pass exact hex strings (for example #0f0787 or #de4528) rather than subjective color adjectives.
# Submit a FLUX 3.1 Image mask-edit job with hex color precision via BFL API
curl -s -X POST "https://api.bfl.ai/v1/flux-3.1-image" -H "x-key: $BFL_API_KEY" -H "Content-Type: application/json" -d '{
"prompt": "Change the background facade color to #0f0787 and update sign lettering to OPEN",
"mode": "quality",
"width": 3840,
"height": 2160,
"input_image": "'"$(base64 -i source.png)"'",
"mask_image": "'"$(base64 -i mask.png)"'"
}'Separate Fast Previews from Quality Final Renders
Run agentic layout verification and prompt iteration in fast mode ($0.015/image) at 1 MP, then trigger quality mode ($0.030/image) at 4K only once bounding-box placement and mask boundaries pass automated vision checks.
Frequently Asked Questions
Q:What is the pricing difference between FLUX 3.1 fast and quality modes?
At 1 MP resolution, fast mode costs $0.015 per image and quality mode costs $0.030 per image. Input reference images are included in both prices with no extra input surcharge.
Q:What maximum resolution does FLUX 3.1 Image support natively?
FLUX 3.1 Image generates and edits natively up to 4K / 16 MP (for example 4736 x 3552) in under 15 seconds without requiring a separate upscaling pass.
Q:How many reference images can FLUX 3.1 combine in one generation?
Official examples demonstrate combining up to 6 distinct reference images (people, garments, materials, and product geometry) while preserving subject and texture identity.
Q:Can FLUX 3.1 edit text inside existing photographs without breaking fonts?
Yes. Quality mode supports translating or rewriting signage, product labels, and packaging headlines in-place while retaining the original lettering style, color, and scene lighting.
Related Alternatives & Comparisons
Related Architecture Guides
View all guidesBest Open Source Coding Agents in 2026: Free, Local & Fully Hackable Harnesses
MCP Server Security Best Practices: Hardening Model Context Protocol Agents in 2026
Open Source Coding Agent Harness: Build a Forkable, Local AI Engineering Runtime
Build with Smoke Monkey Harness
Zero dependencies. 24 built-in tools. Human-in-the-loop safety. 100% open source under the MIT License.