n8n-io/n8n · error · NodeOperationError

Model ${model} is not supported for image generation

Error message

Model ${model} is not supported for image generation

What it means

Thrown at the tail of the Google Gemini 'image / generate' operation after the model-id branches for 'gemini' (generateContent) and 'imagen' (predict) have both been skipped. The node only routes image generation to those two model families; any other model id falls through to this terminal throw. The description 'Please check the model ID and try again.' is attached.

Source

Thrown at packages/@n8n/nodes-langchain/nodes/vendors/GoogleGemini/actions/image/generate.operation.ts:167

				fileName,
				prediction.mimeType,
			);
			return {
				binary: {
					[binaryPropertyOutput]: binaryData,
				},
				json: {
					...binaryData,
					data: undefined,
				},
				pairedItem: { item: i },
			};
		});

		return await Promise.all(promises);
	}

	throw new NodeOperationError(
		this.getNode(),
		`Model ${model} is not supported for image generation`,
		{
			description: 'Please check the model ID and try again.',
		},
	);
}

View on GitHub (pinned to 5ac6606e81)

Solutions

  1. Open the node, set Model to a Gemini image-capable id (default 'models/gemini-3.1-flash-image-preview' on v1.2+) or an Imagen id such as 'models/imagen-4.0-generate-preview-06-06'.
  2. If the Model field is driven by an expression, verify the resolved value at runtime (Preview execution / executed data) contains 'gemini' or 'imagen'.
  3. If you migrated node versions, confirm node.typeVersion >= 1.2 picks up the new default; otherwise re-pick the model from the list.
  4. For a custom/parameterised model id, rename it so it includes the literal token 'gemini' or 'imagen' that the branch matches on.

Example fix

// before — falls through to the throw
const model = 'models/text-bison-001';

// after — uses an imagen model
const model = 'models/imagen-4.0-generate-preview-06-06';
Defensive patterns

Strategy: validation

Validate before calling

const model = String(this.getNodeParameter('modelId', i, '', { extractValue: true }));
if (!model.includes('gemini') && !model.includes('imagen')) {
  // surface a friendly error before the API call, or remap to a known id
  throw new Error(`Image generation requires a 'gemini-*' or 'imagen-*' model, got: ${model}`);
}

Type guard

function isImageModel(model: string): boolean {
  const m = model.toLowerCase();
  return m.includes('gemini') || m.includes('imagen');
}

Prevention

When it happens

Trigger: User sets Model (modelId, extracted value) to an id whose substring contains neither 'gemini' nor 'imagen' — e.g. a text-only model like 'models/text-embedding-004', a Veo id, or a typo such as 'gemini-3-flash' missing the required token. Also fires when an expression returns an empty/blank model id.

Common situations: Selecting a model from the resource list (RLC) that belongs to a different resource (video/text) than 'image'; copying a model id from the Google AI docs that omits the 'gemini'/'imagen' keyword; the v1.2+ default model id being overwritten by an expression; using an older model id after Google renamed it.

Related errors


AI-assisted analysis of n8n-io/n8n@5ac6606e81 (2026-08-12). Data as JSON: /api/errors/4c5cb1f0003ceeb8. Report an issue: GitHub.