[object Object]

← back to Wallco Ai

refiner-compare: write progress per-image (not per-pair) + live viewer shows each render the instant it lands

c51e39fe986aef83d4ec1d71d2fa8171b3eaa1ae · 2026-05-19 11:24:38 -0700 · SteveStudio2

Files touched

Diff

commit c51e39fe986aef83d4ec1d71d2fa8171b3eaa1ae
Author: SteveStudio2 <steve@designerwallcoverings.com>
Date:   Tue May 19 11:24:38 2026 -0700

    refiner-compare: write progress per-image (not per-pair) + live viewer shows each render the instant it lands
---
 scripts/refiner_compare.js | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/scripts/refiner_compare.js b/scripts/refiner_compare.js
index 680dab7..435746f 100644
--- a/scripts/refiner_compare.js
+++ b/scripts/refiner_compare.js
@@ -100,12 +100,20 @@ function render(workflow, outPath) {
     const seed = 770000 + i;
     const POS = buildPos(style, pal);
     const baseFile = `${i}_base.png`, refFile = `${i}_refiner.png`;
-    let okB = false, okR = false;
-    try { okB = render(baseWorkflow(seed, POS), path.join(OUT, baseFile)); } catch (e) { console.log(`  ${i} base ERR ${e.message}`); }
-    try { okR = render(refinerWorkflow(seed, POS), path.join(OUT, refFile)); } catch (e) { console.log(`  ${i} refiner ERR ${e.message}`); }
-    rows.push({ i, style, brand: pal.brand, seed, base: okB ? baseFile : null, refiner: okR ? refFile : null });
-    console.log(`[${i + 1}/25] ${style} · ${pal.brand} — base:${okB ? 'ok' : 'FAIL'} refiner:${okR ? 'ok' : 'FAIL'} · ${((Date.now() - t0) / 1000 / 60).toFixed(1)}min`);
-    fs.writeFileSync(path.join(OUT, 'progress.json'), JSON.stringify({ done: i + 1, total: 25, rows }, null, 1));
+    // row pushed up-front (base/refiner = null = "rendering"); progress.json
+    // is rewritten after EVERY render so each image shows the instant it lands.
+    const row = { i, style, brand: pal.brand, seed, base: null, refiner: null };
+    rows.push(row);
+    const save = done => fs.writeFileSync(path.join(OUT, 'progress.json'),
+      JSON.stringify({ done, total: STYLES.length, rows }, null, 1));
+    save(i);
+    try { row.base = render(baseWorkflow(seed, POS), path.join(OUT, baseFile)) ? baseFile : false; }
+    catch (e) { row.base = false; console.log(`  ${i} base ERR ${e.message}`); }
+    save(i);
+    try { row.refiner = render(refinerWorkflow(seed, POS), path.join(OUT, refFile)) ? refFile : false; }
+    catch (e) { row.refiner = false; console.log(`  ${i} refiner ERR ${e.message}`); }
+    save(i + 1);
+    console.log(`[${i + 1}/25] ${style} · ${pal.brand} — base:${row.base ? 'ok' : 'FAIL'} refiner:${row.refiner ? 'ok' : 'FAIL'} · ${((Date.now() - t0) / 1000 / 60).toFixed(1)}min`);
   }
 
   // compare page

← af70673 generator: ban halftones, allow 3D/dimensional designs, add  ·  back to Wallco Ai  ·  generator: seamless tiling now MANDATORY for all non-mural d f9ddcbe →