Skip to content

armgit / fuobe

Public Imported from GitHub
0

The open creative studio on ComfyUI: images, video, 3D and audio on open weights, on your own GPU or the cloud. Camera motions, effects, apps, Cinema, Layers, Image to 3D and an AI agent.

Originals O5: Katana and the Ad Multiplier on Genjutsu's Original; eval cases for Character swap

Claudec376c0714bcd
diff --git a/scripts/eval/cases/genjutsu.json b/scripts/eval/cases/genjutsu.json
index ea04739e..4070ff43 100644
--- a/scripts/eval/cases/genjutsu.json
+++ b/scripts/eval/cases/genjutsu.json
@@ -1,20 +1,38 @@
{
"$schema": "./case.schema.json",
"suite": "genjutsu",
- "title": "Fuobe Genjutsu · motion transfer, object swap, restyle",
- "description": "Runs the Genjutsu studio route (POST /api/genjutsu, priced by /api/genjutsu/estimate) on your reference clips and images in local/genjutsu/: dance.mp4 (a 4–10 s clip of one person moving), character.png (who should move like that, a consenting person or a drawn character), street.mp4 (a clip with an object to swap), object.png (what replaces it), style.png (a look image you own). The Originals (O5) come first in each model list; today's open models run until they exist. On the cloud there is no hosted-open Genjutsu before O5, so the cloud runs only the partner variant for reference, with each mode's own partner model on fal: Kling 3.0 Motion Control (move), Kling O3 edit (swap) and Kling O3 4K edit (restyle). A job is skipped when the studio would pick another model than the one named, or run through Higgsfield's API.",
- "original": ["fuobe-genjutsu-move", "fuobe-genjutsu-swap", "fuobe-genjutsu-restyle"],
+ "title": "Fuobe Genjutsu · motion transfer, character swap, object swap, restyle",
+ "description": "Runs the Genjutsu studio route (POST /api/genjutsu, priced by /api/genjutsu/estimate) on your reference clips and images in local/genjutsu/: dance.mp4 (a 4–10 s clip of one person moving), person.mp4 (5–15 s, one continuous shot, the person visible in its first frame), character.png (who should move like that or take their place, a consenting person or a drawn character), street.mp4 (a clip with an object to swap), object.png (what replaces it), style.png (a look image you own). The Originals (O5) run on both engines: open weights on ComfyUI (Wan Animate 2, MiniMax H3 Character swap, Wan 2.1 VACE with SAM 3.1, Wan 2.2 Fun VACE) and the same open models hosted on fal (Wan 2.2 Animate, MiniMax H3 with Akatz Labs' swap LoRA, Wan VACE). The -lite cases run an Original's cheaper, faster tier on the same inputs (motion and object swap have one); the partner variant runs each mode's partner model on fal for reference (Kling 3.0 Motion Control, MiniMax H3 Max Recast, Kling O3 edit, Kling O3 4K edit). A job is skipped when the studio would pick another model than the one named, or run through Higgsfield's API.",
+ "original": [
+ "fuobe-genjutsu-motion",
+ "fuobe-character-swap",
+ "fuobe-genjutsu-swap",
+ "fuobe-genjutsu-restyle"
+ ],
"kind": "video",
"targets": {
- "open": { "models": ["fuobe-genjutsu-move", "oss-wan22-animate"] },
- "cloud": { "models": ["fuobe-genjutsu-move"] },
- "demo": { "models": ["oss-wan22-animate"] }
+ "open": {
+ "models": ["fuobe-genjutsu-motion"]
+ },
+ "cloud": {
+ "models": ["fuobe-genjutsu-motion"]
+ },
+ "demo": {
+ "models": ["fuobe-genjutsu-motion"]
+ }
+ },
+ "defaults": {
+ "seeds": [1001],
+ "metrics": ["temporal", "clip"],
+ "timeoutSeconds": 2700,
+ "candidate": "original"
},
- "defaults": { "seeds": [1001], "metrics": ["temporal", "clip"], "timeoutSeconds": 2700 },
"variants": {
- "original": { "description": "The Original (or today's open model) as the studio runs it" },
+ "original": {
+ "description": "The Original as the studio runs it (the -lite cases: its Lite tier)"
+ },
"partner": {
- "description": "Each mode's partner model on fal, for reference (cases name it: Kling 3.0 Motion Control, Kling O3 edit, Kling O3 4K edit)",
+ "description": "Each mode's partner model on fal, for reference (cases name it)",
"engines": ["cloud"]
}
},
@@ -22,43 +40,298 @@
{
"id": "genjutsu/move",
"title": "Motion transfer: your character dances the clip",
- "inputs": { "video": "local/genjutsu/dance.mp4", "images": ["local/genjutsu/character.png"] },
- "demoInputs": { "video": "samples/demo-portrait.mp4", "images": ["fixtures/character/drawn-face-1.png"] },
- "variantModels": { "partner": { "cloud": ["kling-motion-control"] } },
- "prompts": [{ "id": "dance", "text": "the character performs the dance from the clip, same timing" }],
+ "inputs": {
+ "video": "local/genjutsu/dance.mp4",
+ "images": ["local/genjutsu/character.png"]
+ },
+ "demoInputs": {
+ "video": "samples/demo-portrait.mp4",
+ "images": ["fixtures/character/drawn-face-1.png"]
+ },
+ "variantModels": {
+ "partner": {
+ "cloud": ["kling-motion-control"]
+ }
+ },
+ "prompts": [
+ {
+ "id": "dance",
+ "text": "the character performs the dance from the clip, same timing"
+ }
+ ],
+ "references": "local/genjutsu/character.png",
+ "metrics": ["temporal", "identity", "clip"],
+ "submit": {
+ "route": "/api/genjutsu",
+ "body": {
+ "engine": "{{engine}}",
+ "mode": "motion",
+ "modelId": "{{modelId}}",
+ "prompt": "{{prompt}}",
+ "references": ["{{inputs.images.0}}"],
+ "source": "{{source:inputs.video}}",
+ "seed": "{{seed}}",
+ "requestId": "{{requestId}}"
+ }
+ }
+ },
+ {
+ "id": "genjutsu/move-lite",
+ "title": "Motion transfer on the Lite tier: Wan Animate at 480p in fewer steps",
+ "inputs": {
+ "video": "local/genjutsu/dance.mp4",
+ "images": ["local/genjutsu/character.png"]
+ },
+ "demoInputs": {
+ "video": "samples/demo-portrait.mp4",
+ "images": ["fixtures/character/drawn-face-1.png"]
+ },
+ "prompts": [
+ {
+ "id": "dance",
+ "text": "the character performs the dance from the clip, same timing"
+ }
+ ],
"references": "local/genjutsu/character.png",
"metrics": ["temporal", "identity", "clip"],
"submit": {
"route": "/api/genjutsu",
- "body": { "engine": "{{engine}}", "mode": "motion", "modelId": "{{modelId}}", "prompt": "{{prompt}}", "references": ["{{inputs.images.0}}"], "source": "{{source:inputs.video}}", "seed": "{{seed}}", "requestId": "{{requestId}}" }
+ "body": {
+ "engine": "{{engine}}",
+ "mode": "motion",
+ "modelId": "{{modelId}}",
+ "prompt": "{{prompt}}",
+ "references": ["{{inputs.images.0}}"],
+ "source": "{{source:inputs.video}}",
+ "seed": "{{seed}}",
+ "requestId": "{{requestId}}"
+ }
+ },
+ "models": {
+ "open": ["fuobe-genjutsu-motion-lite"],
+ "cloud": ["fuobe-genjutsu-motion-lite"],
+ "demo": ["fuobe-genjutsu-motion-lite"]
+ }
+ },
+ {
+ "id": "genjutsu/character",
+ "title": "Character swap: your character takes the person's place, with the first frame made first",
+ "models": {
+ "open": ["fuobe-character-swap", "oss-h3-character-swap-relay"],
+ "cloud": ["fuobe-character-swap"],
+ "demo": ["fuobe-character-swap"]
+ },
+ "variantModels": {
+ "partner": {
+ "cloud": ["h3-max-recast", "p-video-replace", "kling-o3"]
+ }
+ },
+ "inputs": {
+ "video": "local/genjutsu/person.mp4",
+ "images": ["local/genjutsu/character.png"]
+ },
+ "demoInputs": {
+ "video": "fixtures/walk-6s.mp4",
+ "images": ["fixtures/character/drawn-face-2.png"]
+ },
+ "prompts": [
+ {
+ "id": "direction",
+ "text": "keep the walk and the timing; the character wears the same clothes as in the picture"
+ }
+ ],
+ "references": "local/genjutsu/character.png",
+ "metrics": ["temporal", "identity", "clip"],
+ "submit": {
+ "route": "/api/genjutsu",
+ "body": {
+ "engine": "{{engine}}",
+ "mode": "character",
+ "modelId": "{{modelId}}",
+ "prompt": "{{prompt}}",
+ "references": ["{{inputs.images.0}}"],
+ "source": "{{source:inputs.video}}",
+ "range": {
+ "start": 0,
+ "end": 5
+ },
+ "character": {
+ "who": "largest"
+ },
+ "seed": "{{seed}}",
+ "requestId": "{{requestId}}"
+ }
+ }
+ },
+ {
+ "id": "genjutsu/character-plain",
+ "title": "Character swap at 480p without the first frame (what a failed anchor falls back to)",
+ "models": {
+ "open": ["fuobe-character-swap"],
+ "cloud": ["fuobe-character-swap"],
+ "demo": ["fuobe-character-swap"]
+ },
+ "inputs": {
+ "video": "local/genjutsu/person.mp4",
+ "images": ["local/genjutsu/character.png"]
+ },
+ "demoInputs": {
+ "video": "fixtures/walk-6s.mp4",
+ "images": ["fixtures/character/drawn-face-2.png"]
+ },
+ "prompts": [
+ {
+ "id": "plain",
+ "text": "the person walks across the scene"
+ }
+ ],
+ "references": "local/genjutsu/character.png",
+ "metrics": ["temporal", "identity", "clip"],
+ "submit": {
+ "route": "/api/genjutsu",
+ "body": {
+ "engine": "{{engine}}",
+ "mode": "character",
+ "modelId": "{{modelId}}",
+ "references": ["{{inputs.images.0}}"],
+ "source": "{{source:inputs.video}}",
+ "range": {
+ "start": 0,
+ "end": 5
+ },
+ "quality": "480p",
+ "character": {
+ "who": "largest",
+ "anchor": false
+ },
+ "seed": "{{seed}}",
+ "requestId": "{{requestId}}"
+ }
}
},
{
"id": "genjutsu/swap",
"title": "Object swap: replace the object in the clip",
- "models": { "open": ["fuobe-genjutsu-swap", "oss-vace-swap"], "cloud": ["fuobe-genjutsu-swap"], "demo": ["oss-vace-swap"] },
- "variantModels": { "partner": { "cloud": ["kling-o3"] } },
- "inputs": { "video": "local/genjutsu/street.mp4", "images": ["local/genjutsu/object.png"] },
- "demoInputs": { "video": "samples/demo-landscape.mp4", "images": ["fixtures/palette.png"] },
- "prompts": [{ "id": "swap", "text": "the car on the left" }],
+ "models": {
+ "open": ["fuobe-genjutsu-swap"],
+ "cloud": ["fuobe-genjutsu-swap"],
+ "demo": ["fuobe-genjutsu-swap"]
+ },
+ "variantModels": {
+ "partner": {
+ "cloud": ["kling-o3"]
+ }
+ },
+ "inputs": {
+ "video": "local/genjutsu/street.mp4",
+ "images": ["local/genjutsu/object.png"]
+ },
+ "demoInputs": {
+ "video": "samples/demo-landscape.mp4",
+ "images": ["fixtures/palette.png"]
+ },
+ "prompts": [
+ {
+ "id": "swap",
+ "text": "the car on the left"
+ }
+ ],
+ "submit": {
+ "route": "/api/genjutsu",
+ "body": {
+ "engine": "{{engine}}",
+ "mode": "swap",
+ "modelId": "{{modelId}}",
+ "target": "type",
+ "subject": "{{prompt}}",
+ "references": ["{{inputs.images.0}}"],
+ "source": "{{source:inputs.video}}",
+ "seed": "{{seed}}",
+ "requestId": "{{requestId}}"
+ }
+ }
+ },
+ {
+ "id": "genjutsu/swap-lite",
+ "title": "Object swap on the Lite tier: VACE at 480p",
+ "models": {
+ "open": ["fuobe-genjutsu-swap-lite"],
+ "cloud": ["fuobe-genjutsu-swap-lite"],
+ "demo": ["fuobe-genjutsu-swap-lite"]
+ },
+ "inputs": {
+ "video": "local/genjutsu/street.mp4",
+ "images": ["local/genjutsu/object.png"]
+ },
+ "demoInputs": {
+ "video": "samples/demo-landscape.mp4",
+ "images": ["fixtures/palette.png"]
+ },
+ "prompts": [
+ {
+ "id": "swap",
+ "text": "the car on the left"
+ }
+ ],
"submit": {
"route": "/api/genjutsu",
- "body": { "engine": "{{engine}}", "mode": "swap", "modelId": "{{modelId}}", "target": "type", "subject": "{{prompt}}", "references": ["{{inputs.images.0}}"], "source": "{{source:inputs.video}}", "seed": "{{seed}}", "requestId": "{{requestId}}" }
+ "body": {
+ "engine": "{{engine}}",
+ "mode": "swap",
+ "modelId": "{{modelId}}",
+ "target": "type",
+ "subject": "{{prompt}}",
+ "references": ["{{inputs.images.0}}"],
+ "source": "{{source:inputs.video}}",
+ "seed": "{{seed}}",
+ "requestId": "{{requestId}}"
+ }
}
},
{
"id": "genjutsu/restyle",
"title": "Restyle: the clip in your look",
- "models": { "open": ["fuobe-genjutsu-restyle", "oss-wan22-vace-restyle"], "cloud": ["fuobe-genjutsu-restyle"], "demo": ["oss-wan22-vace-restyle"] },
- "variantModels": { "partner": { "cloud": ["kling-o3-4k-edit"] } },
- "inputs": { "video": "local/genjutsu/dance.mp4", "images": ["local/genjutsu/style.png"] },
- "demoInputs": { "video": "samples/demo-portrait.mp4", "images": ["fixtures/references/warm-1.png"] },
- "prompts": [{ "id": "look", "text": "the same scene as a warm hand-painted animation" }],
+ "models": {
+ "open": ["fuobe-genjutsu-restyle"],
+ "cloud": ["fuobe-genjutsu-restyle"],
+ "demo": ["fuobe-genjutsu-restyle"]
+ },
+ "variantModels": {
+ "partner": {
+ "cloud": ["kling-o3-4k-edit"]
+ }
+ },
+ "inputs": {
+ "video": "local/genjutsu/dance.mp4",
+ "images": ["local/genjutsu/style.png"]
+ },
+ "demoInputs": {
+ "video": "samples/demo-portrait.mp4",
+ "images": ["fixtures/references/warm-1.png"]
+ },
+ "prompts": [
+ {
+ "id": "look",
+ "text": "the same scene as a warm hand-painted animation"
+ }
+ ],
"references": "local/genjutsu/style.png",
"metrics": ["temporal", "style", "clip"],
"submit": {
"route": "/api/genjutsu",
- "body": { "engine": "{{engine}}", "mode": "restyle", "modelId": "{{modelId}}", "look": { "kind": "custom", "images": ["{{inputs.images.0}}"], "words": "{{prompt}}" }, "source": "{{source:inputs.video}}", "seed": "{{seed}}", "requestId": "{{requestId}}" }
+ "body": {
+ "engine": "{{engine}}",
+ "mode": "restyle",
+ "modelId": "{{modelId}}",
+ "look": {
+ "kind": "custom",
+ "images": ["{{inputs.images.0}}"],
+ "words": "{{prompt}}"
+ },
+ "source": "{{source:inputs.video}}",
+ "seed": "{{seed}}",
+ "requestId": "{{requestId}}"
+ }
}
}
]
diff --git a/scripts/eval/fixtures/make-fixtures.py b/scripts/eval/fixtures/make-fixtures.py
index 8443ee50..6e8d11f1 100644
--- a/scripts/eval/fixtures/make-fixtures.py
+++ b/scripts/eval/fixtures/make-fixtures.py
@@ -4,6 +4,8 @@ python3 -I scripts/eval/fixtures/make-fixtures.py (needs numpy and Pillow)
"""
import math
import pathlib
+import shutil
+import subprocess
import wave
import numpy as np
@@ -61,6 +63,27 @@ def voice(path, seconds=2.0, rate=16000):
w.writeframes(pcm.tobytes())
+def walk(path, seconds=6, fps=24, w=432, h=768):
+ """A drawn figure (blocks, no person) walking across a two-tone scene with a hum: Character swap needs 5 s or more."""
+ if not shutil.which("ffmpeg"):
+ print("ffmpeg not found: skipping", path.name)
+ return
+ x = f"60+(t/{seconds})*({w}-180)"
+ graph = (
+ f"color=c=0x8fb4dc:s={w}x{h}:r={fps}:d={seconds},drawbox=x=0:y={h * 2 // 3}:w={w}:h={h // 3}:color=0xc89a6e:t=fill[bg];"
+ f"color=c=0xaa1e28:s=60x200:r={fps}:d={seconds}[coat];"
+ f"color=c=0xe1bea0:s=36x40:r={fps}:d={seconds}[head];"
+ f"[bg][coat]overlay=x='{x}':y={h // 2 - 40}[a];"
+ f"[a][head]overlay=x='{x}+12':y={h // 2 - 84},format=yuv420p[v]"
+ )
+ subprocess.run(
+ ["ffmpeg", "-v", "error", "-y", "-filter_complex", graph, "-f", "lavfi", "-i", f"sine=frequency=180:duration={seconds}",
+ "-map", "[v]", "-map", "0:a", "-c:v", "libx264", "-crf", "30", "-preset", "veryslow", "-c:a", "aac", "-b:a", "32k",
+ "-map_metadata", "-1", "-fflags", "+bitexact", "-flags:v", "+bitexact", "-flags:a", "+bitexact", str(path)],
+ check=True,
+ )
+
+
if __name__ == "__main__":
scene(HERE / "start-frame.png", (120, 160, 220), (230, 170, 110), (380, 120))
scene(HERE / "end-frame.png", (40, 50, 90), (90, 70, 120), (120, 110))
@@ -72,4 +95,5 @@ if __name__ == "__main__":
scene(HERE / "references" / "warm-2.png", (240, 170, 110), (190, 110, 70), (330, 150))
palette(HERE / "palette.png")
voice(HERE / "voice.wav")
+ walk(HERE / "walk-6s.mp4")
print("fixtures written to", HERE)
diff --git a/scripts/eval/fixtures/walk-6s.mp4 b/scripts/eval/fixtures/walk-6s.mp4
new file mode 100644
index 00000000..56546c27
Binary files /dev/null and b/scripts/eval/fixtures/walk-6s.mp4 differ
diff --git a/src/lib/av/katana.ts b/src/lib/av/katana.ts
index e1971891..8871c389 100644
--- a/src/lib/av/katana.ts
+++ b/src/lib/av/katana.ts
@@ -31,18 +31,24 @@ export interface MotionModel {
export const MOTION_MODELS: Record<Engine, MotionModel[]> = {
cloud: [
{ id: "kling-o3", label: "Kling O3 edit", op: "v2v", min: 3, max: 10, maxRefs: 4 },
- { id: "genjutsu-motion-transfer", label: "Higgsfield Genjutsu motion transfer", op: "motion-transfer", min: 3, max: 10, maxRefs: 8 },
+ { id: "fuobe-genjutsu-motion", label: "Fuobe Genjutsu · Motion (Wan 2.2 Animate on fal)", op: "motion-transfer", min: 3, max: 10, maxRefs: 1 },
{ id: "kling-motion-control", label: "Kling 3.0 Motion Control", op: "motion-transfer", min: 3, max: 10, maxRefs: 1 },
],
open: [
- { id: "oss-wan22-animate", label: "Wan 2.2 Animate", op: "motion-transfer", min: 1, max: 5, maxRefs: 1 },
+ { id: "fuobe-genjutsu-motion", label: "Fuobe Genjutsu · Motion (Wan Animate 2)", op: "motion-transfer", min: 1, max: 5, maxRefs: 1 },
{ id: "oss-wan22-fun-control", label: "Wan 2.2 Fun Control", op: "motion-transfer", min: 1, max: 5, maxRefs: 1 },
],
};
export const KEYFRAME_MODEL: Record<Engine, string> = { cloud: "nano-banana-pro", open: "oss-qwen-edit" };
-export const motionModel = (engine: Engine, id?: string): MotionModel => MOTION_MODELS[engine].find((m) => m.id === id) ?? MOTION_MODELS[engine][0];
+/** Katana's earlier motion models, now Fuobe Genjutsu's Original (a saved job or an API call may still name them). */
+export const RETIRED_MOTION_MODELS: Record<string, string> = { "genjutsu-motion-transfer": "fuobe-genjutsu-motion", "oss-wan22-animate": "fuobe-genjutsu-motion" };
+
+export const motionModel = (engine: Engine, id?: string): MotionModel => {
+ const want = id && (RETIRED_MOTION_MODELS[id] ?? id);
+ return MOTION_MODELS[engine].find((m) => m.id === want) ?? MOTION_MODELS[engine][0];
+};
export interface Segment {
start: number;
@@ -224,7 +230,8 @@ export function katanaSteps(o: KatanaInput): KatanaStep[] {
const photos = o.engine === "open" ? o.photos.slice(0, 2) : o.photos;
steps.push({ key: `key${i}`, after: `frame${i}`, chain: [{ slot: "images", position: "first" }], request: { ...base, modelId: KEYFRAME_MODEL[o.engine], op: "edit", prompt: keyframePrompt(o.instructions, photos.length), inputs: { images: photos }, step: label("your subject") } });
// Open models render as long as they're told (Wan Fun Control defaults to 81 frames ≈ 5 s): ask for the segment's length.
- const motion: GenerationRequest = { ...base, modelId: m.id, op: m.op, prompt: motionPrompt(o.instructions), params: { aspectRatio: aspect, ...(o.engine === "open" && { resolution: "480p", duration: r2(s.end - s.start) }) }, step: label("motion") };
+ // The engine is named: a Fuobe Original (Genjutsu's motion) runs on both.
+ const motion: GenerationRequest = { ...base, engine: o.engine, modelId: m.id, op: m.op, prompt: motionPrompt(o.instructions), params: { aspectRatio: aspect, ...(o.engine === "open" && { resolution: "480p", duration: r2(s.end - s.start) }) }, step: label("motion") };
if (m.op === "v2v") {
// The segment is edited with the new keyframe first among its references, then the photos.
steps.push({ key: `move${i}`, after: [`cut${i}`, `key${i}`], chain: [{ slot: "video" }, { slot: "images", position: "first" }], request: { ...motion, inputs: { images: o.photos.slice(0, m.maxRefs - 1) } } });
diff --git a/src/lib/catalog/marketing.ts b/src/lib/catalog/marketing.ts
index 7f827519..1d5be98b 100644
--- a/src/lib/catalog/marketing.ts
+++ b/src/lib/catalog/marketing.ts
@@ -998,7 +998,7 @@ export const MULTIPLIER_MODELS: Record<Engine, ModelChoice[]> = {
{ id: "kling-o3", note: "Kling O3 edit, up to 4 @images" },
{ id: "gemini-omni-flash", note: "Gemini Omni Flash edit, prompt only" },
],
- open: [{ id: "oss-wan22-animate", note: "Wan Animate: your @image_1 takes over the performance" }],
+ open: [{ id: "fuobe-genjutsu-motion", note: "Fuobe Genjutsu · Motion (Wan Animate 2): your @image_1 takes over the performance" }],
};
/** Ad Multiplier quality → the resolution sent; open models top out at 720p. */
diff --git a/src/server/katana.ts b/src/server/katana.ts
index a4ecd719..43e3ce4f 100644
--- a/src/server/katana.ts
+++ b/src/server/katana.ts
@@ -2,7 +2,7 @@ import "server-only";
import { nanoid } from "nanoid";
import { z } from "zod";
import type { PlannedJob } from "@/lib/assist";
-import { finalKey, KATANA_FEATURE, KATANA_LIMITS, katanaSteps, katanaStage, motionModel, MOTION_MODELS, planSegments, stepsToRedo, type KatanaInput, type KatanaJob, type KatanaJobView, type Segment } from "@/lib/av/katana";
+import { finalKey, KATANA_FEATURE, KATANA_LIMITS, katanaSteps, katanaStage, motionModel, MOTION_MODELS, planSegments, RETIRED_MOTION_MODELS, stepsToRedo, type KatanaInput, type KatanaJob, type KatanaJobView, type Segment } from "@/lib/av/katana";
import { getModel } from "@/lib/catalog";
import type { Engine, Generation } from "@/lib/catalog/types";
import { probeMedia } from "@/lib/media-probe";
@@ -176,7 +176,7 @@ export function planKatana(body: KatanaRequest): { input: KatanaInput; engine: E
const duration = Math.min(referenceLength(body.reference, body.duration), KATANA_LIMITS.maxReference);
if (duration < KATANA_LIMITS.minReference) throw new Error("The reference is too short");
const m = motionModel(engine, body.motionModel);
- if (body.motionModel && m.id !== body.motionModel) throw new Error(`${getModel(body.motionModel)?.name ?? body.motionModel} isn't a ${engine === "open" ? "open-source" : "cloud"} motion model for Katana`);
+ if (body.motionModel && m.id !== (RETIRED_MOTION_MODELS[body.motionModel] ?? body.motionModel)) throw new Error(`${getModel(body.motionModel)?.name ?? body.motionModel} isn't a ${engine === "open" ? "open-source" : "cloud"} motion model for Katana`);
const segments = body.segments?.length ? validSegments(body.segments, duration) : planSegments({ duration, mode: "fixed", length: body.length ?? m.max, min: m.min, max: m.max });
const title = body.title?.trim().slice(0, 120) || "Katana edit";
return {
diff --git a/src/server/marketing.ts b/src/server/marketing.ts
index ede3e225..3d47bbcb 100644
--- a/src/server/marketing.ts
+++ b/src/server/marketing.ts
@@ -838,6 +838,8 @@ export function planMultiplier(input: MultiplierInput, ctx: MultiplierContext):
label: "Recreating",
request: {
feature: trimmed ? "ad-multiplier" : step,
+ // Fuobe Genjutsu's Original runs on both engines: this is its open half.
+ engine: "open",
modelId: model.id,
op: "motion-transfer",
prompt: lead.prompt,
diff --git a/tests/av-katana.test.ts b/tests/av-katana.test.ts
index d22229d1..91741031 100644
--- a/tests/av-katana.test.ts
+++ b/tests/av-katana.test.ts
@@ -127,11 +127,11 @@ describe("katana steps", () => {
["cut0", "oss-segment", "trim"],
["frame0", "oss-extract-frame", "frame"],
["key0", "oss-qwen-edit", "edit"],
- ["move0", "oss-wan22-animate", "motion-transfer"],
+ ["move0", "fuobe-genjutsu-motion", "motion-transfer"],
["cut1", "oss-segment", "trim"],
["frame1", "oss-extract-frame", "frame"],
["key1", "oss-qwen-edit", "edit"],
- ["move1", "oss-wan22-animate", "motion-transfer"],
+ ["move1", "fuobe-genjutsu-motion", "motion-transfer"],
["join", "oss-join-clips", "concat"],
["final", "oss-mux", "mux"],
]);
@@ -248,7 +248,7 @@ describe("katana runs (demo mode)", () => {
const tool = getTool("katana")!;
expect(tool.gated).toBe(true);
const [job] = tool.plan!({ reference, photos: [photo], segment_seconds: 4 }, { engine: "open" });
- expect(job).toMatchObject({ tool: "katana", kind: "video", modelId: "oss-wan22-animate" });
+ expect(job).toMatchObject({ tool: "katana", kind: "video", modelId: "fuobe-genjutsu-motion" });
expect(job.error).toBeUndefined();
expect(tool.plan!({ reference: "nope", photos: [] }, { engine: "cloud" })[0].error).toBeTruthy();
});
diff --git a/tests/eval-harness.test.ts b/tests/eval-harness.test.ts
index 3b2a79b2..035b35c4 100644
--- a/tests/eval-harness.test.ts
+++ b/tests/eval-harness.test.ts
@@ -230,13 +230,26 @@ describe("the runner on the demo provider", () => {
expect(row.status).toBe("succeeded");
const body = (row.request as { route: string; body: Record<string, unknown> }).body;
expect((row.request as { route: string }).route).toBe("/api/genjutsu");
- expect(body).toMatchObject({ engine: "open", mode: "motion", modelId: "oss-wan22-animate", seed: 1001 });
+ expect(body).toMatchObject({ engine: "open", mode: "motion", modelId: "fuobe-genjutsu-motion", seed: 1001 });
expect(String(body.requestId)).toMatch(/^eval-[0-9a-f]{24}$/);
expect((body.source as { url: string }).url).toMatch(/^\/api\/files\//);
if (fs.existsSync("/usr/bin/ffprobe")) expect(body.source).toMatchObject({ fps: 24, width: 432, height: 768, duration: 4 });
expect(row.outputs?.[0]?.kind).toBe("video");
});
+ it("runs Genjutsu's Character swap on the 6 s fixture clip: the part, the character, who to swap", async () => {
+ const r = await cli(["run", "--suite", "genjutsu", "--engine", "demo", "--cases", "genjutsu/character,genjutsu/character-plain", "--no-metrics"]);
+ expect(r.code, r.stderr).toBe(0);
+ const rows = store.latestJobs(path.join(results, runIdFrom(r.stderr)));
+ expect(rows.map((x) => [x.caseId, x.status]).sort()).toEqual([
+ ["genjutsu/character", "succeeded"],
+ ["genjutsu/character-plain", "succeeded"],
+ ]);
+ const body = (rows.find((x) => x.caseId === "genjutsu/character")!.request as { body: Record<string, unknown> }).body;
+ expect(body).toMatchObject({ mode: "character", modelId: "fuobe-character-swap", range: { start: 0, end: 5 }, character: { who: "largest" } });
+ if (fs.existsSync("/usr/bin/ffprobe")) expect(body.source).toMatchObject({ duration: 6, width: 432, height: 768 });
+ });
+
it("a training case in a demo run makes an element from the fixtures and @mentions it (no training)", async () => {
const r = await cli(["run", "--suite", "soul-id", "--engine", "demo", "--cases", "soul-id/character,soul-id/look", "--prompts", "1", "--variants", "trained", "--no-metrics"]);
const runDir = path.join(results, runIdFrom(r.stderr));
@@ -265,21 +278,38 @@ describe("the runner on the demo provider", () => {
setSetting("cloudProvider", "higgsfield");
const soul = await dry(["--suite", "soul", "--engine", "cloud", "--looks", "v1-general", "--variants", "plain", "--prompts", "1"]);
expect(soul.jobs.map((j) => j.skip)).toEqual([expect.stringMatching(/would run on Higgsfield's API/)]);
- // Genjutsu's studio route lists its steps' providers: Motion Control and O3 edit go to Higgsfield, the 4K edit is fal-only.
+ // Genjutsu's studio route lists its steps' providers: Motion Control goes to Higgsfield, the 4K edit is fal-only.
const gh = await dry(["--suite", "genjutsu", "--engine", "cloud", "--variants", "partner", "--allow-fixtures"]);
const by = (p: Plan) => Object.fromEntries(p.jobs.map((j) => [j.case, j]));
expect(by(gh)["genjutsu/move"].skip).toMatch(/Higgsfield's API/);
expect(by(gh)["genjutsu/restyle"]).toMatchObject({ model: "kling-o3-4k-edit" });
expect(by(gh)["genjutsu/restyle"].skip).toBeUndefined();
- // On Auto with fal connected, each mode runs its own partner on fal, even with a Higgsfield key set (no Genjutsu Lite).
+ // On Auto with fal connected, each mode runs its own partner on fal, even with a Higgsfield key set.
setSetting("cloudProvider", "auto");
const g = await dry(["--suite", "genjutsu", "--engine", "cloud", "--variants", "partner", "--allow-fixtures"]);
expect(g.jobs.map((j) => [j.case, j.model, j.skip ?? null])).toEqual([
["genjutsu/move", "kling-motion-control", null],
+ // A case with no partner of its own runs its own models (the -lite tiers, the Original without its first frame).
+ ["genjutsu/move-lite", "fuobe-genjutsu-motion-lite", null],
+ // Character swap's partner: MiniMax's own Recast on fal.
+ ["genjutsu/character", "h3-max-recast", null],
+ ["genjutsu/character-plain", "fuobe-character-swap", null],
// The fixture clip is 768×432: Kling O3's edit wants 720 px on each side (your street.mp4 must be that big).
["genjutsu/swap", "kling-o3", expect.stringMatching(/at least 720 px on each side/)],
+ ["genjutsu/swap-lite", "fuobe-genjutsu-swap-lite", null],
["genjutsu/restyle", "kling-o3-4k-edit", null],
]);
+ // The Originals on the cloud: their hosted open halves on fal.
+ const o = await dry(["--suite", "genjutsu", "--engine", "cloud", "--variants", "original", "--allow-fixtures"]);
+ expect(o.jobs.map((j) => [j.case, j.model, j.skip ?? null])).toEqual([
+ ["genjutsu/move", "fuobe-genjutsu-motion", null],
+ ["genjutsu/move-lite", "fuobe-genjutsu-motion-lite", null],
+ ["genjutsu/character", "fuobe-character-swap", null],
+ ["genjutsu/character-plain", "fuobe-character-swap", null],
+ ["genjutsu/swap", "fuobe-genjutsu-swap", null],
+ ["genjutsu/swap-lite", "fuobe-genjutsu-swap-lite", null],
+ ["genjutsu/restyle", "fuobe-genjutsu-restyle", null],
+ ]);
// Mixed Media names its hosted open model, so the studio runs that one (and says so).
const mm = await dry(["--suite", "mixed-media", "--engine", "cloud", "--cases", "mixed-media/toxic", "--allow-fixtures"]);
expect(mm.jobs.map((j) => [j.model, j.skip ?? null])).toEqual([["ltx-2-3-restyle", null]]);
diff --git a/tests/marketing-api.test.ts b/tests/marketing-api.test.ts
index 05da88c9..986d6e3b 100644
--- a/tests/marketing-api.test.ts
+++ b/tests/marketing-api.test.ts
@@ -383,7 +383,7 @@ describe("Ad Multiplier", () => {
expect(cloud.steps).toHaveLength(1);
expect(cloud.steps[0].request).toMatchObject({ modelId: "kling-o3", op: "v2v", prompt: "Swap the bottle for @Image1", inputs: { images: [imgs[1], imgs[0]] }, params: { extra: { keep_audio: true } } });
const open = mk.planMultiplier({ engine: "open", video: video(), duration: 12, images: imgs, mode: "prompt", prompt: "", quality: "1080p" }, { higgsfield: false });
- expect(open.steps.map((s) => [s.key, s.request.modelId])).toEqual([["edit", "oss-wan22-animate"], ["sound", "oss-mux"]]);
+ expect(open.steps.map((s) => [s.key, s.request.modelId])).toEqual([["edit", "fuobe-genjutsu-motion"], ["sound", "oss-mux"]]);
expect(() => mk.planMultiplier({ engine: "open", video: video(), duration: 12, mode: "prompt", quality: "720p" }, { higgsfield: false })).toThrow(/Add an image/);
});