Simplify lattice inference and hosted landing
This commit is contained in:
parent
3fa3be8dc9
commit
16c86d54aa
46 changed files with 1844 additions and 1492 deletions
|
|
@ -64,7 +64,7 @@ def _parse_args() -> argparse.Namespace:
|
|||
parser.add_argument(
|
||||
"--dense-phase-field-output",
|
||||
default="tests/fixtures/real/dense-landscape-fixed-512.png",
|
||||
help="Tracked fixed-lattice phase-field output used for the dense landscape row.",
|
||||
help="Tracked fixed-lattice output used for the dense landscape row.",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--guard-cell-bbox",
|
||||
|
|
@ -93,20 +93,7 @@ def _parse_args() -> argparse.Namespace:
|
|||
type=int,
|
||||
default=126,
|
||||
help="Pinned target height for the canonical badge comparison.",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--phase-x",
|
||||
type=float,
|
||||
default=0.0,
|
||||
help="Pinned lattice phase X for the canonical badge comparison.",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--phase-y",
|
||||
type=float,
|
||||
default=-0.2,
|
||||
help="Pinned lattice phase Y for the canonical badge comparison.",
|
||||
)
|
||||
parser.add_argument(
|
||||
) parser.add_argument(
|
||||
"--dense-target-width",
|
||||
type=int,
|
||||
default=512,
|
||||
|
|
@ -393,12 +380,10 @@ def main() -> None:
|
|||
scratch_dir / "badge-ai-phase-field-pinned.png",
|
||||
target_width=args.target_width,
|
||||
target_height=args.target_height,
|
||||
phase_x=args.phase_x,
|
||||
phase_y=args.phase_y,
|
||||
diagnostics_dir=scratch_dir / "phase-field-diag",
|
||||
steps=args.steps,
|
||||
device=args.device,
|
||||
enable_phase_rerank=False,
|
||||
enable_candidate_rerank=False,
|
||||
)
|
||||
|
||||
source_rgba = load_rgba(source_input)
|
||||
|
|
@ -429,7 +414,7 @@ def main() -> None:
|
|||
rows = [
|
||||
PreviewRow(
|
||||
row_id="badge",
|
||||
title=f"AI fake pixel art -> {args.target_width}x{args.target_height} pinned lattice @ ({args.phase_x:.1f}, {args.phase_y:.1f})",
|
||||
title=f"AI fake pixel art -> {args.target_width}x{args.target_height} pinned lattice",
|
||||
source_rgba=source_rgba,
|
||||
source_subtitle="Cleaned AI fake pixel art",
|
||||
lanczos_rgba=lanczos,
|
||||
|
|
|
|||
|
|
@ -98,16 +98,12 @@ def _build_focus_states(
|
|||
artifacts.initial_rgba,
|
||||
target_width=inference.target_width,
|
||||
target_height=inference.target_height,
|
||||
phase_x=inference.phase_x,
|
||||
phase_y=inference.phase_y,
|
||||
),
|
||||
"final": source_lattice_consistency_breakdown(
|
||||
source,
|
||||
artifacts.target_rgba,
|
||||
target_width=inference.target_width,
|
||||
target_height=inference.target_height,
|
||||
phase_x=inference.phase_x,
|
||||
phase_y=inference.phase_y,
|
||||
),
|
||||
}
|
||||
return source, artifacts.initial_rgba, artifacts.target_rgba, (cell_x, cell_y), fidelity
|
||||
|
|
|
|||
61
scripts/run_hosted_gui.ps1
Normal file
61
scripts/run_hosted_gui.ps1
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
param(
|
||||
[string]$BindHost = "0.0.0.0",
|
||||
[int]$Port = 8000,
|
||||
[switch]$Reload,
|
||||
[ValidateSet("auto", "show", "hide")]
|
||||
[string]$QueueUI = "auto"
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
$repoRoot = Split-Path -Parent $PSScriptRoot
|
||||
$python = Join-Path $repoRoot ".venv\Scripts\python.exe"
|
||||
if (-not (Test-Path $python)) {
|
||||
$python = "python"
|
||||
}
|
||||
|
||||
$previousHostedDemo = $env:REPIXELIZER_HOSTED_DEMO
|
||||
$previousShowQueuePanel = $env:REPIXELIZER_SHOW_QUEUE_PANEL
|
||||
|
||||
try {
|
||||
$env:REPIXELIZER_HOSTED_DEMO = "1"
|
||||
|
||||
if ($QueueUI -eq "show") {
|
||||
$env:REPIXELIZER_SHOW_QUEUE_PANEL = "1"
|
||||
} elseif ($QueueUI -eq "hide") {
|
||||
$env:REPIXELIZER_SHOW_QUEUE_PANEL = "0"
|
||||
} else {
|
||||
Remove-Item Env:\REPIXELIZER_SHOW_QUEUE_PANEL -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
$launcherArgs = @(
|
||||
(Join-Path $repoRoot "scripts\run_gui.py"),
|
||||
"--host", $BindHost,
|
||||
"--port", $Port,
|
||||
"--queue-ui", $QueueUI
|
||||
)
|
||||
|
||||
if ($Reload) {
|
||||
$launcherArgs += "--reload"
|
||||
}
|
||||
|
||||
Write-Host "Starting Repixelizer hosted GUI..."
|
||||
Write-Host " Hosted demo: $env:REPIXELIZER_HOSTED_DEMO"
|
||||
Write-Host " Bind: http://${BindHost}:${Port}"
|
||||
Write-Host " Python: $python"
|
||||
Write-Host ""
|
||||
|
||||
& $python @launcherArgs
|
||||
} finally {
|
||||
if ($null -eq $previousHostedDemo) {
|
||||
Remove-Item Env:\REPIXELIZER_HOSTED_DEMO -ErrorAction SilentlyContinue
|
||||
} else {
|
||||
$env:REPIXELIZER_HOSTED_DEMO = $previousHostedDemo
|
||||
}
|
||||
|
||||
if ($null -eq $previousShowQueuePanel) {
|
||||
Remove-Item Env:\REPIXELIZER_SHOW_QUEUE_PANEL -ErrorAction SilentlyContinue
|
||||
} else {
|
||||
$env:REPIXELIZER_SHOW_QUEUE_PANEL = $previousShowQueuePanel
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue