Skip to content
הדף עדיין אינו זמין בשפה שלכם, ולכן הוא מוצג באנגלית.
Black Forest Labs · FLUX

flux-kontext-pro API

Generate and edit context-aware images with flux-kontext-pro on APISea.

יצירת תמונותתמונותמשימה אסינכרונית
מזהה מודל
flux-kontext-pro

תמחור API של flux-kontext-pro

כל המחירים נקובים ב-USD. תעריפי APISea בהשוואה למחירון הרשמי עבור אותה יחידה.

אפשרותAPISeaרשמיחיסכון
ברירת מחדלברירת מחדל$0.0352$0.04−12%

המחירים הם לכל תמונה.

מהו flux-kontext-pro?

flux-kontext-pro is Black Forest Labs’ FLUX model for context-aware image generation and editing in general-purpose workflows. Use a text prompt to generate an image from scratch, or supply reference images and describe the changes to apply. It supports publicly accessible image URLs and Base64 reference inputs, with up to four reference images per task. Outputs are approximately 1 MP, with square, landscape, portrait, and reference-matched aspect ratio options, plus PNG, JPEG, and WebP encoding.

On APISea, submit an asynchronous request to the image generation endpoint, then poll the returned task ID to retrieve the result. Controls include a seed for reproducible output with the same parameters, optional prompt rewriting, and configurable safety tolerance. APISea Default pricing is $0.0352 per image, about 12% below the provider list price of $0.04 per image. Access it through APISea’s shared API key and OpenAI-compatible base URL, with pay-as-you-go billing only for successful requests.

המאפיינים הבולטים של flux-kontext-pro

Generation and Editing

Generate images from text alone or apply prompt-described edits to reference images. Both workflows use the same image generation endpoint.

Multiple Reference Inputs

Supply up to four reference images through publicly accessible URLs or Base64 input. The output and all references must stay within a combined 9 MP.

Aspect Ratio Controls

Choose from nine supported aspect ratios or use auto to follow a reference image’s ratio. Without a reference, auto defaults to 1:1.

Reproducible Generation Controls

Reuse the same seed and parameters for reproducible output. Optional prompt upsampling can enhance and rewrite the prompt before generation.

איך לקרוא ל-API של flux-kontext-pro ב-4 שלבים

  1. 01

    יצירת מפתח API

    יש להתחבר ל-APISea, להוסיף יתרה החל מ-$50 וליצור מפתח sk-sea במסוף.

  2. 02

    הגדרת כתובת הבסיס

    יש להשתמש ב-https://api.apisea.ai/v1 ככתובת הבסיס ב-SDK או בלקוח HTTP.

  3. 03

    שליחת הבקשה

    יש לקרוא ל-POST /v1/images/generations עם "model": "flux-kontext-pro" והפרמטרים שלהלן.

  4. 04

    טיפול בתגובה

    התגובה מכילה task_id. יש לשלוח בקשות GET אל /v1/tasks/{task_id} עד שהסטטוס יהיה completed, ואז להוריד את כתובות ה-URL של התוצאות.

curl --request POST \
  --url https://api.apisea.ai/v1/images/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "flux-kontext-pro",
    "prompt": "Change the hair color to blue",
    "image_urls": ["https://example.com/portrait.jpg"],
    "size": "1:1",
    "output_format": "png"
  }'

פרמטרים

