Add one-tap edit chips with FLUX.2-klein-4B, shared paid-call accounting and a stale-result guard
Magnus Persson
3b7d0f4
Chips (config/app.yaml edit_chips) send the visitor's current image and a static or LLM-picked instruction to the edit model; the LLM instruction is moderated and policy-checked, the output image is checked before display, and previous images go to history. Create and edit share services/spend.paid_call. A result arriving after New visitor is dropped (session epoch), for Create too. edit_instruction no longer asks for the unused new_prompt. Real-keys check covers two live edits. Library images and lock are left out: a forced rebuild is waiting for review. 415 tests.
Add the HF edit adapter and a model bake-off script; fast model cost measured
Magnus Persson
186ad3c
HFEditProvider (image_to_image) shares an HFRunner with the image adapter: typed errors, billing-safe retries, hard deadline, worker thread. EditModel gets hf_provider and the factory builds the edit provider once an edit model has hf_model. scripts/bakeoff.py compares models on fixed prompts with latency and a contact sheet. First edit bake-off on fal-ai: FLUX.2-klein-4B 3.9-5.2 s, klein-9B 4.1-5.8 s, Kontext-dev 8.6-9.4 s, Qwen-Image-Edit-2511 13.9-14.8 s. FLUX.1-schnell estimate set to the measured 0.003. 388 tests.
Add Help me and Surprise me with Undo, and the real-keys flow check
Magnus Persson
09aba58
HelperService rewrites an idea (Help me) or invents one from a library theme (Surprise me). Every reply passes moderation and the workshop policy check before it is shown; a failed Surprise falls back to a curated library prompt. Limits: 2 s per device, 60 a minute overall, 8 at once, pause switch. Undo restores the previous text until the visitor types, picks an idea or uses an alternative. check_generated_text now runs the policy check and does not generate an alternative for LLM text.
scripts/check_real_flow.py drives startup validation, Create, a cached example, refusals, Help me and Surprise me with real keys and scans the logs for leaks. README gets the provider privacy note. Whole-flow safety review done; operational gate items are in todo.md. 381 tests.
Add the ideas popup with cached example images; drop the format picker
Magnus Persson
0016651
Ideas popup: 7 themed groups of example prompts in Swedish and English (config/prompt_library.yaml), including a like-real-photos group. Tapping a prompt fills the text box. An unchanged library prompt with no style returns its cached image at once, with no moderation call, provider call or cost, and a note that it is an example. Cached images live in assets/library and are tied to their texts by config/prompt_library.lock.json; a mismatch hides the prompt. scripts/build_library.py makes the images through the normal safety checks (every language of each prompt, and the image) and refreshes the lock.
Create is now always square: the Kvadrat/Liggande/Stående picker and its locale keys are removed (spec 3.3 updated); adapters still accept an aspect.
344 tests pass.
Add the Hugging Face image adapter, billing-safe retries and try_image script
Magnus Persson
6494c95
HF Inference Providers adapter (sync client in a worker thread), real image model ids, image_backend hf by default, 402 pauses generation, failures after the provider call keep the estimate unless known unbilled, HF_TOKEN prefix check, shared logging setup.
Safety cases run against the real services; alternatives must not name the original; known-issue marker
Magnus Persson
6419e2f
Phase 3: OpenAI moderation and text adapters, shared HTTP retry helper, safety review fixes
Magnus Persson
1da1792
Read secrets from a .env file one folder above the repo
SafetyService runs moderation and the workshop policy in parallel on the final prompt and fails closed. Policy replies are validated; character mode and offer_safe_rewrite have the last word; serious categories never get an alternative; alternatives are cleaned and moderated before display. Fixed internal moderation code set. Rewrite card in the Create tab. 40 SV/EN safety cases replayed with table-driven fakes, plus a script for the real services. 170 tests.
Phase 2: login, budget and rate limits, device cooldown, kill switch, admin status tab
Magnus Persson
d8ebb7a
Add access.py (workshop/admin login, password rules), limits.py (reserve/reconcile/release under one lock, cooldown, hourly cap, per-minute rate, slots, pause), admin tab, CooldownError and device id in BrowserState. Events are private to the Gradio client (EXPOSE_API lifts this for load tests). Load test now logs in, keeps the device id and detects refused Creates. 99 tests with fakes.
Pin gradio[mcp,oauth] so requirements.txt resolves on the Space; add Space install check
Magnus Persson
045c645
Phase 0 and 1: project setup, config, fakes, Create tab