1. 11 Jun, 2026 3 commits
    • Stefy Lanza (nextime / spora )'s avatar
      LoRA transport: upload / id / url / inline file (no shared filesystem) · 42e45456
      Stefy Lanza (nextime / spora ) authored
      Previously a per-request LoRA could only be a local path or HF id, which
      assumed the client shared the server's filesystem. Add a content-addressed
      store so remote clients can supply LoRAs by value or handle.
      
      Request `loras` spec now accepts (resolved server-side, in priority):
        id "name:<registered>"  -> a LoRA trained on this server (path-independent)
        id "sha256:<hex>"       -> a previously uploaded blob
        file/data (base64)      -> inline weights, cached in the blob store
        url                     -> server downloads (cached by content hash)
        model/path              -> legacy local path / HF id (unchanged)
      
      - loras.py: blob store (save_lora_blob / lora_blob_exists / _lora_blob_path),
        resolve_lora_ref(), resolve_request_loras() (in-place -> clean 400 on a
        missing blob / unknown name). New POST /v1/loras/upload (multipart / JSON
        base64 / raw, dedup) and GET /v1/loras/blob/{hash} existence check.
      - LoraConfig / VideoLoraConfig: model now optional; add id/url/file/data/path.
      - image + video handlers resolve_request_loras() before model work, so
        signature dedup / VRAM reserve / load_lora_weights read lora.model as before.
      - gen_township_fighters.py: reference trained LoRAs by id "name:<registered>"
        (derived from the server path) with the raw path kept as a co-located
        fallback, so the script works client/server-split.
      
      Also harden video load: float(cfg.get('balanced_gpu_percent', 80)) crashed on
      an explicit null (admin UI writes null for blank fields); use `or 80`.
      Co-Authored-By: 's avatarClaude Opus 4.8 <noreply@anthropic.com>
      42e45456
    • Stefy Lanza (nextime / spora )'s avatar
      Truncate base64 blobs in request debug log; add ftfy dependency · 2b28cae2
      Stefy Lanza (nextime / spora ) authored
      - log.py: _redact_blobs() recursively truncates data-URI / base64 fields
        (init_image, image, mask, character_references, …) to their first 48 chars
        in the FULL REQUEST DEBUG dump, so a clip request no longer prints tens of KB
        of base64. Prompts and normal fields are left intact (base64-charset check
        excludes anything with spaces/punctuation).
      - requirements.txt: add ftfy (required by the diffusers Wan/T5 prompt_clean
        path; its absence surfaced as "name 'ftfy' is not defined" at generation).
      Co-Authored-By: 's avatarClaude Opus 4.8 <noreply@anthropic.com>
      2b28cae2
    • Stefy Lanza (nextime / spora )'s avatar
      Add acceleration/distillation support (Lightning/Turbo/LCM/Hyper-SD) · d27ebf43
      Stefy Lanza (nextime / spora ) authored
      Per-model `acceleration` config block fuses a distillation LoRA into the
      pipeline at load and supplies low step-count / guidance defaults at
      generation time, for a 5-10x speedup. Covers video (Wan), image diffusers
      (SD/SDXL), and sd.cpp (step/cfg defaults + <lora:> prompt injection).
      
      - New codai/models/acceleration.py: preset catalog (ACCEL_PRESETS),
        resolve_acceleration(), apply_accel_to_pipeline() (load->fuse->unload so
        it stays orthogonal to per-request character/env LoRAs), accel_call_defaults().
      - video.py: fuse accel LoRA after load; _generate_video / _generate_sdcpp_video
        use preset steps/guidance (request always wins).
      - images.py: _apply_image_acceleration on both diffusers load paths;
        _generate_image and _generate_with_sdcpp honour preset steps/guidance.
      - main.py: surface `acceleration` as a first-class runtime kwarg.
      - admin: persist `acceleration`; new GET /admin/api/accel-presets; models.html
        Acceleration/Distillation card (preset dropdown + manual override).
      
      Also fix a latent null-trap: float(cfg.get('balanced_gpu_percent', 80))
      crashed when the config stored an explicit null (written by the admin UI for
      blank fields) since .get(key, default) returns the stored None. Use `or 80`.
      Co-Authored-By: 's avatarClaude Opus 4.8 <noreply@anthropic.com>
      d27ebf43
  2. 10 Jun, 2026 11 commits
    • Stefy Lanza (nextime / spora )'s avatar
      Township: attach env + both fighters' LoRAs to outcome clips & keyframes · bf50d8a1
      Stefy Lanza (nextime / spora ) authored
      Outcome scenes belong to a match, so their keyframe (image model) and video
      clip (video model) now attach the environment + BOTH match fighters' LoRAs,
      matching the fight clips — previously they sent only the single named
      fighter. Resolves the match pair from the in-memory fight_plan, falling back
      to the saved prompts.json so a single-outcome regen (fight_plan == []) still
      gets both. Legacy outcomes with no resolvable match keep the single fighter.
      Co-Authored-By: 's avatarClaude Opus 4.8 <noreply@anthropic.com>
      bf50d8a1
    • Stefy Lanza (nextime / spora )'s avatar
      Township: "Generate missing" keyframes button · d3878ff3
      Stefy Lanza (nextime / spora ) authored
      New keyframes-missing render scope fills in only the keyframes that don't
      exist yet for a whole match (clips + outcomes) — existing ones are kept and
      nothing is re-rendered. Buttons added on the keyframes page and the match
      detail action row; finishes immediately when none are missing.
      Co-Authored-By: 's avatarClaude Opus 4.8 <noreply@anthropic.com>
      d3878ff3
    • Stefy Lanza (nextime / spora )'s avatar
      Township: dedicated keyframes page for a match + outcome fixes · 71fe0c19
      Stefy Lanza (nextime / spora ) authored
      - New /match/keyframes page (🖼 Keyframes ▸ from the match page): thumbnail
        grid of every clip + planned-outcome keyframe, each with per-tile
        regenerate (image model) and delete, plus match-level Regenerate all /
        Clear all. Live progress bars; reloads on completion with mtime
        cache-bust.
      - Regenerate all (whole match) now also covers this match's OUTCOME
        keyframes, not just clips.
      - Clear all now removes planned outcome keyframes too (not only ones with a
        rendered video), keeping it symmetric with Regenerate all.
      - Fix outcome keyframe stem on the page: use the plan entry's actual
        match_name (None → legacy "<fighter>_<outcome>") so it matches the file
        the generator writes, instead of a "<match>_<fighter>_<outcome>" that is
        never created (outcome keyframes were showing "no keyframe" after a
        successful regen).
      Co-Authored-By: 's avatarClaude Opus 4.8 <noreply@anthropic.com>
      71fe0c19
    • Stefy Lanza (nextime / spora )'s avatar
      Township: allow keyframes/keyframe scopes in /matches/render · 9a6550d8
      Stefy Lanza (nextime / spora ) authored
      The render endpoint's scope allowlist rejected the new keyframe-regen
      scopes with a 400 before reaching the handler. Add them so the
      "Regenerate keyframes" / per-clip kf↻ buttons work.
      Co-Authored-By: 's avatarClaude Opus 4.8 <noreply@anthropic.com>
      9a6550d8
    • Stefy Lanza (nextime / spora )'s avatar
      LoRA training: async kickoff, restart recovery, keyframe regen UI · 80f48d72
      Stefy Lanza (nextime / spora ) authored
      Server (codai/api/loras.py):
      - /v1/loras/train gains wait (default True) + session; wait=false detaches
        the job and returns a job_id, avoiding HTTP read-timeouts on multi-hour
        video trainings.
      - Disk-persisted job registry keyed by job_id (carries session). Progress
        endpoint serves ?job=<id> / ?session=<tok> so a client only ever sees its
        own job — no cross-user spillover. Jobs left mid-flight at startup are
        marked interrupted.
      - Mid-training PEFT checkpoints (SD1.5/SDXL/Wan) + train_state.json; a
        resubmit resumes from the last step when base/target/rank (and session)
        match, so a reboot no longer throws away hours of Wan training.
      
      Township (tools/gen_township_fighters.py):
      - Async training: per-run session token + persisted per-LoRA job_id; polls
        by job_id, re-attaches to a running server job after a restart, resubmits
        an interrupted one (server resumes from checkpoint).
      - Dedicated train timeouts (24h video / 4h image).
      - Match page: regenerate/clear keyframes (match-level + per-clip/outcome)
        via new keyframes/keyframe render + delete scopes.
      
      tools/videogen.py: mirror the session-token + job-id recovery helpers.
      Co-Authored-By: 's avatarClaude Opus 4.8 <noreply@anthropic.com>
      80f48d72
    • Stefy Lanza (nextime / spora )'s avatar
      Backends, API, and tooling updates; gitignore township_output · f21c6185
      Stefy Lanza (nextime / spora ) authored
      - cuda/vulkan backend improvements and config plumbing
      - API updates across characters, text, environments, audio, embeddings, tts
      - admin chat/settings template updates
      - add hf_loading helper, video request fields, platform paths
      - new docs (CODERAI_API_DOCUMENTATION.md) and tools (review_outputs, video_dubber)
      - ignore generated township_output/
      Co-Authored-By: 's avatarClaude Opus 4.8 <noreply@anthropic.com>
      f21c6185
    • Stefy Lanza (nextime / spora )'s avatar
      7dc60f66
    • Stefy Lanza (nextime / spora )'s avatar
      Township: per-card LoRA training progress for concurrent jobs · f4bf08b2
      Stefy Lanza (nextime / spora ) authored
      The server exposes one global training progress (jobs run one at a time via the
      queue), so every queued card was mirroring the active job's progress. Restore the
      name match: a card shows real progress only when the global progress reports ITS
      LoRA; otherwise it shows "queued — '<other>' training first… (elapsed)". Keeps the
      elapsed-timer handling so a long model load still looks alive rather than frozen.
      Co-Authored-By: 's avatarClaude Opus 4.8 <noreply@anthropic.com>
      f4bf08b2
    • Stefy Lanza (nextime / spora )'s avatar
      Wan LoRA: cache the whole stack (VAE + UMT5 + transformer) across jobs · 5d547a33
      Stefy Lanza (nextime / spora ) authored
      Extend the cross-job cache from just the transformer expert(s) to the full Wan
      stack: VAE, tokenizer and text encoder are kept on CPU between jobs (moved to GPU
      only while encoding), experts stay on GPU. A back-to-back training against the
      same base now reloads nothing from disk — previously the small VAE/text-encoder
      still reloaded each job. The releaser and error path clear all cached components.
      Co-Authored-By: 's avatarClaude Opus 4.8 <noreply@anthropic.com>
      5d547a33
    • Stefy Lanza (nextime / spora )'s avatar
      Township: match fighter/env dropdowns, video LoRA status, train progress · fc78dc98
      Stefy Lanza (nextime / spora ) authored
      - Match detail page: Fighter 1/2 and Environment are now dropdowns of saved
        profiles + the built-in pools, so a match's fighters/location can be switched
        before re-rendering (Save match persists; env_desc updated with env).
      - Video LoRA status on profile cards: resolve the active video model the same
        way training/generation do (configured, else auto-picked, cached), and show
        "trained for: <slug>" even when the active model can't be resolved so a trained
        LoRA never looks untrained.
      - Video LoRA training progress: show a ticking elapsed timer during the long
        model-load/preparing phase (the progress endpoint is starved while a large
        model loads), drop the strict name filter that could freeze the bar at 6%, and
        use step-based % once training begins.
      Co-Authored-By: 's avatarClaude Opus 4.8 <noreply@anthropic.com>
      fc78dc98
    • Stefy Lanza (nextime / spora )'s avatar
      Wan LoRA: cache transformer across jobs + smoother progress · d1fc17e0
      Stefy Lanza (nextime / spora ) authored
      Cache the Wan transformer expert(s) between consecutive trainings against the
      same base (keyed by base_path+quantize) so a back-to-back job skips the very slow
      reload (tens of minutes for A14B). Only this job's adapter + gradient-checkpoint
      hooks are removed at teardown; the base transformer(s) stay resident. Since 4-bit
      weights can't move to CPU, they hold GPU VRAM between jobs — so the external VRAM
      releaser now drops the Wan cache too when a generation needs the GPU, and the
      error path clears both caches.
      
      Also report training progress every step (cheap dict update) instead of every
      10, so the web UI bar advances smoothly once steps begin.
      Co-Authored-By: 's avatarClaude Opus 4.8 <noreply@anthropic.com>
      d1fc17e0
  3. 09 Jun, 2026 16 commits
    • Stefy Lanza (nextime / spora )'s avatar
      Wan LoRA trainer: fix fp32/bf16 dtype mismatch in the train step · 8e8c0a45
      Stefy Lanza (nextime / spora ) authored
      torch.rand defaults to fp32, so the rectified-flow interpolation promoted x_t to
      fp32 while the patch-embedding Conv3d stays bf16 (bitsandbytes 4-bit quantizes
      only Linear layers), raising "Input type (float) and bias type (BFloat16) should
      be the same". Compute the interpolation in fp32 then cast x_t/target back to the
      model compute dtype, and pass timestep as fp32 (Wan casts it internally).
      Co-Authored-By: 's avatarClaude Opus 4.8 <noreply@anthropic.com>
      8e8c0a45
    • Stefy Lanza (nextime / spora )'s avatar
      Logging: filter only the noisy progress poll from access log · ad891a34
      Stefy Lanza (nextime / spora ) authored
      Suppressing the whole uvicorn.access logger hid every request. Instead add a
      logging.Filter that drops only /v1/loras/progress (polled ~1.5s by the web UI);
      all other API request lines keep logging. A logger filter also survives uvicorn's
      configure_logging(), which resets the access logger LEVEL at startup (that reset
      is what defeated the earlier setLevel(WARNING)). --debug-web shows everything.
      Co-Authored-By: 's avatarClaude Opus 4.8 <noreply@anthropic.com>
      ad891a34
    • Stefy Lanza (nextime / spora )'s avatar
      Township: Wan video LoRAs, enhance feature, lightbox, outcome fixes · d03385f9
      Stefy Lanza (nextime / spora ) authored
      Several related changes accumulated in this session:
      
      Wan video LoRAs (additive — image LoRAs kept for keyframes):
      - New per-model maps video_loras.json/env_video_loras.json keyed
        name -> {model_slug: path}; on-disk names tagged with the video model slug.
      - Video requests attach the video LoRA matching the current video model's slug;
        image LoRAs stay on the keyframe path only.
      - Per-profile "Train video LoRA" button + step button + full-run checkbox +
        --video-loras/--only-video-loras; batch + CLI wiring; client target="video".
      
      Final/outcome enhance (upscale 2x/4x + raise FPS):
      - _enhance_video_file + Phase C stage; --upscale-factor/--fps-multiplier and
        Run-page selects; match-page Enhance card with live progress bars.
      
      Match page UX:
      - Video previews enlarge + center on play (video lightbox).
      - Match render shows global + per-clip progress bars, surviving reload.
      
      Outcome fixes:
      - Re-rendering a match's outcomes now resolves legacy per-fighter outcomes
        (no match_name) by fighter membership, and forces them into the match's
        environment so a match stays in one location.
      Co-Authored-By: 's avatarClaude Opus 4.8 <noreply@anthropic.com>
      d03385f9
    • Stefy Lanza (nextime / spora )'s avatar
      LoRA trainer: in-process Wan video-DiT (QLoRA) training path · 9071e839
      Stefy Lanza (nextime / spora ) authored
      Adds a target="video" path that trains a LoRA directly against the configured
      video model so it loads on the video pipeline (image LoRAs can't apply to a Wan
      DiT). _train_wan: encodes stills as 1-frame latents via the Wan 3D VAE
      (latents_mean/std normalized), encodes the prompt via UMT5, loads the
      transformer expert(s) in 4-bit (QLoRA) with gradient checkpointing, adds PEFT
      LoRA to the attention projections, and trains a rectified-flow loss. Handles
      Wan2.2's dual experts (transformer + transformer_2) via boundary_ratio routing,
      and saves both expert LoRA layers (falls back to high-noise only on older
      diffusers). Reuses the queue, eviction, thermal checkpoints and progress.
      
      LoraTrainRequest gains target/quantize_4bit/num_frames; base-path resolution
      gains a "video" category so it resolves the video model entry.
      Co-Authored-By: 's avatarClaude Opus 4.8 <noreply@anthropic.com>
      9071e839
    • Stefy Lanza (nextime / spora )'s avatar
      Video LoRA: skip adapters incompatible with the video model · 8b30dcc3
      Stefy Lanza (nextime / spora ) authored
      An SD/SDXL image LoRA loaded onto a Wan video transformer matches no keys, so
      set_adapters() raised "not in the list of present adapters: set()" and aborted
      the whole request. Now each adapter is checked against the pipe's PEFT-capable
      components after load; ones that registered nothing (wrong architecture) are
      skipped with a clear message and generation proceeds with whatever is
      compatible (or no LoRA). The request signature is still cached so the futile
      load isn't retried every clip.
      Co-Authored-By: 's avatarClaude Opus 4.8 <noreply@anthropic.com>
      8b30dcc3
    • Stefy Lanza (nextime / spora )'s avatar
      Video LoRA: reuse adapters across clips with the same set · c9c0871b
      Stefy Lanza (nextime / spora ) authored
      The video model stays cached across clips, but LoRAs were loaded from disk
      and fully unloaded on every clip — wasted I/O and fusion latency, since
      consecutive clips of a match request the identical fighter+env LoRAs.
      
      Cache the active LoRA signature on the pipe (_coderai_active_loras) and only
      swap when it changes: a request with the same set reuses the loaded adapters,
      a different set (or none) triggers a clean unload + reload. Replaces the
      apply-then-unload-every-clip path.
      Co-Authored-By: 's avatarClaude Opus 4.8 <noreply@anthropic.com>
      c9c0871b
    • Stefy Lanza (nextime / spora )'s avatar
      Township match render: live progress bars (global + per-clip) · b86bb85b
      Stefy Lanza (nextime / spora ) authored
      Match re-render previously showed only a frozen text status. Now:
      - _stage_videos_render reports per-clip start/end via clip_cb and overall
        done/total via progress_cb.
      - _run_match_job seeds an items list and maps clip state into the job record.
      - The match detail page renders a global progress bar plus one bar per
        clip/output (pending/rendering/done/failed), and these survive a reload
        via /active-jobs + resumeMatchJobs.
      Co-Authored-By: 's avatarClaude Opus 4.8 <noreply@anthropic.com>
      b86bb85b
    • Stefy Lanza (nextime / spora )'s avatar
      LoRA training: admit through the central queue instead of rejecting · 9083cda7
      Stefy Lanza (nextime / spora ) authored
      Route /v1/loras/train through queue_manager.acquire/release with a constant
      "lora-train" model key. Concurrent training requests now queue and run one after
      another (serialized by the scheduler, protecting the shared base cache) and
      participate in the same scheduling/metrics as every other model request, instead
      of being rejected with 409. _train_lock is kept as the in-flight signal that
      _release_base_cache checks.
      Co-Authored-By: 's avatarClaude Opus 4.8 <noreply@anthropic.com>
      9083cda7
    • Stefy Lanza (nextime / spora )'s avatar
      Township UI: regen/train progress survives a page reload · eb655005
      Stefy Lanza (nextime / spora ) authored
      Tag regen/train jobs with kind/name/jtype and add a /active-jobs endpoint listing
      running ones. On Characters/Environments page load, resumeActiveJobs() re-attaches
      the live progress display to any in-flight job for the matching card, so a reload
      (or reopening the tab) keeps showing progress until completion.
      Co-Authored-By: 's avatarClaude Opus 4.8 <noreply@anthropic.com>
      eb655005
    • Stefy Lanza (nextime / spora )'s avatar
      Township UI: click character/environment thumbnails to enlarge · f08cd384
      Stefy Lanza (nextime / spora ) authored
      Add a shared image lightbox (injected into every page via _page) and make the
      reference-image thumbnails on the Characters/Environments pages clickable to view
      them full-size. Click the backdrop or press Escape to close. Delete button still
      works independently.
      Co-Authored-By: 's avatarClaude Opus 4.8 <noreply@anthropic.com>
      f08cd384
    • Stefy Lanza (nextime / spora )'s avatar
      LoRA training base cache + thermal averaging + scoped debug flags; live model config · 8d1136c4
      Stefy Lanza (nextime / spora ) authored
      - LoRA trainer: cache the SD/SDXL base on CPU between jobs so back-to-back
        trainings against the same base skip the disk reload, and the base holds no
        VRAM between jobs (moved to GPU only while training). Fixes the post-training
        eviction failure that forced the next image request into CPU/disk offload.
      - Model manager: add register_external_vram_releaser() + last-resort eviction
        pass so a generation can reclaim the trainer's cached base when needed (skips
        while a job runs).
      - Thermal: average 3 CPU samples spread across a 3s budget for the resume/
        cooldown decision (CPU sensors swing +/-10C); pause stays single-read to react
        fast. Bounded so it never blocks past 3s of the poll interval.
      - Debug flags: --debug-web (uvicorn access lines), --debug-thermal ([thermal]
        [debug] checks), --debug-lora (per-step training loss to terminal); all off by
        default and independent of --debug.
      - Admin: lora_train_base_model field on the Models page; saves apply live to the
        running server (build_runtime_kwargs/apply_model_entry_live) with no restart.
      Co-Authored-By: 's avatarClaude Opus 4.8 <noreply@anthropic.com>
      8d1136c4
    • Stefy Lanza (nextime / spora )'s avatar
      Fix Z-Image image-gen + LoRA training; add separate LoRA training base model · f21de22e
      Stefy Lanza (nextime / spora ) authored
      - images.py: stop reusing cached prompt embeds for Z-Image. Its encode_prompt
        returns per-sample lists the pipeline consumes during a run, so cache-HIT
        reuse corrupted the batch (AssertionError: len(size) == bsz in unpatchify).
        Z-Image now always encodes natively; cache key also bound to id(pipeline).
      - loras.py: fix wrong import (multi_model_manager lives in codai.models.manager,
        not codai.api.state) used for VRAM unload + base-model path resolution; add an
        up-front architecture guard so transformer/DiT models (Z-Image/Flux/SD3) fail
        with a clear message instead of crashing in the CLIP tokenizer.
      - New train_base_model on LoraTrainRequest: train LoRAs against a separate
        UNet-based SD1.x/SDXL model while generation keeps using the DiT image model.
      - gen_township_fighters.py: thread --lora-train-base-model / web field through
        train_lora, _train_profile_loras, stage_loras/stage_env_loras, all run + per-
        card call sites; CONFIG_FIELDS + live default_args apply on /start, /save-config.
      Co-Authored-By: 's avatarClaude Opus 4.8 <noreply@anthropic.com>
      f21de22e
    • Stefy Lanza (nextime / spora )'s avatar
      Township web UI: suppress BrokenPipe/ConnReset from aborted requests · 2c736da4
      Stefy Lanza (nextime / spora ) authored
      Browsers routinely abort media (video seek/scrub) and SSE connections
      mid-response, which surfaced as BrokenPipeError/ConnectionResetError
      tracebacks spamming the terminal. Swallow these in the request handler's
      handle_one_request() and finish() so they're ignored cleanly.
      Co-Authored-By: 's avatarClaude Opus 4.8 <noreply@anthropic.com>
      2c736da4
    • Stefy Lanza (nextime / spora )'s avatar
      Township: per-match outcomes, match previews, editable prompts, terminal logs · df1c0032
      Stefy Lanza (nextime / spora ) authored
      Matches:
      - Outcomes are now per-match (<match>_<fighter>_<outcome>), generated for each
        match's two fighters, so each match's outcome scenes are its own/different.
      - Support multiple matches for the same pair+environment via unique match names
        (numeric suffix); scanner and delete isolate siblings correctly.
      - List view shows a lightweight preview (clip00 keyframe or metadata poster);
        detail view shows clips AND the match's outcomes per fighter, each with an
        editable prompt + re-render + remove. Clip/outcome prompts save to
        prompts.json. Legacy per-fighter outputs still listed.
      
      Prompts page: reframed as master prompts that auto-write a unique prompt per
      clip/outcome of every match; static templates marked fallback-only.
      
      Terminal: per-card action jobs (regenerate, train LoRA, match render) now echo
      their progress to the terminal too.
      Co-Authored-By: 's avatarClaude Opus 4.8 <noreply@anthropic.com>
      df1c0032
    • Stefy Lanza (nextime / spora )'s avatar
      Township: Matches list/detail with edit+remove, global Prompts page, --browser · 5e040759
      Stefy Lanza (nextime / spora ) authored
      Matches page:
      - Lightweight list view (no embedded players); per-match/per-fighter detail
        loads only that item's videos.
      - Edit a match: change fighters, environment, short/long targets, and each
        clip's prompt (saved to prompts.json). Fighter-outputs detail edits outcome
        prompts.
      - Remove videos: per clip, per final, whole match, single output, or all of a
        fighter's outputs (keeps plan/keyframes for re-render). Traversal-guarded.
      
      Global Prompts page (/prompts):
      - Edit the script's global templates — LLM fight/outcome system prompts and the
        static fight-shot + win/ko_win/retire/draw fallback templates. Persisted to
        <out-dir>/prompts_config.json, applied live and re-loaded on every run, with
        reset-to-defaults.
      
      Web UI:
      - Only auto-open a browser when --browser is passed (avoids spawning a terminal
        text browser on headless servers).
      Co-Authored-By: 's avatarClaude Opus 4.8 <noreply@anthropic.com>
      5e040759
    • Stefy Lanza (nextime / spora )'s avatar
      Township: per-profile LoRA training, Matches page, modals; fix SDXL LoRA dtype · 533bab82
      Stefy Lanza (nextime / spora ) authored
      LoRA training (codai/api/loras.py):
      - Fix instant crash "mat1 and mat2 have the same dtype (Half != float)":
        components loaded in their checkpoint's native dtype (fp16 text encoders +
        fp32 UNet). Force consistent fp32 (stable LoRA reference) for both SD1.5 and
        SDXL, and free VAE/text encoders after pre-encoding to keep memory in budget.
      
      Web UI (tools/gen_township_fighters.py):
      - Per-profile LoRA training launched from the Characters/Environments cards
        (steps/rank, live server progress, status badge); the "Train LoRAs" step now
        trains regardless of the consistency setting and logs what it does. Profiles
        are uploaded to CoderAI first so server-side training has reference images.
      - New Matches page: final short/long videos, single clips, and outcome outputs
        per match. Re-render clips/outputs with the video model (reuses the render
        path, honoring keyframe/LoRA settings) or reassemble finals from existing
        clips (no model).
      - Replace browser alert/confirm/prompt with proper in-page modal dialogs
        (uiConfirm/uiAlert/uiPrompt) on every page.
      - Apply changed connection/model settings (image/video/text model) to the live
        session on Save config / Start, so per-profile jobs use them immediately.
      Co-Authored-By: 's avatarClaude Opus 4.8 <noreply@anthropic.com>
      533bab82
  4. 08 Jun, 2026 2 commits
    • Stefy Lanza (nextime / spora )'s avatar
      Township UI: profile management, regenerate/upload refs, env parity · 278fab3e
      Stefy Lanza (nextime / spora ) authored
      Web UI (tools/gen_township_fighters.py):
      - Characters and Environments management pages: edit every meta field
        (data-driven form, not a fixed set), remove a profile, delete individual
        reference images — synced to CoderAI (DELETE/PATCH).
      - Regenerate references: background job generates N new images guided by the
        kept references (IP-Adapter) and APPENDS them, preserving non-deleted ones.
      - Upload your own reference image files (magic-byte validated, appended).
      - Clear run banner + status-pill label indicating which run/step is executing.
      - Config: -s/--save and -c/--config; web Save button writes server-side and,
        when launched with -c, defaults to that same config path.
      
      Environment parity / consistency:
      - Per-environment identity LoRAs (loras.py: environment field, env image
        resolver, "place" instance prompt; script stage_env_loras, env_loras.json,
        applied to keyframes + video alongside fighter LoRAs).
      - Environment IP-Adapter: environment_profiles on the image request
        (imagerequest.py) resolved into the IP-Adapter reference set (images.py),
        so environment regeneration can match kept references.
      Co-Authored-By: 's avatarClaude Opus 4.8 <noreply@anthropic.com>
      278fab3e
    • Stefy Lanza (nextime / spora )'s avatar
      Add config save/load to township fighters generator · f5cb44e1
      Stefy Lanza (nextime / spora ) authored
      CLI: -s/--save FILE writes selected generation options to a JSON config
      and exits; -c/--config FILE loads them as defaults (command-line args
      still override, via a two-phase parse).
      
      Web UI: "Save config" button writes the current form options to a file
      on the server (relative paths land in the output dir, absolute paths as-is)
      via a new /save-config endpoint. Web- and CLI-saved configs are
      interchangeable (shared CONFIG_FIELDS / canonical mapping).
      Co-Authored-By: 's avatarClaude Opus 4.8 <noreply@anthropic.com>
      f5cb44e1
  5. 03 Jun, 2026 1 commit
  6. 11 May, 2026 7 commits