#!/usr/bin/env powershell # PixelForge mit Z-Image Turbo Start-Skript # Verwendung: .\start_zimageturbo.ps1 Write-Host "╔════════════════════════════════════╗" -ForegroundColor Cyan Write-Host "║ PixelForge + Z-Image Turbo Start ║" -ForegroundColor Cyan Write-Host "╚════════════════════════════════════╝`n" -ForegroundColor Cyan # 1. Konfiguration abfragen Write-Host "Bitte Colab-Ngrok-URL eingeben:" -ForegroundColor Yellow Write-Host "(z.B.: https://abc123def456.ngrok.io)" -ForegroundColor Gray $colab_url = Read-Host "Ngrok-URL" if (-not $colab_url -or -not $colab_url.StartsWith("https://")) { Write-Host "✗ Ungültige URL" -ForegroundColor Red exit 1 } # 2. Umgebungsvariablen setzen $env:ZIMAGETURBO_API_URL = $colab_url $env:ZIMAGETURBO_TIMEOUT = "300" Write-Host "✓ Z-Image Turbo konfiguriert: $colab_url" -ForegroundColor Green # 3. Backend starten Write-Host "`nStarte Backend..." -ForegroundColor Yellow cd "d:/VSC Codes/Bild/imageforge" $backend_running = $false Start-Process -NoNewWindow -FilePath "D:/VSC Codes/Bild/.venv/Scripts/python.exe" ` -ArgumentList "-m backend.app.main" ` -PassThru | ForEach-Object { Write-Host "Backend gestartet (PID: $($_.Id))" -ForegroundColor Green $backend_running = $true Start-Sleep -Seconds 3 } # 4. Frontend starten (optional) Write-Host "Starte Frontend..." -ForegroundColor Yellow cd "d:/VSC Codes/Bild/imageforge/frontend" Start-Process -NoNewWindow -FilePath "npm" ` -ArgumentList "run dev:web" ` -PassThru | Out-Null Start-Sleep -Seconds 2 # 5. Prüfung Write-Host "`nPrüfe Services..." -ForegroundColor Yellow try { $health = Invoke-RestMethod "http://127.0.0.1:8008/health" -TimeoutSec 3 Write-Host "✓ Backend OK" -ForegroundColor Green } catch { Write-Host "✗ Backend nicht erreichbar" -ForegroundColor Red } try { $fe = Invoke-WebRequest "http://127.0.0.1:5173" -TimeoutSec 3 Write-Host "✓ Frontend OK" -ForegroundColor Green } catch { Write-Host "⚠ Frontend wird noch gestartet..." -ForegroundColor Yellow } # 6. Finale Informationen Write-Host "`n╔════════════════════════════════════╗" -ForegroundColor Green Write-Host "║ System bereit zum Testen! ║" -ForegroundColor Green Write-Host "╚════════════════════════════════════╝`n" -ForegroundColor Green Write-Host "Öffne im Browser: http://127.0.0.1:5173/" -ForegroundColor Cyan Write-Host "Backend API: http://127.0.0.1:8008/" -ForegroundColor Cyan Write-Host "Colab Modell: $colab_url" -ForegroundColor Cyan Write-Host "`nDrücke Ctrl+C zum Beenden" -ForegroundColor Yellow