generated from fahricansecer/boilerplate-be
@@ -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++) {
|
||||
|
||||
Reference in New Issue
Block a user