"Nano Banana Text-Only, No Image? Fix It in Minutes"

"If Nano Banana returns text instead of an image, the API said 200 OK and gave you nothing to save. This guide gives the direct fix: the one-line response_modalities change, the 2026 model-ID table, and how to read the response body like a debugger."

Looking for the nano banana text only no image fix? Set response_modalities=['IMAGE'] (or ['TEXT','IMAGE'] ) in your generation config, call a current model ID like gemini-3.1-flash-image , and iterate over *all* response parts looking for inline_data — the image often follows a text part. That is the whole answer. The rest of this guide covers *why* the API says 200 OK and hands you nothing, the four causes in order of likelihood, and a verify snippet so you never ship this bug again. The error: HTTP 200, text only, no image The call succeeds. No exception, no 4xx, no 5xx. You get a response object with finishReason: STOP and a text part that says something like "Here's your image:" — but there is no image. Or you get candidates with text and your save-to-disk code writes nothing because it looked in the wrong place. Developers report this constantly: the API *chose* text, and nothing in the status code tells you. response = client.models.generate_content( model="gemini-3.1-flash-image", contents="A red panda sticker, flat vector style", ) for part in response.candidates[0].content.parts: print(type(part).__name__, "->", bool(part.inline_data)) # TextPart -> False ← that's all you got The image wasn't blocked or errored — it was never requested correctly in the first place. Why Nano Banana answers in text instead of images Four causes, in order of likelihood. First , response_modalities was never set: for image models the default modality is text, so the model answers in words unless you explicitly ask for image output. Second , the model ID is expired or legacy — preview IDs were shut down in 2026 and gemini-2.5-flash-image is legacy now; calls to dead IDs return 404 or fall back to odd behavior. Third , your reader code…

Explore