fix: correct Gemini model names + add model dropdown
Corrected model names (per Google AI docs): - gemini-2.5-flash-image (was gemini-2.0-flash-preview-image-generation) - gemini-3-pro-image-preview (Nano Banana Pro) - gemini-3.1-flash-image-preview (Nano Banana 2) UI: replaced text input with dropdown selector showing all 3 models with human-readable descriptions. Default changed to gemini-2.5-flash-image (fast, high-volume). AI Assistant: generate_project_cover tool description updated to be provider-agnostic (works with both DALL-E and Gemini). Co-Authored-By: claude-flow <ruv@ruv.net>
This commit is contained in:
@@ -1181,13 +1181,15 @@ export function SystemSettingsClient() {
|
|||||||
Model <InfoTooltip content="Gemini model for image generation. The default model supports image output." />
|
Model <InfoTooltip content="Gemini model for image generation. The default model supports image output." />
|
||||||
</span>
|
</span>
|
||||||
</label>
|
</label>
|
||||||
<input
|
<select
|
||||||
type="text"
|
|
||||||
className={INPUT_CLASS}
|
className={INPUT_CLASS}
|
||||||
value={geminiModel}
|
value={geminiModel || "gemini-2.5-flash-image"}
|
||||||
onChange={(e) => setGeminiModel(e.target.value)}
|
onChange={(e) => setGeminiModel(e.target.value)}
|
||||||
placeholder="gemini-2.0-flash-preview-image-generation"
|
>
|
||||||
/>
|
<option value="gemini-2.5-flash-image">Gemini 2.5 Flash Image — fast, high-volume</option>
|
||||||
|
<option value="gemini-3-pro-image-preview">Gemini 3 Pro Image Preview — high-fidelity</option>
|
||||||
|
<option value="gemini-3.1-flash-image-preview">Gemini 3.1 Flash Image Preview — latest</option>
|
||||||
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ export function isGeminiConfigured(settings: GeminiSettings | null | undefined):
|
|||||||
export async function generateGeminiImage(
|
export async function generateGeminiImage(
|
||||||
apiKey: string,
|
apiKey: string,
|
||||||
prompt: string,
|
prompt: string,
|
||||||
model = "gemini-2.0-flash-preview-image-generation",
|
model = "gemini-2.5-flash-image",
|
||||||
): Promise<string> {
|
): Promise<string> {
|
||||||
const fullPrompt = `Generate a professional, cinematic cover image for a 3D production project. ${prompt}`;
|
const fullPrompt = `Generate a professional, cinematic cover image for a 3D production project. ${prompt}`;
|
||||||
|
|
||||||
|
|||||||
@@ -1020,7 +1020,7 @@ export const TOOL_DEFINITIONS: ToolDef[] = [
|
|||||||
type: "function",
|
type: "function",
|
||||||
function: {
|
function: {
|
||||||
name: "generate_project_cover",
|
name: "generate_project_cover",
|
||||||
description: "Generate an AI cover art image for a project using DALL-E. The image will be stored as the project's cover. Requires manageProjects permission and DALL-E to be configured.",
|
description: "Generate an AI cover art image for a project. Uses the configured image provider (DALL-E or Google Gemini). The image will be stored as the project's cover. Requires manageProjects permission.",
|
||||||
parameters: {
|
parameters: {
|
||||||
type: "object",
|
type: "object",
|
||||||
properties: {
|
properties: {
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ export const settingsRouter = createTRPCRouter({
|
|||||||
azureDalleEndpoint: settings?.azureDalleEndpoint ?? null,
|
azureDalleEndpoint: settings?.azureDalleEndpoint ?? null,
|
||||||
hasDalleApiKey: !!settings?.azureDalleApiKey,
|
hasDalleApiKey: !!settings?.azureDalleApiKey,
|
||||||
// Gemini
|
// Gemini
|
||||||
geminiModel: settings?.geminiModel ?? "gemini-2.0-flash-preview-image-generation",
|
geminiModel: settings?.geminiModel ?? "gemini-2.5-flash-image",
|
||||||
hasGeminiApiKey: !!settings?.geminiApiKey,
|
hasGeminiApiKey: !!settings?.geminiApiKey,
|
||||||
// Image provider
|
// Image provider
|
||||||
imageProvider: settings?.imageProvider ?? "dalle",
|
imageProvider: settings?.imageProvider ?? "dalle",
|
||||||
@@ -331,7 +331,7 @@ export const settingsRouter = createTRPCRouter({
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const { generateGeminiImage } = await import("../gemini-client.js");
|
const { generateGeminiImage } = await import("../gemini-client.js");
|
||||||
const model = settings.geminiModel ?? "gemini-2.0-flash-preview-image-generation";
|
const model = settings.geminiModel ?? "gemini-2.5-flash-image";
|
||||||
|
|
||||||
// Generate a tiny test image with a simple prompt
|
// Generate a tiny test image with a simple prompt
|
||||||
const dataUrl = await generateGeminiImage(
|
const dataUrl = await generateGeminiImage(
|
||||||
|
|||||||
@@ -1449,7 +1449,7 @@ model SystemSettings {
|
|||||||
azureDalleApiKey String? // Optional: separate API key for DALL-E
|
azureDalleApiKey String? // Optional: separate API key for DALL-E
|
||||||
// Gemini image generation
|
// Gemini image generation
|
||||||
geminiApiKey String?
|
geminiApiKey String?
|
||||||
geminiModel String? @default("gemini-2.0-flash-preview-image-generation")
|
geminiModel String? @default("gemini-2.5-flash-image")
|
||||||
imageProvider String? @default("dalle") // "dalle" | "gemini"
|
imageProvider String? @default("dalle") // "dalle" | "gemini"
|
||||||
updatedAt DateTime @updatedAt
|
updatedAt DateTime @updatedAt
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user