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: the image hatches full frame from the card's logo; new Prompt+ line

Gabriele Lozupone2e2726aaf020
diff --git a/marketing/audio/voiceover.md b/marketing/audio/voiceover.md
index 4bf0ca7..62ff9e0 100644
--- a/marketing/audio/voiceover.md
+++ b/marketing/audio/voiceover.md
@@ -8,7 +8,7 @@ scene windows in the current cut; the redesign times the scenes to these lines.
|---|---|---|---|
| 1 | Intro (the mark) | 0:00–0:03.4 | Introducing Kokon. |
| 2 | Hook (wall of edits) | 0:03.4–0:07.8 | Another image editor? Nope. This one is yours. |
-| 3 | Create | 0:07.8–0:23.6 | Kokon runs on your PC, and everything stays there. Not great at writing prompts? No worries, Prompt Plus writes it for you. Your graphics card does the rest. No cloud. No account. No subscription. |
+| 3 | Create | 0:07.8–0:23.6 | Kokon runs on your PC, and everything stays there. Describe an image in a few words: Prompt Plus writes the full prompt, and your graphics card makes it. No cloud. No account. No subscription. |
| 4 | Region | 0:23.6–0:39.5 | Want to change just one thing? Paint over it, and say what you want. Remove the scooter. Add a cat. Everything else stays exactly as it was. |
| 5 | Versions | 0:39.5–0:44.6 | Changed your mind? Every version is saved. |
| 6 | Montage | 0:44.0–1:00.9 | Change the season. Fix the sign. Restyle a portrait. Swap the furniture. Expand the frame. Shoot a product ad. One sentence each. |
@@ -21,7 +21,7 @@ line are in FINAL there); files land in voice/final/, one per line, mastered to
0.10 update (2026-10-20): Prompt+ in Create, Linux in Hardware. Only the changed sentences were
read again, with `gen_voice.py redo` / `splice` (the rest is the approved take, cut from
-voice/final/raw): line 3 sentences 1-3 and line 8 sentence 0. Line 6's "Shoot a product ad." is
+voice/final/raw): line 3 sentence 1 and line 8 sentence 0. Line 6's "Shoot a product ad." is
no longer played (the montage has five edits, so the Agent scene still lands on the drop); the
line keeps its text so the file and its sentence numbers stay as approved. "Prompt Plus" is
spelled out for the voice; on screen it is "Prompt+".
diff --git a/marketing/video/src/app/timeline.ts b/marketing/video/src/app/timeline.ts
index 0f1a6ab..f9d8941 100644
--- a/marketing/video/src/app/timeline.ts
+++ b/marketing/video/src/app/timeline.ts
@@ -77,9 +77,9 @@ const all = (scene: SceneName, line: number, local: number): Cue => cue(scene, l
// Scene-local frames where things happen that the voice names. Scenes import these too.
// Create with Prompt+: a few words typed, Prompt+ on, Send on beat 10 and a cut to the card; it
-// writes the prompt, fades to the percentage, the result hatches, and the full-frame image
-// arrives on beat 22.
-export const CREATE = { ask: 100, pill: 150, writes: 158, send: 172, job: 173, write: 180, written: 244, leave: 256, rest: 264, form: 278, done: 294, hatch: 300, full: 355, promises: 360 };
+// writes the prompt and fades to the percentage (a closer shot on beat 17); the logo forms, and
+// from it the image hatches full frame.
+export const CREATE = { ask: 100, pill: 150, send: 172, job: 173, write: 180, written: 244, leave: 256, form: 278, closer: 279, done: 294, hatch: 300, full: 355, promises: 360 };
// Shot changes (removeCut, removeShot, addCut, addShot) and the scene's end sit on beats.
export const REGION = { paint: 46, paint1: 130, removeCut: 138, remove: 150, removeSend: 177, removeShot: 185, addCut: 246, add: 256, addSend: 298, addShot: 307, same: 344 };
export const MONTAGE_EDIT = 91.5; // 1.5 bars
@@ -93,9 +93,7 @@ export const CUES: Cue[] = [
all("hook", 2, 15),
cue("create", 3, 12, 0),
cue("create", 3, CREATE.ask, 1),
- cue("create", 3, CREATE.writes, 2),
- cue("create", 3, CREATE.rest, 3),
- cue("create", 3, CREATE.promises, 4, 6),
+ cue("create", 3, CREATE.promises, 2, 4),
cue("region", 4, 6, 0),
cue("region", 4, 58, 1),
cue("region", 4, REGION.remove, 2),
diff --git a/marketing/video/src/app/voice.json b/marketing/video/src/app/voice.json
index 5a99fa4..144235c 100644
--- a/marketing/video/src/app/voice.json
+++ b/marketing/video/src/app/voice.json
@@ -26,7 +26,7 @@
]
},
"3": {
- "dur": 13.76,
+ "dur": 12.24,
"sentences": [
[
0.0,
@@ -34,27 +34,19 @@
],
[
2.92,
- 4.64
+ 8.12
],
[
- 5.04,
- 7.64
+ 8.52,
+ 9.56
],
[
- 8.04,
- 9.64
+ 9.96,
+ 10.76
],
[
- 10.04,
- 11.08
- ],
- [
- 11.48,
- 12.28
- ],
- [
- 12.68,
- 13.76
+ 11.16,
+ 12.24
]
]
},
diff --git a/marketing/video/src/mocks/Cocoon.tsx b/marketing/video/src/mocks/Cocoon.tsx
index 6ffbc49..3409cdd 100644
--- a/marketing/video/src/mocks/Cocoon.tsx
+++ b/marketing/video/src/mocks/Cocoon.tsx
@@ -58,8 +58,9 @@ export function Cocoon({ src, pct, dim }: { src?: string; pct: number; form?: bo
);
}
-/** The result hatching from the formed logo, at the card's `hatchMs`; a plain frame otherwise. */
-export function Hatch({ aspect, children }: { id?: string; aspect: number; children: React.ReactNode }) {
+/** The result hatching from the formed logo, at the card's `hatchMs`; a plain frame otherwise.
+ * `fill`: over a whole positioned box (the video's full frame) instead of a flex layout. */
+export function Hatch({ aspect, children, fill }: { id?: string; aspect: number; children: React.ReactNode; fill?: boolean }) {
const c = useCard();
const ms = c.hatchMs ?? null;
const running = ms !== null && ms < hatchEnd(FORM_MS);
@@ -70,6 +71,15 @@ export function Hatch({ aspect, children }: { id?: string; aspect: number; child
const veilBox = useRef<HTMLDivElement>(null);
const veil = useRef<SVGSVGElement>(null);
const veilPath = useRef<SVGPathElement>(null);
+ // The frame may be laid out only after the first commit: paint again once it has a size.
+ const [, setSized] = useState(0);
+ useLayoutEffect(() => {
+ const el = ref.current;
+ if (!el) return;
+ const ro = new ResizeObserver(() => setSized((n) => n + 1));
+ ro.observe(el);
+ return () => ro.disconnect();
+ }, []);
useLayoutEffect(() => {
const el = ref.current;
@@ -80,9 +90,9 @@ export function Hatch({ aspect, children }: { id?: string; aspect: number; child
});
return (
- <div className="hatch" ref={ref}>
+ <div className="hatch" ref={ref} style={fill ? { position: "absolute", inset: 0 } : undefined}>
{running && <div className="hatch-canvas" ref={canvasBox} />}
- <div className="hatch-body" ref={body}>
+ <div className="hatch-body" ref={body} style={fill ? { position: "absolute", inset: 0 } : undefined}>
{children}
</div>
{running && (
diff --git a/marketing/video/src/scenes/AppScenes.tsx b/marketing/video/src/scenes/AppScenes.tsx
index 9824ad7..ed1980e 100644
--- a/marketing/video/src/scenes/AppScenes.tsx
+++ b/marketing/video/src/scenes/AppScenes.tsx
@@ -11,7 +11,8 @@ import { imageBox, InpaintOverlay, strokePoints } from "../app/InpaintOverlay";
import { Backdrop, type Cam, Camera, camAt, camSpeed, Caption, DepthOfField, Dissolve, inOut, kf, Pointer, prog, typed, typingDone, Vignette } from "../app/motion";
import { Send, Sfx } from "../app/sound";
import { CREATE, FPS, LENGTH, REGION, sceneCues, sentenceAt } from "../app/timeline";
-import type { CardMotion } from "../mocks/card";
+import { CardMotionContext, type CardMotion } from "../mocks/card";
+import { Hatch } from "../mocks/Cocoon";
import type { State } from "../mocks/store";
const inpaintReq = (prompt: string, from: string, action: "remove" | "add") => ({
@@ -76,9 +77,12 @@ const Tag = ({ text, start, end }: { text: string; start: number; end: number })
// ---------------------------------------------------------------------------------------
export const CREATE_FRAMES = LENGTH.create;
-/** The card's shot: the stage, still (a slow push only). */
-// Zoomed so the window just fills the width (the camera then holds it edge to edge).
-const CARD_CAM: Cam = { x: 720, y: 400, s: 1.34 };
+/** The card in two still shots: the whole card while Prompt+ writes (a slow push), then, from
+ * the percentage on, closer, with the logo where the full-frame logo the image hatches from
+ * sits (same centre and size, measured), so the cut between them reads as one logo. */
+const CARD_CAM: Cam = { x: 852, y: 360, s: 1.55 };
+const CARD_CAM_END = 1.6;
+const LOGO_CAM: Cam = { x: 848, y: 364, s: 1.756 };
const PILL: [number, number] = [840, 853];
/** The job's percentage at scene frame `f`: the image starts while Prompt+ is still on screen. */
@@ -129,7 +133,7 @@ export function Create() {
[C.send, { ...PROMPT_CAM, s: 1.86 }],
]);
const onCard = f >= C.job;
- const cam = onCard ? { ...CARD_CAM, s: CARD_CAM.s + (f - C.job) * 0.0004 } : typingCam;
+ const cam = !onCard ? typingCam : f >= C.closer ? LOGO_CAM : { ...CARD_CAM, s: CARD_CAM.s + (CARD_CAM_END - CARD_CAM.s) * prog(f, C.job, C.closer - C.job, (x) => x) };
// Sharp on the composer while typing; the whole window on the card.
const dof = onCard ? 0 : prog(f, 70, 20);
const app = (
@@ -151,26 +155,32 @@ export function Create() {
)}
</Camera>
);
- // A hard cut on the beat: the window's small image and the full frame never overlap.
- const full = f >= C.full ? 1 : 0;
- const words = cues.find((c) => c.from === 4)!;
+ // Once the card has formed the logo: a hard cut to the same logo filling the frame, and the
+ // image hatches out of it full frame (the app's hatching, on the frame instead of the stage).
+ const full = f >= C.hatch ? 1 : 0;
+ const words = cues.find((c) => c.from === 2)!;
return (
<AbsoluteFill>
<Backdrop />
- {dof > 0.01 ? <DepthOfField focus={PROMPT_FOCUS} blur={7 * dof}>{app}</DepthOfField> : app}
+ {!full && (dof > 0.01 ? <DepthOfField focus={PROMPT_FOCUS} blur={7 * dof}>{app}</DepthOfField> : app)}
{full > 0 && (
- <div style={{ position: "absolute", inset: 0 }}>
- <FullImage before="street" push={1 + prog(f, C.full, LENGTH.create - C.full, (x) => x) * 0.05} dim={0.25 * prog(f, C.promises - 8, 12)} />
+ // Its own stacking context: the hatch layers (z-index 1-2) stay under the words.
+ <div style={{ position: "absolute", inset: 0, isolation: "isolate" }}>
+ <CardMotionContext.Provider value={card}>
+ <Hatch aspect={1920 / 1080} fill>
+ <FullImage before="street" push={1 + prog(f, C.full, LENGTH.create - C.full, (x) => x) * 0.05} dim={0.25 * prog(f, C.promises - 8, 12)} />
+ </Hatch>
+ </CardMotionContext.Provider>
</div>
)}
- <Vignette strength={(onCard ? 0.7 : 0) * (1 - full)} />
+ <Vignette strength={onCard && f < C.closer ? 0.7 : 0} />
<Tag text="Prompt+ writes the prompt." start={C.write - 2} end={C.leave + 12} />
- <Caption title="Made on your own GPU." sub="Qwen-Image 2.1 Turbo · Prompt+ ~2 s, then 2752×1536 in 38 s on an RTX 5070 Ti (sped up here)" start={C.leave + 14} end={C.full - 4} size={48} />
+ <Caption title="Made on your own GPU." sub="Qwen-Image 2.1 Turbo · Prompt+ ~2 s, then 2752×1536 in 38 s on an RTX 5070 Ti (sped up here)" start={C.leave + 14} end={C.hatch} size={48} />
<Words
items={[
- { text: "No cloud.", at: sentenceAt(words, 4) },
- { text: "No account.", at: sentenceAt(words, 5) },
- { text: "No subscription.", at: sentenceAt(words, 6) },
+ { text: "No cloud.", at: sentenceAt(words, 2) },
+ { text: "No account.", at: sentenceAt(words, 3) },
+ { text: "No subscription.", at: sentenceAt(words, 4) },
]}
end={LENGTH.create - 4}
/>
diff --git a/src/components/Cocoon.tsx b/src/components/Cocoon.tsx
index fe54be9..4c8d7de 100644
--- a/src/components/Cocoon.tsx
+++ b/src/components/Cocoon.tsx
@@ -349,9 +349,11 @@ export function paintHatch(e: HatchEls, aspect: number, tl: number, formFrom: nu
r = { ...r, h: r.w / aspect, x: (W - r.w) / 2, y: (H - r.w / aspect) / 2 };
const shown = b.querySelector<HTMLElement>(".image-box, .compare-box");
if (shown && shown.offsetWidth > 0) {
+ // Client rects include any scaling of an ancestor; the styles set below are layout pixels.
const a = shown.getBoundingClientRect();
const o = el.getBoundingClientRect();
- r = { w: a.width, h: a.height, x: a.left - o.left, y: a.top - o.top };
+ const k = el.offsetWidth > 0 ? o.width / el.offsetWidth : 1;
+ r = { w: a.width / k, h: a.height / k, x: (a.left - o.left) / k, y: (a.top - o.top) / k };
}
const { w: iw, h: ih, x: ox, y: oy } = r;
const m = markLayout(iw, ih);