[object Object]

← back to Enrich Local Hybrid

palette: make vl_max env-tunable via ENRICH_VL_MAX (default 1024, backward-compatible)

029e6674a3397deb63a6fa7d15fb81abbaddfbff · 2026-07-01 15:10:29 -0700 · Steve Abrams

Files touched

Diff

commit 029e6674a3397deb63a6fa7d15fb81abbaddfbff
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Wed Jul 1 15:10:29 2026 -0700

    palette: make vl_max env-tunable via ENRICH_VL_MAX (default 1024, backward-compatible)
---
 enrich-palette.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/enrich-palette.py b/enrich-palette.py
index bde239a..20e748b 100644
--- a/enrich-palette.py
+++ b/enrich-palette.py
@@ -5,13 +5,13 @@
   Pillow guarantees ollama/llama-server can load it (catalog images are often CMYK JPEG / WebP /
   odd encodings that Pillow reads but the VL image loader rejects → "Failed to load image").
 Usage: enrich-palette.py <image> [k]   → prints {"palette":[...], "image_b64":"..."}"""
-import sys, json, io, base64
+import sys, json, io, base64, os
 from PIL import Image
 
 def _dist(a, b):
     return sum((x - y) ** 2 for x, y in zip(a, b)) ** 0.5
 
-def analyze(path, k=6, merge_thresh=30, vl_max=1024):
+def analyze(path, k=6, merge_thresh=30, vl_max=int(os.environ.get("ENRICH_VL_MAX", "1024"))):
     im = Image.open(path).convert("RGB")            # CMYK/RGBA/P/WebP -> RGB
     # --- palette from a small copy ---
     small = im.copy(); small.thumbnail((220, 220))

← 79237c9 enrich-local: raise VL timeout 120s→300s + keep_alive 15m to  ·  back to Enrich Local Hybrid  ·  chore: macstudio3 migration — reconcile from mac2 + repoint 20434f1 →