Skip to content

Commit 7b06b39

Browse files
authored
fix: Imagen model name (dev → main)
Critical bugfix: Imagen model name imagen-4-fast → imagen-4.0-fast-generate-001
2 parents b2ef3f6 + 2d7ef6b commit 7b06b39

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

lib/services/gemini-infographics.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export interface DualOrientationResult {
5252

5353
/** Options for batch infographic generation. */
5454
export interface InfographicBatchOptions {
55-
/** Override the Imagen model (defaults to pipeline_config.infographicModel or "imagen-4-fast"). */
55+
/** Override the Imagen model (defaults to pipeline_config.infographicModel or "imagen-4.0-fast-generate-001"). */
5656
model?: string;
5757
/** Number of images per prompt (1–4). Defaults to 1. */
5858
numberOfImages?: number;
@@ -88,13 +88,13 @@ function getAI(): GoogleGenAI {
8888
* Generate a single infographic image using Imagen 4 Fast.
8989
*
9090
* @param request - Prompt and generation options.
91-
* @param model - Imagen model ID (e.g. "imagen-4-fast").
91+
* @param model - Imagen model ID (e.g. "imagen-4.0-fast-generate-001").
9292
* @returns InfographicResult with base64 image bytes.
9393
* @throws If the API call fails or no image is returned.
9494
*/
9595
export async function generateInfographic(
9696
request: InfographicRequest,
97-
model: string = "imagen-4-fast",
97+
model: string = "imagen-4.0-fast-generate-001",
9898
): Promise<InfographicResult> {
9999
const ai = getAI();
100100

@@ -161,7 +161,7 @@ export async function generateInfographicBatch(
161161
): Promise<InfographicBatchResult> {
162162
const model =
163163
options.model ??
164-
(await getConfigValue("pipeline_config", "infographicModel", "imagen-4-fast"));
164+
(await getConfigValue("pipeline_config", "infographicModel", "imagen-4.0-fast-generate-001"));
165165

166166
const results: InfographicResult[] = [];
167167
const errors: Array<{ prompt: string; error: string }> = [];
@@ -261,7 +261,7 @@ export async function generateInfographicsForTopic(
261261
);
262262

263263
const model = await getConfigValue(
264-
"pipeline_config", "infographicModel", "imagen-4-fast"
264+
"pipeline_config", "infographicModel", "imagen-4.0-fast-generate-001"
265265
);
266266

267267
const contextSuffix = briefing
@@ -306,7 +306,7 @@ export async function generateFromScenePrompts(
306306
topic: string,
307307
): Promise<DualOrientationResult> {
308308
const model = await getConfigValue(
309-
"pipeline_config", "infographicModel", "imagen-4-fast"
309+
"pipeline_config", "infographicModel", "imagen-4.0-fast-generate-001"
310310
);
311311

312312
const horizontal: InfographicResult[] = [];

sanity/schemas/singletons/pipelineConfig.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export default defineType({
7070
title: "Infographic Model",
7171
type: "string",
7272
description: "Model used for generating brand-consistent infographics from research data. Imagen 4 Fast ($0.02/image) supports seed-based reproducibility",
73-
initialValue: "imagen-4-fast",
73+
initialValue: "imagen-4.0-fast-generate-001",
7474
}),
7575
defineField({
7676
name: "qualityThreshold",

0 commit comments

Comments
 (0)