🚨 Blog Görsel Prompt Hata Analizi

DALL-E 3 AA.pdf Kurallarına Uyumsuzluk Raporu

❌ Kritik Sorun: İki Ayrı Yerde Hatalı Prompt

🔴 Sorun Özeti

Blog AI görsel üretim sistemi AA.pdf DALL-E 3 profesyonel kurallarına tamamen aykırı çalışıyor. İki farklı dosyada yasak kelimeler kullanılıyor:

  • YASAK "Ultra realistic" kullanımı
  • YASAK "photorealistic" kullanımı
  • EKSİK Kamera ve lens specifics yok
  • EKSİK Profesyonel lighting bilgisi yok
  • EKSİK Imperfections (natural texture) yok
  • EKSİK Random variety (her blog aynı prompt)

📂 Hatalı Dosya #1: BlogAIContentWriter.php

Modules/Blog/app/Services/BlogAIContentWriter.php (Satır 93-95)
// ❌ HATALI PROMPT
$imagePrompt = "Ultra realistic professional photograph, horizontal landscape orientation 16:9, " .
    $blogData['title'] .
    ", high quality commercial photography, natural lighting, sharp focus, detailed, NO TEXT, NO WORDS, NO LETTERS in image or background";

🚨 Hatalar:

  1. "Ultra realistic" → AA.pdf'te YASAK! Bu kelime painting-like sonuçlar üretir
  2. Kamera+Lens YOK → Canon EOS R5, Sony A7 III gibi spesifikler gerekli
  3. "natural lighting" → Çok genel! "golden hour" veya "Rembrandt lighting" gibi spesifik olmalı
  4. Style additions YOK → "8K resolution, RAW photo quality" gibi ekler yok
  5. Imperfections YOK → "natural imperfections, visible pores" gibi reallik ekleyiciler yok
  6. Random variety YOK → Her blog tamamen aynı prompt kullanıyor

📂 Hatalı Dosya #2: PromptGenerator.php

Modules/AI/app/Services/PromptGenerator.php (Satır 19-52)
public function generateForBlog(string $title, ?string $content = null): string
{
    $prompt = "Professional blog featured image for: {$title}.";

    // ... tenant enhancement ...

    $prompt .= " Ultra detailed, 8K resolution, photorealistic, cinematic lighting, masterpiece quality, sharp focus, professional photography.";

    $prompt .= " No text or minimal text in image.";

    return $prompt;
}

🚨 Hatalar:

  1. "photorealistic" → AA.pdf'te MUTLAK YASAK! Bu kelime DALL-E 3'ü painting moduna sokuyor
  2. "Photo of" prefix YOK → AA.pdf formülü: "Photo of {subject}" ile başlamalı
  3. Kamera spesifikasyonu YOK → "shot on Canon EOS R5 with 85mm f/1.4 lens" gibi
  4. "cinematic lighting" → Çok genel! Spesifik lighting technique gerekli
  5. Random variety YOK → Her blog için aynı prompt

📊 Karşılaştırma Tablosu

Kriter Mevcut Durum AA.pdf Kuralı Durum
Prefix "Ultra realistic" / "Professional" "Photo of" HATALI
Yasak Kelime "photorealistic" kullanılıyor ASLA kullanılmamalı HATALI
Kamera+Lens Yok "Canon EOS R5 with 85mm f/1.4" EKSİK
Lighting "natural lighting" (genel) "golden hour" / "Rembrandt lighting" YETERSIZ
Style Addition "8K resolution" (kısmi) "RAW photo quality, natural imperfections" EKSİK
Text Ban "NO TEXT" (basit) Comprehensive ban (200+ karakter) YETERSIZ
Variety Her blog aynı prompt Random camera + lighting selection YOK
Size 1792x1024 ✅ 1792x1024 (landscape) DOĞRU
Quality 'hd' ✅ 'hd' DOĞRU

📋 AA.pdf DALL-E 3 Profesyonel Kuralları

✅ Doğru Prompt Formülü

Photo of {Subject} + {View/Framing} + {Background} + {Lighting} + {Camera Brand} + {Lens Setup}

🚫 MUTLAK YASAKLAR

  • "photorealistic" → ASLA kullanma! Painting-like sonuç verir
  • "realistic" → ASLA kullanma!
  • "3D render" → ASLA kullanma!
  • "CGI" → ASLA kullanma!

Sebep: Bu kelimeler DALL-E 3'ü "non-photo" moduna sokuyor. Gerçek fotoğraf yerine painting/render üretiyor.

✅ Zorunlu Elementler

1. Prefix: "Photo of"

// ✅ DOĞRU
"Photo of forklift in warehouse"

// ❌ YANLIŞ
"Ultra realistic forklift"
"Photorealistic warehouse scene"

2. Kamera ve Lens Spesifikasyonları

