Short answer
When the API returnsfinishReason: NO_IMAGE and parts is null, the model usually processed the request but did not return image content.
This does not necessarily mean that the prompt triggered a content-safety block. Prompts such as “What is GEO?” or “Explain this concept” look more like text questions. The model may not be able to confirm that the user explicitly wants an image, so it returns NO_IMAGE.
Make the image intent explicit at the beginning of the prompt, then describe the subject, layout, style, and output requirements.
Another frequent cause is a prompt that asks the model to write text, such as “produce a design proposal” or “make the analysis thorough.” When the call only allows image output, such a request returns NO_IMAGE some of the time, so the same request may fail and then succeed. See “The prompt asks for written output” below.
candidates but contains promptFeedback.blockReason (for example OTHER), that is a different problem: the input was blocked by the provider before generation started. See Why Does Gemini Image Return blockReason: OTHER?Why does NO_IMAGE happen?
1. The prompt looks like a text question
For example:- what type of image to generate;
- which elements should appear in the image;
- how the information should be laid out;
- whether the response should contain only an image.
2. The image intent is not specific enough
Some platform tools automatically prepend instructions such as “Generate an image:”. With a direct API call, however, the request may be transparently forwarded without a complete image-generation instruction being added automatically. Instead of writing only:3. The prompt has no visual description
If the prompt only explains a concept, the model does not know how to turn it into a visual composition. Consider specifying:- image type: infographic, poster, flowchart, or promotional graphic;
- layout: three columns, timeline, or radial structure;
- visual style: technology, business, minimalist, or branded;
- text hierarchy: title, numbered sections, body copy, and layout;
- output instruction: generate an image only, without a text explanation.
4. The prompt asks for written output
Gemini image models can also read images and write text. If the prompt contains sentences that ask for written output, the model will sometimes “write the proposal first” instead of generating the image:responseModalities: ["IMAGE"]), the proposal the model wants to write cannot be returned, so the response becomes finishReason: NO_IMAGE, parts: null, and zero output tokens.
We re-ran a real shoe-design request (3 reference images plus a prompt like the one above) in September 2026 (UTC+8) on gemini-3.1-flash-image with responseModalities: ["IMAGE"]:
Different responseModalities settings, different symptoms
The same request with unclear image intent fails differently depending onresponseModalities:
responseModalities and read what the model writes when it does not return an image:
- A proposal, an analysis, or an image prompt → the image intent is unclear; fix the prompt as described on this page
- A refusal such as “I can’t generate this” → a content-safety policy was triggered; see Nano Banana image generation failures
Example GEO prompt
You can rewrite the original prompt as follows:How to troubleshoot NO_IMAGE
Step 1: Identify which field carries the failure
candidates[0].finishReason is NO_IMAGE, this page applies. If there are no candidates and promptFeedback.blockReason has a value, the input was blocked before generation; see Troubleshooting blockReason: OTHER.Step 2: Check whether the response contains image data
parts, inlineData, image, or the equivalent image field in the response. If parts is null, the response usually contains no image content.Step 3: Confirm that the prompt explicitly requests an image
Step 4: Check content-safety factors next
NO_IMAGE, check for NSFW content, minors, well-known IP, watermark removal, real-person portraits, or other upstream safety policies.Step 5: Check the call logs
usageMetadata shows that the model processed the request, but it does not prove that an image was generated or that a safety block occurred.How is NO_IMAGE different from a safety block?
finishReason: NO_IMAGE only means that no image was returned. It does not by itself prove that the prompt violated a policy. Use the complete error, prompt, and call logs together.Frequently asked questions
Will adding “generate an image” always fix the problem?
Will adding “generate an image” always fix the problem?
Was the GEO topic blocked by content safety?
Was the GEO topic blocked by content safety?
NO_IMAGE alone cannot completely rule out an upstream policy decision. In this case, the prompt reads more like a knowledge explanation, so unclear image intent is the more appropriate first check.Why does the same request sometimes work and sometimes fail? Did the route change?
Why does the same request sometimes work and sometimes fail? Did the route change?
NO_IMAGE caused by unclear intent is probabilistic: on each request the model chooses between generating an image and writing text first. In our tests, the same request failed about 21% of the time, often several times in a row. Retry NO_IMAGE responses automatically 1–2 times in your client, and fix the prompt to remove the root cause.Why are there tokens in usageMetadata if no image was returned?
Why are there tokens in usageMetadata if no image was returned?
usageMetadata only shows that the model processed the input and produced reasoning or text tokens. It does not mean that the response contains an image. Check the image data fields in the response.Will NO_IMAGE be charged?
Will NO_IMAGE be charged?
NO_IMAGE alone. Check the APIYI call logs to confirm whether the request created a charge record.Still stuck? Contact support
If the request still returnsNO_IMAGE after you make the image intent explicit, contact APIYI support and include:
- Model name and token group;
- Complete error message and
request ID; - Redacted prompt;
- Time of occurrence;
- Charge record from the call logs.
WeCom Support
