NO_IMAGE — Gemini API returned no image (Nano Banana finishReason)
The exact error
NO_IMAGE
You asked a Gemini image model for a picture and the candidate ended without
one. NO_IMAGE is Google’s way of saying the model failed to produce the image
it was supposed to, as opposed to a filter deciding it should not.
What it means
The Gemini API reference defines NO_IMAGE in the FinishReason enum as: the
model was expected to generate an image, but none was generated. Google’s API
errors page lists the Interactions API equivalent, no_image, under
Generation error codes, the group for structural problems with the model’s
output. It is not in the Generation blocked codes group, where
image_safety, image_prohibited_content and image_other sit. That
placement is the key distinction: officially, NO_IMAGE is a generation
failure, not a policy block.
Google’s Vertex page on Gemini image generation limitations describes the behaviors that lead to a missing image, without naming a finish reason for each:
- The model might only create text and no image if the prompt is ambiguous. Google’s advice is to ask for images clearly.
- The model might stop generating before it is finished. Google says to try again or use a different prompt.
- If a prompt is potentially unsafe, the model might reply that it cannot
create unsafe images, and in that case the
FinishReasonisSTOP.
That last point matters for agent code: a text-only answer with STOP can be
a refusal, and it will not show up as a block code.
Merged variant: "finishReason": "OTHER" with empty content. In forum
thread 111867, a user calling gemini-3-pro-image-preview reports occasional
responses where the candidate’s content is {} and finishReason is
OTHER. The usage metadata showed prompt and thinking tokens but no output.
Other posters report the same, including one using the Python SDK with an
image alongside the prompt, who says the request works in AI Studio. No
cause was posted. The API reference defines OTHER only as an unknown reason.
How to confirm it’s this
candidates[0].finishReasonisNO_IMAGE, and the candidate has no image part. Check whether it has text, and log it.- For the merged variant:
finishReasonisOTHERandcontentis empty. promptFeedback.blockReasonis not set. If it is, the prompt was blocked.- Python SDK: python-genai issue #2024 reports that when the API returned a
finish reason the SDK did not recognize, such as
IMAGE_SAFETYorNO_IMAGE, the SDK emitted aUserWarning(“is not a valid FinishReason”) and then hung onfinish_reasonaccess. The reporter wrapped property access in a thread with a timeout. The issue was closed as stale. If your worker freezes after that warning, this is a likely cause.
Fix
- Ask for an image explicitly. Google’s limitations page says ambiguous
prompts can yield text only. Make sure your request config asks for image
output (the reporter in issue #2024 set
response_modalities=["IMAGE"]), and phrase the prompt as a request for an image. - Check the parts, not only the finish reason. Read the text part when there is no image. It may explain what happened, or be a refusal.
- Guard your SDK calls. Put a timeout around response handling so an unrecognized finish reason cannot stall an agent worker.
- Log the prompt, code path,
modelVersionand usage metadata for failures. In thread 111867, the people trying to reproduce asked for the prompt and the code snippet.
Retry or not
It depends on what came back.
NO_IMAGEor an emptyOTHERwith no text: a limited retry is reasonable. Google’s limitations page says that when the model stops before it is finished, you can try again, and the thread 111867 reports describe the emptyOTHERresult as occasional. Retry once or twice with backoff, then fail clearly.- Text only,
STOP: retrying the same ambiguous prompt is unlikely to change much. Google’s advice is to change the request to ask for images clearly. - Text that declines on safety grounds: treat it like a block and do not loop.
When it’s not this
IMAGE_SAFETYorIMAGE_PROHIBITED_CONTENT: explicit blocks. Do not retry automatically.IMAGE_OTHER: a block for unspecified reasons, which users describe as intermittent.- An error about response modalities: if the request itself fails instead of returning a candidate, the problem is the request setup, not generation. See the response modalities page below.
Related errors
- IMAGE_OTHER
- IMAGE_SAFETY
- IMAGE_PROHIBITED_CONTENT
- Response modalities IMAGE not supported
- 500 internal error
Error text last verified against the sources below on .