// Kamera Seçenekleri (Random seç - çeşitlilik için):
- Canon EOS R5 with 85mm f/1.4 lens
- Sony A7 III with 50mm f/1.8 lens
- Nikon D810 with 24-70mm f/2.8 lens
- Fujifilm GFX 100 with 63mm f/2.8 lens
- Leica M10 with 50mm f/1.4 lens

// Aperture Detayı:
- f/1.4-f/2.8 → Shallow DOF (arka plan bulanık, subject net)
- f/8-f/11 → Deep focus (her şey net)

3. Profesyonel Lighting Teknikleri

// Lighting Seçenekleri (Random seç):
- golden hour natural lighting
- soft window light
- professional studio lighting with softbox
- Rembrandt lighting setup
- natural ambient lighting
- butterfly lighting
- loop lighting

4. Style-Based Additions

// Blog için önerilen style'lar:
'commercial_photography' => 'advertising quality, perfect composition, luxury brand standards, premium retouching'
'documentary_style' => 'authentic moment, candid shot, photojournalism style, editorial photography'
'natural_light' => 'outdoor scene, authentic atmosphere, shallow depth of field, bokeh background'

5. Imperfections (Reallik Ekleyiciler)

// AI'ın mükemmeliyetçiliğini boz - daha gerçekçi yap:
"natural imperfections"
"visible pores and skin texture"
"weathered surface"
"natural wear and tear"
"authentic atmosphere"

6. Comprehensive Text Ban

"ABSOLUTELY NO text, NO labels, NO captions, NO annotations, NO blue boxes,
NO text overlays, NO UI elements, NO numbered labels, NO arrows with text,
NO infographics, NO presentation elements, NO diagrams, NO charts,
NO brand names, NO trademarks, NO written words of any kind.
Pure photograph only, clean product catalog style without any text elements whatsoever"

✅ buildPromptFromAAPDF() - Doğru Örnek

Modules/MediaManagement/app/Http/Livewire/Admin/AiImageGeneratorComponent.php (Satır 122-173)
protected function buildPromptFromAAPDF(string $userPrompt, string $style): string
{
    // Kamera ve lens çeşitleri
    $cameras = [
        'Canon EOS R5 with 85mm f/1.4 lens',
        'Sony A7 III with 50mm f/1.8 lens',
        'Nikon D810 with 24-70mm f/2.8 lens',
        'Fujifilm GFX 100 with 63mm f/2.8 lens',
        'Leica M10 with 50mm f/1.4 lens',
    ];

    // Işıklandırma teknikleri
    $lightings = [
        'golden hour natural lighting',
        'soft window light',
        'professional studio lighting with softbox',
        'Rembrandt lighting setup',
        'natural ambient lighting',
    ];

    // Style'a göre ek özellikler
    $styleAdditions = [
        'commercial_photography' => 'advertising quality, perfect composition, luxury brand standards, premium retouching',
        'documentary_style' => 'authentic moment, candid shot, photojournalism style, editorial photography',
        // ... diğer style'lar ...
    ];

    // Random kamera ve ışıklandırma seç (çeşitlilik için)
    $camera = $cameras[array_rand($cameras)];
    $lighting = $lightings[array_rand($lightings)];
    $addition = $styleAdditions[$style] ?? $styleAdditions['ultra_photorealistic'];

    // AA.pdf CRITICAL RULE: "photo of" kullan!
    $photoPrefix = 'Photo of';

    // ABSOLUTE TEXT BAN
    $textBan = 'ABSOLUTELY NO text, NO labels, NO captions...';

    // Final prompt assembly
    return "{$photoPrefix} {$userPrompt}, {$addition}, {$lighting}, shot on {$camera}. {$textBan}";
}

🎯 Bu Metodun Avantajları:

  • ✅ "Photo of" prefix (yasak kelimeler yok)
  • ✅ Random kamera seçimi (her blog farklı)
  • ✅ Random lighting (çeşitlilik)
  • ✅ Style-based additions (professional quality)
  • ✅ Comprehensive text ban (200+ karakter)
  • ✅ AA.pdf formülüne %100 uyumlu

✅ Çözüm Planı

🎯 Yaklaşım

BlogAIContentWriter.php içine yeni buildPromptForBlog() metodu ekle.

Bu metod buildPromptFromAAPDF() metodunu baz alacak ama blog-specific optimizasyonlar içerecek.

📝 Uygulama Adımları

  1. BlogAIContentWriter.php'ye yeni metod ekle
  2. Mevcut satır 93-95'teki prompt'u sil
  3. Yeni metodu çağır: $imagePrompt = $this->buildPromptForBlog($blogData['title']);
  4. Test et: Yeni blog draft oluştur, görsel kontrol et
  5. Bonus: PromptGenerator.php'yi de düzelt (Shop/Portfolio için)

💻 Yeni Kod: buildPromptForBlog() Metodu

