Flux Kontext Max API इंटीग्रेशन
Rivya Public API v1 के जरिए मॉडल id flux-kontext-max, समर्थित इनपुट, पैरामीटर, Files API नियम, क्रेडिट और रिस्पॉन्स उदाहरणों के साथ Flux Kontext Max का उपयोग करें।
flux-kontext-max
text, file
संदर्भ mode के लिए जरूरी
8
इमेज
FIXED
प्रॉम्प्ट सीमा दर्ज नहीं है
रिक्वेस्ट अनुबंध
मॉडल id को शीर्ष स्तर पर भेजें। मॉडल के लिए खास कंट्रोल params में रखें।
| Key | प्रकार | जरूरी | डिफॉल्ट | विवरण |
|---|---|---|---|---|
| model | string | हां | flux-kontext-max | flux-kontext-max API मॉडल id का उपयोग करें। |
| prompt | string | हां | - | टेक्स्ट इनपुट समर्थित मॉडल के लिए प्रॉम्प्ट टेक्स्ट। |
| params | object | नहीं | - | मॉडल के लिए खास पैरामीटर ऑब्जेक्ट। अनुमत keys के लिए नीचे दी गई पंक्तियां देखें। |
| client_request_id | string | नहीं | - | अपने सिस्टम में रिक्वेस्ट ट्रेस करने के लिए वैकल्पिक client-side id। |
मॉडल पैरामीटर
| Key | प्रकार | जरूरी | डिफॉल्ट | सीमा | विकल्प | विवरण |
|---|---|---|---|---|---|---|
| aspectRatio | select | नहीं | 16:9 | - | 21:9, 16:9, 4:3, 1:1, 3:4, 9:16 | आस्पेक्ट रेशियो |
| outputFormat | select | नहीं | jpeg | - | jpeg, png | JPEG छोटा होता है, जबकि PNG पारदर्शिता या साफ lossless किनारों के लिए बेहतर है। |
| enableTranslation | select | नहीं | true | - | true, false | Prompt अपने-आप अनुवाद करें |
| promptUpsampling | select | नहीं | false | - | false, true | चालू होने पर, Rivya generation से पहले model को आपका prompt विस्तार और निखारने देता है। इससे अक्सर detail quality में मदद मिलती है, लेकिन result आपके raw prompt से ज्यादा interpretive भी हो सकता है। |
| safetyTolerance | number | नहीं | 2 | min 0 / max 6 | - | यह तय करता है कि content moderation कितना strict हो। Generation आम तौर पर editing से wider range allow करता है; lower values ज्यादा strict होती हैं और higher values ज्यादा permissive होती हैं। |
| watermark | text | नहीं | - | - | - | वॉटरमार्क |
अपलोड नीति
पहले संदर्भ फाइल अपलोड करें, फिर लौटे हुए URL और duration token को params.referenceMediaItems में रखें।
संदर्भ इमेज: इमेज एडिटिंग प्रोजेक्ट के लिए अधिकतम 1 इमेज फ़ाइल अपलोड करें।
1
image
अवधि सत्यापन जरूरी होने पर वीडियो और ऑडियो संदर्भों में /api/v1/files से मिला durationToken होना चाहिए।
| kind | अधिकतम आकार | MIME प्रकार |
|---|---|---|
| image | 10 MB | image/jpeg, image/png, image/webp |
न्यूनतम रिक्वेस्ट
{
"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": "वैकल्पिक वॉटरमार्क टेक्स्ट"
}
}संदर्भ फाइल रिक्वेस्ट
{
"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 एंडपॉइंट सार्वजनिक टास्क id लौटाता है। टास्क सफल या विफल होने तक स्टेटस एंडपॉइंट पोल करें।
{
"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
}सामान्य त्रुटियां
validation_failed, insufficient_credits, idempotency_conflict, rate_limited, not_found
कुछ mode में Files API संदर्भ अपलोड जरूरी हैं।