Skip to content

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

xAI のロゴ

Grok Imagine Image Quality

テキストから画像 • xAI

Markdown で表示Agent セットアップ
  • サードパーティ
  • ゼロデータ保持

よりシャープな細部、正確な構図、強力なテキスト描画に最適化した、xAI の高忠実度テキスト画像生成モデルです。参照画像とマスクによる画像編集に対応します。grok-imagine-image と比べて速度より品質を優先します。デフォルト出力は 2k 解像度です。

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

使い方

const response = await env.AI.run(
  'xai/grok-imagine-image-quality',
  { prompt: 'A golden retriever puppy playing in autumn leaves' },
)
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": "xai/grok-imagine-image-quality",
  "input": {
    "prompt": "A golden retriever puppy playing in autumn leaves"
  }
}'
簡単な生成
{
  "state": "Completed",
  "result": {
    "image": "https://examples.aig.cloudflare.com/xai/grok-imagine-image-quality/simple-generation.jpeg"
  },
  "gatewayMetadata": {
    "keySource": "Unified"
  }
}

高品質ポートレート — 2K 解像度の高品質ポートレート向きレンダリングです
const response = await env.AI.run(
  'xai/grok-imagine-image-quality',
  {
    prompt:
      'A detailed botanical illustration of exotic tropical flowers with fine line work and watercolor textures',
    aspect_ratio: '3:4',
    quality: 'high',
    resolution: '2k',
  },
)
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": "xai/grok-imagine-image-quality",
  "input": {
    "prompt": "A detailed botanical illustration of exotic tropical flowers with fine line work and watercolor textures",
    "aspect_ratio": "3:4",
    "quality": "high",
    "resolution": "2k"
  }
}'
高品質ポートレート
{
  "state": "Completed",
  "result": {
    "image": "https://examples.aig.cloudflare.com/xai/grok-imagine-image-quality/high-quality-portrait.png"
  },
  "gatewayMetadata": {
    "keySource": "Unified"
  }
}
シネマティックなワイド画面 — ワイド画面のシネマティックな構図です
const response = await env.AI.run(
  'xai/grok-imagine-image-quality',
  {
    prompt:
      'A neon-lit cyberpunk figure standing in the rain beneath a holographic billboard, cinematic lighting',
    aspect_ratio: '16:9',
    quality: 'high',
    resolution: '2k',
  },
)
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": "xai/grok-imagine-image-quality",
  "input": {
    "prompt": "A neon-lit cyberpunk figure standing in the rain beneath a holographic billboard, cinematic lighting",
    "aspect_ratio": "16:9",
    "quality": "high",
    "resolution": "2k"
  }
}'
シネマティックなワイド画面
{
  "state": "Completed",
  "result": {
    "image": "https://examples.aig.cloudflare.com/xai/grok-imagine-image-quality/cinematic-widescreen.png"
  },
  "gatewayMetadata": {
    "keySource": "Unified"
  }
}
中品質の風景 — バランス品質の風景レンダリングです
const response = await env.AI.run(
  'xai/grok-imagine-image-quality',
  {
    prompt:
      'A panoramic view of the northern lights over a snowy mountain range, vivid greens and purples dancing across the sky',
    aspect_ratio: '16:9',
    quality: 'medium',
    resolution: '1k',
  },
)
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": "xai/grok-imagine-image-quality",
  "input": {
    "prompt": "A panoramic view of the northern lights over a snowy mountain range, vivid greens and purples dancing across the sky",
    "aspect_ratio": "16:9",
    "quality": "medium",
    "resolution": "1k"
  }
}'
中品質の風景
{
  "state": "Completed",
  "result": {
    "image": "https://examples.aig.cloudflare.com/xai/grok-imagine-image-quality/medium-quality-landscape.jpeg"
  },
  "gatewayMetadata": {
    "keySource": "Unified"
  }
}
正方形の低品質下書き — 反復向けの高速な下書きです
const response = await env.AI.run(
  'xai/grok-imagine-image-quality',
  {
    prompt: 'A quiet Japanese garden in morning mist with a stone lantern and koi pond',
    aspect_ratio: '1:1',
    quality: 'low',
    resolution: '1k',
  },
)
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": "xai/grok-imagine-image-quality",
  "input": {
    "prompt": "A quiet Japanese garden in morning mist with a stone lantern and koi pond",
    "aspect_ratio": "1:1",
    "quality": "low",
    "resolution": "1k"
  }
}'
正方形の低品質下書き
{
  "state": "Completed",
  "result": {
    "image": "https://examples.aig.cloudflare.com/xai/grok-imagine-image-quality/square-low-quality-draft.jpeg"
  },
  "gatewayMetadata": {
    "keySource": "Unified"
  }
}

パラメーター

prompt
string必須
n
integerminimum: 1maximum: 10
aspect_ratio
stringenum: 1:1, 3:4, 4:3, 9:16, 16:9, 2:3, 3:2, 9:19.5, 19.5:9, 9:20, 20:9, 1:2, 2:1, auto
quality
stringenum: low, medium, high
resolution
stringenum: 1k, 2k
response_format
stringenum: url, b64_json
user
string
image
string生成画像です。上流の `response_format` に応じて、Base64 data URI(`data:image/png;base64,...`)または `https://` URL です(デフォルトは Base64)。

API スキーマ(Raw)

Input
Output

役に立ちましたか?