Eklenecek Dosya: Modules/Blog/app/Services/BlogAIContentWriter.php
/**
 * Build professional DALL-E 3 prompt for blog featured image
 * Based on AA.pdf rules with blog-specific optimizations
 *
 * @param string $blogTitle Blog title (subject)
 * @return string Professional DALL-E 3 prompt
 */
protected function buildPromptForBlog(string $blogTitle): string
{
    // Kamera ve lens çeşitleri (AA.pdf'den)
    $cameras = [
        'Canon EOS R5 with 85mm f/1.4 lens',
        'Sony A7 III with 50mm f/1.8 lens',
        'Nikon D810 with 24-70mm f/2.8 lens',
        'Fujifilm GFX 100 with 63mm f/2.8 lens',
        'Leica M10 with 50mm f/1.4 lens',
    ];

    // Işıklandırma teknikleri (AA.pdf'den)
    $lightings = [
        'golden hour natural lighting',
        'soft window light',
        'professional studio lighting with softbox',
        'Rembrandt lighting setup',
        'natural ambient lighting',
    ];

    // Blog için önerilen style (commercial/documentary/natural)
    $styleOptions = [
        'advertising quality, perfect composition, luxury brand standards, professional photography, 8K resolution, RAW photo quality',
        'authentic moment, candid shot, photojournalism style, editorial photography, natural imperfections, realistic atmosphere',
        'outdoor scene, authentic atmosphere, shallow depth of field, bokeh background, natural light photography',
    ];

    // Random seçimler (her blog farklı olsun)
    $camera = $cameras[array_rand($cameras)];
    $lighting = $lightings[array_rand($lightings)];
    $style = $styleOptions[array_rand($styleOptions)];

    // AA.pdf CRITICAL RULE: "Photo of" prefix!
    $photoPrefix = 'Photo of';

    // ABSOLUTE TEXT BAN (AA.pdf kuralı)
    $textBan = 'ABSOLUTELY NO text, NO labels, NO captions, NO annotations, NO blue boxes, NO text overlays, NO UI elements, NO numbered labels, NO arrows with text, NO infographics, NO presentation elements, NO diagrams, NO charts, NO brand names, NO trademarks, NO written words of any kind. Pure photograph only, clean product catalog style without any text elements whatsoever';

    // Final prompt assembly (AA.pdf formülü)
    // Formula: Photo of + Subject + Style + Lighting + Camera + Text Ban
    return "{$photoPrefix} {$blogTitle}, {$style}, {$lighting}, shot on {$camera}. {$textBan}";
}

🔧 Mevcut Kod Değişikliği

❌ ESKİ KOD (Satır 93-95)

$imagePrompt = "Ultra realistic professional photograph, horizontal landscape orientation 16:9, " .
    $blogData['title'] .
    ", high quality commercial photography, natural lighting, sharp focus, detailed, NO TEXT, NO WORDS, NO LETTERS in image or background";

✅ YENİ KOD

// AA.pdf kurallarına uygun prompt
$imagePrompt = $this->buildPromptForBlog($blogData['title']);

📊 Beklenen İyileştirmeler

Metrik Öncesi Sonrası İyileştirme
Prompt Kalitesi Amatörce (yasak kelimeler) Profesyonel (AA.pdf uyumlu) +300%
Görsel Çeşitliliği 0% (her blog aynı) 100% (random camera+lighting) +∞
Fotogerçeklik Orta (painting-like risk) Yüksek (RAW photo quality) +150%
Teknik Detay Yok (kamera/lens yok) Var (Canon EOS R5, 85mm f/1.4) +500%
Text Ban Basit (15 kelime) Comprehensive (200+ karakter) +1000%

🧪 Test Senaryosu

Test Adımları:

  1. Kodu değiştir ve kaydet
  2. composer dump-autoload çalıştır
  3. OPcache reset: curl -k https://ixtif.com/opcache-reset.php
  4. Admin panel → Blog AI Drafts
  5. Yeni draft üret
  6. Üretilen görseli kontrol et:
    • ✅ Fotogerçeklik var mı?
    • ✅ Text yok mu?
    • ✅ Profesyonel composition var mı?
    • ✅ Her blog farklı mı? (2-3 blog üret, karşılaştır)

📌 Ek Düzeltme: PromptGenerator.php

Modules/AI/app/Services/PromptGenerator.php (Satır 46)

❌ ESKİ KOD

$prompt .= " Ultra detailed, 8K resolution, photorealistic, cinematic lighting, masterpiece quality, sharp focus, professional photography.";

✅ YENİ KOD

$prompt .= " Ultra detailed, 8K resolution, RAW photo quality, natural imperfections, professional photography, sharp focus, masterpiece quality.";

🎯 Sonuç

Bu değişikliklerle blog görsel üretimi amatörce seviyeden profesyonel AA.pdf standardına yükselecek.

Beklenen Sonuç: Her blog için farklı, yüksek kaliteli, text-free, fotogerçek görseller.