Implement Kaika: full audio→fluid→video pipeline + local app#2
Conversation
…omfyUI+GPU scaffold) with tests
…& embedded; served by server
…cipe discovery, second recipe, docs
There was a problem hiding this comment.
Code Review
This pull request introduces Kaika, a comprehensive pipeline and local web application that converts music into video clips using audio analysis, fluid simulation, and video diffusion models. The implementation includes a FastAPI backend, a React-based frontend, and an extensive test suite. The code review identified several critical issues and improvement opportunities: a path traversal vulnerability in the file-serving endpoint, performance overhead from importing cv2 inside a hot simulation loop, a potential ZeroDivisionError when lookahead_s is zero, potential ffmpeg failures due to odd-dimension padding in wide aspect ratios or missing explicit stream mappings, and a configuration merging bug where None values can overwrite default settings and cause downstream crashes.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
… guard, even pad, explicit ffmpeg maps, null-merge guard
…ion + clip-global E3 normalization
…y damping, calibrated force/vorticity scales, HDR tonemap+bloom+palette rendering
…rces spawned by onsets (born->emit->die); colour follows the music, ambient stirring is RMS-driven only
…cay + expanding puffs so each kick blooms and fades distinctly
… each source streams matter along its heading (jet + self-propulsion) instead of an isotropic blob -> no central pile-up
…es) and per-frame config variation in a single continuous simulation
…esume), project-driven per-segment prompts
…ic staged job queue
…nt prompt + fluid inspector), preview->generate Render flow; rebuilt frontend
…onstants, remove dead color code, dedupe control-signals + cross-module audio helper, centralize test scaffolding
…ield special-casing), ComfyUI workflow registry, curated core public API, job worker logging
…ft mode, E3 deferred to generate, audio slicing
…aries, split/merge, beats/onsets on waveform, rich per-segment inspector, palette/seed/YAML editing; generate is self-sufficient
…ette mapping + centroid brightness, flow-advected texture in local stylizer, HPSS strict onsets, grain/vignette in E5
…e frame peek while rendering, cooperative job cancel
…ed controls, segment nav + override indicators + reset, representative video posters, labelled recipe picker
Complete, working, tested implementation of the Kaika spec, in a new
kaika/folder. Built phase by phase;pytestis green end-to-end (55 tests) with no GPU.What's here
The five-stage pipeline, each stage independently testable:
core/analyze.pyscore.json(librosa: tempo, beats, per-band onsets, RMS, centroid, sections)core/simulate.pycore/control.pycore/diffuse/core/post.pykaika_final.mp4(ffmpeg mux + sync check)Plus:
core/pipeline.py(reproducibleruns/<id>/dirs), FastAPI server with a single-worker job queue + SQLite + WebSocket progress, and a React/Vite/TS frontend (Studio / Render / Gallery) built and embedded in the package. One command —kaika— launches everything;kaika runis the scripting path calling the same library.Honoured the review feedback from #1
baseand fall back todefault; the ComfyUI backend transfers compressed video, never raw PNG sequences.E4 backends
local— deterministic, GPU-free stylizer so the whole pipeline runs and is tested anywhere (this is not the figurative metamorphosis).comfyui— ComfyUI / Wan 2.2 on a rented GPU: section-aligned chunking, score-derived prompt schedule, versioned workflow template, provisioning scaffold. Real orchestration is unit-tested offline; the live HTTP path is gated behind a reachable endpoint and not exercised in CI.Verification
pytest→ 55 passed (E1–E5, recipe, pipeline e2e, server via TestClient, live HTTP smoke, frontend serving).uv buildwheel confirmed to includerecipes/andwebapp_dist/.A 6-second proof clip (synthetic track → full pipeline, local backend) was shared in the session.
Generated by Claude Code