n8n-io/n8n · error · NodeOperationError
No images were generated
Error message
No images were generated
What it means
Thrown when /image_generation returns success (status_code 0) but response.data.image_urls is missing or empty (defaulted to []). A response-shape inconsistency: success signalled, no images produced.
Source
Thrown at packages/@n8n/nodes-langchain/nodes/vendors/MiniMax/actions/image/generate.operation.ts:150
if (options.seed !== undefined) {
body.seed = options.seed;
}
const response = (await apiRequest.call(this, 'POST', '/image_generation', {
body,
})) as ImageGenerationResponse;
if (response.base_resp?.status_code !== 0) {
throw new NodeOperationError(
this.getNode(),
`Image generation failed: ${response.base_resp?.status_msg || 'Unknown error'}`,
);
}
const imageUrls = response.data?.image_urls ?? [];
if (imageUrls.length === 0) {
throw new NodeOperationError(this.getNode(), 'No images were generated');
}
const results: INodeExecutionData[] = [];
for (let idx = 0; idx < imageUrls.length; idx++) {
const imageUrl = imageUrls[idx];
if (downloadImage) {
const imageResponse = await this.helpers.httpRequest({
method: 'GET',
url: imageUrl,
encoding: 'arraybuffer',
returnFullResponse: true,
});
const contentType = (imageResponse.headers?.['content-type'] as string) || 'image/png';
const fileContent = Buffer.from(imageResponse.body as ArrayBuffer);
const ext = contentType.includes('jpeg') || contentType.includes('jpg') ? 'jpg' : 'png';View on GitHub (pinned to 5ac6606e81)
Solutions
- Retry the identical request.
- Log the full response body to confirm image_urls is empty vs. located elsewhere.
- Adjust the prompt to be more concrete and retry.
- Verify the credentials base URL is the official MiniMax endpoint.
Defensive patterns
Strategy: retry
Validate before calling
// No caller-side input prevents an upstream success-without-images glitch.
// Validate only the request shape against the API contract.
function validateImageGenRequestShape(body: IDataObject): string | null {
if (typeof body.prompt !== 'string' || body.prompt.length === 0) return 'body.prompt must be a non-empty string';
if (typeof body.model !== 'string') return 'body.model is required';
return null;
} Type guard
function hasImageUrls(r: unknown): r is { data: { image_urls: string[] } } {
const urls = (r as { data?: { image_urls?: unknown[] } })?.data?.image_urls;
return Array.isArray(urls) && urls.length > 0;
} Try / catch
async function imageGenWithRetry(apiRequest: any, body: IDataObject, maxAttempts = 3) {
for (let attempt = 0; attempt < maxAttempts; attempt++) {
const response = (await apiRequest.call(this, 'POST', '/image_generation', { body })) as ImageGenerationResponse;
if (response.base_resp?.status_code !== 0) {
throw new NodeOperationError(this.getNode(), `Image generation failed: ${response.base_resp?.status_msg || 'Unknown error'}`);
}
if ((response.data?.image_urls ?? []).length > 0) return response;
await sleep(1000 * (attempt + 1));
}
throw new NodeOperationError(this.getNode(), 'No images were generated');
} Prevention
- Treat success-without-images as transient and retry with backoff.
- Log the full response body to detect a real API field rename versus a glitch.
- Use the official MiniMax base URL in credentials to avoid response-filtering proxies.
- Keep prompts concrete to reduce silent no-output edge cases.
When it happens
Trigger: Transient backend glitch returning success with no image URLs; API revision moving URLs to a different field; safety filter silently dropped all outputs while still reporting success; intermediary proxy stripping the image_urls array.
Common situations: Rare upstream inconsistency; safety filter edge case; non-official base URL filtering the response; prompt that the model declined to render without an explicit error.
Related errors
- No audio data returned
- Image generation failed: ${response.base_resp?.status_msg ||
- No task_id returned from video generation request
- No task_id returned from video generation request
- Video generation succeeded but no file_id was returned
AI-assisted analysis of n8n-io/n8n@5ac6606e81 (2026-08-12).
Data as JSON: /api/errors/ddb9e9736e1be743.
Report an issue: GitHub.