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.
Wypróbuj model
PNG, JPEG, WebP lub GIF · maksymalnie 20 MiB
PNG, JPEG, WebP lub GIF · maksymalnie 20 MiB
PNG, JPEG, WebP, or GIF · 20 MiB maximum each
Wybierz przykład, aby wczytać jego dane wejściowe i wynik do playgroundu.
{
"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.
Zacznij tworzyć
Prześlij ten model przez 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"Utwórz klucz API SandBase i ustaw go w środowisku serwera. Wszystkie żądania używają uwierzytelniania Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Przechowuj klucz na serwerze. Nie ujawniaj go w kodzie przeglądarkowym ani nie commituj do repozytorium.
Wyślij POST do /v1/run z tym identyfikatorem modelu i jego danymi wejściowymi. Powyższy przykład żądania obejmuje wysyłanie i odpytywanie statusu.
Użyj zwróconego ID uruchomienia, aby odpytywać status do momentu completion, failed lub timeout. Odczytaj wynik dopiero po completion.
curl "https://api.sandbase.ai/v1/run/$RUN_ID" \
-H "Authorization: Bearer $SANDBASE_API_KEY"Przekaż publicznie dostępny URL pliku w polu image, video lub audio modelu. Obsługiwane formaty i limity są pokazane obok każdego pola wejściowego w Playground.
Użyj kontrolki upload lub replace w obsługiwanych polach image w Playground. Pola URL wideo akceptują hostowany film źródłowy; nie oznacza to obsługi przesyłania wideo.
maskstringMask matching the source dimensions. Black edits, white preserves. Must contain both regions after rounding.
seedintegerRandom seed. Omit to choose automatically.
imagestringwymaganePrimary source image to edit.
promptstringwymaganeThe generation or editing prompt.
qualitystringQuality tier for either edit precision. Defaults to medium.
Domyślnie: "medium"
Możliwe wartości: "very_low", "low", "medium", "high"
aspect_ratiostringThe aspect ratio of the generated image.
Możliwe wartości: "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.
Domyślnie: "regular"
Możliwe wartości: "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"
}Zakończone uruchomienie udostępnia swój wynik w output. Poniżej znajduje się zapisany przykład modelu, a nie nowa generacja.
[
{
"url": "https://static.sandbase.ai/examples/3ee7e615-fd9a-4e53-b457-2790e4b945ba/output/22ae9074-722b-4433-8b1a-eaa223ddf6d6.png"
}
]