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.

Evolution: a direct cloud run is priced on the clip's frames and held to fal's 241, and the direction frame is VACE's reference as on the GPU

Claude63613bb38856
diff --git a/docs/research/fuobe-originals-recipes-5.json b/docs/research/fuobe-originals-recipes-5.json
index b0374c63..fe3cf6ff 100644
--- a/docs/research/fuobe-originals-recipes-5.json
+++ b/docs/research/fuobe-originals-recipes-5.json
@@ -18239,7 +18239,8 @@
},
"segments": "Fuobe Shorts' cloud pieces: equal pieces of at most 10 s and 241 frames as fal works them (a clip above 30 fps worked at a whole fraction of its rate with temporal_downsample_factor and brought back), each cut with fal's trim-video unless it is the whole clip",
"directionFrame": "per piece, its first frame (fal's extract-frame) taken toward the direction by hosted Qwen-Image-Edit 2511 with the GPU's frame instruction for the intensity and the first 3 references as images 2–4, as the GPU recipe does with its own edit step",
- "video": "Wan 2.2 Fun VACE depth: video_url = the piece (preprocess on, so fal derives the depth itself), first_frame_url = the direction frame, the direction as the prompt; frames and rate match the piece",
+ "video": "Wan 2.2 Fun VACE depth: video_url = the piece (preprocess on, so fal derives the depth itself), ref_image_urls = [the direction frame], the direction as the prompt; frames and rate match the piece; no first_frame_url",
+ "frameRole": "the direction frame goes as the VACE reference (ref_image_urls), as the GPU graph uses it (video-evolution-wan22-fun-vace node 15 WanVaceToVideo: reference_image = the direction frame, control_video = the depth); first_frame_url is not sent, so frame 0 isn't pinned to the frame, which the GPU doesn't do either (decided 2026-11-01 in package owner-calls-1's fix: the first build sent first_frame_url only, as Fuobe Shorts does; Shorts keeps it, its own recipe pins the restyled first frame). Unmeasured: the evolution eval suite can compare the two once paid keys exist",
"intensity": "the endpoint has no strength or denoise field (31 inputs, read 2026-11-01): in the cloud the change level reaches the direction frame's instruction only (refine gently / change / reimagine boldly; low and medium keep the people), and the clip reaches the model only as its depth, so how much of the clip's own look stays (the GPU's denoise) is set on the GPU only",
"references": "the first 3 go into each piece's direction frame (images 2–4); the rest, and up to 8 in all with the clip's frame, shape the written direction",
"resolutions": [
@@ -18701,7 +18702,8 @@
"cloud": {
"edit": "fal-ai/qwen-image-edit-2511 (fal-ai/qwen-image-edit-2511/lora with LoRAs; Replicate qwen/qwen-image-edit-2511)",
"t2i": "fal-ai/qwen-image-2512 (fal-ai/qwen-image-2512/lora with LoRAs)",
- "price": "$0.03 per megapixel for an edit, $0.035 with LoRAs; text to image $0.02 per megapixel"
+ "price": "$0.03 per megapixel for an edit, $0.035 with LoRAs; text to image $0.02 per megapixel",
+ "productShot": "none: the Standalone shot runs on the GPU only (the owner's 10-30 rule, package owner-calls-1's fix, 2026-11-01). fal hosts BiRefNet (fal-ai/birefnet/v2) and Qwen-Image-Edit 2509 with LoRAs by URL (fal-ai/qwen-image-edit-plus-lora, so the White_to_Scene LoRA could load), but no hosted step puts the cut-out on white: fal-ai/birefnet/v2 (output_mask, mask_only, refine_foreground) and fal-ai/bria/background/remove take no background colour (schemas read 2026-11-01), and the LoRA turns a product on white into a scene. The cloud's Standalone format lists the Original as running on your GPU only and starts on a partner; until this fix it made the shot as a plain 2511 edit"
},
"open": {
"edit": "qwen-image-edit-2511-multi (up to 3 references: product, person, setting)",
diff --git a/docs/research/fuobe-originals-recipes-5.md b/docs/research/fuobe-originals-recipes-5.md
index ee7d64eb..bcced72d 100644
--- a/docs/research/fuobe-originals-recipes-5.md
+++ b/docs/research/fuobe-originals-recipes-5.md
@@ -716,7 +716,7 @@ Also new and worth a later look: Lightricks LTX-2.5 **Cinemagraph** (2026-09-10,
- **Change intensity:** denoise 0.45 / 0.65 / 0.85 (build plan O13), and on both engines the direction frame's instruction (refine gently / change / reimagine boldly). fal's hosted Wan 2.2 Fun VACE has no strength field (its 31 inputs, read 2026-11-01), so in the cloud the instruction is all of it.
- **Open (ComfyUI):** Fuobe `video-evolution-wan22-fun-vace`: per ≤81-frame segment at 16 fps (video-segment-resample), Qwen-Image 2.1 Turbo takes the segment's first frame toward the direction (images 2–4 = the first three references; *corrected 2026-11-01: Qwen-Image-Edit 2511 with two references until the image tools moved to Qwen-Image 2.1*), then Wan 2.2 Fun VACE re-renders the segment from the segment itself: reference latent + VAE-encoded frames, noised to denoise = the noise level it starts from ((1 − denoise) × clip + denoise × noise). The simple scheduler with shift 5 reaches that level N − 4 steps into a schedule of N = round(4 × (5 − 4 × denoise) / denoise) steps and the last 4 run (Lightx2v 4-step): low starts at σ 0.455, medium 0.645, high 0.833. Wan 2.2's high-noise expert takes only steps at or above its switch point (σ 0.875), so the three intensities run on the low-noise expert; full denoise is the restyle graph's 2 + 2. Depth Anything 3 depth on every frame, the direction frame as the VACE reference. The graph loads any clip at 16 fps (VHS_LoadVideo, at most `frames` frames, 4n+1) and runs as many frames as it loaded, so a whole clip from Edit video is neither slow motion nor a shape error. Then video-concat-N and the clip's own sound. Same weights as the restyle graph (24 GB). *(Corrected 2026-10-29: the first version noised the way KSampler does, floor(4 / denoise) steps, which with 4 steps and shift 5 started every intensity at σ 0.83–1 and made high the same as full noise.)*
-- **Hosted (since 2026-11-01, the owner's call of 2026-10-30):** the GPU's own model, `fal-ai/wan-22-vace-fun-a14b/depth`, the way Fuobe Shorts runs it: per piece of up to 10 s and 241 frames as fal works them, fal's trim and extract-frame, hosted `fal-ai/qwen-image-edit-2511` takes the piece's first frame toward the direction with the GPU's frame instruction and the first three references, then VACE gets the piece as `video_url` (`preprocess` on: fal derives the depth) and the direction frame as `first_frame_url`, frames and rate matched; the clip's own sound goes back on the joined result. $0.10 per video second at 720p ($0.075 at 580p, $0.05 at 480p), frames ÷ 16, plus each direction frame's edit. *(Until 2026-11-01 the cloud ran `fal-ai/ltx-2.3-22b/video-to-video` at `video_strength` 1 − denoise: a different model, and it took no images.)*
+- **Hosted (since 2026-11-01, the owner's call of 2026-10-30):** the GPU's own model, `fal-ai/wan-22-vace-fun-a14b/depth`, the way Fuobe Shorts runs it: per piece of up to 10 s and 241 frames as fal works them, fal's trim and extract-frame, hosted `fal-ai/qwen-image-edit-2511` takes the piece's first frame toward the direction with the GPU's frame instruction and the first three references, then VACE gets the piece as `video_url` (`preprocess` on: fal derives the depth) and the direction frame as its reference, `ref_image_urls`, as the GPU graph uses it (WanVaceToVideo's `reference_image`; no `first_frame_url`, which would pin frame 0 where the GPU doesn't: *the first build of 2026-11-01 sent it as `first_frame_url`, the way Shorts does*), frames and rate matched; the clip's own sound goes back on the joined result. $0.10 per video second at 720p ($0.075 at 580p, $0.05 at 480p), frames ÷ 16, plus each direction frame's edit. *(Until 2026-11-01 the cloud ran `fal-ai/ltx-2.3-22b/video-to-video` at `video_strength` 1 − denoise: a different model, and it took no images.)*
- **Direction:** an LLM writes it from the references and the user's few words (Claude in the cloud, Ollama with a vision model on the GPU; up to 8 / 4 references and a frame of the clip are sent), as a description of the finished video; without one (no key, Ollama not running, demo mode, the text model switched off) Fuobe's offline writer builds it from the intensity, the words and the number of references.
- **Unverified:** nothing rendered; the denoise values on the GPU, and in the cloud how far the direction frame plus depth carries each change level; fal's `preprocess` on an RGB clip; Lightx2v's 4-step LoRA at these start levels (it was distilled on the full-noise schedule, σ 1 → 0.94 → 0.83 → 0.63), and whether low (σ 0.45) changes enough to be seen.
- **Licences:** Wan 2.2 Fun VACE, lightx2v, Qwen-Image-Edit 2511 Apache-2.0; Qwen-Image 2.1 (the GPU's direction frame) non-commercial
diff --git a/scripts/gen-cloud-models.py b/scripts/gen-cloud-models.py
index 1563714f..f86398d9 100644
--- a/scripts/gen-cloud-models.py
+++ b/scripts/gen-cloud-models.py
@@ -680,15 +680,17 @@ model("fuobe-shorts", "Fuobe Shorts", "Fuobe Original", "fuobe-shorts", "video",
api_defaults=SHORTS_O["cloud"]["defaults"], defaults={"resolution": "720p"}, licence=SHORTS_O["licence"])
# ----- Originals (O13): Fuobe Evolution's cloud half (research §8 evolution → studios[evolution].original.cloud): fal's
# hosted Wan 2.2 Fun VACE depth, the GPU recipe's own model (the owner's call of 2026-10-30; LTX-2.3 video-to-video until
-# 2026-11-01). Like Fuobe Shorts: the piece as video_url (preprocess on, fal derives the depth), its direction frame
-# (hosted Qwen-Image-Edit 2511, planned by src/lib/catalog/evolution.ts) as first_frame_url only (no VACE subject
-# references: `images` is dropped), frames and rate matched to the piece, no aspect ratio asked (the clip keeps its shape).
+# 2026-11-01). The piece as video_url (preprocess on, fal derives the depth), its direction frame (hosted
+# Qwen-Image-Edit 2511, planned by src/lib/catalog/evolution.ts) as the VACE reference, ref_image_urls, the way the GPU
+# graph feeds it to WanVaceToVideo's reference_image (`image`, fal's first_frame_url, is dropped: the GPU pins no first
+# frame; research studios[evolution].original.cloud.frameRole), frames and rate matched to the piece, no aspect ratio
+# asked (the clip keeps its shape).
# The endpoint has no strength field: the change level reaches the direction frame's instruction only. Silent: the clip's
# own sound goes back on.
EVOLUTION = next(s for s in ORIGINALS["studios"] if s["id"] == "evolution")["original"]["cloud"]
model("fuobe-evolution", "Fuobe Evolution", "Fuobe Original", "fuobe-evolution", "video",
"Takes your clip further in a direction an LLM writes from your references: a direction frame per piece carried through it by depth (Wan 2.2 Fun VACE)",
- [("v2v", EVOLUTION["endpoint"], "fal", {"drop": ["aspectRatio", "images"], "fixed": EVOLUTION["fixed"]})],
+ [("v2v", EVOLUTION["endpoint"], "fal", {"drop": ["aspectRatio", "image"], "fixed": EVOLUTION["fixed"]})],
original=True, fit_values=True, pricing=("second", 0.1, f"720p; 580p $0.075, 480p $0.05 · {_FRAMES16}; each direction frame's Qwen edit is priced on its own",
{"byResolution": {"720p": 0.1, "580p": 0.075, "480p": 0.05}}),
options={"resolutions": EVOLUTION["resolutions"]}, api_defaults=EVOLUTION["defaults"], defaults={"resolution": "720p"},
diff --git a/src/components/studio/composer.tsx b/src/components/studio/composer.tsx
index e9252146..53a6bb8a 100644
--- a/src/components/studio/composer.tsx
+++ b/src/components/studio/composer.tsx
@@ -277,7 +277,8 @@ export function Composer({ docked }: { docked: boolean }) {
// The day a launch price is read on: the browser's, once hydrated (none while the page prerenders: no price shown then).
const today = useToday();
// Upscale hub: the attached clip's header (length, size, frame rate). Its length prices per-second tools and
- // travels with the request (params.sourceDuration); a clip swapped since a Reuse never keeps the old one's.
+ // travels with the request (params.sourceDuration), with its rate for a route billed by frames (params.sourceFps);
+ // a clip swapped since a Reuse never keeps the old one's.
const facts = useClipFacts(config.clipFacts && !typed.slots.video?.uploading ? typed.slots.video?.ref : undefined).data;
// Lipsync: a talking avatar is as long as its voice (the voice's header prices it and goes with the request); not while a
// video is attached (lip re-sync keeps the clip's length).
@@ -286,11 +287,11 @@ export function Composer({ docked }: { docked: boolean }) {
const draft = useMemo(
() =>
config.clipFacts
- ? { ...typed, params: { ...typed.params, sourceDuration: typed.slots.video?.ref ? facts?.duration : undefined } }
+ ? { ...typed, params: { ...typed.params, sourceDuration: typed.slots.video?.ref ? facts?.duration : undefined, sourceFps: typed.slots.video?.ref ? facts?.fps : undefined } }
: config.voiceFacts
? { ...typed, params: { ...typed.params, sourceDuration: voiceRef ? voice?.duration : undefined } }
: typed,
- [config.clipFacts, config.voiceFacts, typed, facts?.duration, voiceRef, voice?.duration],
+ [config.clipFacts, config.voiceFacts, typed, facts?.duration, facts?.fps, voiceRef, voice?.duration],
);
const liveElements = useElements().data;
const elements = (hydrated && liveElements) || EMPTY;
diff --git a/src/lib/catalog/clip-windows.ts b/src/lib/catalog/clip-windows.ts
index 74504aec..99e3cb81 100644
--- a/src/lib/catalog/clip-windows.ts
+++ b/src/lib/catalog/clip-windows.ts
@@ -18,14 +18,50 @@ export function sourceSeconds(modelId: string): { min?: number; max?: number } {
return SOURCE_SECONDS[modelId] ?? {};
}
+/**
+ * Cloud clip edits that keep every frame of a clip sent whole (Edit video, an API call): fal's Wan 2.2 Fun VACE depth
+ * route (Fuobe Shorts, Evolution and Genjutsu Restyle in the cloud, match_input_num_frames on) takes 17–241 frames and
+ * bills them ÷ 16 as "video seconds"; a clip whose rate isn't known counts as 30 fps (the fastest it works unhalved).
+ * Their studios cut their own pieces (src/lib/catalog/shorts.ts) and say the seconds they bill. Cloud only: the GPU
+ * graphs load the clip at 16 fps and keep to their own frame caps.
+ */
+const VACE_FRAMES = { minFrames: 17, maxFrames: 241, billFps: 16, assumeFps: 30 } as const;
+type FrameWindow = { minFrames: number; maxFrames: number; billFps: number; assumeFps: number; studio: string };
+const SOURCE_FRAMES: Record<string, FrameWindow> = {
+ "fuobe-shorts": { ...VACE_FRAMES, studio: "Shorts" },
+ "fuobe-evolution": { ...VACE_FRAMES, studio: "Video tools → Evolution" },
+ "fuobe-genjutsu-restyle": { ...VACE_FRAMES, studio: "Genjutsu" },
+};
+
+/** The frame window and billing of a cloud clip edit that is billed by its frames, or undefined. */
+export function sourceFrames(modelId: string, engine?: string): FrameWindow | undefined {
+ return engine === "open" ? undefined : SOURCE_FRAMES[modelId];
+}
+
+/** The seconds a clip `seconds` long is billed for: its frames ÷ 16 on a frame-billed route, else its seconds. */
+export function billedClipSeconds(modelId: string, seconds: number, fps?: number, engine?: string): number {
+ const f = sourceFrames(modelId, engine);
+ if (!f) return seconds;
+ return Math.round(((seconds * (fps && fps > 0 ? fps : f.assumeFps)) / f.billFps) * 1e6) / 1e6;
+}
+
const secs = (n: number) => `${Math.round(n * 10) / 10} s`;
/**
* Why a clip `seconds` long is outside the model's window, in Generate's words ("Happy Horse Video Edit takes 3–15 s
* clips, and this one is 40 s: trim it first"), or null. A header's length can run a frame or so past the cut that
- * made it, so a few hundredths over are let through.
+ * made it, so a few hundredths over are let through. A frame-billed cloud route counts the clip's frames at its rate
+ * (`fps`, 30 when not known).
*/
-export function clipWindowProblem(model: { id: string; name: string }, seconds: number): string | null {
+export function clipWindowProblem(model: { id: string; name: string; engine?: string }, seconds: number, fps?: number): string | null {
+ const f = sourceFrames(model.id, model.engine);
+ if (f) {
+ const rate = fps && fps > 0 ? fps : f.assumeFps;
+ const frames = Math.round(seconds * rate);
+ const at = `${Math.round(rate * 100) / 100} fps`;
+ if (frames > f.maxFrames) return `${model.name} in the cloud takes up to ${f.maxFrames} frames (${secs(f.maxFrames / rate)} at ${at}), and this clip is ${secs(seconds)}: trim it first, or use ${f.studio}, which cuts a long clip into pieces`;
+ if (frames < f.minFrames) return `${model.name} in the cloud needs at least ${f.minFrames} frames (${secs(f.minFrames / rate)} at ${at}), and this clip is ${secs(seconds)}: use a longer one`;
+ }
const { min, max } = sourceSeconds(model.id);
const long = max !== undefined && seconds > max + 0.05;
const short = min !== undefined && seconds < min - 0.05;
diff --git a/src/lib/catalog/cloud-models.generated.ts b/src/lib/catalog/cloud-models.generated.ts
index 0001c864..c08293eb 100644
--- a/src/lib/catalog/cloud-models.generated.ts
+++ b/src/lib/catalog/cloud-models.generated.ts
@@ -19529,7 +19529,7 @@ export const ORIGINAL_CLOUD: ModelDef[] = [
"endpoint": "fal-ai/wan-22-vace-fun-a14b/depth",
"map": {
"negativePrompt": "negative_prompt",
- "image": "first_frame_url",
+ "images": "ref_image_urls",
"video": "video_url",
"seed": "seed",
"fps": "frames_per_second",
@@ -19562,7 +19562,7 @@ export const ORIGINAL_CLOUD: ModelDef[] = [
"580p",
"720p"
],
- "maxImages": 1
+ "maxImages": 4
},
"licence": {
"licence": "Apache-2.0",
diff --git a/src/lib/catalog/evolution.ts b/src/lib/catalog/evolution.ts
index c48d10fc..a982892d 100644
--- a/src/lib/catalog/evolution.ts
+++ b/src/lib/catalog/evolution.ts
@@ -10,7 +10,8 @@
* (video-evolution-wan22-fun-vace, which also loads a whole clip at 16 fps when Edit video sends one).
* - In the cloud: the same model hosted on fal (Wan 2.2 Fun VACE depth), the way Fuobe Shorts runs it. Per piece of up to
* 10 s (241 frames as fal works them), hosted Qwen-Image-Edit 2511 takes the piece's first frame toward the direction
- * (the first references as images 2–4), and VACE carries that frame through the piece by its depth. The endpoint has
+ * (the first references as images 2–4), and VACE re-renders the piece by its depth with that frame as its reference
+ * (ref_image_urls, as the GPU graph's reference_image; no first frame pinned, as on the GPU). The endpoint has
* no strength field, so the change level reaches the direction frame only: how much of the clip's own look stays
* (the GPU's denoise) is set on your GPU only (EVOLUTION_CLOUD_NOTE).
* - Then the pieces are joined and the clip's own sound put back.
@@ -84,6 +85,9 @@ export const EVOLUTION_CLOUD_NOTE = "In the cloud the change level shapes each p
export const EVOLUTION_RESOLUTIONS: Record<Engine, string[]> = { open: ["480p", "720p"], cloud: ["480p", "580p", "720p"] };
export const EVOLUTION_DEFAULT_RESOLUTION: Record<Engine, string> = { open: "480p", cloud: "720p" };
+/** The resolutions an engine offers, as a choice: "480p, 580p or 720p". */
+export const resolutionChoices = (engine: Engine): string => EVOLUTION_RESOLUTIONS[engine].join(", ").replace(/, ([^,]*)$/, " or $1");
+
/** The cloud's pieces: Fuobe Shorts' (at most 10 s and 241 frames as fal's VACE works them, by the clip's rate). */
export function cloudPieces(range: ShortsRange, fps?: number) {
return planCloudSegments(range, originalSegmentSeconds(fps));
@@ -117,7 +121,7 @@ export function evolutionProblem(o: { engine: Engine; source: Pick<EvolutionSour
if (r) return r;
if (o.references > EVOLUTION.maxReferences) return `Use up to ${EVOLUTION.maxReferences} references`;
if ((o.direction?.length ?? 0) > EVOLUTION.maxDirectionChars) return `Keep the direction under ${EVOLUTION.maxDirectionChars.toLocaleString("en")} characters`;
- if (o.resolution && !EVOLUTION_RESOLUTIONS[o.engine].includes(o.resolution)) return `${o.resolution} isn't offered ${o.engine === "open" ? "on your GPU" : "in the cloud"} — pick ${EVOLUTION_RESOLUTIONS[o.engine].join(", ").replace(/, ([^,]*)$/, " or $1")}`;
+ if (o.resolution && !EVOLUTION_RESOLUTIONS[o.engine].includes(o.resolution)) return `${o.resolution} isn't offered ${o.engine === "open" ? "on your GPU" : "in the cloud"} — pick ${resolutionChoices(o.engine)}`;
// fal's VACE refuses a piece under 17 frames or a clip under 5 fps: said before the cuts and frames are paid for.
if (o.engine === "cloud") return cloudPieces(o.range, o.source.fps).map((p) => originalSegmentProblem(p.end - p.start, o.source.fps)).find(Boolean) ?? null;
return null;
@@ -250,8 +254,8 @@ const pieceLabel = (i: number, n: number, what: string) => ({ label: n > 1 ? `Pi
/**
* The whole job. GPU: per segment, cut it (16 fps), take its first frame toward the direction, evolve it from itself
* at the intensity's denoise. Cloud: per piece of up to 10 s, cut it (unless it is the whole clip), take its first frame
- * toward the direction on hosted Qwen-Image-Edit 2511, and carry that frame through the piece by depth on fal's Wan 2.2
- * Fun VACE, frames and rate kept (billed on frames ÷ 16). Then join and put the sound back.
+ * toward the direction on hosted Qwen-Image-Edit 2511, and re-render the piece by its depth on fal's Wan 2.2 Fun VACE
+ * with that frame as its reference, frames and rate kept (billed on frames ÷ 16). Then join and put the sound back.
*/
export function planEvolution(input: EvolutionPlanInput): EvolutionPlan {
const { engine } = input;
diff --git a/src/lib/catalog/models.ts b/src/lib/catalog/models.ts
index fde0c689..66629fa0 100644
--- a/src/lib/catalog/models.ts
+++ b/src/lib/catalog/models.ts
@@ -2051,9 +2051,11 @@ const originals: ModelDef[] = [
imageLabels: ["direction frame (optional: the clip's first frame as it should look)"],
},
}),
- defaults: { duration: 5, resolution: EVOLUTION_DEFAULT_RESOLUTION.cloud },
+ // The cloud half renders the clip's own frames (match_input_num_frames) and is priced on them (clip-windows.ts):
+ // only the GPU half asks for a length.
+ defaults: { resolution: EVOLUTION_DEFAULT_RESOLUTION.cloud },
engineNote: "Both engines run Wan 2.2 Fun VACE with a direction frame per segment; in the cloud the change level shapes the direction frame only, and how much of the clip's own look stays is set on your GPU only",
- engineDefaults: { open: { resolution: EVOLUTION_DEFAULT_RESOLUTION.open, aspectRatio: "auto" } },
+ engineDefaults: { open: { resolution: EVOLUTION_DEFAULT_RESOLUTION.open, aspectRatio: "auto", duration: 5 } },
engineOptions: {
open: {
aspectRatios: ["auto", ...VID_AR],
diff --git a/src/lib/catalog/plan.ts b/src/lib/catalog/plan.ts
index 3e6f67d3..f54551ad 100644
--- a/src/lib/catalog/plan.ts
+++ b/src/lib/catalog/plan.ts
@@ -10,7 +10,7 @@ import type {
Preset,
PresetRoute,
} from "./types";
-import { sourceSeconds } from "./clip-windows";
+import { billedClipSeconds, sourceSeconds } from "./clip-windows";
import { chainGapProblem, chainTiming, FIRST_AT_ZERO, frameTimes, keyframeChain, MAX_KEYFRAMES, spread } from "./keyframes";
import { cloudPath, fitLoras, gated, localOnly, loraCapacity, needsToken, routeLoraField, triggerOf } from "./loras";
import { anglesPrompt, anglesWords, ANGLES_ORIGINAL } from "./open-tools";
@@ -702,15 +702,17 @@ const CLIP_LENGTH_OPS = new Set<Operation>(["upscale-video", "interpolate", "sdr
/**
* The seconds a clip edit that keeps the clip's length is billed for (Happy Horse, Runway Aleph, Lucy Edit, Kling O3 4K
* edit…: a v2v model with no length to ask for): the clip's (params.sourceDuration, when the caller knows it), up to the
- * most its window takes (./clip-windows). Undefined for a model asked for a length, or when the clip's length isn't known.
+ * most its window takes (./clip-windows), or its frames ÷ 16 on fal's Wan 2.2 Fun VACE (params.sourceFps; 30 fps when
+ * not known). Undefined for a model asked for a length, or when the clip's length isn't known.
*/
-export function clipEditSeconds(model: Pick<ModelDef, "id" | "options" | "routes">, params: Pick<GenParams, "sourceDuration">, op?: Operation): number | undefined {
+export function clipEditSeconds(model: Pick<ModelDef, "id" | "options" | "routes"> & Partial<Pick<ModelDef, "engine">>, params: Pick<GenParams, "sourceDuration" | "sourceFps">, op?: Operation): number | undefined {
const seconds = params.sourceDuration;
if (op !== "v2v" || !seconds || !(seconds > 0) || model.options.durations?.length) return undefined;
const routes = model.routes.filter((r) => r.op === "v2v");
if (!routes.length || routes.some((r) => r.map?.duration)) return undefined;
const max = sourceSeconds(model.id).max;
- return max !== undefined ? Math.min(seconds, max) : seconds;
+ // fal's Wan 2.2 Fun VACE bills a clip's frames ÷ 16 (a 30 fps clip about 1.9× its length): clip-windows.ts.
+ return billedClipSeconds(model.id, max !== undefined ? Math.min(seconds, max) : seconds, params.sourceFps, model.engine);
}
/**
diff --git a/src/lib/catalog/types.ts b/src/lib/catalog/types.ts
index 412de736..a8ae8248 100644
--- a/src/lib/catalog/types.ts
+++ b/src/lib/catalog/types.ts
@@ -790,6 +790,11 @@ export interface GenParams {
* many frames a frame-count route renders (LTX 2.3 clean plate / HDR, VOID; FieldMap.numFrames).
*/
sourceDuration?: number;
+ /**
+ * The input clip's frame rate, when the caller knows it: what a clip edit billed by its frames costs (fal's Wan 2.2
+ * Fun VACE bills frames ÷ 16; src/lib/catalog/clip-windows.ts). The server's header read wins over it.
+ */
+ sourceFps?: number;
/** Extract every Nth frame. */
frameInterval?: number;
/** Frame interpolation: the frame rate to reach, and a slow-motion factor (1–8; 2 = twice as long). */
diff --git a/src/lib/composer.ts b/src/lib/composer.ts
index 22490cdf..482c5ba9 100644
--- a/src/lib/composer.ts
+++ b/src/lib/composer.ts
@@ -284,7 +284,7 @@ export function clipBlocker(
model: (Pick<ModelDef, "engine" | "options" | "defaults"> & Partial<Pick<ModelDef, "id" | "name">>) | undefined,
ramBytes: number | undefined,
): string | null {
- if (op === "v2v" && model?.id && facts?.duration) return clipWindowProblem({ id: model.id, name: model.name ?? model.id }, facts.duration);
+ if (op === "v2v" && model?.id && facts?.duration) return clipWindowProblem({ id: model.id, name: model.name ?? model.id, engine: model.engine }, facts.duration, facts.fps);
if (!facts?.width || !facts.height || !model) return null;
if (op === "upscale-video") {
const tier = upscaleTier(params.resolution ?? model.defaults?.resolution, model.options.resolutions, { width: facts.width, height: facts.height }, params.resolution !== undefined);
diff --git a/src/server/evolution.ts b/src/server/evolution.ts
index 8ae8bf4c..4d00dae1 100644
--- a/src/server/evolution.ts
+++ b/src/server/evolution.ts
@@ -6,17 +6,19 @@ import {
DIRECTION_SYSTEM,
directionRequest,
EVOLUTION,
+ EVOLUTION_CLOUD_NOTE,
EVOLUTION_DEFAULT_RESOLUTION,
EVOLUTION_RESOLUTIONS,
evolutionProblem,
evolutionTitle,
offlineDirection,
planEvolution,
+ resolutionChoices,
tidyDirection,
type EvolutionPlanInput,
type Intensity,
} from "@/lib/catalog/evolution";
-import type { PlanStep } from "@/lib/catalog/shorts";
+import { SHORTS, vaceDownsample, type PlanStep } from "@/lib/catalog/shorts";
import type { Engine, Generation } from "@/lib/catalog/types";
import { ACCESS_PLACE } from "@/lib/model-access";
import { createPipeline } from "./chains";
@@ -187,8 +189,13 @@ function planInput(body: z.infer<typeof EvolutionBodySchema>, info: Awaited<Retu
notes.push("Needs a 24 GB GPU · Wan 2.2 Fun VACE is Apache-2.0; Qwen-Image 2.1's weights are non-commercial");
} else {
const k = Math.min(n, EVOLUTION.cloudReferences);
- notes.push(`${name} runs the GPU's model hosted on fal: each ≤10 s piece's first frame is taken toward the direction by Qwen-Image-Edit 2511${n ? ` with your first ${k === 1 ? "reference" : `${k} references`}` : ""}, then Wan 2.2 Fun VACE carries it through the piece by depth, in your clip's shape`);
+ notes.push(`${name} runs the GPU's model hosted on fal: each ≤10 s piece's first frame is taken toward the direction by Qwen-Image-Edit 2511${n ? ` with your first ${k === 1 ? "reference" : `${k} references`}` : ""}, then Wan 2.2 Fun VACE re-renders the piece by its depth with that frame as its reference, in your clip's shape`);
if (n > EVOLUTION.cloudReferences) notes.push(`The other ${n - EVOLUTION.cloudReferences} reference${n - EVOLUTION.cloudReferences > 1 ? "s" : ""} shape the direction only`);
+ notes.push(EVOLUTION_CLOUD_NOTE);
+ // fal bills frames ÷ 16 as video seconds; a clip above 30 fps is worked at a fraction of its rate (as in Shorts).
+ const fps = source.fps;
+ if (fps && fps > SHORTS.original.billFps + 0.5) notes.push(`fal bills this clip's ${Math.round(fps)} fps as ${(fps / SHORTS.original.billFps).toFixed(1)}× its length (video seconds at ${SHORTS.original.billFps} fps)`);
+ if (vaceDownsample(fps)) notes.push(`Wan 2.2 Fun VACE works this ${Math.round(fps!)} fps clip at ${Math.round(fps! / (vaceDownsample(fps) + 1))} fps and brings it back to its own rate`);
notes.push("Wan 2.2 Fun VACE and Qwen-Image-Edit 2511 are Apache-2.0 (information, Settings → Models & licences)");
}
if (source.hasAudio) notes.push("Your clip's own sound is put back on the result");
@@ -265,7 +272,7 @@ export function estimateEvolution(body: z.infer<typeof EvolutionEstimateSchema>)
export async function createEvolution(body: z.infer<typeof EvolutionBodySchema>): Promise<{ final: Generation; items: Generation[]; direction: string; by: DirectionAnswer["by"] | "you" }> {
mustMatchMode(body.engine);
mustBeOffered(body.engine);
- if (body.resolution && !EVOLUTION_RESOLUTIONS[body.engine].includes(body.resolution)) throw new ShortsError(`Pick ${EVOLUTION_RESOLUTIONS[body.engine].join(" or ")}`, 422);
+ if (body.resolution && !EVOLUTION_RESOLUTIONS[body.engine].includes(body.resolution)) throw new ShortsError(`Pick ${resolutionChoices(body.engine)}`, 422);
const info = await probeSource(body.source.url);
let direction = body.direction?.trim() ?? "";
let by: DirectionAnswer["by"] | "you" = "you";
diff --git a/src/server/generations.ts b/src/server/generations.ts
index 8669cf96..ce434535 100644
--- a/src/server/generations.ts
+++ b/src/server/generations.ts
@@ -12,7 +12,7 @@ import { cueText, type Cue } from "@/lib/cues";
import { HELPER_FEATURES, HELPER_SUFFIX, isReviewStatus, type AssetUse, type ReviewFilter } from "@/lib/library";
import { upscaleTier } from "@/lib/av/upscale";
import { chainedWaitMessage, framesWait, keyframeChain } from "@/lib/catalog/keyframes";
-import { clipWindowProblem } from "@/lib/catalog/clip-windows";
+import { clipWindowProblem, sourceFrames } from "@/lib/catalog/clip-windows";
import { avatarSeconds, clipEditSeconds, estimateCost, inferOperation, movedAppRequest, planGeneration, presetRoute, routeLoras, routesFor, withoutTriggers } from "@/lib/catalog/plan";
import { framedLength, keepMatte } from "@/lib/catalog/payload";
import { fitLoras, loraName, lorasFit } from "@/lib/catalog/loras";
@@ -1568,12 +1568,14 @@ async function submitNow(
}
// A clip edit of a clip sent as it is (Edit video, an API call; the studios that cut clips keep to the windows
// themselves): one outside the model's window is refused before it's paid for (Happy Horse bills 60 s and returns
- // 15), and one that keeps the clip's length is priced for it once the header is read (a call that didn't say).
+ // 15; fal's Wan 2.2 Fun VACE takes at most 241 frames), and one that keeps the clip's length is priced for it once
+ // the header is read (a call that didn't say). A route billed by frames is priced on the header's rate as well.
if (plan.op === "v2v" && input.sourceDuration && !req.chain?.length && req.params?.duration === undefined && providerId !== "mock" && plan.model.engine !== "open") {
- const problem = clipWindowProblem(plan.model, input.sourceDuration);
+ const problem = clipWindowProblem(plan.model, input.sourceDuration, input.sourceFps);
if (problem) throw new Error(problem);
- if (plan.params.sourceDuration === undefined && clipEditSeconds(plan.model, input, plan.op) !== undefined) {
- update(id, { cost_usd: estimateCost(plan.model, { ...plan.params, sourceDuration: input.sourceDuration }, 1, plan.op, plan.loras.length > 0 && !!route.loraEndpoint) });
+ const byFrames = !!sourceFrames(plan.model.id, plan.model.engine) && source.sourceFps !== undefined && source.sourceFps !== plan.params.sourceFps;
+ if ((plan.params.sourceDuration === undefined || byFrames) && clipEditSeconds(plan.model, input, plan.op) !== undefined) {
+ update(id, { cost_usd: estimateCost(plan.model, { ...plan.params, sourceDuration: input.sourceDuration, sourceFps: input.sourceFps }, 1, plan.op, plan.loras.length > 0 && !!route.loraEndpoint) });
}
}
// An upscale that wouldn't enlarge the clip (a 1080p clip at a default 1080p; a 4K clip would even shrink):
diff --git a/src/server/request-schema.ts b/src/server/request-schema.ts
index 87016c5f..a99ad18d 100644
--- a/src/server/request-schema.ts
+++ b/src/server/request-schema.ts
@@ -88,6 +88,7 @@ export const GenerationRequestSchema = z.object({
easing: z.enum(["linear", "ease-in-out"]).optional(),
crossfade: z.number().min(0).max(30).optional(),
sourceDuration: z.number().positive().max(36_000).optional(),
+ sourceFps: z.number().positive().max(1000).optional(),
frameInterval: z.number().int().min(1).max(10_000).optional(),
targetFps: z.number().positive().max(240).optional(),
slowdown: z.number().min(1).max(8).optional(),
diff --git a/tests/e2e/popcorn-evolution.mjs b/tests/e2e/popcorn-evolution.mjs
index 52ffe870..8ceec3de 100644
--- a/tests/e2e/popcorn-evolution.mjs
+++ b/tests/e2e/popcorn-evolution.mjs
@@ -84,7 +84,7 @@ try {
await page.waitForFunction(() => /Placeholder · free|≈ \$|Free/.test(document.body.innerText), null, { timeout: 30_000 }).catch(() => {});
check(`${tag}: the price before it runs (a demo here)`, /Placeholder · free/.test(await text()) && /Fuobe Evolution · \d+(\.\d+)? s · 720p/.test(await text()));
// The cloud runs the GPU's model hosted on fal, never a substitute, and says in one line what the GPU keeps.
- check(`${tag}: cloud: Wan 2.2 Fun VACE hosted on fal, no LTX-2.3`, /runs the GPU's model hosted on fal/.test(await text()) && /Wan 2\.2 Fun VACE carries it through the piece/.test(await text()) && !/LTX/.test(await text()));
+ check(`${tag}: cloud: Wan 2.2 Fun VACE hosted on fal, no LTX-2.3`, /runs the GPU's model hosted on fal/.test(await text()) && /Wan 2\.2 Fun VACE re-renders the piece by its depth with that frame as its reference/.test(await text()) && !/LTX/.test(await text()));
check(`${tag}: cloud: one line says the change level's limit`, /In the cloud the change level shapes each piece's direction frame; how much of the clip's own look stays is set on your GPU only/.test(await text()));
check(`${tag}: cloud: the references reach each piece's direction frame`, /In the cloud the first 3 also go into each piece's direction frame/.test(await text()));
check(`${tag}: cloud: 480p, 580p or 720p`, (await page.getByRole("radiogroup", { name: "Resolution" }).getByRole("radio").allInnerTexts()).join("|") === "480p|580p|720p");
diff --git a/tests/edit-video-pricing.test.ts b/tests/edit-video-pricing.test.ts
index c6a383df..ef2f2407 100644
--- a/tests/edit-video-pricing.test.ts
+++ b/tests/edit-video-pricing.test.ts
@@ -21,6 +21,7 @@ const { getModel } = await import("@/lib/catalog");
const { estimateCost } = await import("@/lib/catalog/plan");
const { clipBlocker } = await import("@/lib/composer");
const { VIDEO_EDIT_STUDIO } = await import("@/lib/studios");
+const { onEngine } = await import("@/lib/catalog/engines");
const sleep = (ms: number) => new Promise((r) => setTimeout(r, ms));
@@ -90,6 +91,28 @@ describe("Edit video: clip edits priced on the clip, inside the model's window",
expect(clipBlocker("v2v", facts(40), {}, getModel("lucy-edit-pro")!, undefined)).toBeNull();
});
+ it("fal's Wan 2.2 Fun VACE (Fuobe Evolution, Shorts and Genjutsu Restyle in the cloud) is priced on the clip's frames ÷ 16 and held to 241 frames", () => {
+ const evo = onEngine(getModel("fuobe-evolution")!, "cloud");
+ const shorts = onEngine(getModel("fuobe-shorts")!, "cloud");
+ // $0.10 a video second at 720p: 20 s at 30 fps = 600 frames = 37.5 video seconds; at 16 fps 20.
+ expect(estimateCost(evo, { resolution: "720p", sourceDuration: 8, sourceFps: 30 }, 1, "v2v")).toBeCloseTo(1.5, 5);
+ expect(estimateCost(evo, { resolution: "720p", sourceDuration: 8, sourceFps: 16 }, 1, "v2v")).toBeCloseTo(0.8, 5);
+ expect(estimateCost(shorts, { resolution: "720p", sourceDuration: 4, sourceFps: 24 }, 1, "v2v")).toBeCloseTo(0.6, 5);
+ // A studio that says the seconds it bills keeps them.
+ expect(estimateCost(evo, { resolution: "720p", duration: 15, sourceDuration: 8 }, 1, "v2v")).toBeCloseTo(1.5, 5);
+ const facts = (duration: number, fps?: number) => ({ width: 1280, height: 720, fps, duration });
+ expect(clipBlocker("v2v", facts(8, 30), {}, evo, undefined)).toBeNull();
+ expect(clipBlocker("v2v", facts(20, 30), {}, evo, undefined)).toBe(
+ "Fuobe Evolution in the cloud takes up to 241 frames (8 s at 30 fps), and this clip is 20 s: trim it first, or use Video tools → Evolution, which cuts a long clip into pieces",
+ );
+ expect(clipBlocker("v2v", facts(14, 16), {}, evo, undefined)).toBeNull();
+ expect(clipBlocker("v2v", facts(0.4, 30), {}, shorts, undefined)).toMatch(/^Fuobe Shorts in the cloud needs at least 17 frames/);
+ // Unknown rate: counted as 30 fps.
+ expect(clipBlocker("v2v", facts(9), {}, evo, undefined)).toMatch(/takes up to 241 frames/);
+ // On your GPU the graph loads the clip at 16 fps and keeps to its own frame cap: no cloud window there.
+ expect(clipBlocker("v2v", facts(20, 30), {}, onEngine(getModel("fuobe-evolution")!, "open"), undefined)).toBeNull();
+ });
+
it("the server prices an API call for the clip once it reads the header, and refuses one outside the window before fal is asked", async () => {
setSetting("falKey", "fal_test_key_123456");
const real = globalThis.fetch;
@@ -116,6 +139,19 @@ describe("Edit video: clip edits priced on the clip, inside the model's window",
for (let i = 0; i < 200 && getGeneration(long.id)!.status !== "failed"; i++) await sleep(25);
expect(getGeneration(long.id)).toMatchObject({ status: "failed", error: expect.stringMatching(/takes 3–15 s clips, and this one is 40 s/) });
expect(asked.filter((u) => u.includes("happy-horse"))).toEqual([]);
+ // Fuobe Evolution in the cloud: no length asked, so the 5 s guess, then the clip's frames once the header is read
+ // (this header has no rate: 6 s counted at 30 fps = 11.25 video seconds × $0.10).
+ const [evo] = createGenerations({ feature: "video-edit", modelId: "fuobe-evolution", engine: "cloud", prompt: "a night market", inputs: { video: clip(6) }, params: { resolution: "720p" } });
+ expect(evo.costUsd).toBeCloseTo(0.5, 5);
+ for (let i = 0; i < 200 && getGeneration(evo.id)!.costUsd !== 1.125; i++) await sleep(25);
+ expect(getGeneration(evo.id)!.costUsd).toBeCloseTo(1.125, 5);
+ db().prepare("UPDATE generations SET status = 'canceled' WHERE id = ?").run(evo.id);
+ // 20 s: more than the 241 frames fal's VACE takes, refused before anything goes to fal.
+ asked.length = 0;
+ const [over] = createGenerations({ feature: "video-edit", modelId: "fuobe-evolution", engine: "cloud", prompt: "a night market", inputs: { video: clip(20) }, params: { resolution: "720p" } });
+ for (let i = 0; i < 200 && getGeneration(over.id)!.status !== "failed"; i++) await sleep(25);
+ expect(getGeneration(over.id)).toMatchObject({ status: "failed", error: expect.stringMatching(/takes up to 241 frames .* this clip is 20 s/) });
+ expect(asked.filter((u) => u.includes("wan-22-vace"))).toEqual([]);
} finally {
globalThis.fetch = real;
fal.prepareFile = upload;
diff --git a/tests/evolution-api.test.ts b/tests/evolution-api.test.ts
index 140adaea..d13c68da 100644
--- a/tests/evolution-api.test.ts
+++ b/tests/evolution-api.test.ts
@@ -60,9 +60,18 @@ describe("Evolution: estimates", () => {
expect(cloud).toMatchObject({ modelName: "Fuobe Evolution", engine: "cloud", resolution: "720p", pieces: 2, seconds: 12, demo: true });
expect(cloud.notes.join(" ")).toMatch(/runs the GPU's model hosted on fal: each ≤10 s piece's first frame is taken toward the direction by Qwen-Image-Edit 2511 with your first reference, then Wan 2\.2 Fun VACE/);
expect(cloud.notes.join(" ")).not.toMatch(/LTX/);
+ // What the cloud can't do of the GPU recipe, in the estimate too; a 16 fps clip is billed for its length.
+ const { EVOLUTION_CLOUD_NOTE } = await import("@/lib/catalog/evolution");
+ expect(cloud.notes).toContain(EVOLUTION_CLOUD_NOTE);
+ expect(cloud.notes.join(" ")).toMatch(/re-renders the piece by its depth with that frame as its reference/);
+ expect(cloud.notes.join(" ")).not.toMatch(/fal bills this clip/);
+ // A 30 fps clip: fal bills its frames ÷ 16, about 1.9× its length, and the estimate says so (as Shorts' does).
+ const fast = await (await estimateRoute.POST(json(body({ source: { url: clip, name: "walk.mp4", ...src, fps: 30 } })))).json();
+ expect(fast.notes).toContain("fal bills this clip's 30 fps as 1.9× its length (video seconds at 16 fps)");
const open = await (await estimateRoute.POST(json(body({ engine: "open" })))).json();
expect(open).toMatchObject({ engine: "open", resolution: "480p", pieces: 3, costUsd: 0 });
expect(open.notes.join(" ")).toMatch(/Qwen-Image 2.1 Turbo takes its first frame toward the direction with your first reference/);
+ expect(open.notes).not.toContain(EVOLUTION_CLOUD_NOTE);
});
describe("with a fal key (estimates submit nothing)", () => {
@@ -86,6 +95,9 @@ describe("Evolution: estimates", () => {
expect(await say(body({ range: { start: 0, end: 3 } }))).toBe("Select at least 4 seconds");
expect(await say(body({ engine: "open", resolution: "1080p" }))).toMatch(/isn't offered on your GPU/);
expect(await say(body({ resolution: "1080p" }))).toBe("1080p isn't offered in the cloud — pick 480p, 580p or 720p");
+ // Starting a run says the list the same way.
+ const pick = await createRoute.POST(json(body({ resolution: "1080p" })));
+ expect([pick.status, (await pick.json()).error]).toEqual([422, "Pick 480p, 580p or 720p"]);
expect(await say({ engine: "cloud" })).toBe("Add a clip and pick how much should change");
// Past the limits, the limit is said (not the schema's generic refusal), on every route.
expect(await say(body({ direction: "x".repeat(10_001) }))).toBe("Keep the direction under 10,000 characters");
diff --git a/tests/evolution.test.ts b/tests/evolution.test.ts
index bac72feb..dc9d89fd 100644
--- a/tests/evolution.test.ts
+++ b/tests/evolution.test.ts
@@ -54,7 +54,10 @@ describe("Fuobe Evolution: intensities", () => {
// The endpoint the generator reads has no strength field: the change level can't reach it (said in the cloud).
const schema = research.hostedBaseEndpoints.find((e: { endpoint: string }) => e.endpoint === evo.cloud.endpoint);
expect(Object.keys(schema.inputs).filter((k) => /strength|denoise/.test(k))).toEqual([]);
- expect(Object.keys(schema.inputs)).toEqual(expect.arrayContaining(["video_url", "first_frame_url", "preprocess", "match_input_num_frames"]));
+ expect(Object.keys(schema.inputs)).toEqual(expect.arrayContaining(["video_url", "ref_image_urls", "preprocess", "match_input_num_frames"]));
+ // The direction frame's role is the GPU graph's (WanVaceToVideo's reference_image), recorded with the choice.
+ expect(evo.cloud.video).toMatch(/ref_image_urls = \[the direction frame\].*no first_frame_url/);
+ expect(evo.cloud.frameRole).toMatch(/reference_image/);
});
});
@@ -86,7 +89,7 @@ describe("Fuobe Evolution: the model on both engines", () => {
expect(cloud.options.maxImages).toBe(1);
});
- it("the fal payload: the piece by its depth, the direction frame as the first frame, frames and rate kept; billed on frames ÷ 16", () => {
+ it("the fal payload: the piece by its depth, the direction frame as the VACE reference (as on the GPU), frames and rate kept; billed on frames ÷ 16", () => {
const cloud = onEngine(m, "cloud");
const p = planGeneration(
{ feature: "evolution", modelId: m.id, op: "v2v", prompt: "a night market", inputs: { video: "https://x/clip.mp4", images: ["https://x/frame.png"] }, params: { resolution: "720p", duration: 15 } },
@@ -98,13 +101,14 @@ describe("Fuobe Evolution: the model on both engines", () => {
expect(body).toMatchObject({
prompt: "a night market",
video_url: "https://x/clip.mp4",
- first_frame_url: "https://x/frame.png",
+ ref_image_urls: ["https://x/frame.png"],
resolution: "720p",
preprocess: true,
match_input_num_frames: true,
match_input_frames_per_second: true,
});
- expect(body).not.toHaveProperty("ref_image_urls");
+ // The GPU graph pins no first frame: the frame is VACE's reference there (video-evolution-wan22-fun-vace node 15).
+ expect(body).not.toHaveProperty("first_frame_url");
expect(body).not.toHaveProperty("aspect_ratio");
expect(body).not.toHaveProperty("video_strength");
// $0.10 a video second at 720p, $0.075 at 580p, $0.05 at 480p.
@@ -112,6 +116,34 @@ describe("Fuobe Evolution: the model on both engines", () => {
expect(estimateCost(cloud, { resolution: "480p", duration: 15 }, 1, "v2v")).toBeCloseTo(0.75, 5);
expect(estimateCost(onEngine(m, "open"), { resolution: "480p", duration: 5 }, 1, "v2v")).toBe(0);
});
+
+ it("mirrors the GPU graph: there the direction frame is WanVaceToVideo's reference image, with no first frame pinned", () => {
+ const graph = JSON.parse(fs.readFileSync(path.join(__dirname, "../workflows/comfyui/video-evolution-wan22-fun-vace.json"), "utf8"));
+ const vace = Object.values(graph as Record<string, { class_type: string; inputs: Record<string, unknown> }>).find((n) => n.class_type === "WanVaceToVideo")!;
+ const [scaled] = vace.inputs.reference_image as [string, number];
+ const [loaded] = graph[scaled].inputs.image as [string, number];
+ expect(graph[loaded]).toMatchObject({ class_type: "LoadImage", inputs: { image: "restyled_first_frame.png" } });
+ expect(vace.inputs).not.toHaveProperty("start_image");
+ const map = onEngine(m, "cloud").routes.find((r) => r.op === "v2v")!.map!;
+ expect(map.images).toBe("ref_image_urls");
+ expect(map.image).toBeUndefined();
+ });
+
+ it("a direct cloud run (Edit video, the API) asks no length: the clip's own frames are made and priced; the GPU keeps its 5 s default", () => {
+ const req = { feature: "video-edit", modelId: m.id, op: "v2v" as const, prompt: "a night market", inputs: { video: "https://x/clip.mp4" } };
+ const cloud = onEngine(m, "cloud");
+ const open = onEngine(m, "open");
+ expect(planGeneration(req, (id) => (id === m.id ? cloud : getModel(id)), getPreset).params.duration).toBeUndefined();
+ const withFrame = { ...req, inputs: { ...req.inputs, images: ["https://x/frame.png"] } };
+ expect(planGeneration(withFrame, (id) => (id === m.id ? open : getModel(id)), getPreset).params.duration).toBe(5);
+ expect(open.options.durations).toEqual([3, 4, 5]);
+ // frames ÷ 16 × $0.10 at 720p: 4 s at 30 fps = 7.5 video seconds; 8 s at 16 fps = 8; an unknown rate counts as 30 fps.
+ expect(estimateCost(cloud, { resolution: "720p", sourceDuration: 4, sourceFps: 30 }, 1, "v2v")).toBeCloseTo(0.75, 5);
+ expect(estimateCost(cloud, { resolution: "720p", sourceDuration: 8, sourceFps: 16 }, 1, "v2v")).toBeCloseTo(0.8, 5);
+ expect(estimateCost(cloud, { resolution: "480p", sourceDuration: 4 }, 1, "v2v")).toBeCloseTo(0.375, 5);
+ // The price follows the clip (it was a flat $0.50 whatever the clip).
+ expect(estimateCost(cloud, { resolution: "720p", sourceDuration: 2, sourceFps: 30 }, 1, "v2v")).not.toBe(estimateCost(cloud, { resolution: "720p", sourceDuration: 6, sourceFps: 30 }, 1, "v2v"));
+ });
});
describe("Fuobe Evolution: the plan", () => {