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 system_prompt="Keep the composition polished, cheerful, and suitable for a product campaign.",
12 aspect_ratio="1:1",
13 output_resolution="4K",
14 output_format="jpg",
15 response_modalities="TEXT_AND_IMAGE",
16)
17print(result["status"]) # COMPLETED
18print(result.get("output")) # model output (e.g. media URL)
19print(result["metrics"]["inference_time"]) # server compute seconds
20
21# --- Or submit + poll manually (track request_id, control the cadence) ---
22from segmind import SegmindClient, InferenceFailed, InferenceTimeout
23
24client = SegmindClient() # reads SEGMIND_API_KEY
25payload = {
26 "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.",
27 "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"],
28 "system_prompt": "Keep the composition polished, cheerful, and suitable for a product campaign.",
29 "aspect_ratio": "1:1",
30 "output_resolution": "4K",
31 "output_format": "jpg",
32 "response_modalities": "TEXT_AND_IMAGE",
33}
34job = client.submit_async("nano-banana-pro", **payload)
35print(job.request_id) # available immediately
36try:
37 result = job.wait(timeout=600, interval=1.0)
38except InferenceTimeout as e:
39 print("still running:", e.request_id)
40except InferenceFailed as e:
41 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 system_prompt="Keep the composition polished, cheerful, and suitable for a product campaign.",
12 aspect_ratio="1:1",
13 output_resolution="4K",
14 output_format="jpg",
15 response_modalities="TEXT_AND_IMAGE",
16)
17print(result["status"]) # COMPLETED
18print(result.get("output")) # model output (e.g. media URL)
19print(result["metrics"]["inference_time"]) # server compute seconds
20
21# --- Or submit + poll manually (track request_id, control the cadence) ---
22from segmind import SegmindClient, InferenceFailed, InferenceTimeout
23
24client = SegmindClient() # reads SEGMIND_API_KEY
25payload = {
26 "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.",
27 "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"],
28 "system_prompt": "Keep the composition polished, cheerful, and suitable for a product campaign.",
29 "aspect_ratio": "1:1",
30 "output_resolution": "4K",
31 "output_format": "jpg",
32 "response_modalities": "TEXT_AND_IMAGE",
33}
34job = client.submit_async("nano-banana-pro", **payload)
35print(job.request_id) # available immediately
36try:
37 result = job.wait(timeout=600, interval=1.0)
38except InferenceTimeout as e:
39 print("still running:", e.request_id)
40except InferenceFailed as e:
41 print("failed:", e.detail)API Endpoint
https://api.segmind.com/v1/nano-banana-proParameters
promptrequiredstringDescribe the image to generate or the changes to make to the reference images.
"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."aspect_ratiooptionalstringChoose the proportions of the generated image. "Auto" lets the model pick.
"1:1""auto""1:1""2:3""3:2""4:3""3:4""4:5""5:4""16:9""9:16"image_urlsoptionalstring[]Optional reference images used to guide generation. Nano Banana Pro accepts up to 14 images.
[]output_formatoptionalstringFile format of the generated image.
"jpg""jpg""png"output_resolutionoptionalstringOutput detail level. Also determines the price tier (1K/2K = $0.15, 4K = $0.25).
"4K""1K""2K""4K"response_modalitiesoptionalstringReturn only the generated image or include a text response alongside it.
"TEXT_AND_IMAGE""TEXT_AND_IMAGE""IMAGE"safety_toleranceoptionalintegerContent-filter strictness, 1 (strictest) to 6 (most permissive). Leave blank for the default.
4Range: 1 - 6seedoptionalintegerOptional seed for reproducible results. Leave blank for a random seed on every request.
123456789Range: 0 - 999999999999999system_promptoptionalstringOptional high-level persona or style instructions applied to the generation.
""web_searchoptionalbooleanGround generation in real-time web data. Recommended for news-related prompts. Also affects price.
falseResponse 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