Skip to content

非公式本サイトは非公式の日本語ドキュメントであり、Cloudflare 公式サイトではありません。最新情報はdevelopers.cloudflare.comをご確認ください。

Black Forest Labs のロゴ

FLUX.1 Kontext [max]

テキストから画像 • Black Forest Labs

Markdown で表示Agent セットアップ
  • サードパーティ

FLUX.1 Kontext [max] は、Black Forest Labs の Kontext モデルで最高品質です。テキストから画像の生成と、コンテキストを考慮した画像編集に対応します。

モデル情報
利用規約とライセンスリンク
詳細情報リンク
料金Cloudflare ダッシュボードで料金を見る

使い方

const response = await env.AI.run(
  'black-forest-labs/flux-1-kontext-max',
  {
    prompt:
      'A lone warrior in bloodstained samurai armor stands before a pagoda engulfed in flames, cinematic dark fantasy realism',
  },
)
console.log(response)
curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \
  --header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
  --header "Content-Type: application/json" \
  --data '{
  "model": "black-forest-labs/flux-1-kontext-max",
  "input": {
    "prompt": "A lone warrior in bloodstained samurai armor stands before a pagoda engulfed in flames, cinematic dark fantasy realism"
  }
}'
最高品質の生成
{
  "state": "Completed",
  "result": {
    "image": "https://examples.aig.cloudflare.com/black-forest-labs/flux-1-kontext-max/maximum-quality-generation.png"
  },
  "gatewayMetadata": {
    "keySource": "Unified"
  }
}

再現可能な生成 — 再現可能な画像生成のため、シードと PNG 出力を使います。
const response = await env.AI.run(
  'black-forest-labs/flux-1-kontext-max',
  {
    prompt:
      'A detailed oil painting portrait of a Renaissance nobleman with an intricate lace collar',
    seed: 42,
    output_format: 'png',
  },
)
console.log(response)
curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \
  --header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
  --header "Content-Type: application/json" \
  --data '{
  "model": "black-forest-labs/flux-1-kontext-max",
  "input": {
    "prompt": "A detailed oil painting portrait of a Renaissance nobleman with an intricate lace collar",
    "seed": 42,
    "output_format": "png"
  }
}'
再現可能な生成
{
  "state": "Completed",
  "result": {
    "image": "https://examples.aig.cloudflare.com/black-forest-labs/flux-1-kontext-max/reproducible-generation.png"
  },
  "gatewayMetadata": {
    "keySource": "Unified"
  }
}

パラメーター

prompt
string必須画像の生成または編集用のテキストプロンプトです。
input_image
string | null編集する画像です。Base64 エンコードまたは URL の任意指定です。
aspect_ratio
string | null出力のアスペクト比です。3:7 から 7:3 です。デフォルトは 1:1 です。
seed
integer | null生成結果を再現するための任意のシードです。
prompt_upsampling
booleanプロンプトをアップサンプルするかどうかです。デフォルトは false です。
safety_tolerance
integerminimum: 0maximum: 6モデレーションの許容度です。0 が最も厳しく、6 が最も緩いです。
output_format
stringenum: jpeg, png出力画像の形式です。デフォルトは jpeg です。
image
stringformat: uri生成された画像の URL です

API スキーマ(Raw)

Input
Output

役に立ちましたか?