Currently stopped — wallpaper.cron.ts is a script (not cron) and has
ENABLED = false. Flip both to resume.
Daily Krea 2 Large wallpaper generation, hosted on Val Town.
Pipeline (same as local generate.py):
- Submit Krea 2 Large job (style refs + moodboard)
- Poll until complete, then 2× upscale via Krea Enhance
- Upload to Supabase
wallpapers/krea/(+latest.pngalias) - Email
joshuacfang@gmail.comthe iOS Shortcuts smart link
Krea jobs take minutes, so the cron uses a state machine across 15-minute ticks (Val Town's 10–60s execution limit can't hold a poll loop).
Val: https://www.val.town/x/fang/kreaWallpaper/code/
export PATH="$HOME/.deno/bin:$PATH" export VAL_TOWN_API_KEY=$(grep '^VAL_API_KEY=' ../../../.env | cut -d= -f2-) cd src/wallpapers/val vt push # after local edits
Root .env uses VAL_API_KEY; the vt CLI expects VAL_TOWN_API_KEY (same token).
KREA_API_KEY, SUPABASE_URL, and SUPABASE_SERVICE_ROLE_KEY are already set on the val.
Email to external addresses requires Val Town Pro.
In the Val Town UI for wallpaper.cron.ts, set schedule to */15 * * * *
(every 15 min — minimum on free tier). Optional env vars on the val:
| Variable | Notes |
|---|---|
WALLPAPER_THEME | Default: fireworks and splendor for 4th of july |
WALLPAPER_SHORTCUT_NAME | Default: My Wallpaper |
WALLPAPER_HOUR_PT | Earliest PT hour to start daily job (default 8) |
Click Run on wallpaper.cron.ts in the Val Town editor. First tick either
starts a job (if after WALLPAPER_HOUR_PT and not yet done today) or polls an
in-progress job.
../generate.py remains for one-off runs from this machine. The Val Town job is
the scheduled path.