New: Nano Banana 2.1Try the model
API Stock

이미지

이미지 생성

모델, 프롬프트, 크기, 반복으로 신뢰도 높은 이미지를 만드는 방법.

2분 분량2개 섹션

프로덕션 이미지는 명확한 의도, 핵심 주제, 정해진 형식에서 시작합니다. 색, 재질, 스타일이 중요하면 형용사 나열보다 참조 이미지를 사용하세요.

실무 핵심

속도, 충실도, 해상도, 제어 중 무엇이 우선인지에 따라 모델을 선택하고 모든 결과의 파라미터와 버전을 저장하세요. nano-banana-*, gpt-image-2, z-image and seedream-* — Image generation.

한 번의 시도에서는 한 가지만 바꾸세요. 좋은 출력은 참조가 되며 다음 반복의 가장 신뢰할 수 있는 출발점입니다.

finished와 failed를 최종 상태로 다루세요. polling 또는 webhook을 사용하고 원본 오류는 서버에 보관하며 사용자에게는 안전한 메시지만 표시하세요.

프롬프트와 API 예시

text
A minimalist composition featuring a single, delicate red maple leaf positioned
in the bottom-right of the frame. The background is a vast, empty off-white
canvas, creating significant negative space for text. Soft, diffused lighting
from the top left. Square image.
Nano Banana 2.1 keeps the subject in the bottom-right and leaves a genuinely usable field for typography.
Nano Banana 2.1 keeps the subject in the bottom-right and leaves a genuinely usable field for typography.

Source: Google AI for Developers, used under CC BY 4.0; format and dimensions adapted.

text
A high-resolution, studio-lit product photograph of a minimalist ceramic coffee
mug in matte black, presented on a polished concrete surface. The lighting is a
three-point softbox setup designed to create soft, diffused highlights and
eliminate harsh shadows. The camera angle is a slightly elevated 45-degree shot
to showcase its clean lines. Ultra-realistic, with sharp focus on the steam
rising from the coffee. Square image.
Nano Banana 2.1 turns lighting setup, surface and camera angle into a clean commercial product shot.
Nano Banana 2.1 turns lighting setup, surface and camera angle into a clean commercial product shot.

Source: Google AI for Developers, used under CC BY 4.0; format and dimensions adapted.

text
A photo of a glossy magazine cover, the minimal blue cover has the large bold
words Nano Banana. The text is in a serif font and fills the view. No other
text. In front of the text there is a portrait of a person in a sleek and
minimal dress. She is playfully holding the number 2, which is the focal point.
Put the issue number and "Feb 2026" date in the corner along with a barcode. The
magazine is on a shelf against an orange plastered wall, within a designer store.
Nano Banana 2.1 renders a structured magazine cover with a large serif title, issue date and barcode.
Nano Banana 2.1 renders a structured magazine cover with a large serif title, issue date and barcode.

Source: Google AI for Developers, used under CC BY 4.0; format and dimensions adapted.

text
Mascot character for a developer tool: a friendly otter wearing a small
backpack, vector illustration, thick outlines, limited palette of teal and
sand, plain background
text
Abstract geometric background, overlapping translucent planes in indigo and
amber, soft grain, no text

About these samples. Ready-made examples are copied to our own storage only when their source permits reuse. The exact prompt appears above each result, and the original source and license are linked below the media.

json
{
"code": 200,
"data": {
"taskId": "019ca8b2-77d1-7a04-8c2e-15f9b0d4a6e1",
"status": "finished",
"files": [
{
"fileUrl": "https://storage.api-stock.com/generated/img-1a.png",
"fileType": "image"
},
{
"fileUrl": "https://storage.api-stock.com/generated/img-1b.png",
"fileType": "image"
},
{
"fileUrl": "https://storage.api-stock.com/generated/img-1c.png",
"fileType": "image"
},
{
"fileUrl": "https://storage.api-stock.com/generated/img-1d.png",
"fileType": "image"
}
],
"createdTime": "2026-02-28T12:41:02.000Z"
}
}
sh
curl -X POST https://api.api-stock.com/api/v1/generation/create \
-H "Authorization: Bearer sk-your-key" \
-H "Content-Type: application/json" \
-d '{
"model": "nano-banana-2",
"input": {
"prompt": "A brass orrery on a walnut desk, single window light, shallow depth of field",
"size": "3:2",
"resolution": "2K"
}
}'
json
{
"code": 200,
"data": {
"taskId": "019ca8b2-77d1-7a04-8c2e-15f9b0d4a6e1",
"status": "not_started",
"createdAt": "2026-02-28T12:41:02.000Z"
}
}
json
{
"model": "gpt-image-2",
"input": {
"prompt": "A brass orrery on a walnut desk, single window light",
"size": "3:2",
"resolution": "2k",
"quality": "high"
}
}
json
{
"model": "midjourney",
"input": {
"action": "imagine",
"prompt": "A brass orrery on a walnut desk, single window light",
"size": "3:2",
"version": "7",
"stylize": 250,
"chaos": 15,
"speed": "relax"
}
}
ts
const BASE = "https://api.api-stock.com/api/v1";
const KEY = process.env.API_STOCK_KEY!;
type TaskFile = { fileUrl: string; fileType: "image" | "video" | "music" };
async function generateImage(prompt: string): Promise<string[]> {
const create = await fetch(`${BASE}/generation/create`, {
method: "POST",
headers: {
Authorization: `Bearer ${KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "seedream-5-0-lite",
input: { prompt, size: "1:1", resolution: "2K", outputFormat: "png" },
}),
});
const created = await create.json();
if (!create.ok) {
throw new Error(`${created.error.code}: ${created.error.message}`);
}
const taskId: string = created.data.taskId;
const deadline = Date.now() + 10 * 60_000;
while (Date.now() < deadline) {
await new Promise((r) => setTimeout(r, 3_000));
const res = await fetch(`${BASE}/task/status/${taskId}`, {
headers: { Authorization: `Bearer ${KEY}` },
});
const body = await res.json().catch(() => null);
if (!res.ok) {
if (res.status === 429) {
const retryAfter = Number(res.headers.get("Retry-After") ?? 3);
await new Promise((r) => setTimeout(r, retryAfter * 1000));
continue;
}
const message = body?.error?.message ?? `${res.status} ${res.statusText}`;
throw new Error(message);
}
const { data } = body;
if (data.status === "finished") {
return (data.files as TaskFile[]).map((f) => f.fileUrl);
}
if (data.status === "failed" || data.status === "expired") {
throw new Error(data.errorMessage);
}
}
throw new Error(`timed out waiting for ${taskId}`);
}
const urls = await generateImage("Isometric cutaway of a lighthouse");
console.log(urls.length); // → 1
json
{
"code": 400,
"error": {
"message": "Resolution \"3K\" is not supported by model seedream-4-5",
"type": "BadRequest",
"code": "invalid_input"
}
}
json
{
"code": 200,
"data": {
"taskId": "019ca8b2-77d1-7a04-8c2e-15f9b0d4a6e1",
"status": "failed",
"createdTime": "2026-02-28T12:41:02.000Z",
"errorMessage": "This generation may violate our content policy. Please try a different prompt."
}
}

직접 발급한 키로 실행해 보세요

API Stock 카탈로그에서 모델과 가격을 확인하고 브라우저나 API로 사용해 보세요.

이어서 읽기