INTEGRATION GUIDE

How to Run FLUX Kontext Pro API: Contextual Inpainting & Editing

Learn how to run FLUX Kontext Pro via unified REST API. Seamless contextual inpainting, subject replacement, and high-fidelity prompt obedience at $0.05/run.

Updated Oct 2026 • 6 min read • Verified Production Ready
Inference Cost
$0.050
per generation
Execution Latency
Instant (< 4s)
Warm GPU cluster
Resolution / Quality
Custom Ratios
Lossless output
SDK Protocol
REST / OpenAI
cURL, Python, Node

Architectural Overview

FLUX Kontext Pro specializes in context-aware image generation and localized modification. Unlike traditional diffusion models that hallucinate inconsistent boundaries, Kontext Pro accurately understands lighting, textures, and geometry from surrounding context.

Pricing Breakdown & Benchmark

No monthly base subscriptions, no minimum commitments, and no idle cluster charges. Compare real production costs below:

Model / Task LumozAI Price Alternative Providers Avg Latency Recommended For
flux-kontext-pro $0.050 / run $0.065 / run 4.2s Inpainting & background swap
step1x-edit $0.033 / run $0.045 / run 3.8s Instruction-based photo edits
picplug $0.060 / run $0.080 / run 5.0s Product photo contextual staging

Code Integration (REST, Python, Node.js)

Execute directly against our high-throughput gateway. Replace YOUR_LUMOZ_API_KEY with your free developer key.

curl -X POST "https://lumozai.com/api/v4/run" \
  -H "Authorization: Bearer YOUR_LUMOZ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "flux-kontext-pro",
    "prompt": "Replace the office background with a sunlit Scandinavian living room with green monstera plants",
    "image": "https://example.com/source-photo.jpg",
    "aspect_ratio": "1:1"
  }'

Frequently Asked Questions

Can I pass image URLs or base64 data to FLUX Kontext Pro?

Both are supported. You can pass a publicly accessible HTTPS image URL or a standard data:image/png;base64 string in the image parameter.

Does it preserve facial features in portrait edits?

Yes. Kontext Pro retains facial symmetry and skin textures while updating clothing, hairstyles, or backgrounds as described in the prompt.

Explore Other Developer Guides

Pricing & Models
FLUX API Pricing & Cost per Megapixel (2026 Comparison)
From $0.050 Read Guide →
Cost Optimization
Cheapest Image Generation API in 2026 (From $0.0023/Run)
From $0.0023 Read Guide →
Microservice API
Background Remover API: High-Speed AI Cutouts (< 200ms)
From $0.005 Read Guide →

Start Building with Zero Cold Starts

Create a developer account to receive instant test credits, generate your unified API key, and launch in minutes.