[object Object]

← back to Wallco Ai

docs: mural-pipeline.md — Replicate gotchas playbook + review-gallery section [yolo T2, local-only]

ab10041654d2d6c357e0c1df3efe8433fb723b0c · 2026-06-03 15:06:52 -0700 · Steve Abrams

Captures today's hard-won Replicate fixes so the next session doesn't burn an hour
rediscovering them: Cloudflare 403 on python urllib → browser User-Agent; 403 on
large inline base64 → files-API upload; model-predictions 404 → version-pinned
/v1/predictions; one transient tile 400 crashed a mural → per-tile 4x retry;
inpaint model = lucataco/sdxl-inpainting (latest). Plus a Reviewing-built-masters
section pointing at the new /admin/mural-masters gallery.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Files touched

Diff

commit ab10041654d2d6c357e0c1df3efe8433fb723b0c
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Wed Jun 3 15:06:52 2026 -0700

    docs: mural-pipeline.md — Replicate gotchas playbook + review-gallery section [yolo T2, local-only]
    
    Captures today's hard-won Replicate fixes so the next session doesn't burn an hour
    rediscovering them: Cloudflare 403 on python urllib → browser User-Agent; 403 on
    large inline base64 → files-API upload; model-predictions 404 → version-pinned
    /v1/predictions; one transient tile 400 crashed a mural → per-tile 4x retry;
    inpaint model = lucataco/sdxl-inpainting (latest). Plus a Reviewing-built-masters
    section pointing at the new /admin/mural-masters gallery.
    
    Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---
 YOLO_BACKLOG.md        |  1 +
 docs/mural-pipeline.md | 32 ++++++++++++++++++++++++++++++++
 2 files changed, 33 insertions(+)

diff --git a/YOLO_BACKLOG.md b/YOLO_BACKLOG.md
index 52804dd..9768481 100644
--- a/YOLO_BACKLOG.md
+++ b/YOLO_BACKLOG.md
@@ -153,3 +153,4 @@ Envelope: LOCAL COMMITS ONLY (deploys Steve-gated), local-only/no destructive, e
 **DTD verdict — next-task (1/2 valid, Claude B vs Codex A, Qwen ERR; tie broken on argument): B — disciplined opportunistic local code-health, fall back to monitor when no real find.** run /tmp/dtd-20260603-143002-29476.
 - T1 · 2026-06-03 ~14:4x · universal search matched by COLOR NAME · done · found real gap (blue/green/teal/navy/cream all → 0 results; universalSearch only indexed title/category/handle/motifs). Added cached colorTokensForHex(dominant_hex) via lib/color _hueBucket+hueName + synonyms; +2 color-match in design scorer. Validated local: blue 0→271, green 0→435, teal 0→253, navy 0→207, cream→117, hex-accurate; toile/floral unchanged (no regression). · CNCP win-2026-06-03-wallco-ai-mpyl3yqlsw · LOCAL (deploy gated)
   - Follow-on candidate (next tick): MATERIAL search (grasscloth/cork/raffia → 0) — ground lives in prompt, not in the snapshot fields universalSearch iterates; needs prompt/ground exposed to the index. Investigate next.
+- T2 · docs/mural-pipeline.md — added "Replicate gotchas (hard-won)" section (403 UA fix, base64→files-API, model-404→version-pin, per-tile retry, inpaint model) + "Reviewing built masters" (/admin/mural-masters). Captures today's fixes so next session doesn't rediscover them. CNCP pending.
diff --git a/docs/mural-pipeline.md b/docs/mural-pipeline.md
index 1fd21d0..d947364 100644
--- a/docs/mural-pipeline.md
+++ b/docs/mural-pipeline.md
@@ -92,6 +92,38 @@ clean sky/ground). Outpainted content is sky/grass only (negative-prompted again
 birds/butterflies/people) — low settlement risk, but **run the settlement gate on
 the final master before any publish** per the project hard rule.
 
+### Replicate gotchas (hard-won 2026-06-03 — don't rediscover these)
+The first real batch run hit a wall of Replicate API quirks. All fixed in
+`build-mural-master.py`; documented so the next session doesn't burn an hour:
+
+- **403 Forbidden on python urllib → set a browser User-Agent.** Replicate's
+  Cloudflare edge 403s the default `Python-urllib/x` UA on the files-upload and
+  model-GET endpoints (curl with its normal UA works fine). Fix: an
+  `install_opener` with `User-Agent: Mozilla/5.0 …` process-wide (top of
+  build-mural-master.py) — covers build-tif's esrgan calls too.
+- **403 on large inline base64 → upload to the files API.** A ~1 MB image as an
+  inline `data:image/png;base64,…` in the prediction body gets edge-403'd. Fix:
+  `_replicate_upload()` POSTs the image to `/v1/files` (multipart) and passes the
+  returned URL as the model input instead.
+- **404 on the model-predictions endpoint → version-pin.** `POST /v1/models/
+  {owner}/{name}/predictions` 404s for some models. Fix: GET the model, read
+  `latest_version.id`, then `POST /v1/predictions` with `{version, input}` (the
+  same path the working real-esrgan call uses).
+- **One transient tile error crashed a whole mural → retry per tile.** A single
+  HTTP 400 on one of a mural's ~17 tiled-ESRGAN calls aborted the build (21079
+  failed this way). Fix: `_esrgan_x4_retry()` wraps each tile call in 4×
+  backoff. Each mural is a fresh process, so adding retry mid-batch protected
+  every subsequent mural immediately.
+- **Inpaint model:** `lucataco/sdxl-inpainting` (latest version, resolved at
+  call time — no pinned hash to rot).
+
+### Reviewing built masters
+Masters land on the Henry external volume (`/Volumes/Henry/wallco-ai-archive/
+mural-masters/<id>/`), Mac2-local — NOT prod. Review them in the browser at
+**`/admin/mural-masters`** (admin-gated local gallery): contact-sheet thumb +
+12×11ft dims + per-width panel counts + size + created date+time chip, with
+Sort + Density. Auto-refreshes every 30s as a batch lands more.
+
 ---
 
 ## Commands

← 3c40e9c YOLO ledger: 2026-06-03 EVE run — DTD verdict B + T1 color-n  ·  back to Wallco Ai  ·  backfill-rooms: skip re-composite when room PNG already on d fc5c3d3 →