promptstringwymagane
The text prompt to generate an image from.
Domyślnie: "Generate an image of gray tabby cat hugging an otter with an orange scarf"
openai/gpt-image-2GPT Image 2, OpenAI's latest image model, is capable of making fine-grained, detailed edits to images.
Wypróbuj model
Wybierz przykład, aby wczytać jego dane wejściowe i wynik do playgroundu.
{
"aspect_ratio": "16:9",
"prompt": "Create a photorealistic candid photograph of an elderly sailor standing on a small fishing boat.\nHe has weathered skin with visible wrinkles, pores, and sun texture, and a few faded traditional sailor tattoos on his arms.\nHe is calmly adjusting a net while his dog sits nearby on the deck. Shot like a 35mm film photograph, medium close-up at eye level, using a 50mm lens.\nSoft coastal daylight, shallow depth of field, subtle film grain, natural color balance.\nThe image should feel honest and unposed, with real skin texture, worn materials, and everyday detail. No glamorization, no heavy retouching."
}{
"aspect_ratio": "16:9",
"prompt": "Create a detailed Infographic of the functioning and flow of an automatic coffee machine like a Jura.\nFrom bean basket, to grinding, to scale, water tank, boiler, etc.\nI'd like to understand technically and visually the flow."
}{
"aspect_ratio": "16:9",
"prompt": "Give me a cool in culture ad / fashion shot for a brand called Thread.\nIt's a hip young street brand. The ad shows a group of friends hanging out together with the tagline \"Yours to Create.\"\nMake it feel like a polished campaign image for a youth streetwear audience: stylish, contemporary, energetic, and tasteful.\nUse clean composition, strong color direction, natural poses, and premium fashion photography cues.\nRender the tagline exactly once, clearly and legibly, integrated into the ad layout.\nNo extra text, no watermarks, no unrelated logos."
}{
"aspect_ratio": "16:9",
"output_format": "png",
"prompt": "Blog cover image for: \"TikTok Fake View Detection, Tested\". Article brief (context for the 3D subject only; do not render any of its words): \"TikTok fake views detection, tested: 68 public videos through one detector API. What drives its score, how stable it is, and why video age beats likes.\". A premium dark cinematic technology cover for the SandBase engineering blog. Canvas: near-black graphite and midnight navy. Emerald/mint illumination is the main accent, with restrained cyan and at most one small coral or amber warning accent. Composition: follow the named layout family exactly. Show one coherent, article-specific high-detail 3D technical subject made from black metal, smoked glass, etched circuitry, controlled reflections, realistic depth, and subtle volumetric light. The visual language is the established SandBase dark cover family: dark hard-surface hardware lit in mint, one subject, generous negative space around the typography. The result should feel like a cinematic AI hardware launch key visual, not a presentation slide. Every surface, panel, card, and prop inside the 3D subject is blank: no text, numbers, code, or symbols that read as words. Absolutely NO white or light-gray background, thin abstract line art as the hero visual, flat dashboards, browser windows, product cards, generic robots, cartoon brains, floating cubes, chaotic node webs, purple gradients, excessive neon bloom, stock photography, people, fake logos, fake metrics, watermark, or imagery reused from another article. ALL text in English only. No Chinese characters. Subject: one balanced split-chamber evaluation instrument with equal physical bays for the compared systems. The exact primary headline text is: \"TikTok Fake View Detection, Tested\". Preserve the model or product name and version number in it verbatim. One short mint-green subtitle line: \"68 public videos through one detector\". No capability labels, no footer labels, no tags. The headline and the text listed above are the ONLY words on the image: no other text anywhere, no URL paths, no API endpoints or model IDs, no code, no file names, no other article titles, no ticker strip, no screen microcopy. Layout family: top-band. Reserve a calm full-width band across the upper 32% for typography; build the technical subject across the lower 68%, with depth rising toward the center. Use bold condensed sans-serif type, white with one mint-green emphasis line. Do not fall back to a left-title/right-object split when another layout family is specified. Keep it readable at 200x112 thumbnail size. 16:9 aspect ratio. Must look good as a small thumbnail."
}Preferencje użytkowników
Oceny Elo na podstawie ślepych głosowań porównawczych, zestawione z innymi modelami obrazu i wideo.
Rankingi pochodzą z Artificial Analysis Arena
Arena tekst-na-obraz: użytkownicy wybierają lepszy z dwóch obrazów wygenerowanych z tego samego promptu, bez znajomości nazw modeli.
GPT Image 2 generates detailed images with strong instruction following and accurate in-image text, at three quality levels and 1K to 4K.
| Field | Type | Default | Notes |
|---|---|---|---|
prompt | string, required | — | Up to 50,000 characters. |
quality | low / medium / high | high | Higher quality costs more; high is the default. |
resolution | 1k / 2k / 4k | — | Output size tier; omit for 1K. |
aspect_ratio | 1:1 / 1:2 / 2:1 / 1:3 / 3:1 / 2:3 / 3:2 / 3:4 / 4:3 / 4:5 / 5:4 / 9:16 / 16:9 / 9:21 / 21:9 | 1:1 | Output frame shape. |
output_format | jpeg / png / webp | png | Output file format. |
Price depends on quality and resolution, per image:
| Quality | 1k | 2k | 4k |
|---|---|---|---|
| low | $0.01 | $0.02 | $0.03 |
| medium | $0.06 | $0.10 | $0.18 |
| high (default) | $0.22 | $0.40 | $0.72 |
Failed runs are not charged.
low, finish at high.Other GPT Image endpoints: openai/gpt-image-2.5-sunburst, openai/gpt-image-2.5-sunburst/edit, openai/gpt-image-2.5-flare, openai/gpt-image-2.5-flare/edit, openai/gpt-image-2/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": "openai/gpt-image-2",
"prompt": "Generate an image of gray tabby cat hugging an otter with an orange scarf",
"quality": "high",
"aspect_ratio": "1:1",
"output_format": "png"
}
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.
promptstringwymaganeThe text prompt to generate an image from.
Domyślnie: "Generate an image of gray tabby cat hugging an otter with an orange scarf"
qualitystringQuality for the generated image
Domyślnie: "high"
Możliwe wartości: "low", "medium", "high"
resolutionstringThe resolution of the generated image. Leave unset to preserve the provider's standard dimensions.
Możliwe wartości: "1k", "2k", "4k"
aspect_ratiostringThe aspect ratio of the generated image.
Domyślnie: "1:1"
Możliwe wartości: "1:1", "1:2", "2:1", "1:3", "3:1", "2:3", "3:2", "3:4", "4:3", "4:5", "5:4", "9:16", "16:9", "9:21", "21:9"
output_formatstringThe format of the generated image.
Domyślnie: "png"
Możliwe wartości: "jpeg", "png", "webp"
{
"model": "openai/gpt-image-2",
"prompt": "Generate an image of gray tabby cat hugging an otter with an orange scarf",
"quality": "high",
"aspect_ratio": "1:1",
"output_format": "png"
}Zakończone uruchomienie udostępnia swój wynik w output. Poniżej znajduje się zapisany przykład modelu, a nie nowa generacja.
[
{
"source": "OpenAI Cookbook prompt (MIT)",
"source_url": "https://developers.openai.com/cookbook/examples/multimodal/image-gen-models-prompting-guide",
"url": "https://static.sandbase.ai/examples/d54cd5f3-d7dc-4981-aff0-36453d1c678b/output/c544106d-1ee3-4412-99d1-a9bcf6d233f3.png"
}
]