maskstring
Mask matching the source dimensions. Black edits, white preserves. Must contain both regions after rounding.
ideogram/4.6/editIdeogram 4.6 Edit changes an image from a text instruction, with optional mask and reference images, keeping text rendering sharp.
試用這個模型
PNG、JPEG、WebP 或 GIF · 最多 20 MiB
PNG、JPEG、WebP 或 GIF · 最多 20 MiB
PNG, JPEG, WebP, or GIF · 20 MiB maximum each
選擇一個範例,將其輸入與結果載入 playground。
{
"aspect_ratio": "16:9",
"image": "https://static.sandbase.ai/examples/3ee7e615-fd9a-4e53-b457-2790e4b945ba/input/1afe56cd-80cf-44e1-a55d-3218e5c95995.png",
"prompt": "add the word SALE in red"
}{
"aspect_ratio": "16:9",
"image": "https://static.sandbase.ai/examples/88ea41ea-fbce-48a9-a5fe-45dadc09e9fa/input/ed5f398b-7d7a-4621-923c-ef7950f6a04b.png",
"prompt": "change the background to a snowy street at night"
}Ideogram 4.6 edit: change an image from an instruction, with an optional mask and style references.
| Field | Type | Default | Notes |
|---|---|---|---|
prompt | string, required | — | Up to 10,000 characters. |
image | image URL, required | — | Image to edit. JPEG, PNG, or WebP URL. |
mask | image URL | — | Optional mask; white areas are edited. |
edit_precision | regular / high | regular | high keeps unmasked areas closer to the original. |
reference_image_urls | image URL[] | — | Optional style references. |
quality | very_low / very_low / low / medium / high | medium | Sets the per-image rate. |
aspect_ratio | 21:9 / 16:9 / 3:2 / 4:3 / 5:4 / 1:1 / 4:5 / 3:4 / 2:3 / 9:16 | — | Output shape. |
seed | integer | random | Fix it to compare prompt changes. |
Per image: $0.008 very_low, $0.03 low, $0.06 medium, $0.22 high.
| Quality | Price |
|---|---|
| very_low | $0.008 |
| low | $0.03 |
| medium | $0.06 |
| high | $0.22 |
| Failed runs are not charged. |
Related: ideogram/4.6, ideogram/4.5/edit.
開始建置
透過 SandBase Unified Run API 提交此模型。
# The quoted heredoc keeps Unicode and shell metacharacters unchanged.
result=$(curl --fail-with-body --silent \
-X POST "https://api.sandbase.ai/v1/run" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @- <<'SANDBASE_JSON'
{
"model": "ideogram/4.6/edit",
"prompt": "A colorful storefront with a sign reading hello",
"quality": "medium",
"edit_precision": "regular"
}
SANDBASE_JSON
)
run_id=$(printf '%s' "$result" | jq -r .id)
for attempt in $(seq 1 120); do
status=$(printf '%s' "$result" | jq -r .status)
case "$status" in completed|failed|timeout) break ;; esac
sleep 2
result=$(curl --fail-with-body --silent \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
"https://api.sandbase.ai/v1/run/$run_id")
done
status=$(printf '%s' "$result" | jq -r .status)
[ "$status" = completed ] || { echo "Generation ended: $status" >&2; exit 1; }
printf '%s\n' "$result"建立 SandBase API 金鑰,並將其設定在伺服器環境中。所有請求都使用 Bearer 驗證。
export SANDBASE_API_KEY="YOUR_API_KEY"請將金鑰保留在伺服器端,不要在瀏覽器程式碼中公開,也不要提交到儲存庫。
使用此模型 ID 及其輸入,向 /v1/run 發送 POST。上方的請求範例包含提交與輪詢。
使用回傳的執行 ID 持續輪詢,直到狀態為 completed、failed 或 timeout。只有在 completed 之後才讀取輸出。
curl "https://api.sandbase.ai/v1/run/$RUN_ID" \
-H "Authorization: Bearer $SANDBASE_API_KEY"在模型的 image、video 或 audio 欄位中傳入可公開存取的檔案 URL。支援格式與限制會顯示在每個 Playground 輸入欄位旁。
在 Playground 中支援的圖片欄位上使用上傳或取代控制項。影片 URL 欄位可接受託管的 driving video;它們不代表支援影片上傳。
maskstringMask matching the source dimensions. Black edits, white preserves. Must contain both regions after rounding.
seedintegerRandom seed. Omit to choose automatically.
imagestring必填Primary source image to edit.
promptstring必填The generation or editing prompt.
qualitystringQuality tier for either edit precision. Defaults to medium.
預設:"medium"
可能值:"very_low", "low", "medium", "high"
aspect_ratiostringThe aspect ratio of the generated image.
可能值:"21:9", "16:9", "3:2", "4:3", "5:4", "1:1", "4:5", "3:4", "2:3", "9:16"
edit_precisionstringregular uses Generate; high uses Precise Edit with unchanged-pixel restoration. Both always prepare structured edit instructions.
預設:"regular"
可能值:"regular", "high"
reference_image_urlsarrayUp to four references plus the primary source, or three references plus the primary source and mask.
{
"model": "ideogram/4.6/edit",
"prompt": "A colorful storefront with a sign reading hello",
"quality": "medium",
"edit_precision": "regular"
}已完成的執行會在輸出中顯示結果。以下為模型已儲存的範例,並非新的生成結果。
[
{
"url": "https://static.sandbase.ai/examples/3ee7e615-fd9a-4e53-b457-2790e4b945ba/output/22ae9074-722b-4433-8b1a-eaa223ddf6d6.png"
}
]