輸出解析度
根據已發布的 endpoint schema,支援 1k, 2k。
Adjustable steps + guidance; up to 10 ref images; best typography
curl -X POST https://runapi.ai/api/v1/flux_2/text_to_image \
-H "Authorization: Bearer $RUNAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "flux-2-flex-text-to-image",
"prompt": "Generate a photorealistic studio portrait of an astronaut holding a cat, dramatic rim lighting, fine detail."
}'
import { Flux2Client } from "@runapi.ai/flux-2";
const client = new Flux2Client();
const result = await client.textToImage.run({
model: "flux-2-flex-text-to-image",
prompt: "Generate a photorealistic studio portrait of an astronaut holding a cat, dramatic rim lighting, fine detail.",
});
import os
import requests
response = requests.post(
"https://runapi.ai/api/v1/flux_2/text_to_image",
headers={"Authorization": f"Bearer {os.environ['RUNAPI_API_KEY']}"},
json={"model":"flux-2-flex-text-to-image","prompt":"Generate a photorealistic studio portrait of an astronaut holding a cat, dramatic rim lighting, fine detail."}
)
response.raise_for_status()
<?php
$client = curl_init("https://runapi.ai/api/v1/flux_2/text_to_image");
curl_setopt_array($client, [
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("RUNAPI_API_KEY"), "Content-Type: application/json"],
CURLOPT_POSTFIELDS => json_encode([
'model' => 'flux-2-flex-text-to-image',
'prompt' => 'Generate a photorealistic studio portrait of an astronaut holding a cat, dramatic rim lighting, fine detail.',
])
]);
$response = curl_exec($client);
RunApi client = new RunApi(System.getenv("RUNAPI_API_KEY"));
Task task = client.textToImage().run({"model":"flux-2-flex-text-to-image","prompt":"Generate a photorealistic studio portrait of an astronaut holding a cat, dramatic rim lighting, fine detail."});
task.waitForResult();
require "runapi/flux_2"
client = RunApi::Flux2::Client.new
result = client.text_to_image.run(
model: "flux-2-flex-text-to-image",
prompt: "Generate a photorealistic studio portrait of an astronaut holding a cat, dramatic rim lighting, fine detail."
)
client := runapi.NewClient(os.Getenv("RUNAPI_API_KEY"))
task, err := client.textToImage.Run({"model":"flux-2-flex-text-to-image","prompt":"Generate a photorealistic studio portrait of an astronaut holding a cat, dramatic rim lighting, fine detail."})
if err != nil { log.Fatal(err) }
task.Wait()
$ runapi generate \
--model flux-2-flex-text-to-image \
--endpoint text_to_image \
--wait
6 個版本可用
選擇任意模型,數秒內即可開始生成。
選擇任意模型,數秒內即可開始生成。
| 提供者 | Black Forest Labs |
| 模型 ID | flux-2-flex-text-to-image |
| 模態 | Image |
| 任務類型 | Asynchronous |
| API 端點 | /api/v1/flux_2/text_to_image |
| 計費單位 | call |
| 輸入參數 | aspect_ratio, callback_url, enable_safety_checker, model, output_resolution, prompt |
| 最大解像度 | 1k, 2k |
| 長寬比 | 1:1, 4:3, 3:4, 16:9, 9:16, 3:2, 2:3 |
| 目錄狀態 | 可正常運作 |
免費註冊後,在控制台建立 flux-2-flex-text-to-image 的 API 金鑰。
向 /api/v1/flux_2/text_to_image 發送 POST 請求,並傳入 flux-2-flex-text-to-image 模型 ID 和參數。
輪詢工作或按照回呼取得已完成的 flux-2-flex-text-to-image 結果。
根據已發布的 endpoint schema,支援 1k, 2k。
可設定 4 個已記錄的參數,包括 aspect_ratio, enable_safety_checker, output_resolution, prompt。
開放 1 個公開 endpoint:text_to_image。
非同步任務接受回調 URL,用於接收完成通知。
promptImage description.
aspect_ratioOutput aspect ratio. (1:1, 4:3, 3:4, 16:9, 9:16, 3:2, 2:3)
callback_urlWebhook URL for async notifications.
output_resolutionOutput resolution. (1k, 2k)
enable_safety_checkerEnable the safety checker.
自動生成適合電商 catalog、但冇 studio 攝影的 lifestyle 產品相。
在落實最終美術之前,快速構思場景同角色。
大規模生成獨特封面圖同插畫,適合 blog post 同文章。
傳入 quickstart 顯示嘅 model ID。
每個 key 的 rate limit 會按使用層級而定。請查看定價頁了解最新限制。
可以——variant 只係一個旗標。只要更改 model 參數就可以切換。
在可用 streaming 的情況下,RunAPI 會端到端串流。
可以在公開 GitHub repo 開 issue,或者電郵支援團隊。