Skip to content

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

Black Forest Labs のロゴ

FLUX.2 [max]

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

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

FLUX.2 [max] は Black Forest Labs の最高品質の画像モデルです。編集の一貫性、プロンプトへの追従性に優れ、リアルタイム情報の可視化向け grounding search に対応します。

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

使い方

const response = await env.AI.run(
  'black-forest-labs/flux-2-max',
  {
    prompt:
      'A cat on its back legs running like a human is holding a big silver fish with its arms. The cat is running away from the shop owner and has a panicked look on his face. The scene is situated in a crowded market.',
    height: 2048,
    width: 1440,
  },
)
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-2-max",
  "input": {
    "prompt": "A cat on its back legs running like a human is holding a big silver fish with its arms. The cat is running away from the shop owner and has a panicked look on his face. The scene is situated in a crowded market.",
    "height": 2048,
    "width": 1440
  }
}'
高解像度の場面
{
  "state": "Completed",
  "result": {
    "image": "https://examples.aig.cloudflare.com/black-forest-labs/flux-2-max/high-resolution-scene.jpeg"
  },
  "gatewayMetadata": {
    "keySource": "Unified"
  }
}

16 進カラー指定 — 16 進コードで正確に色を制御します。ブランド一貫性のある画像に便利です
const response = await env.AI.run(
  'black-forest-labs/flux-2-max',
  {
    prompt:
      'A vase on a table in living room, the color of the vase is a gradient of color, starting with color #02eb3c and finishing with color #edfa3c. The flowers inside the vase have the color #ff0088',
  },
)
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-2-max",
  "input": {
    "prompt": "A vase on a table in living room, the color of the vase is a gradient of color, starting with color #02eb3c and finishing with color #edfa3c. The flowers inside the vase have the color #ff0088"
  }
}'
16 進カラー指定
{
  "state": "Completed",
  "result": {
    "image": "https://examples.aig.cloudflare.com/black-forest-labs/flux-2-max/hex-color-control.jpeg"
  },
  "gatewayMetadata": {
    "keySource": "Unified"
  }
}
画像編集 — 単一参照の画像編集です。製品写真のライティングや構図を変えられます
const response = await env.AI.run(
  'black-forest-labs/flux-2-max',
  {
    prompt: 'Place this product onto a minimalist marble countertop with soft window light',
    input_images: [
      'https://replicate.delivery/xezq/jCypj4MeXYUiRyq7nfgm8z1OvFZF81wh4FznutDsZOuJz0YWA/tmp1iukn307.jpg',
    ],
  },
)
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-2-max",
  "input": {
    "prompt": "Place this product onto a minimalist marble countertop with soft window light",
    "input_images": [
      "https://replicate.delivery/xezq/jCypj4MeXYUiRyq7nfgm8z1OvFZF81wh4FznutDsZOuJz0YWA/tmp1iukn307.jpg"
    ]
  }
}'
画像編集
{
  "state": "Completed",
  "result": {
    "image": "https://examples.aig.cloudflare.com/black-forest-labs/flux-2-max/image-editing.jpeg"
  },
  "gatewayMetadata": {
    "keySource": "Unified"
  }
}

パラメーター

prompt
string必須画像の生成または編集用のテキストプロンプトです。
seed
integerminimum: -9007199254740991maximum: 9007199254740991生成結果を再現するための任意のシードです。
width
integerminimum: 64maximum: 9007199254740991生成画像の幅(ピクセル、最小 64)です。省略すると BFL が選びます。
height
integerminimum: 64maximum: 9007199254740991生成画像の高さ(ピクセル、最小 64)です。省略すると BFL が選びます。
safety_tolerance
integerminimum: 0maximum: 5入力/出力モデレーションの許容度です。0 が最も厳しく、5 が最も緩いです。デフォルトは 2 です。
output_format
stringenum: jpeg, png, webp出力画像の形式です。デフォルトは jpeg です。
image
stringformat: uri生成された画像の URL です

API スキーマ(Raw)

Input
Output

役に立ちましたか?