メインコンテンツへスキップ
POST
/
generate
/
k
/
flux-kontext
Flux Kontext 画像生成/編集
curl --request POST \
  --url https://api.sinancode.com/v1/generate/k/flux-kontext \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "prompt": "a beautiful landscape with mountains",
  "aspect_ratio": "16:9",
  "enable_translation": true,
  "input_image": "https://example.com/input.jpg",
  "model": "flux-kontext-pro",
  "output_format": "jpeg",
  "prompt_upsampling": false,
  "safety_tolerance": 2,
  "upload_cn": false,
  "watermark": ""
}
'
{
  "task_id": "01234567-89ab-cdef-0123-456789abcdef"
}
Flux Kontext モデルを使用して画像を生成します。 主な特徴:
  • 多言語サポート - 中国語プロンプトをサポートし、自動翻訳機能付き
  • コンテキスト認識 - インテリジェントなコンテキスト理解

承認

Authorization
string
header
必須

API トークンを使用して認証してください

ボディ

application/json

タスクパラメータ

prompt
string
必須

プロンプト(必須、英語対応)

Minimum string length: 1
:

"a beautiful landscape with mountains"

aspect_ratio
enum<string>
デフォルト:auto

アスペクト比(任意、デフォルト 16:9)

利用可能なオプション:
auto,
21:9,
16:9,
4:3,
1:1,
3:4,
9:16
:

"16:9"

enable_translation
boolean
デフォルト:true

自動翻訳を有効化(任意、デフォルト true)

:

true

input_image
string

入力画像 URL(任意、編集モードで使用)

:

"https://example.com/input.jpg"

model
enum<string>
デフォルト:flux-kontext-pro

モデルバージョン(任意、デフォルト flux-kontext-pro)

利用可能なオプション:
flux-kontext-pro,
flux-kontext-max
:

"flux-kontext-pro"

output_format
enum<string>
デフォルト:jpeg

出力形式(任意、デフォルト jpeg)

利用可能なオプション:
jpeg,
png
:

"jpeg"

prompt_upsampling
boolean
デフォルト:false

プロンプト強化を有効化(任意、デフォルト false)

:

false

safety_tolerance
integer
デフォルト:2

安全許容レベル(任意、0-6、デフォルト2)

必須範囲: 0 <= x <= 6
:

2

upload_cn
boolean

中国本土サーバーでアップロード(任意)

:

false

watermark
string

透かし識別子(任意)

:

""

レスポンス

OK

task_id
string
必須

Task ID

:

"01234567-89ab-cdef-0123-456789abcdef"