Nano Banana Pro Serverless API
High-fidelity images with accurate multilingual text rendering.
POST /v2/nano-banana-pro · submit + poll 1# pip install "segmind>=1.1.0"
2# export SEGMIND_API_KEY="YOUR_API_KEY"
3import segmind
4
5# Async (v2): submit to the queue and block until COMPLETED.
6# run() returns the final result dict (600s deadline, 1.0s poll by default).
7result = segmind.run(
8 "nano-banana-pro",
9 prompt="Create a multi-panel GTA-style comic page featuring one woman and one man as office coworkers working on a new product launch. Use bold outlines, dramatic GTA loading-screen shading, expressive faces, modern tech office backgrounds.\n\nPanel 1 — Narration:\nThe woman enters the office early, holding a laptop. She looks stressed but determined.\nText: ‘Launch day. Weeks of work… all coming down to this.’\n\nPanel 2 — Dialogue:\nMan appears behind her with a calm, confident smile.\nMan: ‘You’re here early. Ready for the big ship?’\nWoman: ‘Trying to be.’\n\nPanel 3 — Action:\nBoth sit at a desk with screens showing graphs, bugs, and a countdown timer.\nText: ‘One critical bug left… time running out.’\n\nPanel 4 — Dialogue:\nClose-up of the man pointing at the screen.\nMan: ‘Wait—I see it. We can fix this.’\nWoman: ‘Let’s do it.’\n\nPanel 5 — Action:\nBoth typing fast, dramatic GTA-style lighting, code streaming across screens.\nText: ‘Two minds. One mission.’\n\nPanel 6 — Victory:\nThe laptop shows PRODUCT SHIPPED — SUCCESS. Both cheer and laugh in relief.\nWoman: ‘We did it!’\nMan: ‘Told you we’d make it.’\n\nPanel 7 — Narration:\nFinal shot: team walking out of the office at night, city lights behind them.\nText: ‘In tech, wins aren’t solo. They’re shared.’\n\nArt style: GTA loading-screen style, bold color blocks, high contrast shadows, confident comic composition, cinematic frames.",
10 image_urls=["https://segmind-inference-inputs.s3.amazonaws.com/ad93498e-3370-432b-8dd7-bc3f4aa1b39a-black-man-image.jpeg", "https://segmind-inference-inputs.s3.amazonaws.com/8bdc63b0-79ed-4369-a4af-e7284f5bde33-image (86).png"],
11 aspect_ratio="9:16",
12 output_format="jpg",
13 output_resolution="4K",
14 response_modalities="TEXT_AND_IMAGE",
15)
16print(result["status"]) # COMPLETED
17print(result.get("output")) # model output (e.g. media URL)
18print(result["metrics"]["inference_time"]) # server compute seconds
19
20# --- Or submit + poll manually (track request_id, control the cadence) ---
21from segmind import SegmindClient, InferenceFailed, InferenceTimeout
22
23client = SegmindClient() # reads SEGMIND_API_KEY
24payload = {
25 "prompt": "Create a multi-panel GTA-style comic page featuring one woman and one man as office coworkers working on a new product launch. Use bold outlines, dramatic GTA loading-screen shading, expressive faces, modern tech office backgrounds.\n\nPanel 1 — Narration:\nThe woman enters the office early, holding a laptop. She looks stressed but determined.\nText: ‘Launch day. Weeks of work… all coming down to this.’\n\nPanel 2 — Dialogue:\nMan appears behind her with a calm, confident smile.\nMan: ‘You’re here early. Ready for the big ship?’\nWoman: ‘Trying to be.’\n\nPanel 3 — Action:\nBoth sit at a desk with screens showing graphs, bugs, and a countdown timer.\nText: ‘One critical bug left… time running out.’\n\nPanel 4 — Dialogue:\nClose-up of the man pointing at the screen.\nMan: ‘Wait—I see it. We can fix this.’\nWoman: ‘Let’s do it.’\n\nPanel 5 — Action:\nBoth typing fast, dramatic GTA-style lighting, code streaming across screens.\nText: ‘Two minds. One mission.’\n\nPanel 6 — Victory:\nThe laptop shows PRODUCT SHIPPED — SUCCESS. Both cheer and laugh in relief.\nWoman: ‘We did it!’\nMan: ‘Told you we’d make it.’\n\nPanel 7 — Narration:\nFinal shot: team walking out of the office at night, city lights behind them.\nText: ‘In tech, wins aren’t solo. They’re shared.’\n\nArt style: GTA loading-screen style, bold color blocks, high contrast shadows, confident comic composition, cinematic frames.",
26 "image_urls": ["https://segmind-inference-inputs.s3.amazonaws.com/ad93498e-3370-432b-8dd7-bc3f4aa1b39a-black-man-image.jpeg", "https://segmind-inference-inputs.s3.amazonaws.com/8bdc63b0-79ed-4369-a4af-e7284f5bde33-image (86).png"],
27 "aspect_ratio": "9:16",
28 "output_format": "jpg",
29 "output_resolution": "4K",
30 "response_modalities": "TEXT_AND_IMAGE",
31}
32job = client.submit_async("nano-banana-pro", **payload)
33print(job.request_id) # available immediately
34try:
35 result = job.wait(timeout=600, interval=1.0)
36except InferenceTimeout as e:
37 print("still running:", e.request_id)
38except InferenceFailed as e:
39 print("failed:", e.detail) 1# pip install "segmind>=1.1.0"
2# export SEGMIND_API_KEY="YOUR_API_KEY"
3import segmind
4
5# Async (v2): submit to the queue and block until COMPLETED.
6# run() returns the final result dict (600s deadline, 1.0s poll by default).
7result = segmind.run(
8 "nano-banana-pro",
9 prompt="Create a multi-panel GTA-style comic page featuring one woman and one man as office coworkers working on a new product launch. Use bold outlines, dramatic GTA loading-screen shading, expressive faces, modern tech office backgrounds.\n\nPanel 1 — Narration:\nThe woman enters the office early, holding a laptop. She looks stressed but determined.\nText: ‘Launch day. Weeks of work… all coming down to this.’\n\nPanel 2 — Dialogue:\nMan appears behind her with a calm, confident smile.\nMan: ‘You’re here early. Ready for the big ship?’\nWoman: ‘Trying to be.’\n\nPanel 3 — Action:\nBoth sit at a desk with screens showing graphs, bugs, and a countdown timer.\nText: ‘One critical bug left… time running out.’\n\nPanel 4 — Dialogue:\nClose-up of the man pointing at the screen.\nMan: ‘Wait—I see it. We can fix this.’\nWoman: ‘Let’s do it.’\n\nPanel 5 — Action:\nBoth typing fast, dramatic GTA-style lighting, code streaming across screens.\nText: ‘Two minds. One mission.’\n\nPanel 6 — Victory:\nThe laptop shows PRODUCT SHIPPED — SUCCESS. Both cheer and laugh in relief.\nWoman: ‘We did it!’\nMan: ‘Told you we’d make it.’\n\nPanel 7 — Narration:\nFinal shot: team walking out of the office at night, city lights behind them.\nText: ‘In tech, wins aren’t solo. They’re shared.’\n\nArt style: GTA loading-screen style, bold color blocks, high contrast shadows, confident comic composition, cinematic frames.",
10 image_urls=["https://segmind-inference-inputs.s3.amazonaws.com/ad93498e-3370-432b-8dd7-bc3f4aa1b39a-black-man-image.jpeg", "https://segmind-inference-inputs.s3.amazonaws.com/8bdc63b0-79ed-4369-a4af-e7284f5bde33-image (86).png"],
11 aspect_ratio="9:16",
12 output_format="jpg",
13 output_resolution="4K",
14 response_modalities="TEXT_AND_IMAGE",
15)
16print(result["status"]) # COMPLETED
17print(result.get("output")) # model output (e.g. media URL)
18print(result["metrics"]["inference_time"]) # server compute seconds
19
20# --- Or submit + poll manually (track request_id, control the cadence) ---
21from segmind import SegmindClient, InferenceFailed, InferenceTimeout
22
23client = SegmindClient() # reads SEGMIND_API_KEY
24payload = {
25 "prompt": "Create a multi-panel GTA-style comic page featuring one woman and one man as office coworkers working on a new product launch. Use bold outlines, dramatic GTA loading-screen shading, expressive faces, modern tech office backgrounds.\n\nPanel 1 — Narration:\nThe woman enters the office early, holding a laptop. She looks stressed but determined.\nText: ‘Launch day. Weeks of work… all coming down to this.’\n\nPanel 2 — Dialogue:\nMan appears behind her with a calm, confident smile.\nMan: ‘You’re here early. Ready for the big ship?’\nWoman: ‘Trying to be.’\n\nPanel 3 — Action:\nBoth sit at a desk with screens showing graphs, bugs, and a countdown timer.\nText: ‘One critical bug left… time running out.’\n\nPanel 4 — Dialogue:\nClose-up of the man pointing at the screen.\nMan: ‘Wait—I see it. We can fix this.’\nWoman: ‘Let’s do it.’\n\nPanel 5 — Action:\nBoth typing fast, dramatic GTA-style lighting, code streaming across screens.\nText: ‘Two minds. One mission.’\n\nPanel 6 — Victory:\nThe laptop shows PRODUCT SHIPPED — SUCCESS. Both cheer and laugh in relief.\nWoman: ‘We did it!’\nMan: ‘Told you we’d make it.’\n\nPanel 7 — Narration:\nFinal shot: team walking out of the office at night, city lights behind them.\nText: ‘In tech, wins aren’t solo. They’re shared.’\n\nArt style: GTA loading-screen style, bold color blocks, high contrast shadows, confident comic composition, cinematic frames.",
26 "image_urls": ["https://segmind-inference-inputs.s3.amazonaws.com/ad93498e-3370-432b-8dd7-bc3f4aa1b39a-black-man-image.jpeg", "https://segmind-inference-inputs.s3.amazonaws.com/8bdc63b0-79ed-4369-a4af-e7284f5bde33-image (86).png"],
27 "aspect_ratio": "9:16",
28 "output_format": "jpg",
29 "output_resolution": "4K",
30 "response_modalities": "TEXT_AND_IMAGE",
31}
32job = client.submit_async("nano-banana-pro", **payload)
33print(job.request_id) # available immediately
34try:
35 result = job.wait(timeout=600, interval=1.0)
36except InferenceTimeout as e:
37 print("still running:", e.request_id)
38except InferenceFailed as e:
39 print("failed:", e.detail)API Endpoint
https://api.segmind.com/v1/nano-banana-proParameters
promptrequiredstringOutline the scene with imaginative language.
aspect_ratiooptionalstringChoose image dimensions. Use '16:9' for widescreen or '1:1' for symmetrical art.
"16:9""1:1""2:3""3:2""4:3""3:4""4:5""5:4""16:9""9:16""21:9"image_urlsoptionalstring[]Add a reference image or leave blank for original ideas.
output_formatoptionalstringDetermines output format
"jpg""jpg""png"output_resolutionoptionalstringSet the image detail level. Choose '4K' for high detail or '1K' for quicker results.
"4K""1K""2K""4K"response_modalitiesoptionalstringControl output type. Use IMAGE for image-only output, TEXT_AND_IMAGE for both text and image.
"TEXT_AND_IMAGE""TEXT_AND_IMAGE""IMAGE"Response Type
Returns: Image
Asynchronous requests (v2)
Use Async for video, long-running (>~60s), or high-concurrency workloads; Sync is simplest for fast image & LLM calls. Async submits a request and you poll it to completion.
- 1
POST /v2/nano-banana-proSubmit — returns request_id, status_url, response_url
- 2
GET /v2/requests/{id}/statusPoll — until COMPLETED or FAILED
- 3
GET /v2/requests/{id}Result — final response body
Status states
- A FAILED request is served as HTTP 422 — the body still carries the error detail.
- An unknown or expired request_id returns HTTP 404.
- Results are retained for 1 hour, then expire.
- Content / RAI blocks surface as FAILED, not a separate state.
- Track completion by polling the status endpoint.
Common Error Codes
The API returns standard HTTP status codes. Detailed error messages are provided in the response body.
Bad Request
Invalid parameters or request format
Unauthorized
Missing or invalid API key
Forbidden
Insufficient permissions
Not Found
Model or endpoint not found
Insufficient Credits
Not enough credits to process request
Rate Limited
Too many requests
Server Error
Internal server error
Bad Gateway
Service temporarily unavailable
Timeout
Request timed out