Skip to content

armgit / kokon

Public Imported from GitHub
0

Edit photos by describing the change, on your own GPU. A free, open-source alternative to Nano Banana and ChatGPT image editing: photos stay on your computer, no daily limit. One installer for Windows, Mac and Linux sets up the best open model (Qwen-Image 2.1). MCP server for AI agents.

video: back to take 1, a pause in "One model, two jobs", the Prompt+ model part slower

Gabriele Lozupone2a7b45164024
diff --git a/marketing/audio/gen_voice.py b/marketing/audio/gen_voice.py
index fbc8310..4839d22 100644
--- a/marketing/audio/gen_voice.py
+++ b/marketing/audio/gen_voice.py
@@ -255,6 +255,11 @@ def splice(n: int, keep: dict[int, int], pick: dict[int, int], src: Path) -> Non
# The "Kokon 0.10" update video (voiceover-0.10.md): each line's model settings, as in FINAL.
UPDATE = {"script": "voiceover-0.10.md", "dir": OUT / "update-0.10", "public": "voice-0.10", "json": "voice-0.10.json"}
UPDATE_TAKES = {1: "calmer", 2: "expressive", 3: "expressive", 4: "expressive", 5: "calmer", 6: "expressive"}
+# build: seconds between a line's sentences where not 0.4 (line 3, Prompt+'s model, read slower),
+# and silences put inside a sentence ("LINE.SENTENCE": [(seconds into the take, seconds)]): the
+# micro-pause in "One model, two jobs." falls in the take's own silence before "two".
+UPDATE_PAUSES = {3: 0.7}
+UPDATE_SPLITS = {"3.0": [(0.93, 0.35)]}
def audition(seeds: int, base: int) -> None:
@@ -276,7 +281,7 @@ def audition(seeds: int, base: int) -> None:
def build(src: Path, pick: dict[str, int]) -> None:
"""The update's lines from the picked sentence takes (`pick` "LINE.SENTENCE" -> seed), 0.4 s
- between sentences, mastered like the launch take (-16 LUFS over all lines). Each build goes to
+ between sentences (UPDATE_PAUSES, UPDATE_SPLITS), mastered like the launch take (-16 LUFS over all lines). Each build goes to
a new folder; the video gets the files and their sentence spans."""
lines = script_lines(UPDATE["script"])
missing = [f"{n}.{i}" for n, l in enumerate(lines, 1) for i in range(len(sentences(l))) if f"{n}.{i}" not in pick]
@@ -292,11 +297,13 @@ def build(src: Path, pick: dict[str, int]) -> None:
for i in range(len(parts)):
c, sr = sf.read(src / f"{n:02d}-s{i}-seed{pick[f'{n}.{i}']}.raw.wav", dtype="float32")
assert sr == SR
+ for t, gap in sorted(UPDATE_SPLITS.get(f"{n}.{i}", []), reverse=True):
+ c = np.concatenate([c[:int(t * SR)], np.zeros(int(gap * SR), dtype=np.float32), c[int(t * SR):]])
chunks.append(c)
marks.append([round(pos / SR, 3), round((pos + c.size) / SR, 3)])
pos += c.size
if i < len(parts) - 1:
- chunks.append(np.zeros(int(SENTENCE_PAUSE * SR), dtype=np.float32))
+ chunks.append(np.zeros(int(UPDATE_PAUSES.get(n, SENTENCE_PAUSE) * SR), dtype=np.float32))
pos += chunks[-1].size
spans[n] = {"dur": round(pos / SR, 3), "sentences": marks}
raw = folder / "raw" / f"{n:02d}.wav"
diff --git a/marketing/audio/make_update_music.py b/marketing/audio/make_update_music.py
index c0cb697..4f06966 100644
--- a/marketing/audio/make_update_music.py
+++ b/marketing/audio/make_update_music.py
@@ -1,6 +1,6 @@
"""The music of the "Kokon 0.10" update video, cut from an ACE-Step take (gen_music.py update).
- D:/AI/tts/.venv/Scripts/python make_update_music.py [1|3] -> ../video/public/<out>
+ D:/AI/tts/.venv/Scripts/python make_update_music.py [1|1b|3] -> ../video/public/<out>
Both takes are 118 BPM (beats every 0.50849 s, grids measured with librosa). The video needs the
take's drop on its beat 26 (the image hatching) and about 12 bars after it, then a stop for the
@@ -31,12 +31,16 @@ PLANS = {
# tail: seconds kept after the last bar (the take's own decay).
1: {"take": "update-20261020-175836-1.wav", "out": "music-0.10.m4a", "first": 16.252 - 8 * BAR,
"lead": 0, "bars": [(1.5, 15), (11, 15), (15, 16)], "tail": 3.5},
+ # Take 1 with one more groove bar (bars 3-7 repeated): the video's Prompt+ model part is a bar
+ # longer. Stop at 39.64 s.
+ "1b": {"take": "update-20261020-175836-1.wav", "out": "music-0.10-long.m4a", "first": 16.252 - 8 * BAR,
+ "lead": 0, "bars": [(1.5, 15), (10, 15), (15, 16)], "tail": 3.5},
3: {"take": "update-20261020-175836-3.wav", "out": "music-0.10-take3.m4a", "first": 0.0287,
"lead": 2, "bars": [(6, 16), (12, 16), (13, 17)], "tail": 2.5},
}
-def main(n: int) -> None:
+def main(n: int | str) -> None:
plan = PLANS[n]
y, sr = sf.read(HERE / "takes" / plan["take"], dtype="float32", always_2d=True)
at = lambda t: int(round(t * sr))
@@ -65,4 +69,5 @@ def main(n: int) -> None:
if __name__ == "__main__":
- main(int(sys.argv[1]) if len(sys.argv) > 1 else 1)
+ arg = sys.argv[1] if len(sys.argv) > 1 else "1"
+ main(arg if arg in PLANS else int(arg))
diff --git a/marketing/video/public/music-0.10-long.m4a b/marketing/video/public/music-0.10-long.m4a
new file mode 100644
index 0000000..7f79d0c
Binary files /dev/null and b/marketing/video/public/music-0.10-long.m4a differ
diff --git a/marketing/video/public/voice-0.10/01.wav b/marketing/video/public/voice-0.10/01.wav
index 1fac1f0..36646e3 100644
Binary files a/marketing/video/public/voice-0.10/01.wav and b/marketing/video/public/voice-0.10/01.wav differ
diff --git a/marketing/video/public/voice-0.10/02.wav b/marketing/video/public/voice-0.10/02.wav
index a7ab447..803400e 100644
Binary files a/marketing/video/public/voice-0.10/02.wav and b/marketing/video/public/voice-0.10/02.wav differ
diff --git a/marketing/video/public/voice-0.10/03.wav b/marketing/video/public/voice-0.10/03.wav
index 28ff7b4..aab268e 100644
Binary files a/marketing/video/public/voice-0.10/03.wav and b/marketing/video/public/voice-0.10/03.wav differ
diff --git a/marketing/video/public/voice-0.10/04.wav b/marketing/video/public/voice-0.10/04.wav
index 283bf43..d52f9c1 100644
Binary files a/marketing/video/public/voice-0.10/04.wav and b/marketing/video/public/voice-0.10/04.wav differ
diff --git a/marketing/video/public/voice-0.10/05.wav b/marketing/video/public/voice-0.10/05.wav
index 24fa90d..882045b 100644
Binary files a/marketing/video/public/voice-0.10/05.wav and b/marketing/video/public/voice-0.10/05.wav differ
diff --git a/marketing/video/public/voice-0.10/06.wav b/marketing/video/public/voice-0.10/06.wav
index 2231ea4..3fca57a 100644
Binary files a/marketing/video/public/voice-0.10/06.wav and b/marketing/video/public/voice-0.10/06.wav differ
diff --git a/marketing/video/src/app/timeline010.ts b/marketing/video/src/app/timeline010.ts
index e9ab963..93b80e4 100644
--- a/marketing/video/src/app/timeline010.ts
+++ b/marketing/video/src/app/timeline010.ts
@@ -10,11 +10,13 @@ import { FPS, type Cue, type Lines, sentenceAt, type VoiceSet } from "./timeline
const MUSICS = {
/** Take 1: a quiet build, the drop, a dead stop. */
take1: { src: "music-0.10.m4a", from: 0, stop: 37.607 },
+ /** Take 1 with one more groove bar, for the longer Prompt+ model part (the cut in use). */
+ take1long: { src: "music-0.10-long.m4a", from: 0, stop: 39.641 },
/** Take 3: groove, a near-silent break under the logo, the drop, a second hit on the LoRA
* part, an ending bar. */
take3: { src: "music-0.10-take3.m4a", from: 0, stop: 37.7 },
};
-export const MUSIC = MUSICS.take3;
+export const MUSIC = MUSICS.take1long;
const BEAT = 60 / 118;
const BEAT0 = 0;
/** Frame of beat `k` of the video. */
@@ -31,16 +33,17 @@ export const SHOT = {
making: 0,
logo: beat(24),
hatch: beat(26), // the drop
- model: beat(30),
- settings: beat(42),
+ // "One model. Two jobs." over the image, then the diagram, read slowly.
+ model: beat(32),
+ settings: beat(46),
/** On the beat before "Turn it on with one click." (set below, from the voice). */
pill: 0,
- look: beat(56),
- bar: beat(59),
- silk: beat(62),
- end: beat(66),
+ look: beat(60),
+ bar: beat(63),
+ silk: beat(66),
+ end: beat(70),
};
-export const UPDATE_FRAMES = beat(80);
+export const UPDATE_FRAMES = beat(84);
// Voice-over: public/voice-0.10/NN.wav and voice-0.10.json from `gen_voice.py build`. Until the
// takes exist the json holds estimated spans ("_provisional"): the cues still time the
@@ -51,7 +54,7 @@ export const UPDATE_VOICE: VoiceSet = { dir: "voice-0.10", lines: json };
const cue = (line: number, at: number, from = 0, to = from): Cue => ({ line, from, to, at, set: UPDATE_VOICE });
/** Seconds into a sentence where a word starts (Whisper word times of the picked takes). */
-export const WORD = { two: 1.25, reads: 0.72, writes: 1.58, load: 0.21, click: 1.07, spun: 1.67 };
+export const WORD = { two: 1.6, reads: 0.72, writes: 1.58, load: 0.21, click: 1.07, spun: 1.67 };
const all = (line: number, at: number): Cue => cue(line, at, 0, UPDATE_VOICE.lines[String(line)].sentences.length - 1);
const span = (line: number, i: number) => UPDATE_VOICE.lines[String(line)].sentences[i];
diff --git a/marketing/video/src/app/voice-0.10.json b/marketing/video/src/app/voice-0.10.json
index 0ecd127..d06ef03 100644
--- a/marketing/video/src/app/voice-0.10.json
+++ b/marketing/video/src/app/voice-0.10.json
@@ -26,19 +26,19 @@
]
},
"3": {
- "dur": 6.76,
+ "dur": 7.71,
"sentences": [
[
0.0,
- 1.84
+ 2.19
],
[
- 2.24,
- 4.56
+ 2.89,
+ 5.21
],
[
- 4.96,
- 6.76
+ 5.91,
+ 7.71
]
]
},
@@ -69,7 +69,7 @@
]
},
"6": {
- "dur": 4.28,
+ "dur": 4.4,
"sentences": [
[
0.0,
@@ -77,7 +77,7 @@
],
[
2.6,
- 4.28
+ 4.4
]
]
}
diff --git a/marketing/video/src/scenes/Update010.tsx b/marketing/video/src/scenes/Update010.tsx
index 1c85759..adc0ca6 100644
--- a/marketing/video/src/scenes/Update010.tsx
+++ b/marketing/video/src/scenes/Update010.tsx
@@ -190,23 +190,23 @@ const glass: CSSProperties = {
function OneModel() {
const f = useCurrentFrame();
const t0 = SHOT.model;
- const show = (at: number, dur = 18) => prog(f, at, dur);
+ const show = (at: number, dur = 26) => prog(f, at, dur);
const rise = (p: number): CSSProperties => ({ opacity: p, transform: `translateY(${(1 - p) * 24}px)`, filter: `blur(${(1 - p) * 8}px)` });
const reads = word(3, 1, "reads");
const writes = word(3, 1, "writes");
const none = said(3, 2);
const a = show(t0 + 2);
- const b = show(t0 + 8);
- const thIn = prog(f, t0 + 6, 20, inOut);
- const thRead = prog(f, reads, 18, inOut);
- const thWrite = prog(f, writes, 18, inOut);
+ const b = show(t0 + 12);
+ const thIn = prog(f, t0 + 8, 30, inOut);
+ const thRead = prog(f, reads, 28, inOut);
+ const thWrite = prog(f, writes, 28, inOut);
const newGlow = Math.min(prog(f, writes + 12, 10), 1 - 0.6 * prog(f, writes + 30, 30));
const s = push(f, t0, SHOT.settings, 1, 1.035);
return (
<AbsoluteFill style={{ fontFamily: font }}>
<Backdrop glow={0.9} />
<div style={{ position: "absolute", inset: 0, transform: `scale(${s})` }}>
- <div style={{ position: "absolute", top: 96, left: 0, right: 0, textAlign: "center", fontSize: 76, fontWeight: 660, letterSpacing: "-0.045em", color: "#f4f4f2", ...rise(show(t0, 14)) }}>One model. Two jobs.</div>
+ <div style={{ position: "absolute", top: 96, left: 0, right: 0, textAlign: "center", fontSize: 76, fontWeight: 660, letterSpacing: "-0.045em", color: "#f4f4f2", ...rise(show(t0, 18)) }}>One model. Two jobs.</div>
<svg width={1920} height={1080} style={{ position: "absolute", inset: 0, overflow: "visible" }}>
<Thread x0={460} y0={540} x1={640} y1={540} p={thIn} />
<Thread x0={1120} y0={500} x1={1250} y1={400} p={thRead} />
@@ -237,7 +237,7 @@ function OneModel() {
</div>
<div style={{ fontSize: 20, color: "rgba(247,246,242,0.6)", marginTop: 6 }}>a full prompt from your few words</div>
</div>
- <div style={{ position: "absolute", top: 880, left: 0, right: 0, textAlign: "center", fontSize: 50, fontWeight: 640, letterSpacing: "-0.03em", color: "#f4f4f2", ...rise(show(none - 2, 16)) }}>
+ <div style={{ position: "absolute", top: 880, left: 0, right: 0, textAlign: "center", fontSize: 50, fontWeight: 640, letterSpacing: "-0.03em", color: "#f4f4f2", ...rise(show(none - 2, 24)) }}>
No second model to download.
</div>
</div>