main
Backend Deploy 🚀 / build-and-deploy (push) Has been cancelled

This commit is contained in:
Harun CAN
2026-04-27 12:50:42 +02:00
parent 9d8c34b39d
commit 7745102584
11 changed files with 3909 additions and 23 deletions
+5 -1
View File
@@ -256,6 +256,7 @@ IMPORTANT: Only output valid JSON, no markdown code blocks or other text.`;
async generateImage(
prompt: string,
aspectRatio: '16:9' | '9:16' | '1:1' = '16:9',
isIllustration: boolean = false,
): Promise<{ buffer: Buffer; mimeType: string } | null> {
if (!this.isAvailable()) {
throw new Error('Gemini AI is not available. Check your configuration.');
@@ -272,7 +273,10 @@ IMPORTANT: Only output valid JSON, no markdown code blocks or other text.`;
// En-boy oranına göre yönlendirmeyi zorla
const orientation = aspectRatio === '9:16' ? '(VERTICAL / PORTRAIT)' : aspectRatio === '16:9' ? '(HORIZONTAL / LANDSCAPE)' : '(SQUARE)';
const enhancedPrompt = `Generate a high-quality, photorealistic image. Description: ${prompt}. Aspect ratio and framing: EXACTLY ${aspectRatio} ${orientation}. Style: cinematic lighting, detailed, professional. IMPORTANT: Return the generated image only, no text.`;
// Gemini modelleri talimat kelimelerinden ("Generate an image of...") ziyade doğrudan görsel açıklamalarını daha iyi anlıyor.
const enhancedPrompt = isIllustration
? `Premium digital illustration, highly detailed, NOT photorealistic. ${prompt}. Aspect ratio: ${aspectRatio} ${orientation}`
: `High-quality photorealistic cinematic image, professional lighting, detailed. ${prompt}. Aspect ratio: ${aspectRatio} ${orientation}`;
// ── Katman 1: gemini-2.5-flash-image (Nano Banana) — 2 deneme ──
for (let attempt = 1; attempt <= 2; attempt++) {