Rivya AI Docs
Model API Pages

Flux Kontext Max API Integration

Flux Kontext Max کو Rivya Public API v1 کے ذریعے model id flux-kontext-max، supported inputs، parameters، Files API rules، credits اور response examples کے ساتھ استعمال کریں۔

API کے ذریعے availableText یا URL ready؛ reference modes Files API استعمال کرتے ہیںImage
API model id

flux-kontext-max

Inputs

text, file

Files API

Reference modes کے لیے required

Base credits

8

Capability

Image

Billing

FIXED

Prompt limit

کوئی documented prompt limit نہیں

Request contract

model id کو top level پر بھیجیں۔ Model-specific controls params میں رہتے ہیں۔

KeyTypeRequiredDefaultDescription
modelstringYesflux-kontext-maxflux-kontext-max API model id استعمال کریں۔
promptstringYes-Text input support کرنے والے models کے لیے prompt text۔
paramsobjectNo-Model-specific parameter object۔ allowed keys کے لیے نیچے والی rows استعمال کریں۔
client_request_idstringNo-آپ کے system میں requests trace کرنے کے لیے optional client-side id۔

Model parameters

KeyTypeRequiredDefaultRangeOptionsDescription
aspectRatioselectNo16:9-21:9, 16:9, 4:3, 1:1, 3:4, 9:16پہلو کا تناسب
outputFormatselectNojpeg-jpeg, pngJPEG چھوٹا ہوتا ہے، جبکہ PNG transparency یا cleaner lossless edges کے لیے بہتر ہے۔
enableTranslationselectNotrue-true, falsePrompt auto-translate کریں
promptUpsamplingselectNofalse-false, trueفعال ہونے پر Rivya generation سے پہلے model کو آپ کا prompt expand اور polish کرنے دیتا ہے۔ یہ اکثر detail quality میں مدد کرتا ہے، مگر result کو raw prompt سے زیادہ interpretive بھی بنا سکتا ہے۔
safetyTolerancenumberNo2min 0 / max 6-یہ control کرتا ہے کہ content moderation کتنی strict ہو۔ Generation عموماً editing سے wider range allow کرتی ہے؛ lower values زیادہ strict اور higher values زیادہ permissive ہوتے ہیں۔
watermarktextNo---واٹرمارک

Upload policy

Reference files پہلے upload کریں، پھر returned URL اور duration token کو params.referenceMediaItems کے اندر رکھیں۔

Reference rule

حوالہ تصویر: Image editing projects کے لیے 1 image file تک upload کریں۔

Max files

1

Accepted file kinds

image

Duration token

duration verification required ہو تو video اور audio references کو /api/v1/files سے durationToken ساتھ رکھنا چاہیے۔

kindMax sizeMIME types
image10 MBimage/jpeg, image/png, image/webp

Minimal request

{
  "model": "flux-kontext-max",
  "prompt": "A clean editorial product image on a soft studio background",
  "params": {
    "aspectRatio": "16:9",
    "outputFormat": "jpeg",
    "enableTranslation": "true",
    "promptUpsampling": "false",
    "safetyTolerance": 2,
    "watermark": "اختیاری واٹرمارک متن"
  }
}

Reference-file request

{
  "model": "flux-kontext-max",
  "prompt": "A clean editorial product image on a soft studio background",
  "params": {
    "aspectRatio": "16:9",
    "outputFormat": "jpeg",
    "enableTranslation": "true",
    "promptUpsampling": "false",
    "safetyTolerance": 2,
    "watermark": "اختیاری واٹرمارک متن",
    "referenceMediaItems": [
      {
        "url": "https://cdn.example.com/reference-image.png",
        "kind": "image",
        "name": "reference-image.png",
        "mimeType": "image/png"
      }
    ]
  }
}

Create response

create endpoint ایک public task id واپس کرتا ہے۔ task succeeded یا failed ہونے تک status endpoint poll کریں۔

{
  "id": "task_flux_kontext_max_example",
  "status": "queued",
  "model": "flux-kontext-max",
  "reserved_credits": 8,
  "final_credits": 0,
  "created_at": "2026-05-11T00:00:00.000Z",
  "updated_at": "2026-05-11T00:00:00.000Z",
  "result": null,
  "error": null
}

Common errors

validation_failed, insufficient_credits, idempotency_conflict, rate_limited, not_found

کچھ modes کو Files API reference uploads درکار ہوتے ہیں۔