- _vae_kwargs(): loads madebyollin/sdxl-vae-fp16-fix instead of upcast_vae() to
avoid the per-render fp32 upcast and its associated FutureWarning.
- PainterBase._remove_bg(): reuses one rembg ONNX session per process; previously
remove() without a session reloaded the ~170MB u2net model on every sprite call.
- Remove _quiet_stderr / _safe_print duplicates now living in utils.py.
- modal_app.py: same VAE and rembg session fixes applied to the Modal backend;
scaledown_window raised to 600s to avoid mid-session GGUF reload.
feat(engine): split play_turn into text+image phases, add resume and session_info
- play_turn_text(): STT + LLM + state mutation, returns text-only ViewState so
dialogue appears before the slower painter/TTS phase.
- play_turn_images(): painter + TTS; recovers pending turn from disk so ZeroGPU
can dispatch the two phases to different GPU workers.
- play_turn() kept as a composed single-call path (smoke tests / MVP UI).
- _text_view() extracted from start_text() and reused across all three paths.
- resume(): restores the session persisted on disk and rebuilds the history list
with display names so the frontend journal can be replayed.
- session_info(): cheap file-read peek (no GPU needed) for the 'Continue' button.
- _save_state() and _load_state() extended to carry pending notifications across
worker restarts.
- Anti-repetition guard: if the generated line is a near-verbatim copy of a recent
turn (SequenceMatcher >= 0.95), one hotter retry is issued with the forbidden line
quoted. A failed retry keeps the first output rather than crashing.
- Error fallback: any exception in the main LLM call returns a bland in-fiction line
instead of propagating to the frontend.
- scout action routes to scout_schema() (new_character required by grammar); when
the stage is full it downgrades to 'scout_full' with the normal schema.
- _repair() now normalises a newcomer's speaker id and fills default traits/appearance
for under-specified new characters; clips runaway generated fields via clip_words.
- compact_memory() uses the player name in the blob, raises max_tokens to 320, and
defends against <think> text polluting the rolling summary via strip_think().
- new_character processing moved to the top of apply_directives so a newly arriving
character can be this turn's speaker (mood/relationship update otherwise skipped).
- Milestone-50 one-shot: arms a 'pending' flag so memory.py can inject the hint
exactly once, then retires it to 'done'.
- remember_fact: appends the director's learned fact to the speaker's known_facts
list (capped at 8, oldest dropped).
- Beat guard: advance_beat ignored when the current beat started fewer than 4 turns
ago, preventing the model from sprinting opening -> resolution in a handful of turns.
- beat_started_turn stored in flags to feed the pacing nudge in memory.py.
- _fit_to_budget() replaces _trim_to_budget(): drops oldest RECENT EXCHANGE lines
first rather than slicing the whole context from the tail.
- assemble_context() accepts action_note and injects it outside the player's quoted
line to keep the model from reading directives as player speech.
- Milestone-50 special-moment hint: fires once per character when affection >= 50.
- Pacing nudge: injected after 7+ turns in the same beat to prompt advance_beat.
- _INTERNAL_FLAGS / _INTERNAL_PREFIXES: scrub engine flags from the FACTS line so
the model never sees implementation details like current_music or milestone50_.
- should_compact() now triggers at 2*RECENT_TURNS_K (meaningful chunk per call).
feat(prompts): force grammar fields, scout_schema, action_note, lru_cache
- directive_schema() now marks emotion and relationship_delta as required so small
models cannot omit them (they default to neutral/0 otherwise).
- scout_schema(): variant where new_character is required and non-nullable, enforcing
an introduction via the grammar rather than relying on prompt instructions alone.
- action_note() replaces format_player_turn() - the director note is now injected
outside the player's quoted line so the model reads it as an instruction.
- scout_full action note for the stage-full fallback path.
- lru_cache on directive_schema / scout_schema / init_schema (immutable, regenerating
them every turn was wasted work).
- Expanded director rules: per-turn relationship_delta guidance, emotion variety,
beat-advance guidance, remember_fact instruction.
- Directives.remember_fact: lets the director store a short third-person note
about something the player revealed this turn.
- ViewState.history: populated by Engine.resume() so the frontend can rebuild
the journal after reconnecting.
- config.IMAGE_VAE: env-var for the fp16-safe SDXL VAE (default madebyollin/sdxl-vae-fp16-fix)
to avoid the per-render fp32 upcast overhead.
- Remove COMPACT_EVERY (replaced by the 2*RECENT_TURNS_K trigger in memory.py).
- Add _hf_gen_kwargs to map complete() kwargs to transformers generate() correctly
(greedy vs sampled) so temperature/top_p actually apply.
- Repair max_tokens-truncated JSON in LlamaCppLLM.complete_json via close_truncated_json.
- Add ModalLLM.warmup() to pre-heat the GPU container before the first player turn.
- Gate complete/complete_json trace logs behind config.DEBUG to reduce noise.
- Remove duplicated helpers now living in utils.py.
refactor(utils): extract shared helpers into visualnovel/utils.py
Move _quiet_stderr, _safe_print, strip_think, clip_words, and close_truncated_json
out of llm.py and painter.py into a new utils.py module so every backend can share
them without circular imports.
commit 30b115e35191d24a85c0cd89d30c2469306d959d
Author: SupPepper <99681586+LorenzoLepoivre@users.noreply.github.com>
Date: Tue Jun 9 17:43:14 2026 +0200
Update index.html
commit 8640b91fd31b1dc92eebc1db4586cc47803e1dc8
Author: SupPepper <99681586+LorenzoLepoivre@users.noreply.github.com>
Date: Tue Jun 9 17:30:59 2026 +0200
save
commit d09ba91ec6cdcf88e58fa9e423998fa32fc9e40e
Author: SupPepper <99681586+LorenzoLepoivre@users.noreply.github.com>
Date: Tue Jun 9 16:44:47 2026 +0200
Update index.html
commit b4fea552a0b39eed5fa74883cc5676f7052edac9
Author: SupPepper <99681586+LorenzoLepoivre@users.noreply.github.com>
Date: Tue Jun 9 16:41:42 2026 +0200
feat: BGM system, NPC bonds, save/load, progress bar, UI polish
- Background music: 6 mood tracks, set_music directive, crossfade transitions
- NPC-NPC relationship system: directed bonds, bond graph in Relations tab
- Save/load: file-based JSON save with journal history + audio settings
- Two-…
Feat : Save System
SupPepper
ba89557
commit 4f1ad091911892a6bdd7a75c58d9233e72b9af15
Author: SupPepper <99681586+LorenzoLepoivre@users.noreply.github.com>
Date: Sun Jun 7 20:22:40 2026 +0200
Update index.html
commit 7a4b04691d4364fd8de0d82ab15d2e81a3374815
Author: SupPepper <99681586+LorenzoLepoivre@users.noreply.github.com>
Date: Sun Jun 7 19:30:33 2026 +0200
save to test
Auto-download Kokoro model files if missing at startup
Replaces the FileNotFoundError with _ensure_kokoro_models() which
downloads kokoro-v1.0.onnx and voices-v1.0.bin from the kokoro-onnx
GitHub releases if they are absent — handles the HF Space ephemeral
filesystem without breaking local or modal configurations.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Without a .env, the lightning backend was defaulting to sdxl-turbo model
(wrong) and no LoRA (wrong). Now defaults match the selected IMAGE_BACKEND
so the app works correctly even without explicit overrides.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Merge branch 'main' of https://huggingface.co/spaces/build-small-hackathon/Hackathon-IA-VisualNovel
SupPepper
9a33481
Journal
SupPepper
fa489d9
Auto-detect HF Space env; fix image dependency check
config.py now reads SPACE_ID (always set by HF platform) to select
transformers backend on Spaces and llamacpp locally — no manual override
needed. Removes explicit VN_LLM_BACKEND from .env so auto-detect applies.
Changes default IMAGE_BACKEND fallback from "local" to "lightning" to match
current usage. Fixes app.py startup check to cover IMAGE_BACKEND="lightning"
(requires diffusers just like "local").
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Merge origin/main into feature/update-vocal_system
Integrates action/target turn system, journal UI, painter and prompt
improvements from main while preserving Kokoro TTS voice system.
Regenerated uv.lock to include kokoro-onnx + soundfile TTS dependencies.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- BACKDROP_GUIDANCE=1.5 so the negative prompt is actually applied (CFG=0
mathematically ignores negatives; sprites keep 0.0 for distillation quality)
- Strip 'expressive eyes' and 'clean linework' from backdrop style guide
(both are character-generation triggers)
- Reorder backdrop prompt: no-humans anchors first (SDXL weights early tokens more)
- guidance_scale threaded through _cached/_render on all painter subclasses
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Renamed Menu/ to ui/
- Fixed enemy spelling throughout
- Organized scripts into autoload/data/const/enums
- Moved unused assets to assets/unused/
- Created addons/ folder for outline system
- Cleaned up folder structure