PixelForge / start_zimageturbo.ps1
Gregorfun's picture
Initial commit
32c5da4
#!/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