Skip to content

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

Black Forest Labs のロゴ

FLUX.1 Kontext [pro]

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

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

FLUX.1 Kontext [pro] は、テキストプロンプトから画像を生成・編集し、キャラクターとスタイルの一貫性が高いモデルです。

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

使い方

const response = await env.AI.run(
  'black-forest-labs/flux-1-kontext-pro',
  { prompt: 'A small furry elephant pet looks out from a cat house' },
)
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-pro",
  "input": {
    "prompt": "A small furry elephant pet looks out from a cat house"
  }
}'
テキストから画像
{
  "state": "Completed",
  "result": {
    "image": "https://examples.aig.cloudflare.com/black-forest-labs/flux-1-kontext-pro/text-to-image.png"
  },
  "gatewayMetadata": {
    "keySource": "Unified"
  }
}

ワイドなシネマティック画像 — ワイドなアスペクト比でシネマティックな風景を生成します。
const response = await env.AI.run(
  'black-forest-labs/flux-1-kontext-pro',
  {
    prompt:
      'A remote gas station swallowed by crimson fog, green glow from overhead lights staining the asphalt, cinematic wide shot',
    input_image:
      'https://cdn.sanity.io/images/gsvmb6gz/production/3ae6ee032b85373b84934574f3ac3bb2fb792d64-2048x1365.jpg',
    aspect_ratio: '16:9',
    output_format: 'jpeg',
  },
)
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-pro",
  "input": {
    "prompt": "A remote gas station swallowed by crimson fog, green glow from overhead lights staining the asphalt, cinematic wide shot",
    "input_image": "https://cdn.sanity.io/images/gsvmb6gz/production/3ae6ee032b85373b84934574f3ac3bb2fb792d64-2048x1365.jpg",
    "aspect_ratio": "16:9",
    "output_format": "jpeg"
  }
}'
ワイドなシネマティック画像
{
  "state": "Completed",
  "result": {
    "image": "https://examples.aig.cloudflare.com/black-forest-labs/flux-1-kontext-pro/wide-cinematic-image.jpeg"
  },
  "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

役に立ちましたか?