Reset viewer after debug stages

This commit is contained in:
Meta Vens 2026-04-25 03:46:06 +01:00
commit 5a56f1fa1e
2 changed files with 51 additions and 41 deletions

View file

@ -595,31 +595,36 @@ function renderSummary(): void {
async function renderViewer(): Promise<void> {
const frame = getSelectedFrame();
let leftAsset = state.preprocessedImage ?? state.sourceImage;
const debugViewerStage = new Set(["inference", "analysis", "selection", "rerank", "solver", "cleanup"]);
const showDebugViewer = debugViewerStage.has(state.stageKey);
let leftAsset = state.sourceImage;
let rightAsset = state.finalOutputImage ?? state.cleanupImage ?? state.sourceImage;
let leftLabel = "Input";
let rightLabel = "Output";
if (state.latticeImage) {
leftAsset = state.latticeImage;
leftLabel = "Lattice Prep";
}
if (state.guidanceImage) {
leftAsset = state.guidanceImage;
leftLabel = "Guidance";
}
if (frame) {
leftAsset = frame.samplingOverlayImage;
rightAsset = frame.outputImage;
leftLabel = "Sampling Overlay";
rightLabel = "Current Output";
} else if (state.cleanupImage) {
if (state.heatmapImage) {
leftAsset = state.heatmapImage;
leftLabel = "Cleanup Heatmap";
if (showDebugViewer) {
leftAsset = state.preprocessedImage ?? state.sourceImage;
if (state.latticeImage) {
leftAsset = state.latticeImage;
leftLabel = "Lattice Prep";
}
if (state.guidanceImage) {
leftAsset = state.guidanceImage;
leftLabel = "Guidance";
}
if (frame) {
leftAsset = frame.samplingOverlayImage;
rightAsset = frame.outputImage;
leftLabel = "Sampling Overlay";
rightLabel = "Current Output";
} else if (state.cleanupImage) {
if (state.heatmapImage) {
leftAsset = state.heatmapImage;
leftLabel = "Cleanup Heatmap";
}
rightAsset = state.cleanupImage;
rightLabel = "Cleaned Output";
}
rightAsset = state.cleanupImage;
rightLabel = "Cleaned Output";
}
leftVizLabel.textContent = leftLabel;

View file

@ -449,31 +449,36 @@ function renderSummary() {
}
async function renderViewer() {
const frame = getSelectedFrame();
let leftAsset = state.preprocessedImage ?? state.sourceImage;
const debugViewerStage = new Set(["inference", "analysis", "selection", "rerank", "solver", "cleanup"]);
const showDebugViewer = debugViewerStage.has(state.stageKey);
let leftAsset = state.sourceImage;
let rightAsset = state.finalOutputImage ?? state.cleanupImage ?? state.sourceImage;
let leftLabel = "Input";
let rightLabel = "Output";
if (state.latticeImage) {
leftAsset = state.latticeImage;
leftLabel = "Lattice Prep";
}
if (state.guidanceImage) {
leftAsset = state.guidanceImage;
leftLabel = "Guidance";
}
if (frame) {
leftAsset = frame.samplingOverlayImage;
rightAsset = frame.outputImage;
leftLabel = "Sampling Overlay";
rightLabel = "Current Output";
}
else if (state.cleanupImage) {
if (state.heatmapImage) {
leftAsset = state.heatmapImage;
leftLabel = "Cleanup Heatmap";
if (showDebugViewer) {
leftAsset = state.preprocessedImage ?? state.sourceImage;
if (state.latticeImage) {
leftAsset = state.latticeImage;
leftLabel = "Lattice Prep";
}
if (state.guidanceImage) {
leftAsset = state.guidanceImage;
leftLabel = "Guidance";
}
if (frame) {
leftAsset = frame.samplingOverlayImage;
rightAsset = frame.outputImage;
leftLabel = "Sampling Overlay";
rightLabel = "Current Output";
}
else if (state.cleanupImage) {
if (state.heatmapImage) {
leftAsset = state.heatmapImage;
leftLabel = "Cleanup Heatmap";
}
rightAsset = state.cleanupImage;
rightLabel = "Cleaned Output";
}
rightAsset = state.cleanupImage;
rightLabel = "Cleaned Output";
}
leftVizLabel.textContent = leftLabel;
rightVizLabel.textContent = rightLabel;