Ana içeriğe geç
black-forest-labs avatarı

FLUX.1 Kontext [pro] API

black-forest-labs/flux-kontext/pro

Mevcut bir görseli metin talimatıyla düzenleyin — nesneleri, tarzı, arka planı ya da metni değiştirin — yüksek prompt uyumu, okunaklı tipografi ve ticari kullanım haklarıyla.

düzenleme
0.04

Model girdisi

Input

The edit instruction. Describe the change to apply to the source image (e.g. 'put a donut next to the flour') and name anything that should stay the same.

The source image to edit. Unmentioned regions are kept consistent while the described change is applied.

Additional Settings

Customize your input with more control.

Min: 1 - Max: 20

How strongly the result follows the edit instruction. Raise for stronger adherence; lower if the edit looks over-applied.

Min: 1 - Max: 4

The number of edited image variations to generate. Each generated image is billed separately.

Force the output aspect ratio. Leave unset to match the source image's aspect ratio.

Content-moderation strictness from '1' (strictest) to '6' (most permissive).

The format of the generated image.

Whether to automatically enhance the prompt for potentially better results.

Random seed. The same seed, prompt, and image produce the same result.

You need to be logged in to run this model and view results.
Log in

Model çıktısı

Output

Loading
Generated in 9.651 seconds
Logs (1 lines)

Örnek istekler

Örnekler

Example output 1Example output 2Example output 3Example output 4

FLUX.1 Kontext [pro] API

FLUX.1 Kontext [pro] is a image-to-image AI model by black-forest-labs. On ModelRunner it runs through a REST API or via MCP from any AI assistant, at $0.04 per image.

POST https://queue.modelrunner.run/black-forest-labs/flux-kontext/pro

cURL

# Submit a request to the queue. Input fields go at the top level of the
# body. The optional reserved "metadata" object holds your own flat string
# tags — stored on the request, never sent to the model; filter later with
# GET https://queue.modelrunner.run/requests?metadata=<url-encoded JSON>.
curl -X POST https://queue.modelrunner.run/black-forest-labs/flux-kontext/pro \
  -H "Authorization: Key $MRUN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Replace the plain sky with a vivid sunset filled with dramatic orange and purple clouds, leaving the buildings below …",
    "image_url": "https://media.modelrunner.ai/lIHWaA0znjyPvZStmHCtw.jpeg",
    "num_images": 1,
    "output_format": "jpeg",
    "enhance_prompt": false,
    "guidance_scale": 3.5,
    "safety_tolerance": "2",
    "metadata": {
      "project": "my-project"
    }
  }'
# → { "request_id": "...", "status_url": "...", "response_url": "..." }

# Poll status_url until "COMPLETED", then fetch the result
curl "https://queue.modelrunner.run/black-forest-labs/flux-kontext/pro/requests/$REQUEST_ID/status" \
  -H "Authorization: Key $MRUN_API_KEY"
curl "https://queue.modelrunner.run/black-forest-labs/flux-kontext/pro/requests/$REQUEST_ID" \
  -H "Authorization: Key $MRUN_API_KEY"

JavaScript

import { modelrunner } from "@modelrunner/client";

const result = await modelrunner.subscribe("black-forest-labs/flux-kontext/pro", {
  input: {
    "prompt": "Replace the plain sky with a vivid sunset filled with dramatic orange and purple clouds, leaving the buildings below …",
    "image_url": "https://media.modelrunner.ai/lIHWaA0znjyPvZStmHCtw.jpeg",
    "num_images": 1,
    "output_format": "jpeg",
    "enhance_prompt": false,
    "guidance_scale": 3.5,
    "safety_tolerance": "2"
  },
});
console.log(result);

Python

import os
import requests

headers = {"Authorization": f"Key {os.environ['MRUN_API_KEY']}"}

submitted = requests.post(
    "https://queue.modelrunner.run/black-forest-labs/flux-kontext/pro",
    headers=headers,
    json={
      "prompt": "Replace the plain sky with a vivid sunset filled with dramatic orange and purple clouds, leaving the buildings below …",
      "image_url": "https://media.modelrunner.ai/lIHWaA0znjyPvZStmHCtw.jpeg",
      "num_images": 1,
      "output_format": "jpeg",
      "enhance_prompt": false,
      "guidance_scale": 3.5,
      "safety_tolerance": "2"
    },
).json()

# Poll submitted["status_url"] until "COMPLETED", then:
result = requests.get(submitted["response_url"], headers=headers).json()

Input parameters

Input parameters of FLUX.1 Kontext [pro]
NameTypeRequiredDescription
promptstringyesThe edit instruction. Describe the change to apply to the source image (e.g. 'put a donut next to the flour') and name anything that should stay the same.
image_urlstring (uri)yesThe source image to edit. Unmentioned regions are kept consistent while the described change is applied.
guidance_scalenumbernoHow strongly the result follows the edit instruction. Raise for stronger adherence; lower if the edit looks over-applied. Default: 3.5.
num_imagesintegernoThe number of edited image variations to generate. Each generated image is billed separately. Default: 1.
aspect_ratioenumnoForce the output aspect ratio. Leave unset to match the source image's aspect ratio. One of: 21:9, 16:9, 4:3, 3:2, 1:1, 2:3, 3:4, 9:16, 9:21.
safety_toleranceenumnoContent-moderation strictness from '1' (strictest) to '6' (most permissive). One of: 1, 2, 3, 4, 5, 6. Default: "2".
output_formatenumnoThe format of the generated image. One of: jpeg, png. Default: "jpeg".
enhance_promptbooleannoWhether to automatically enhance the prompt for potentially better results. Default: false.
seedintegernoRandom seed. The same seed, prompt, and image produce the same result.

Machine-readable: OpenAPI schema · llms.txt

Use FLUX.1 Kontext [pro] from Claude & Cursor (MCP)

Point Claude Code, Claude Desktop, Cursor, or any MCP client at the ModelRunner MCP server and FLUX.1 Kontext [pro] becomes a tool your assistant can call directly — it authorizes via OAuth (no API key in config) and runs this model with the run_model tool using the endpoint black-forest-labs/flux-kontext/pro.

MCP client config (Claude Desktop, Cursor)

{
  "mcpServers": {
    "modelrunner": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://mcp.modelrunner.run/mcp"]
    }
  }
}

Claude Code

claude mcp add --transport http modelrunner https://mcp.modelrunner.run/mcp

Then ask your assistant, for example: “Run black-forest-labs/flux-kontext/pro on ModelRunner to generate image”. MCP setup guide.

Model Detayları

Model Detayları

FLUX.1 Kontext [pro], verdiğiniz bir görseli düz bir dille yazılmış talimatı izleyerek düzenler. Bir kaynak fotoğraf ve değişikliği tarif eden bir prompt verirsiniz — bir nesneyi başkasıyla değiştirin, sahneyi yeniden tarzlayın, arka planı değiştirin, metni düzenleyin ya da rengi ayarlayın — ve model, bahsetmediğiniz her şeyi tutarlı tutarak görseli o düzenlemeyle yeniden üretir. Black Forest Labs imzalı Kontext ailesinin production kullanımına yönelik, kapalı ağırlıklı düzenleme kademesidir: açık ağırlıklı kademeye göre daha yüksek prompt uyumu ve daha güçlü tipografi sunar, ticari işler için ayarlanmıştır ve ticari kullanım hakları dahildir. Güçlü yanı, düzenlemeler boyunca korunan karakter ve sahne tutarlılığıdır — yüzler, ürünler, kompozisyon ve dokunulmayan bölgeler sıfırdan yeniden üretilmek yerine sabit kalır; böylece art arda yapılan düzenlemeler temiz biçimde birikir.

## En uygun olduğu işler - Bir fotoğrafa talimatla yapılan düzenlemeler — "ahşap zemini beyaz mermer yap", "gece olsun", "soldaki kişiyi kaldır" - Prompt uyumunun ve temiz tipografinin önem taşıdığı ticari ve pazarlama düzenlemeleri (okunaklı metin ve tabela düzenleyin ya da ekleyin) - Öznenin kimliğini ve pozunu koruyarak bir sahneyi yeniden tarzlamak ya da yeniden aydınlatmak - Ön planı yeniden üretmeden arka planları değiştirmek ya da yeniden tarzlamak - Tutarlılığın turlar boyunca korunması gereken yinelemeli, çok adımlı düzenlemeler

## Şu durumlarda başka bir model seçin - Kaynak fotoğrafınız yoksa ve yalnızca prompt’tan görsel üretmek istiyorsanız — bir text-to-image modeli kullanın - Düzenlenmiş sonucun canlandırılmasını ya da hareket etmesini istiyorsanız — bir image-to-video modeli kullanın - Yalnızca tek bir bölgenin hassas maskeli inpaint’i gerekiyorsa — özel bir inpainting modeli kullanın - En düşük maliyeti istiyorsanız ve açık ağırlık karşılığında biraz prompt uyumundan ödün verebiliyorsanız — FLUX.1 Kontext [dev] kullanın

## İpuçları - Değişikliği kesin biçimde tarif edin ve neyin aynı kalması gerektiğini söyleyin — Kontext bahsedilmeyen bölgeleri tutarlı tutar, dolayısıyla özgül talimatlar görselin daha azını değiştirir - Kaynak görselin en-boy oranına uymak için `aspect_ratio` alanını boş bırakın (hizalı önce/sonra karşılaştırması için önerilir); yalnızca çıktıyı bilerek yeniden çerçevelemek istediğinizde ayarlayın - Talimata daha güçlü uyum için `guidance_scale` değerini aralığın üst ucuna doğru yükseltin; düzenleme aşırı uygulanmış görünüyorsa düşürün

## Gelişmiş Yapılandırma - `guidance_scale` (1–20, varsayılan 3.5) sonucun talimatı ne kadar güçlü izleyeceğini belirler; daha güçlü düzenleme için yükseltin, düzenleme aşırı uygulanmış görünüyorsa düşürün. - `aspect_ratio` (varsayılan olarak boş) çıktının en-boy oranını zorlar — `21:9`, `16:9`, `4:3`, `3:2`, `1:1`, `2:3`, `3:4`, `9:16`, `9:21` değerlerinden biri. Girdi görselinin oranına uymak için boş bırakın. - `safety_tolerance` (`1`–`6`, varsayılan `2`) içerik denetimi sıkılığını ayarlar: `1` en sıkı, `6` en serbest. - `num_images` (1–4, varsayılan 1) kaç düzenlenmiş varyasyon üretileceğini belirler; üretilen her görsel ayrı faturalandırılır. - `output_format` `jpeg` (varsayılan) ya da `png` seçer. - `enhance_prompt` (varsayılan false) potansiyel olarak daha iyi sonuçlar için talimatınızı otomatik genişletir.

ModelRunner JavaScript client ile çalıştırmak için: ```js import { modelrunner } from "@modelrunner/client";

const result = await modelrunner.subscribe("black-forest-labs/flux-kontext/pro", { input: { prompt: "Change the wooden floor to white marble.", image_url: "https://media.modelrunner.ai/OnB0a9tFqLGcUP53RQ46n.png", guidance_scale: 3.5, output_format: "jpeg", }, }); ```