פרמטרסוגנדרשברירת מחדלתיאור
modelstringנדרש—Model name:
nsfw_checkbooleanאופציונליfalseWhether to run content moderation before submitting the image task.
promptstringנדרש—Text description of the image to generate or the edit to apply to the reference images.
image_urlsarrayאופציונלי—Reference images for image editing. Publicly accessible image URLs and Base64 input are supported.
sizestringאופציונלי1:1Output aspect ratio. A pixel string such as `1024x1536` is also accepted, but Kontext maps it to the closest supported ratio rather than producing those exact pixel dimensions. Supported aspect ratios and automatic mode:
output_formatstringאופציונליpngOutput image encoding. Supported values: `png`, `jpeg`, and `webp`.
response_formatstringאופציונלי—OpenAI-compatible response-shape field. It accepts only `url` or `b64_json` and does not change the image encoding. When both fields are supplied, `output_format` takes priority.
nintegerאופציונלי1Number of images generated per task. The only supported value is `1`; submit multiple tasks concurrently if you need multiple images.
seedintegerאופציונלי—Random seed. Reuse the same seed and parameters for reproducible output; omit it to use a random seed.
prompt_upsamplingbooleanאופציונליfalseWhether to enhance and rewrite the prompt before generation.
safety_toleranceintegerאופציונלי2Safety tolerance from `0` to `6`. Higher values are more permissive.

מה אפשר לבנות עם flux-kontext-pro

Text-to-image tools

Build a prompt-based image creation interface with selectable aspect ratios and PNG, JPEG, or WebP output.

Reference-based editing

Let users upload reference images and describe edits in text, submitting those inputs together in a single task.

Multi-reference workflows

Build an image editing workflow that accepts several visual references, while validating the four-image and combined 9 MP limits.

Repeatable image experiments

Record prompts, seeds, and generation parameters so teams can reproduce outputs and compare controlled changes.

טיפים לקבלת תוצאות טובות יותר

  • 01

    Submit, then poll

    Send the task to POST /v1/images/generations and store the returned task ID. Poll GET /v1/tasks/{task_id} to retrieve the generated image.

  • 02

    Use size for framing

    Set size to a supported ratio or auto; do not send width or height. Pixel strings map to the closest supported ratio rather than producing exact requested dimensions.

  • 03

    Keep prompts unchanged

    Explicitly set prompt_upsampling to false when you do not want prompt rewriting. Reuse the same seed and parameters when reproducibility matters.

  • 04

    Plan multiple images

    Set n to 1, the only supported value, and submit concurrent tasks for multiple images. Budget using the APISea Default rate of $0.0352 per image.

מגבלות ודברים שכדאי לדעת

  • Each asynchronous task supports only one output image.

  • Reference inputs are limited to four images, with output and references totaling no more than 9 MP.

  • Width and height cause task failure; resolution has no effect on the approximately 1 MP output.

שאלות נפוצות על API של flux-kontext-pro

How much does flux-kontext-pro cost on APISea?

APISea Default costs $0.0352 per image, about 12% below the provider list price of $0.04 per image. Pricing is pay-as-you-go, with billing only for successful requests.

How do I call flux-kontext-pro through the API?

Use Bearer Token authentication and POST to https://api.apisea.ai/v1/images/generations with model set to flux-kontext-pro and a required prompt. The response returns a task ID; poll GET /v1/tasks/{task_id} for the result.

Can flux-kontext-pro edit existing images?

Yes. Provide image_urls containing publicly accessible image URLs or Base64 inputs, then describe the edit in prompt. It accepts up to four references, with a combined output-plus-reference limit of 9 MP.

Which output sizes and formats are supported?

Supported ratios are 1:1, 4:3, 3:4, 16:9, 9:16, 3:2, 2:3, 21:9, and 9:21, plus auto. Output is approximately 1 MP and supports PNG, JPEG, and WebP; arbitrary pixel strings are mapped to a supported ratio.

Can I use flux-kontext-pro images commercially?

Commercial use is subject to the provider’s terms. Review Black Forest Labs’ applicable terms for your intended use before deploying generated images.

What is the difference between flux-kontext-pro and flux-kontext-max?

The documentation describes flux-kontext-pro as supporting general-purpose context-aware generation and editing, while flux-kontext-max is described as higher-quality. Both support text-to-image generation and editing with reference images.

מודלים קשורים

עומק: יותר מ-250 מודלים · טעינת יתרה מינימלית $50

מתחילים לבנות עם flux-kontext-pro

מפתח אחד, תשלום לפי שימוש החל מ-$50, וחיוב רק על בקשות שהצליחו.