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 O11: Fuobe Angles, Fuobe Speak and the face mosaic in the catalog, provider and studios

Claudefb65f11d2f76
diff --git a/scripts/comfy/library.spec.mjs b/scripts/comfy/library.spec.mjs
index 4e2e2bdc..865e6745 100644
--- a/scripts/comfy/library.spec.mjs
+++ b/scripts/comfy/library.spec.mjs
@@ -1849,7 +1849,7 @@ export const SPEC = [
{
id: 'video-depth-vda-large',
- title: 'Video Depth Map (Video Depth Anything Large: Higgsfield Depth Map\'s model, non-commercial weights)',
+ title: 'Video Depth Map (Video Depth Anything Large, non-commercial weights)',
capability: 'depth-video',
handBuilt: 'hand-built/video-depth-vda-small.json',
transforms: [{ op: 'set', node: '3', input: 'model', value: 'video_depth_anything_vitl.pth' }],
diff --git a/scripts/eval/cases/speak.json b/scripts/eval/cases/speak.json
index cfbd20d1..32fea95b 100644
--- a/scripts/eval/cases/speak.json
+++ b/scripts/eval/cases/speak.json
@@ -2,7 +2,7 @@
"$schema": "./case.schema.json",
"suite": "speak",
"title": "Fuobe Speak · talking portraits",
- "description": "A portrait and a voice track you supply (local/speak/portrait.png of a consenting person, local/speak/voice.wav, 5–15 s of clear speech). Measures lip-sync (a mouth-motion / audio-envelope proxy; SyncNet when you install it, see the README), temporal consistency and identity against the portrait. O11 adds the InfiniteTalk 'Higgsfield-like defaults' preset and Wan 2.2 S2V route.",
+ "description": "A portrait and a voice track you supply (local/speak/portrait.png of a consenting person, local/speak/voice.wav, 5–15 s of clear speech). Measures lip-sync (a mouth-motion / audio-envelope proxy; SyncNet when you install it, see the README), temporal consistency and identity against the portrait. Fuobe Speak (O11) is InfiniteTalk with Higgsfield's Infinite Talk settings on the GPU (FusioniX, 15 motion frames, 25 steps, shift 10, guidance 5 / 5) and fal's InfiniteTalk in the cloud; the s2v variant is Fuobe Speak · Motion (Wan 2.2 S2V, a Speak v1-like route). The fast InfiniteTalk graphs stay the baseline until this suite promotes the recipe.",
"original": "fuobe-speak",
"kind": "video",
"targets": {
@@ -12,8 +12,8 @@
},
"defaults": { "seeds": [1001], "metrics": ["lipsync", "temporal", "identity"], "timeoutSeconds": 3600 },
"variants": {
- "infinitetalk": { "description": "InfiniteTalk (open: native ComfyUI graph; cloud: fal-ai/infinitalk)" },
- "s2v": { "description": "Wan 2.2 Speech-to-Video (Speak v1-like)", "models": { "open": ["oss-wan22-s2v"], "demo": ["oss-wan22-s2v"] } }
+ "infinitetalk": { "description": "Fuobe Speak: InfiniteTalk (open: kijai's wrapper with the FusioniX recipe; cloud: fal-ai/infinitalk), against the fast native graph and fal's own" },
+ "s2v": { "description": "Fuobe Speak · Motion: Wan 2.2 Speech-to-Video (a Speak v1-like route) on both engines", "models": { "open": ["fuobe-speak-motion", "oss-wan22-s2v"], "cloud": ["fuobe-speak-motion"], "demo": ["oss-wan22-s2v"] } }
},
"cases": [
{
diff --git a/scripts/gen-soul-originals.py b/scripts/gen-soul-originals.py
index 70580ddf..f0628aa6 100644
--- a/scripts/gen-soul-originals.py
+++ b/scripts/gen-soul-originals.py
@@ -50,6 +50,8 @@ BASES = {"z-image-turbo": "z-image", "qwen-image-2512": "qwen-2512"}
# Which LoRA bases each Soul base loads.
BASE_LORAS = {"z-image": re.compile(r"^z-image"), "qwen-2512": re.compile(r"^qwen-image-2512")}
OVERLAYS = {"date-stamp", "cctv", "photo-booth"}
+# Steps after the picture (O11): the face mosaic (SAM 3.1 + a mosaic; src/lib/catalog/open-tools.ts).
+POSTS = {"face-mosaic"}
MAX_LORAS = 3
errors = []
notes = []
@@ -199,6 +201,9 @@ for p in RECIPES["presets"]:
overlay = p.get("overlay")
if overlay and overlay not in OVERLAYS:
errors.append(f"{where}: unknown overlay {overlay!r}")
+ post = p.get("post")
+ if post and post not in POSTS:
+ errors.append(f"{where}: unknown post step {post!r}")
if p.get("commercialOk") is False or p.get("hostedOk") is False:
notes.append(f"{where}: the research marks it not commercial-safe on both engines")
entry = {
@@ -216,6 +221,8 @@ for p in RECIPES["presets"]:
entry["grade"] = grade
if overlay:
entry["overlay"] = overlay
+ if post:
+ entry["post"] = post
if p.get("trainOwn"):
entry["train"] = True
if clean(p.get("notes")):
@@ -293,6 +300,8 @@ for l in looks:
card["grade"] = l["grade"]
if l.get("overlay"):
card["overlay"] = l["overlay"]
+ if l.get("post"):
+ card["post"] = l["post"]
card["civitai"] = any(library[x["key"]].get("download") == "civitai-token" for x in l["loras"])
card["hd"] = l["base"] == "qwen-2512"
cards.append(card)
diff --git a/src/components/studio/composer.tsx b/src/components/studio/composer.tsx
index 4c4030f4..6d0a0117 100644
--- a/src/components/studio/composer.tsx
+++ b/src/components/studio/composer.tsx
@@ -56,6 +56,7 @@ import {
presetModel,
presetOriginal,
presetParams,
+ postStepCost,
prestepCost,
pushRecent,
settingsShape,
@@ -425,6 +426,8 @@ export function Composer({ docked }: { docked: boolean }) {
cost = estimateCost(plan.model, plan.params, plan.jobs, plan.op, plan.loras.length > 0 && routesFor(plan.model, plan.op).some((r) => !!r.loraEndpoint));
// A relight effect relights the start frame first (free on the GPU, about $0.04 in the cloud).
if (cost !== null) cost += prestepCost(preset, plan.model.id, engine);
+ // PixeletedFace pixelates each picture's faces afterwards ($0.01 a picture in the cloud, free on the GPU).
+ if (cost !== null) cost += postStepCost(plan.model.id, planned.presetId, engine, planned.params?.numOutputs ?? 1, catalog.getModel);
} catch (e) {
planError = (e as Error).message;
}
diff --git a/src/components/studio/soul-finish.ts b/src/components/studio/soul-finish.ts
index f9a2b0eb..7211b908 100644
--- a/src/components/studio/soul-finish.ts
+++ b/src/components/studio/soul-finish.ts
@@ -4,7 +4,7 @@ import { useQueryClient } from "@tanstack/react-query";
import { useEffect } from "react";
import { applyPreset, PRESETS } from "@/lib/grade";
import type { Generation } from "@/lib/catalog/types";
-import { cropRect, finishSteps, outputsToFinish, overlayLayout, type FinishSteps } from "@/lib/soul-post";
+import { cropRect, finishSteps, mosaicPixels, outputsToFinish, overlayLayout, unionMasks, type FinishSteps } from "@/lib/soul-post";
/**
* Fuobe Soul's post steps in the browser (research §4.4): when a result with a look arrives, Soul Cinema's 21:9
@@ -33,12 +33,38 @@ function load(url: string): Promise<HTMLImageElement> {
const FONTS = { mono: '"Courier New", ui-monospace, monospace', serif: 'Georgia, "Times New Roman", serif' } as const;
+/** The face mosaic (O11): the picture SAM 3.1 looked at, with a block mosaic wherever its masks are white. */
+async function mosaicCanvas(m: NonNullable<FinishSteps["mosaic"]>): Promise<HTMLCanvasElement> {
+ const [img, ...masks] = await Promise.all([load(m.source), ...m.masks.map(load)]);
+ const w = img.naturalWidth;
+ const h = img.naturalHeight;
+ const canvas = document.createElement("canvas");
+ canvas.width = w;
+ canvas.height = h;
+ const ctx = canvas.getContext("2d", { willReadFrequently: true })!;
+ const read = (el: HTMLImageElement) => {
+ ctx.clearRect(0, 0, w, h);
+ ctx.drawImage(el, 0, 0, w, h);
+ return ctx.getImageData(0, 0, w, h).data;
+ };
+ const mask = unionMasks(masks.map(read));
+ ctx.clearRect(0, 0, w, h);
+ ctx.drawImage(img, 0, 0);
+ const pixels = ctx.getImageData(0, 0, w, h);
+ mosaicPixels(pixels.data, mask, w, h, m.scale);
+ ctx.putImageData(pixels, 0, 0);
+ return canvas;
+}
+
/** The finished picture: graded, then its overlay drawn (a print border, a date stamp, a CCTV caption). */
async function finish(url: string, steps: FinishSteps, when: Date): Promise<Blob> {
- const img = await load(url);
+ // The face mosaic's cloud step: the output is the faces' mask; the result is the picture it was made from, pixelated.
+ const img: HTMLImageElement | HTMLCanvasElement = steps.mosaic ? await mosaicCanvas(steps.mosaic) : await load(url);
+ const iw = img instanceof HTMLCanvasElement ? img.width : img.naturalWidth;
+ const ih = img instanceof HTMLCanvasElement ? img.height : img.naturalHeight;
let canvas = document.createElement("canvas");
// Soul Cinema's 21:9: the middle band of the 16:9 picture.
- const r = steps.crop ? cropRect(img.naturalWidth, img.naturalHeight, steps.crop) : { x: 0, y: 0, width: img.naturalWidth, height: img.naturalHeight };
+ const r = steps.crop ? cropRect(iw, ih, steps.crop) : { x: 0, y: 0, width: iw, height: ih };
canvas.width = r.width;
canvas.height = r.height;
canvas.getContext("2d")!.drawImage(img, r.x, r.y, r.width, r.height, 0, 0, r.width, r.height);
diff --git a/src/lib/catalog/apps.ts b/src/lib/catalog/apps.ts
index d136935e..a3e07a34 100644
--- a/src/lib/catalog/apps.ts
+++ b/src/lib/catalog/apps.ts
@@ -262,44 +262,46 @@ export const APPS: Preset[] = [
icon: "Rotate3d",
hue: 190,
badges: ["top"],
- // The cloud model turns its rotate / tilt / zoom settings into the Multiple-Angles LoRA's own words; the open
- // route runs that LoRA on Qwen-Image-Edit 2511 with the same words ("<sks> front-left quarter view …").
+ // Fuobe Angles (O11): Higgsfield Angles' recipe, Qwen-Image-Edit 2509 + dx8152's Multiple-angles LoRA on both engines. The
+ // choices set the hosted route's own fields (rotate −90…90°, positive = left; vertical −1 above … 1 below; move forward
+ // 0–10; a wide-angle lens); on the GPU they become the LoRA's words (src/lib/catalog/open-tools.ts). The default turns it.
options: [
- angleOption("angle", "Angle", "horizontal_angle", [
- ["Front", "front view", 0],
- ["Front right", "front-right quarter view", 45],
- ["Right side", "right side view", 90],
- ["Back right", "back-right quarter view", 135],
- ["Back", "back view", 180],
- ["Back left", "back-left quarter view", 225],
- ["Left side", "left side view", 270],
- ["Front left", "front-left quarter view", 315],
+ {
+ ...angleOption("rotate", "Rotate", "rotate_right_left", [
+ ["90° left", "", 90],
+ ["45° left", "", 45],
+ ["Front", "", 0],
+ ["45° right", "", -45],
+ ["90° right", "", -90],
+ ]),
+ default: "45-left",
+ },
+ angleOption("height", "Camera height", "vertical_angle", [
+ ["Eye level", "", 0],
+ ["From above", "", -1],
+ ["From below", "", 1],
]),
- angleOption("height", "Height", "vertical_angle", [
- ["Eye level", "eye-level shot", 0],
- ["Low angle", "low-angle shot", -30],
- ["Elevated", "elevated shot", 30],
- ["High angle", "high-angle shot", 60],
- ]),
- angleOption("distance", "Distance", "zoom", [
- ["Medium", "medium shot", 5],
- ["Close-up", "close-up", 10],
- ["Wide", "wide shot", 0],
+ angleOption("distance", "Distance", "move_forward", [
+ ["As is", "", 0],
+ ["Closer", "", 5],
+ ["Close-up", "", 10],
]),
+ {
+ key: "lens",
+ label: "Lens",
+ choices: [
+ { value: "normal", label: "Normal", prompt: "", extra: { wide_angle_lens: false } },
+ { value: "wide", label: "Wide-angle", prompt: "", extra: { wide_angle_lens: true } },
+ ],
+ },
],
userPrompt: "optional",
- placeholder: "Anything to keep in mind (optional)",
- prompt: "Show the exact same scene and subject as a {option:angle}, {option:height}, {option:distance}, as if the camera physically moved. Keep identity, outfit, props, lighting and environment consistent. {prompt}",
- // fal builds the camera words from the sliders; this goes in as its additional_prompt (never empty, so the
- // app runs without a note).
- cloud: { modelId: "qwen-multiple-angles", op: "edit", promptTemplate: "Keep the same subject, identity, outfit, lighting and environment. {prompt}" },
- open: {
- modelId: "oss-qwen-edit",
- op: "edit",
- loras: [{ file: "qwen-image-edit-2511-multiple-angles-lora.safetensors", url: "https://huggingface.co/fal/Qwen-Image-Edit-2511-Multiple-Angles-LoRA/resolve/main/qwen-image-edit-2511-multiple-angles-lora.safetensors", strength: 1 }],
- promptTemplate: "<sks> {option:angle} {option:height} {option:distance}. {prompt}",
- },
- parity: "Both engines run the same Multiple-Angles LoRA: hosted by fal on the cloud, added to Qwen-Image-Edit 2511 on the open engine (0.3 GB)",
+ placeholder: "Anything to keep in mind (used on your GPU)",
+ prompt: "{prompt}",
+ cloud: { modelId: "fuobe-angles", op: "edit" },
+ open: { modelId: "fuobe-angles", op: "edit" },
+ parity:
+ "Both engines run Higgsfield Angles' recipe, Qwen-Image-Edit 2509 + the Multiple-angles LoRA: hosted on fal, or with Qwen-Image-Lightning on your GPU (24 GB). fal's route takes no words of its own",
}),
app({
name: "Shots",
diff --git a/src/lib/catalog/cinema.ts b/src/lib/catalog/cinema.ts
index 0b64a970..122c004d 100644
--- a/src/lib/catalog/cinema.ts
+++ b/src/lib/catalog/cinema.ts
@@ -3,6 +3,7 @@ import { getModel, getPreset } from "./index";
import { DOP_MODEL, LTX25_HOSTED } from "./dop";
import { dualEngine, onEngine } from "./engines";
import { localOnly, needsToken, triggerOf } from "./loras";
+import { ANGLES_2511_LORA } from "./open-tools";
import { composeShots, estimateCost, planGeneration, routesFor } from "./plan";
import { soulRecipe } from "./soul";
import { CAST_LOOK } from "./soul-cards";
@@ -1639,7 +1640,7 @@ function planLocationView(input: CinemaGenerateInput): CinemaPlan {
};
} else {
model = editModel("open");
- const loras = getPreset("app-angles")?.open?.loras;
+ const loras = [ANGLES_2511_LORA];
request = {
feature: "cinema-location",
modelId: model.id,
@@ -1928,7 +1929,7 @@ function planRecompose(input: CinemaGenerateInput): CinemaPlan {
request = { feature: "cinema-recompose", modelId: model.id, op: "edit", prompt: anglesNote(lens, aperture, input.prompt), inputs: src ? { images: [src] } : undefined, params };
notes.push(`${model.name} re-shoots the still from the angles you flew to (${Math.round(pose.horizontal)}° round, ${Math.round(pose.vertical)}° up, zoom ${pose.zoom}) — the capture itself isn't sent`);
} else {
- const loras = open ? getPreset("app-angles")?.open?.loras : undefined;
+ const loras = open ? [ANGLES_2511_LORA] : undefined;
const words = recomposePrompt(lens, aperture, input.prompt);
request = {
feature: "cinema-recompose",
diff --git a/src/lib/catalog/models.ts b/src/lib/catalog/models.ts
index 83ebb8f4..02489792 100644
--- a/src/lib/catalog/models.ts
+++ b/src/lib/catalog/models.ts
@@ -3,6 +3,7 @@ import { pricingAt } from "./plan";
import { DEFAULT_FPS_TARGET, FPS_TARGETS, SLOW_MOTION } from "@/lib/av/fps";
import { ASR_LANGUAGES, WHISPER_LANGUAGES } from "../speech-languages";
import { loraEntry, loraRef } from "./loras";
+import { ANGLES_LORA, MOSAIC_SCALE, MOSAIC_TARGET, SPEAK_GRAPH, SPEAK_LORA, SPEAK_PROMPT } from "./open-tools";
import { CINEMA_CROP, SOUL_ASPECTS, SOUL_TIERS } from "./soul";
import { LAST_FRAME_CHAIN, type ModelDef, type ModelOptions, type ModelRoute, type Operation } from "./types";
@@ -624,6 +625,18 @@ const open: ModelDef[] = [
// VideoDepthAnythingOutput draws gray or inferno only; turbo, magma and viridis are the cloud's.
options: { colormaps: ["grayscale", "inferno"], sideBySide: true },
}),
+ // Higgsfield's Depth Map runs Video Depth Anything Large (build plan O11). Its weights are CC-BY-NC-4.0: the licence is
+ // information (Settings → Models & licences lists it as Non-commercial, with a switch); the Depth map's default stays Small.
+ o({
+ id: "oss-video-depth-vda-large",
+ name: "Video Depth Anything (large)",
+ vendor: "ByteDance",
+ family: "depth-anything",
+ kind: "video",
+ tagline: "The finest temporally stable depth, the model hosted depth tools use · non-commercial weights (CC-BY-NC-4.0) · 8 GB",
+ routes: [comfy("depth-video", "video-depth-vda-large", "Video Depth Anything Large (about 1.5 GB, downloaded on first run)")],
+ options: { colormaps: ["grayscale", "inferno"], sideBySide: true },
+ }),
// Remove object (Video tools → Remove object; docs/research/comfyui-oss-4.md §b). The prompt names what to remove
// (the provider sends the objects in it to SAM 3.1 as maskPrompt; the scene the gap is filled with is
// params.extra.prompt or a neutral default). One window per job: src/lib/catalog/remove-object.ts tiles longer clips
@@ -1757,8 +1770,65 @@ const originals: ModelDef[] = [
// The GPU graph follows a restyled first frame it can't make itself (fal's route runs without one, on the words).
engineOptions: { open: { requires: { images: 1, msg: "Add the clip's first frame in the new look: Wan 2.2 Fun VACE carries it through every frame" } } },
},
+ // Fuobe Angles (O11): Higgsfield Angles' recipe, Qwen-Image-Edit 2509 with dx8152's Multiple-angles LoRA. The camera is the
+ // hosted route's own fields on both engines (rotate −90…90°, positive = left; tilt −1…1; move forward 0–10; a wide-angle lens in
+ // the Angles app); on the GPU src/lib/catalog/open-tools.ts turns them into the LoRA's words. Words of your own are the GPU's
+ // only (fal's route has no prompt field).
+ {
+ ...original({
+ id: "fuobe-angles",
+ open: [comfy("edit", "qwen-image-edit-2509-angles", "Qwen-Image-Edit 2509 + Lightning + the Multiple-angles LoRA at 1.25, 6 steps")],
+ tagline: "The same shot from another camera: rotate, tilt, move closer, go wide · Qwen-Image-Edit 2509 + Multiple-angles LoRA, free on your GPU (24 GB), or hosted on fal",
+ options: { maxImages: 1, seed: true, promptOptional: true, sliders: ORIGINAL_HALVES.get("fuobe-angles")?.options.sliders },
+ }),
+ // The GPU graph loads the LoRA itself; as the recipe's LoRA it is downloaded before a run and has a switch in Settings.
+ engineOptions: { open: { ...(ANGLES_LORA && { loras: [ANGLES_LORA] }) }, cloud: { promptless: true } },
+ },
+ // Fuobe Speak (O11): InfiniteTalk. On the GPU, Higgsfield's Infinite Talk settings on kijai's wrapper graph (FusioniX in place of
+ // the lightx2v distill LoRA, 15 motion frames, 25 steps, shift 10, text and audio guidance 5, colour match): about ten times the
+ // fast pass's time (InfiniteTalk Long). In the cloud, fal's InfiniteTalk, which takes none of those knobs. As long as the voice.
+ {
+ ...original({
+ id: "fuobe-speak",
+ open: [{ ...comfy("avatar", "infinitetalk-wanwrapper", "InfiniteTalk + FusioniX, 25 steps, shift 10, guidance 5 / 5, 15 motion frames"), extra: { ...SPEAK_GRAPH } }],
+ tagline: "A portrait speaks your voice track, lips, face and head in sync, long takes · InfiniteTalk + FusioniX free on your GPU (16 GB), or hosted on fal",
+ options: { resolutions: ["480p", "720p"], seed: true, maxImages: 1, promptOptional: true, defaultPrompt: SPEAK_PROMPT },
+ }),
+ engineDefaults: { open: { aspectRatio: "auto" } },
+ // The GPU graph frames the portrait itself (its shape by default); the LoRA is the recipe's, downloaded before a run.
+ engineOptions: { open: { aspectRatios: ["auto", ...VID_AR], negativePrompt: true, ...(SPEAK_LORA && { loras: [SPEAK_LORA] }) } },
+ },
+ // Fuobe Speak · Motion (O11): a Speak v1-like route, Wan 2.2 Speech-to-Video. The body and the scene move with the speech; fal
+ // makes 2.5–7.5 s a call (num_frames 40–120), the GPU graph up to about 14 s.
+ {
+ ...original({
+ id: "fuobe-speak-motion",
+ open: [comfy("avatar", "wan22-s2v-14b", "Wan 2.2 S2V 14B with the lightx2v 4-step LoRA, up to about 14 s")],
+ tagline: "Speech with the body and the scene moving · Wan 2.2 S2V free on your GPU (24 GB), or hosted on fal (up to 7.5 s)",
+ options: { resolutions: ["480p", "580p", "720p"], seed: true, negativePrompt: true, maxImages: 1, promptOptional: true, defaultPrompt: SPEAK_PROMPT },
+ }),
+ engineDefaults: { open: { aspectRatio: "9:16" } },
+ engineOptions: { open: { aspectRatios: VID_AR, resolutions: ["480p", "720p"] } },
+ },
];
+/**
+ * Fuobe Soul's face mosaic on the GPU (build plan O11): SAM 3.1 finds the faces (or what the words name) and a block
+ * mosaic covers them, in one graph. A helper step after a look that asks for it (PixeletedFace); in the cloud fal's
+ * SAM 3.1 makes the masks and the browser pixelates (sam-3-1-face-mask).
+ */
+const faceMosaic: ModelDef = o({
+ id: "oss-face-mosaic",
+ name: "Pixelate faces",
+ vendor: "Meta SAM 3.1 + ComfyUI",
+ family: "sam",
+ kind: "image",
+ tagline: "SAM 3.1 finds every face and covers it with large blocks · core nodes, 4 GB",
+ routes: [comfy("face-mosaic", "image-face-mosaic-sam3", "SAM 3.1 face mask, grown 12 px, a 25 px block mosaic under it")],
+ options: { maxImages: 1, promptOptional: true, defaultPrompt: MOSAIC_TARGET, sliders: [{ param: "mosaicScale", label: "Block size (smaller = bigger blocks)", min: 0.01, max: 0.2, step: 0.01, default: MOSAIC_SCALE }] },
+ hidden: true,
+});
+
/** Tools that run entirely in the browser; recorded in the library like any other result. */
const local: ModelDef[] = [
{
@@ -1840,4 +1910,4 @@ const local: ModelDef[] = [
}),
];
-export const MODELS: ModelDef[] = [...originals, ...cloud, ...open, ...local];
+export const MODELS: ModelDef[] = [...originals, ...cloud, ...open, faceMosaic, ...local];
diff --git a/src/lib/catalog/open-tools.ts b/src/lib/catalog/open-tools.ts
new file mode 100644
index 00000000..9ea0fa28
--- /dev/null
+++ b/src/lib/catalog/open-tools.ts
@@ -0,0 +1,132 @@
+/**
+ * Higgsfield's rebranded open tools and Speak, rebuilt as Fuobe Originals (build plan O11; research
+ * docs/research/fuobe-originals-recipes-5.json studios[angles], studios[speak], presets[PixeletedFace].post). Pure:
+ * the recipes' constants and the words, steps and LoRAs they need, used by the catalog, the planner and the server.
+ *
+ * - Fuobe Angles: Qwen-Image-Edit 2509 with dx8152's Multiple-angles LoRA. fal's hosted route takes the camera as
+ * fields (rotate, vertical angle, move forward, wide-angle) and writes the LoRA's words itself; on the GPU Fuobe
+ * writes them ({@link anglesWords}), the instructions the LoRA was trained on, in Chinese with English.
+ * - Fuobe Speak: InfiniteTalk with Higgsfield's Infinite Talk settings on the GPU (the FusioniX LoRA, 15 motion
+ * frames, 25 steps, shift 10, text and audio guidance 5, colour correction), fal's InfiniteTalk in the cloud.
+ * Fuobe Speak · Motion is Wan 2.2 S2V on both engines (a Speak v1-like route: the body and the scene move).
+ * - The face mosaic (Fuobe Soul's PixeletedFace look): SAM 3.1 finds the faces, a mosaic covers them. On the GPU one
+ * graph does both; in the cloud fal's SAM 3.1 answers with the masks and the browser pixelates under them.
+ */
+import { loraEntry, loraRef } from "./loras";
+import type { Engine, LoraRef } from "./types";
+
+export const ANGLES_ORIGINAL = "fuobe-angles";
+export const SPEAK_ORIGINAL = "fuobe-speak";
+export const SPEAK_MOTION_ORIGINAL = "fuobe-speak-motion";
+
+/** dx8152's Multiple-angles LoRA for Qwen-Image-Edit 2509 at 1.25 (the research's adapterLoras record). */
+const ANGLES_ENTRY = loraEntry("qwen-edit-2509-multiple-angles");
+export const ANGLES_LORA: LoraRef | undefined = ANGLES_ENTRY && loraRef(ANGLES_ENTRY);
+
+/**
+ * fal's Multiple-Angles LoRA for Qwen-Image-Edit 2511 (its `<sks>` pose words), which Cinema's recomposition and Soul
+ * Location's other views run on the GPU next to Fuobe Angles' 2509 recipe (the Angles app's open route until O11).
+ */
+export const ANGLES_2511_LORA: LoraRef = {
+ file: "qwen-image-edit-2511-multiple-angles-lora.safetensors",
+ url: "https://huggingface.co/fal/Qwen-Image-Edit-2511-Multiple-Angles-LoRA/resolve/main/qwen-image-edit-2511-multiple-angles-lora.safetensors",
+ strength: 1,
+};
+
+/** FusioniX for Wan 2.1 I2V 14B, the LoRA Higgsfield's Infinite Talk loads at 1 (adapterLoras). */
+const SPEAK_ENTRY = loraEntry("fusionix-i2v-14b");
+export const SPEAK_LORA: LoraRef | undefined = SPEAK_ENTRY && loraRef(SPEAK_ENTRY);
+
+/**
+ * Fuobe Speak's InfiniteTalk settings on kijai's wrapper graph (infinitetalk-wanwrapper's bindings; research
+ * studios[speak].original.open.defaults): motion_frame 15, 25 steps, shift 10, text guidance 5, audio guidance 5,
+ * InfiniteTalk's UniPC solver, and its colour correction as the wrapper's Reinhard colour match (a Lab mean and
+ * spread match to the portrait, on or off). A run's own settings (params.extra) win.
+ */
+export const SPEAK_GRAPH: Readonly<Record<string, number | string>> = {
+ motionFrame: 15,
+ steps: 25,
+ shift: 10,
+ cfg: 5,
+ audioCfg: 5,
+ scheduler: "unipc",
+ colormatch: "reinhard",
+};
+
+/** What Fuobe Speak (and · Motion) says when the run has no words: InfiniteTalk and Wan S2V both ask for a prompt. */
+export const SPEAK_PROMPT = "A person talking to the camera, natural head movement and facial expressions";
+
+/** Fuobe Angles' camera: the hosted route's own fields, which the open graph reads as words. */
+export interface AnglesCamera {
+ /** Degrees, −90…90: positive turns the camera to the left (fal's rotate_right_left). */
+ rotate_right_left?: number;
+ /** −1 (a bird's-eye view, looking down) … 1 (a worm's-eye view, looking up). */
+ vertical_angle?: number;
+ /** 0–10: 1–5 moves the camera forward, above 5 is a close-up. */
+ move_forward?: number;
+ wide_angle_lens?: boolean;
+}
+
+const num = (v: unknown): number => (typeof v === "number" && Number.isFinite(v) ? v : typeof v === "string" && v.trim() !== "" && Number.isFinite(Number(v)) ? Number(v) : 0);
+const yes = (v: unknown): boolean => v === true || v === "true" || v === "on" || v === 1;
+
+/**
+ * The Multiple-angles LoRA's instruction for a camera (the words it was trained on, as its card and the public
+ * Hugging Face Space write them): a turn left or right by whole degrees, a move forward or a close-up, a bird's-eye or
+ * worm's-eye view at the ends of the tilt, a wide-angle lens. "" when the camera doesn't move.
+ */
+export function anglesWords(camera: AnglesCamera | Record<string, unknown> | undefined): string {
+ const c = (camera ?? {}) as Record<string, unknown>;
+ const rotate = Math.max(-90, Math.min(90, Math.round(num(c.rotate_right_left))));
+ const forward = Math.max(0, Math.min(10, num(c.move_forward)));
+ const tilt = Math.max(-1, Math.min(1, num(c.vertical_angle)));
+ const parts: string[] = [];
+ if (rotate > 0) parts.push(`将镜头向左旋转${rotate}度 Rotate the camera ${rotate} degrees to the left.`);
+ else if (rotate < 0) parts.push(`将镜头向右旋转${-rotate}度 Rotate the camera ${-rotate} degrees to the right.`);
+ if (forward > 5) parts.push("将镜头转为特写镜头 Turn the camera to a close-up.");
+ else if (forward >= 1) parts.push("将镜头向前移动 Move the camera forward.");
+ if (tilt <= -1) parts.push("将相机转向鸟瞰视角 Turn the camera to a bird's-eye view.");
+ else if (tilt >= 1) parts.push("将相机切换到仰视视角 Turn the camera to a worm's-eye view.");
+ if (yes(c.wide_angle_lens)) parts.push("将镜头转为广角镜头 Turn the camera to a wide-angle lens.");
+ return parts.join(" ");
+}
+
+/**
+ * Fuobe Angles' prompt on the GPU: the camera's words, then the user's note. A camera that doesn't move (and no
+ * note) is refused: the edit would only redraw the picture.
+ */
+export function anglesPrompt(extra: Record<string, unknown> | undefined, words: string | undefined): string {
+ const camera = anglesWords(extra);
+ const note = words?.trim() ?? "";
+ if (!camera && !note) throw new Error("Move the camera first: rotate it, tilt it, move it closer or go wide");
+ return [camera, note].filter(Boolean).join(" ");
+}
+
+/** The camera fields Fuobe Angles reads (they go to fal as they are; the GPU graph takes them as words instead). */
+export const ANGLES_FIELDS = ["rotate_right_left", "vertical_angle", "move_forward", "wide_angle_lens"] as const;
+
+/** The face mosaic's step per engine: the GPU graph does the whole mosaic; fal's SAM 3.1 makes the masks. */
+export const FACE_MOSAIC_MODELS: Record<Engine, string> = { open: "oss-face-mosaic", cloud: "sam-3-1-face-mask" };
+
+/** What SAM 3.1 looks for when the run names nothing. */
+export const MOSAIC_TARGET = "face";
+
+/**
+ * The mosaic's scale: the picture is shrunk to this (each block averages its pixels) and blown back up with hard edges,
+ * so a block is 1 / MOSAIC_SCALE pixels wide on both engines (the open graph's mosaicScale; 0.04 = 25 px).
+ */
+export const MOSAIC_SCALE = 0.04;
+
+/** The post step a look asks for after its picture is made. */
+export type SoulPost = "face-mosaic";
+
+/** The face mosaic as the second step of a Soul run: its model on the engine the picture is made on. */
+export function faceMosaicStep(engine: Engine): { modelId: string; op: "face-mosaic"; prompt: string } {
+ return { modelId: FACE_MOSAIC_MODELS[engine], op: "face-mosaic", prompt: MOSAIC_TARGET };
+}
+
+/** The grid of a mosaic over a `width` × `height` picture: square blocks of 1 / scale pixels, the last ones cut off. */
+export function mosaicGrid(width: number, height: number, scale = MOSAIC_SCALE): { cell: number; cols: number; rows: number } {
+ const cell = Math.max(1, Math.round(1 / Math.max(0.001, scale)));
+ return { cell, cols: Math.ceil(width / cell), rows: Math.ceil(height / cell) };
+}
diff --git a/src/lib/catalog/plan.ts b/src/lib/catalog/plan.ts
index 8909bd98..61f15551 100644
--- a/src/lib/catalog/plan.ts
+++ b/src/lib/catalog/plan.ts
@@ -13,6 +13,7 @@ import type {
} from "./types";
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";
import { numFramesValue, sizeValue } from "./payload";
import { characterScale, CINEMA_CROP, soulKind, soulMegapixels, soulRecipe, soulSize, type SoulOverlay } from "./soul";
@@ -150,6 +151,8 @@ const PROMPTLESS = new Set<Operation>([
"timeline",
// round 4: tools that work from their inputs (removing an object needs a prompt only on models that read one)
"sdr-to-hdr", "export-video", "ocr", "still-motion", "audio-loop", "audio-join", "scene-3d", "splat", "rig-3d", "extract-frames", "images-to-video", "overlay",
+ // round 5 (O11): the face mosaic names the faces itself ("face")
+ "face-mosaic",
]);
/**
@@ -256,6 +259,10 @@ export function planGeneration(
prompt = r.prompt;
loras = r.loras;
notes.push(...r.notes);
+ // PixeletedFace: a second step pixelates the faces (src/server/chains.ts createMosaicRun).
+ if (r.look?.post === "face-mosaic") {
+ notes.push(model.engine === "open" ? "Then SAM 3.1 pixelates the faces on your GPU (free)" : `Then SAM 3.1 finds the faces (${"$"}0.01 a picture) and they're pixelated as the picture arrives`);
+ }
const own = new Set(req.loras ?? []);
soulPlan = {
...(r.look && { look: r.look.id }),
@@ -276,6 +283,16 @@ export function planGeneration(
const own = charStrength === undefined ? req.loras : req.loras.map((l) => ({ ...l, strength: characterScale(charStrength) }));
loras = [...own, ...loras];
}
+ // Fuobe Angles: the camera's fields go to fal as they are; on the GPU they become the Multiple-angles LoRA's own words,
+ // the user's note after them. fal's route takes no words of its own.
+ if (model.id === ANGLES_ORIGINAL) {
+ if (model.engine === "open") prompt = anglesPrompt(params.extra, prompt);
+ else {
+ if (!anglesWords(params.extra)) throw new Error("Move the camera first: rotate it, tilt it, move it closer or go wide");
+ if (prompt) notes.push("The hosted Multiple-angles route takes no words: your note is used on your GPU only");
+ prompt = "";
+ }
+ }
// The words a model takes when none are given (Fuobe Try-On: its LoRA's own instruction).
if (!prompt && model.options.defaultPrompt) prompt = model.options.defaultPrompt;
// A recipe's own LoRAs (Fuobe Try-On's try-on LoRA) go on every run, first (an API's LoRA cap leaves out yours
@@ -497,6 +514,7 @@ const NEEDS: Partial<
"video-insert": { video: true, images: 1, msg: "Add the video and a picture of what to add" },
keyframes: { images: 1, msg: "Add the keyframes, in order" },
"sdr-to-hdr": { video: true, msg: "Add the video to convert" },
+ "face-mosaic": { images: 1, msg: "Add the picture whose faces to pixelate" },
"export-video": { video: true, msg: "Add the video to export" },
ocr: { images: 1, msg: "Add the image to read" },
"still-motion": { images: 1, msg: "Add the still to move over" },
diff --git a/src/lib/catalog/soul-cards.ts b/src/lib/catalog/soul-cards.ts
index 87798334..a2d29343 100644
--- a/src/lib/catalog/soul-cards.ts
+++ b/src/lib/catalog/soul-cards.ts
@@ -18,6 +18,8 @@ export interface SoulLookCard {
grade?: string;
/** Drawn on the result in the browser: a date stamp, a CCTV caption, a photo-booth print. */
overlay?: "date-stamp" | "cctv" | "photo-booth";
+ /** A step after the picture: "face-mosaic" pixelates the faces (SAM 3.1 + a mosaic; priced into the run). */
+ post?: "face-mosaic";
/** Some of its LoRAs download from civitai (needs the user's free civitai key). */
civitai: boolean;
/** Made for Fuobe Soul HD (Qwen-Image 2512: lettering). */
diff --git a/src/lib/catalog/soul-looks.generated.ts b/src/lib/catalog/soul-looks.generated.ts
index 75622344..5e7be8af 100644
--- a/src/lib/catalog/soul-looks.generated.ts
+++ b/src/lib/catalog/soul-looks.generated.ts
@@ -785,6 +785,7 @@ export const SOUL_LOOK_CARDS: SoulLookCard[] = [
"categories": [],
"description": "Retro early-internet portrait with the face pixelated into large blocks.",
"hue": 15,
+ "post": "face-mosaic",
"civitai": false,
"hd": false
},
diff --git a/src/lib/catalog/soul-originals.generated.ts b/src/lib/catalog/soul-originals.generated.ts
index 08d4c718..24c2576f 100644
--- a/src/lib/catalog/soul-originals.generated.ts
+++ b/src/lib/catalog/soul-originals.generated.ts
@@ -1601,6 +1601,7 @@ export const SOUL_ORIGINALS: SoulLook[] = [
],
"base": "z-image",
"coverage": "prompt+core",
+ "post": "face-mosaic",
"note": "Do the pixelation in post: SAM 3.1 face mask, then a mosaic filter on the masked area.",
"legacyStyleId": "34c50302-83ff-487d-b3a9-e35e501d80a7"
},
diff --git a/src/lib/catalog/soul.ts b/src/lib/catalog/soul.ts
index 56fc8e1f..2fbf041d 100644
--- a/src/lib/catalog/soul.ts
+++ b/src/lib/catalog/soul.ts
@@ -18,6 +18,7 @@
* (`legacyStyleId`); they are never sent anywhere.
*/
import { loraEntry, loraRef } from "./loras";
+import type { SoulPost } from "./open-tools";
import { DEFAULT_LOOK, OWN_LOOK, SOUL_MODEL_IDS } from "./soul-cards";
import { SOUL_CINEMA, SOUL_CORE_LORAS, SOUL_ORIGINALS, SOUL_SIZES, SOUL_TAILS } from "./soul-originals.generated";
import type { LoraRef, ModelDef } from "./types";
@@ -49,6 +50,11 @@ export interface SoulLook {
grade?: string;
/** Drawn on the result in the browser (diffusion draws text and frames badly). */
overlay?: SoulOverlay;
+ /**
+ * A step after the picture (O11): "face-mosaic" pixelates the faces (PixeletedFace): SAM 3.1 and a mosaic on the GPU, fal's
+ * SAM 3.1 masks pixelated in the browser in the cloud (src/lib/catalog/open-tools.ts).
+ */
+ post?: SoulPost;
/** A Fuobe-trained LoRA should replace the public one or the words (research §6). */
train?: true;
note?: string;
@@ -249,6 +255,13 @@ export function promptWithLoras(prompt: string, triggers: string[], kept: Pick<L
* Cinema's 21:9 crop the browser applies; meta.grade / meta.overlay / meta.crop tell API clients). Undefined for
* other models.
*/
+/** The step a Soul run's look asks for after its picture (the face mosaic), or none. Soul Cinema has none. */
+export function soulPostStep(modelId: string, presetId: string | null | undefined): SoulPost | undefined {
+ const kind = soulKind(modelId);
+ if (!kind || kind === "cinema") return undefined;
+ return soulLook(presetId ?? DEFAULT_LOOK)?.post;
+}
+
export function soulPostSteps(
modelId: string,
presetId: string | null | undefined,
diff --git a/src/lib/catalog/types.ts b/src/lib/catalog/types.ts
index dd9b6e67..b6d38634 100644
--- a/src/lib/catalog/types.ts
+++ b/src/lib/catalog/types.ts
@@ -1038,7 +1038,7 @@ export interface PresetChoice {
/** Text substituted for {option:<key>} in the prompt template. */
prompt: string;
/** Model settings this choice sets (params.extra), e.g. the camera angle sliders of Qwen Multiple Angles; what the user set wins. */
- extra?: Record<string, number | string>;
+ extra?: Record<string, number | string | boolean>;
}
export interface PresetOption {
diff --git a/src/lib/composer.ts b/src/lib/composer.ts
index ea31fcba..c79b3097 100644
--- a/src/lib/composer.ts
+++ b/src/lib/composer.ts
@@ -8,6 +8,8 @@ import { fpsPlan, fpsSummary } from "./av/fps";
import { targetShortEdge, upscaledSize, upscaleFactorFor, upscaleTier } from "./av/upscale";
import { wholeClipProblem, wholeClipTool } from "./av/video-finish";
import { addFrameAt, frameTimes, framesInputs, removeFrameAt, spread, type FrameSupport } from "./catalog/keyframes";
+import { FACE_MOSAIC_MODELS } from "./catalog/open-tools";
+import { soulPostStep } from "./catalog/soul";
import { COLORMAPS, type Engine, type GenParams, type InputSlot, type MatteOutput, type MediaKind, type ModelDef, type Operation, type Preset, type VideoFormat } from "./catalog/types";
import { spokenLanguageName } from "./speech-languages";
@@ -744,6 +746,16 @@ export function followEngineParams(params: GenParams, from: GenParams, to: GenPa
* What a step before the clip adds to its price (Fuobe DoP relights a start frame first), when the run is on the
* preset's own model: a partner model runs the effect's words alone.
*/
+/**
+ * A step after the run that costs on its own: Fuobe Soul's PixeletedFace look pixelates each picture's faces (SAM 3.1:
+ * free on the GPU, fal's per-request price in the cloud), one step per picture.
+ */
+export function postStepCost(modelId: string | undefined, look: string | undefined, engine: Engine, pictures: number, getModel: (id: string) => ModelDef | undefined): number {
+ if (!modelId || soulPostStep(modelId, look) !== "face-mosaic") return 0;
+ const step = getModel(FACE_MOSAIC_MODELS[engine]);
+ return step?.engine === "cloud" && step.pricing?.unit === "request" ? step.pricing.usd * Math.max(1, pictures) : 0;
+}
+
export function prestepCost(preset: Pick<Preset, "type" | "open" | "cloud" | "prestep"> | undefined, modelId: string | undefined, engine: Engine): number {
if (!preset?.prestep || !modelId || presetModel(preset, engine) !== modelId) return 0;
return preset.prestep[engine].usd ?? 0;
diff --git a/src/lib/soul-post.ts b/src/lib/soul-post.ts
index 262cb7c5..8e6d8814 100644
--- a/src/lib/soul-post.ts
+++ b/src/lib/soul-post.ts
@@ -5,6 +5,7 @@
* outputs still need it. src/components/studio/soul-finish.ts draws it; the server keeps the finished picture
* (POST /api/generations/<id>/finish) and the original beside it (meta.original).
*/
+import { MOSAIC_SCALE, mosaicGrid } from "@/lib/catalog/open-tools";
import type { Generation, OutputFile } from "@/lib/catalog/types";
export type SoulOverlay = "date-stamp" | "cctv" | "photo-booth";
@@ -15,6 +16,11 @@ export interface FinishSteps {
crop?: "21:9";
grade?: string;
overlay?: SoulOverlay;
+ /**
+ * The face mosaic's cloud step (O11): this output is SAM 3.1's mask of the faces; the finished picture is `source` with a
+ * block mosaic wherever one of `masks` is white (src/lib/catalog/open-tools.ts). `scale` sets the block size.
+ */
+ mosaic?: { source: string; masks: string[]; scale: number };
}
const OVERLAYS = new Set<SoulOverlay>(["date-stamp", "cctv", "photo-booth"]);
@@ -25,7 +31,67 @@ export function finishSteps(o: Pick<OutputFile, "kind" | "meta">): FinishSteps |
const crop = o.meta.crop === "21:9" ? ("21:9" as const) : undefined;
const grade = typeof o.meta.grade === "string" && o.meta.grade ? o.meta.grade : undefined;
const overlay = OVERLAYS.has(o.meta.overlay as SoulOverlay) ? (o.meta.overlay as SoulOverlay) : undefined;
- return crop || grade || overlay ? { ...(crop && { crop }), ...(grade && { grade }), ...(overlay && { overlay }) } : null;
+ const mosaic = mosaicOf(o.meta.mosaic);
+ return crop || grade || overlay || mosaic ? { ...(crop && { crop }), ...(grade && { grade }), ...(overlay && { overlay }), ...(mosaic && { mosaic }) } : null;
+}
+
+function mosaicOf(v: unknown): FinishSteps["mosaic"] {
+ if (!v || typeof v !== "object") return undefined;
+ const m = v as Record<string, unknown>;
+ const masks = Array.isArray(m.masks) ? m.masks.filter((u): u is string => typeof u === "string" && !!u) : [];
+ if (typeof m.source !== "string" || !m.source || !masks.length) return undefined;
+ const scale = typeof m.scale === "number" && m.scale > 0 && m.scale < 1 ? m.scale : MOSAIC_SCALE;
+ return { source: m.source, masks, scale };
+}
+
+/**
+ * The face mosaic in place on a `width` × `height` RGBA picture: every block of the grid that the mask touches (its red
+ * channel above half, white = a face) takes the block's average colour, so the faces turn into whole square blocks (the
+ * mask grows to the block edges, like the GPU graph's grown mask). `mask` is the same size as the picture.
+ */
+export function mosaicPixels(rgba: Uint8ClampedArray, mask: Uint8ClampedArray, width: number, height: number, scale = MOSAIC_SCALE): number {
+ const { cell, cols, rows } = mosaicGrid(width, height, scale);
+ let blocks = 0;
+ for (let by = 0; by < rows; by++) {
+ for (let bx = 0; bx < cols; bx++) {
+ const x0 = bx * cell;
+ const y0 = by * cell;
+ const x1 = Math.min(width, x0 + cell);
+ const y1 = Math.min(height, y0 + cell);
+ let hit = false;
+ for (let y = y0; y < y1 && !hit; y++) for (let x = x0; x < x1; x++) if (mask[(y * width + x) * 4] > 127) { hit = true; break; }
+ if (!hit) continue;
+ let r = 0;
+ let g = 0;
+ let b = 0;
+ const n = (x1 - x0) * (y1 - y0);
+ for (let y = y0; y < y1; y++) {
+ for (let x = x0; x < x1; x++) {
+ const i = (y * width + x) * 4;
+ r += rgba[i];
+ g += rgba[i + 1];
+ b += rgba[i + 2];
+ }
+ }
+ for (let y = y0; y < y1; y++) {
+ for (let x = x0; x < x1; x++) {
+ const i = (y * width + x) * 4;
+ rgba[i] = Math.round(r / n);
+ rgba[i + 1] = Math.round(g / n);
+ rgba[i + 2] = Math.round(b / n);
+ }
+ }
+ blocks++;
+ }
+ }
+ return blocks;
+}
+
+/** Several masks as one (the brightest red at each pixel), for {@link mosaicPixels}. */
+export function unionMasks(masks: Uint8ClampedArray[]): Uint8ClampedArray {
+ const out = new Uint8ClampedArray(masks[0]?.length ?? 0);
+ for (const m of masks) for (let i = 0; i < out.length; i += 4) if (m[i] > out[i]) out[i] = m[i];
+ return out;
}
/** The crop of a `width` × `height` picture to an aspect ratio ("21:9"): the full width, the middle band (or the reverse). */
diff --git a/src/server/chains.ts b/src/server/chains.ts
index 7743433e..f15de864 100644
--- a/src/server/chains.ts
+++ b/src/server/chains.ts
@@ -3,6 +3,7 @@ import { nanoid } from "nanoid";
import { getModel, supportsOp } from "@/lib/catalog";
import { MODEL3D_STEP_FEATURE, stillPromptFor3d } from "@/lib/av/model3d";
import { chainTiming, frameTimes, planKeyframeClips, spread } from "@/lib/catalog/keyframes";
+import { faceMosaicStep } from "@/lib/catalog/open-tools";
import { onEngine } from "@/lib/catalog/engines";
import { routesFor } from "@/lib/catalog/plan";
import type { ChainSlot, Engine, GenParams, Generation, GenerationRequest, LoraRef, ModelDef, ModelRoute, Operation } from "@/lib/catalog/types";
@@ -411,6 +412,42 @@ export function createRelitClip(
}
}
+/**
+ * Fuobe Soul's PixeletedFace look (O11): each picture, then its faces pixelated on the engine it was made on: one SAM 3.1 +
+ * mosaic graph on the GPU; in the cloud fal's SAM 3.1 finds the faces and the browser pixelates under its masks. One
+ * two-step pipeline per picture (a later step takes one result), all in one batch.
+ */
+export function createMosaicRun(original: GenerationRequest, model: ModelDef): Generation[] {
+ const n = Math.max(1, Math.min(4, original.params?.numOutputs ?? 1));
+ const engine = model.engine;
+ const step = faceMosaicStep(engine);
+ const words = original.prompt?.trim() || "Pixelated face";
+ const batchId = nanoid(10);
+ const items: Generation[] = [];
+ try {
+ for (let i = 0; i < n; i++) {
+ const of = n > 1 ? ` ${i + 1} of ${n}` : "";
+ const { items: made } = createPipeline(
+ [
+ { key: "picture", request: { ...original, engine, params: { ...original.params, numOutputs: 1 }, step: { label: `Before the face mosaic${of}`, index: 0, of: 2 } } },
+ {
+ key: "mosaic",
+ request: { feature: original.feature, modelId: step.modelId, op: step.op, prompt: step.prompt, title: words, step: { label: `Face mosaic${of}`, index: 1, of: 2 } },
+ after: "picture",
+ chain: [{ slot: "images", position: "first" }],
+ },
+ ],
+ { batchId },
+ );
+ items.push(...made);
+ }
+ } catch (e) {
+ for (const g of items) void cancelGeneration(g.id);
+ throw e;
+ }
+ return items;
+}
+
/** The model a storyboard film is animated with. */
export function filmModel(engine: Engine, modelId?: string): ModelDef {
const m = getModel(modelId ?? (engine === "open" ? "oss-wan22-14b-fast" : "seedance-2-5"));
diff --git a/src/server/generations.ts b/src/server/generations.ts
index 46ff06be..c9fbca44 100644
--- a/src/server/generations.ts
+++ b/src/server/generations.ts
@@ -16,7 +16,7 @@ import { estimateCost, inferOperation, planGeneration, presetRoute, routeLoras,
import { framedLength, keepMatte } from "@/lib/catalog/payload";
import { fitLoras, loraName, lorasFit } from "@/lib/catalog/loras";
import { dualEngine, onEngine, pickEngine } from "@/lib/catalog/engines";
-import { promptWithLoras, soulKind, soulLook, soulPostSteps } from "@/lib/catalog/soul";
+import { promptWithLoras, soulKind, soulLook, soulPostStep, soulPostSteps } from "@/lib/catalog/soul";
import { isDop } from "@/lib/catalog/dop";
import { MIXED_ORIGINAL, originalFrameSize } from "@/lib/catalog/mixed-media";
import { imageSize } from "@/lib/image-size";
@@ -42,7 +42,7 @@ import {
import { db } from "./db";
import { listElements } from "./elements";
import { pollTrainings } from "./training";
-import { createExtendChain, createKeyframeFilm, createRelitClip, createShotFilm, createStillTo3d } from "./chains";
+import { createExtendChain, createKeyframeFilm, createMosaicRun, createRelitClip, createShotFilm, createStillTo3d } from "./chains";
import { enhancePrompt, enhanceSoulWords } from "./enhance";
import { setResolver, watchGenerations, type LiveEvent } from "./live";
import { provider, PROVIDERS, RETIRED_PROVIDER_ERROR } from "./providers";
@@ -681,6 +681,11 @@ export function createGenerations(asked: GenerationRequest, opts: CreateOptions
// Fuobe DoP's relight effects: the start frame is relit first, then animated.
const relight = !opts.dependsOn && shotModel ? relightStep(original, shotModel) : undefined;
if (relight) return createRelitClip(original, relight);
+ // Fuobe Soul's PixeletedFace look: the picture, then its faces pixelated (SAM 3.1 + a mosaic). A step of a pipeline
+ // (Soul's own picture inside this one) runs as it is.
+ if (!opts.dependsOn && !original.step && shotModel && soulPostStep(shotModel.id, original.presetId) === "face-mosaic") {
+ return createMosaicRun(original, shotModel);
+ }
const deps = opts.dependsOn === undefined ? [] : Array.isArray(opts.dependsOn) ? opts.dependsOn : [opts.dependsOn];
const waits = deps.length > 0;
// A dependent job can't be planned until its inputs exist; it's validated with placeholders, then launched by the runner.
@@ -1118,6 +1123,14 @@ async function submit(
};
return adapter.prepareFile(f.data, f.contentType, f.name, route);
};
+ // A talking avatar is as long as its voice (fal's InfiniteTalk and Wan 2.2 S2V take a frame count): the voice's header.
+ const prepVoice = async (ref?: string) => {
+ if (!ref) return undefined;
+ const f = await readRef(ref);
+ const facts = mediaFacts(f.data);
+ if (facts.duration && !source.sourceDuration) source = { ...source, sourceDuration: facts.duration };
+ return adapter.prepareFile(f.data, f.contentType, f.name, route);
+ };
const prepMask = async (ref?: string) => {
if (!ref) return undefined;
const f = await readRef(ref);
@@ -1145,7 +1158,7 @@ async function submit(
endImage: await prep(req.inputs?.endImage),
mask: await prepMask(req.inputs?.mask),
video: await prepVideo(req.inputs?.video),
- audio: await prep(req.inputs?.audio),
+ audio: await (plan.op === "avatar" ? prepVoice : prep)(req.inputs?.audio),
audio2: await prep(req.inputs?.audio2),
voiceAudio: await prep(req.inputs?.voiceAudio),
voiceAudio2: await prep(req.inputs?.voiceAudio2),
@@ -1405,6 +1418,18 @@ async function pollOne(r: Row): Promise<void> {
// API clients read it as meta.
const post = soulPostSteps(r.model_id, r.preset_id, soulKind(r.model_id) ? requestAspect(r.request_json) : undefined);
if (post) for (const [i, o] of outputs.entries()) if (o.kind === "image") outputs[i] = { ...o, meta: { ...o.meta, ...post } };
+ // The face mosaic's cloud step (fal's SAM 3.1): its outputs are the faces' masks; the browser pixelates the picture it
+ // looked at under them (meta.mosaic, src/lib/soul-post.ts), as it finishes Soul's looks.
+ if (r.op === "face-mosaic") {
+ const source = (JSON.parse(r.request_json) as GenerationRequest).inputs?.images?.[0];
+ const scale = (JSON.parse(r.request_json) as GenerationRequest).params?.extra?.mosaicScale;
+ for (const [i, o] of outputs.entries()) {
+ const masks = o.meta?.masks;
+ if (o.kind === "image" && source && Array.isArray(masks) && masks.length) {
+ outputs[i] = { ...o, meta: { ...o.meta, mosaic: { source, masks, ...(typeof scale === "number" && { scale }) } } };
+ }
+ }
+ }
// Fuobe DoP's colour-grade effects: the grade the browser applies to the clip (the result's "Apply the grade" step).
const grade = isDop(r.model_id) && r.preset_id ? getPreset(r.preset_id)?.grade : undefined;
if (grade) for (const [i, o] of outputs.entries()) if (o.kind === "video") outputs[i] = { ...o, meta: { ...o.meta, grade } };
@@ -1450,12 +1475,21 @@ export async function persistArtifacts(meta: Record<string, unknown> | undefined
out = { ...out, [key]: kept };
}
for (const key of LINKS) if (typeof meta[key] === "string" && meta[key] !== main) out = { ...out, [key]: await keepLink(meta[key], key, generationId) };
+ for (const key of LINK_LISTS) {
+ const list = meta[key];
+ if (!Array.isArray(list)) continue;
+ const kept: unknown[] = [];
+ for (const [i, v] of list.entries()) kept.push(v === main ? v : await keepLink(v, `${key}-${i}`, generationId));
+ out = { ...out, [key]: kept };
+ }
return out;
}
/** Maps of extra files by name, and single extra files, that a result links to (see persistArtifacts). */
const LINK_MAPS = ["artifacts", "formats"] as const;
const LINKS = ["preview"] as const;
+/** Lists of extra files: SAM 3.1's masks of the faces (the face mosaic's cloud step), kept here so the browser can read them. */
+const LINK_LISTS = ["masks"] as const;
/** A provider's link stored as a file of the generation (its local URL), or the link as it was when it can't be fetched. */
async function keepLink(v: unknown, label: string, generationId: string): Promise<unknown> {
@@ -1486,6 +1520,10 @@ function relinkMain(meta: Record<string, unknown> | undefined, from: string, to:
out = { ...out, [key]: Object.fromEntries(Object.entries(links as Record<string, unknown>).map(([k, v]) => [k, v === from ? to : v])) };
}
for (const key of LINKS) if (meta[key] === from) out = { ...out, [key]: to };
+ for (const key of LINK_LISTS) {
+ const list = meta[key];
+ if (Array.isArray(list) && list.includes(from)) out = { ...out, [key]: list.map((v) => (v === from ? to : v)) };
+ }
return out;
}
diff --git a/src/server/providers/comfyui.ts b/src/server/providers/comfyui.ts
index ca32591c..32cbf1f7 100644
--- a/src/server/providers/comfyui.ts
+++ b/src/server/providers/comfyui.ts
@@ -1134,6 +1134,15 @@ export async function prepareWorkflow(endpointTemplate: string, input: GenInput,
else if (want !== "gray") throw new ProviderError(b.colormap ? "The open engine's depth maps come in grayscale or inferno — turbo, magma and viridis are on the cloud" : "This depth model makes grayscale maps only — pick Video Depth Anything for inferno");
}
if (b.sideBySide && input.sideBySide !== undefined) values.sideBySide = input.sideBySide;
+ // A wrapper graph that loads its LoRA itself (kijai's InfiniteTalk: WanVideoLoraSelect, no core model loader to attach
+ // one after) takes the run's LoRA there: Fuobe Speak's FusioniX in place of the graph's lightx2v. One at most.
+ let loras = input.loras ?? [];
+ if (loras.length && b.lora && !canTakeLoras(workflow)) {
+ if (loras.length > 1) throw new ProviderError(`${manifest.title} takes one LoRA (it loads it itself): ${loras.map((l) => l.file).join(", ")}`);
+ values.lora = loras[0].file;
+ values.loraStrength = loras[0].strength ?? 1;
+ loras = [];
+ }
// Matte graphs save a cut-out and a black-and-white matte: params.matteOutput keeps one.
const keepRole: string | undefined = ctx.op === "bg-remove-video" ? input.matteOutput : undefined;
@@ -1258,10 +1267,10 @@ export async function prepareWorkflow(endpointTemplate: string, input: GenInput,
} catch (e) {
throw new ProviderError((e as Error).message);
}
- if (input.loras?.length) {
+ if (loras.length) {
// A LoRA a graph can't attach would be dropped without a word: say so instead.
if (!canTakeLoras(wf)) throw new ProviderError(`${manifest.title} can't take LoRAs (it has no model loader to attach them to)`);
- wf = injectLoras(wf, input.loras);
+ wf = injectLoras(wf, loras);
}
// The output not asked for isn't saved (nor encoded: ComfyUI runs only what an output node needs).
if (keepRole && manifest.outputs.some((o) => o.role === keepRole)) for (const o of manifest.outputs) if (o.role && o.role !== keepRole) delete wf[o.node];
@@ -1416,7 +1425,9 @@ export const comfyProvider: ProviderAdapter = {
async submit({ route, input, generationId }) {
const worker = workerFor(route.endpoint);
- const { manifest, workflow: wf, meta } = await prepareWorkflow(route.endpoint, input, {
+ // A route's own graph settings (Fuobe Speak's InfiniteTalk recipe) go in unless the run sets them.
+ const asked = route.extra ? { ...input, extra: { ...route.extra, ...input.extra } } : input;
+ const { manifest, workflow: wf, meta } = await prepareWorkflow(route.endpoint, asked, {
generationId,
op: route.op,
upload: (data, contentType, name) => uploadTo(worker, data, contentType, name),
diff --git a/src/server/providers/mock.ts b/src/server/providers/mock.ts
index 4e7006dc..4b401f9b 100644
--- a/src/server/providers/mock.ts
+++ b/src/server/providers/mock.ts
@@ -320,6 +320,9 @@ function demoOutputs(op: Operation | undefined, kind: MediaKind, prompt: string,
return Array.from({ length: clamp(Math.round(Number(meta.frames ?? 4)), 1, 500) }, (_, index) => ({ url: svgUri(demoSvg(`frame ${index + 1}`, ar, index)), kind: "image" as const, contentType: "image/svg+xml", meta: { index, demo: true } }));
case "overlay":
return [{ url: svgUri(demoSvg(brief || "overlay", ar, 5)), kind: "image", contentType: "image/svg+xml", meta: { demo: true } }];
+ // The face mosaic (O11): a demo picture; no masks, so the browser has nothing to pixelate.
+ case "face-mosaic":
+ return [{ url: svgUri(demoSvg(brief || "pixelated faces", ar, 6)), kind: "image", contentType: "image/svg+xml", meta: { demo: true } }];
// The same tone, as long as the loop was asked to be (or the clips joined end to end).
case "audio-loop":
return [{ url: toDataUri(demoWav(clamp(Math.round(Number(meta.duration ?? 12)), 4, 30)), "audio/wav"), kind: "audio", contentType: "audio/wav", meta: { demo: true } }];
diff --git a/tests/av-tools.test.ts b/tests/av-tools.test.ts
index ada1fa8b..38a492c0 100644
--- a/tests/av-tools.test.ts
+++ b/tests/av-tools.test.ts
@@ -2,6 +2,7 @@ import { describe, expect, it } from "vitest";
import { buildPayload, extractOutputs } from "@/lib/catalog/payload";
import { getModel, getPreset } from "@/lib/catalog";
import { planGeneration } from "@/lib/catalog/plan";
+import { onEngine } from "@/lib/catalog/engines";
import { BURN_CAPS, burnPricePerMinute, burnRequest, burnRouteFor, CAPTION_STYLES, lookFor, nearestColorName, OPEN_FONT_SIZE, previewText, styleById, usesCues, type CaptionLook } from "@/lib/av/captions";
import { animateSpinHref, model3dRequest, model3dView, MODELS_3D } from "@/lib/av/model3d";
import { frameParams, frameRequest } from "@/lib/av/frames";
@@ -162,7 +163,9 @@ describe("apps on the new models", () => {
const preset = getPreset(id)!;
const route = engine === "cloud" ? preset.cloud! : preset.open!;
const images = (preset.inputs ?? []).filter((s) => s.accept === "image").map((_, i) => `/api/files/in${i}.png`);
- return planGeneration({ feature: `app:${id}`, presetId: id, modelId: route.modelId, inputs: { images }, presetOptions }, getModel, getPreset);
+ // An Original (Fuobe Angles) plans as it runs on the engine asked for.
+ const lookup = (m: string) => (getModel(m)?.engines ? onEngine(getModel(m)!, engine) : getModel(m));
+ return planGeneration({ feature: `app:${id}`, presetId: id, modelId: route.modelId, inputs: { images }, presetOptions }, lookup, getPreset);
};
it.each(ids.flatMap((id) => [[id, "cloud"] as const, [id, "open"] as const]))("%s plans on %s without a prompt", (id, engine) => {
@@ -178,14 +181,13 @@ describe("apps on the new models", () => {
expect(plan("app-image-to-3d", "open").model.id).toBe("oss-trellis2");
});
- it("Angles: the choices set the camera sliders on the cloud and the LoRA's words on the open engine", () => {
- const choice = { angle: "back-left", height: "high-angle", distance: "close-up" };
+ it("Angles: the choices set the camera fields on the cloud and the LoRA's words on the open engine (Fuobe Angles, O11)", () => {
+ const choice = { rotate: "45-right", height: "from-above", distance: "close-up" };
const cloud = plan("app-angles", "cloud", choice);
- expect(cloud.model.id).toBe("qwen-multiple-angles");
- expect(cloud.params.extra).toMatchObject({ horizontal_angle: 225, vertical_angle: 60, zoom: 10 });
- expect(cloud.prompt.length).toBeGreaterThan(0);
+ expect(cloud.model.id).toBe("fuobe-angles");
+ expect(cloud.params.extra).toMatchObject({ rotate_right_left: -45, vertical_angle: -1, move_forward: 10 });
const open = plan("app-angles", "open", choice);
- expect(open.prompt).toMatch(/^<sks> back-left quarter view high-angle shot close-up/);
+ expect(open.prompt).toMatch(/^将镜头向右旋转45度 Rotate the camera 45 degrees to the right\. .*Turn the camera to a close-up\. .*bird's-eye view\.$/);
expect(open.loras[0]?.file).toMatch(/multiple-angles/);
});
diff --git a/tests/model-access-listings.test.ts b/tests/model-access-listings.test.ts
index dc55914d..0fdb9bdd 100644
--- a/tests/model-access-listings.test.ts
+++ b/tests/model-access-listings.test.ts
@@ -94,9 +94,12 @@ describe("Models & licences in listings and picks", () => {
it("lists every model, LoRA and node pack with its licence, and flips switches through the settings API", async () => {
const list = (await (await settingsRoute.GET()).json()) as import("@/lib/model-access").AccessList;
expect(list.models.length).toBeGreaterThan(300);
- // The library's 115 LoRAs (Fuobe Try-On's try-on LoRA among them), the preset LoRA map's files that aren't library
- // files, and MiniMax H3's four (Akatz Labs' swap LoRA V1.5 and V1 and Person Remover V1, lightx2v's H3 Turbo), each once.
- expect(list.loras.length).toBe(171);
+ // The library's 117 LoRAs (Fuobe Try-On's try-on LoRA, and since O11 Fuobe Angles' Multiple-angles and Fuobe Speak's
+ // FusioniX among them), the preset LoRA map's files that aren't library files, and MiniMax H3's four (Akatz Labs' swap
+ // LoRA V1.5 and V1 and Person Remover V1, lightx2v's H3 Turbo), each once.
+ expect(list.loras.length).toBe(173);
+ expect(list.loras.find((l) => l.file === "qwen-edit-2509-multiple-angles-dx8152.safetensors")).toMatchObject({ group: "adapter", on: true, licence: { name: "Apache-2.0", class: "commercial" } });
+ expect(list.loras.find((l) => l.file === "Wan2.1_I2V_14B_FusionX_LoRA.safetensors")).toMatchObject({ group: "adapter", on: true });
expect(list.loras.find((l) => l.file === "tryon-klein-4b.safetensors")).toMatchObject({ group: "adapter", on: true, licence: { name: "Apache-2.0", class: "commercial" } });
expect(list.loras.find((l) => l.file === "h3_character_swap_v1.5.safetensors")).toMatchObject({ group: "adapter", base: "MiniMax H3", on: true, licence: { name: "MiniMax H3 Community License", class: "regions" } });
expect(list.packs.find((p) => p.name === "h3_character_swap")).toMatchObject({ licence: { name: "GPL-3.0" }, on: true });
diff --git a/tests/open-engine.test.ts b/tests/open-engine.test.ts
index 08045ee6..b7a539cf 100644
--- a/tests/open-engine.test.ts
+++ b/tests/open-engine.test.ts
@@ -7,6 +7,7 @@ import type { Manifest } from "@/lib/comfy";
import { planGeneration } from "@/lib/catalog/plan";
import { applySketch, stripMotionPaths } from "@/lib/catalog/sketch";
import { resample, tracksFor } from "@/lib/motion-paths";
+import { ANGLES_FIELDS, ANGLES_ORIGINAL } from "@/lib/catalog/open-tools";
describe("motion paths (Wan-Move draw to video)", () => {
it("resamples a path to evenly spaced points, one per frame", () => {
@@ -124,7 +125,8 @@ describe("round-3 open models", () => {
for (const wid of ids) {
const keys = Object.keys(workflowById.get(wid)?.bindings ?? {});
for (const p of [...(m.options.sliders ?? []), ...(m.options.controls ?? [])].map((s) => s.param)) {
- if (!PROVIDER_PARAMS.has(p) && p !== "cameraMotion") expect(keys, `${m.id} → ${wid}: ${p}`).toContain(p);
+ // Fuobe Angles' camera fields become the Multiple-angles LoRA's words in the planner (src/lib/catalog/open-tools.ts).
+ if (!PROVIDER_PARAMS.has(p) && p !== "cameraMotion" && !(m.id === ANGLES_ORIGINAL && (ANGLES_FIELDS as readonly string[]).includes(p))) expect(keys, `${m.id} → ${wid}: ${p}`).toContain(p);
}
}
}
diff --git a/tests/open-tools.test.ts b/tests/open-tools.test.ts
new file mode 100644
index 00000000..68a6c4fb
--- /dev/null
+++ b/tests/open-tools.test.ts
@@ -0,0 +1,309 @@
+import fs from "node:fs";
+import os from "node:os";
+import path from "node:path";
+import { afterAll, beforeAll, describe, expect, it } from "vitest";
+import type { GenInput, ModelDef, ModelRoute, Operation } from "@/lib/catalog/types";
+import type { ComfyWorkflow } from "@/lib/comfy";
+
+// Build plan O11 (rebranded open tools, Speak and finishing): Fuobe Angles (Qwen-Image-Edit 2509 + dx8152's
+// Multiple-angles LoRA on both engines, the Angles app's Higgsfield-like controls), Fuobe Speak (InfiniteTalk with
+// Higgsfield's Infinite Talk settings on the GPU, fal's InfiniteTalk) and Fuobe Speak · Motion (Wan 2.2 S2V), Depth
+// Map's Large model as a labelled alternative, the HDR route's LoRA endpoint, and Soul's face mosaic (SAM 3.1 + a
+// mosaic on the GPU, fal's SAM 3.1 masks pixelated in the browser).
+const dir = fs.mkdtempSync(path.join(os.tmpdir(), "fuobe-o11-"));
+process.env.FUOBE_DATA_DIR = dir;
+process.env.COMFYUI_URL = "http://127.0.0.1:9"; // nothing listens here: open runs fall back to the demo
+
+const { setSetting } = await import("@/server/settings");
+const { createGenerations, getGeneration, previewGeneration } = await import("@/server/generations");
+const { falProvider } = await import("@/server/providers/fal");
+const { prepareWorkflow, getWorkflow } = await import("@/server/providers/comfyui");
+const { getModel, getPreset } = await import("@/lib/catalog");
+const { onEngine } = await import("@/lib/catalog/engines");
+const { planGeneration, estimateCost } = await import("@/lib/catalog/plan");
+const { extractOutputs, numFramesValue } = await import("@/lib/catalog/payload");
+const { soulPostStep, soulLook } = await import("@/lib/catalog/soul");
+const tools = await import("@/lib/catalog/open-tools");
+const { finishSteps, mosaicPixels, unionMasks } = await import("@/lib/soul-post");
+const { accessList } = await import("@/server/model-access");
+const { licenceInfo } = await import("@/lib/licences");
+
+beforeAll(() => setSetting("demoMode", "auto"));
+afterAll(() => fs.rmSync(dir, { recursive: true, force: true }));
+
+const view = (id: string, engine: "open" | "cloud") => onEngine(getModel(id)!, engine);
+const plan = (r: Parameters<typeof planGeneration>[0], engine: "open" | "cloud") =>
+ planGeneration(r, (id) => (getModel(id)?.engines ? view(id, engine) : getModel(id)), getPreset);
+const research = JSON.parse(fs.readFileSync(path.join(__dirname, "../docs/research/fuobe-originals-recipes-5.json"), "utf8"));
+
+async function prepare(id: string, input: GenInput, op: Operation): Promise<ComfyWorkflow> {
+ const { workflow } = await prepareWorkflow(id, { seed: 7, ...input }, { generationId: "g", op, upload: async (_d, _t, name) => `up_${name}`, media: () => undefined, serverRam: async () => undefined });
+ return workflow;
+}
+
+/** Submit through the fal adapter and return the endpoint URL and the JSON body it posted. */
+async function submit(model: ModelDef, route: ModelRoute, given: GenInput): Promise<{ url: string; body: Record<string, unknown> }> {
+ const real = globalThis.fetch;
+ let seen: { url: string; body: Record<string, unknown> } | undefined;
+ globalThis.fetch = (async (url: string, init?: RequestInit) => {
+ seen = { url: String(url), body: JSON.parse(String(init?.body ?? "{}")) };
+ return new Response(JSON.stringify({ request_id: "r1", status_url: "s", response_url: "r", cancel_url: "c" }), { status: 200 });
+ }) as typeof fetch;
+ try {
+ await falProvider.submit({ generationId: "g", model, route, input: given });
+ } finally {
+ globalThis.fetch = real;
+ }
+ return seen!;
+}
+
+describe("Fuobe Angles", () => {
+ it("writes the Multiple-angles LoRA's own words for a camera, and refuses one that doesn't move", () => {
+ expect(tools.anglesWords({ rotate_right_left: 45 })).toBe("将镜头向左旋转45度 Rotate the camera 45 degrees to the left.");
+ expect(tools.anglesWords({ rotate_right_left: -90, move_forward: 10, vertical_angle: -1, wide_angle_lens: true })).toBe(
+ "将镜头向右旋转90度 Rotate the camera 90 degrees to the right. 将镜头转为特写镜头 Turn the camera to a close-up. 将相机转向鸟瞰视角 Turn the camera to a bird's-eye view. 将镜头转为广角镜头 Turn the camera to a wide-angle lens.",
+ );
+ expect(tools.anglesWords({ move_forward: 3, vertical_angle: 1 })).toBe("将镜头向前移动 Move the camera forward. 将相机切换到仰视视角 Turn the camera to a worm's-eye view.");
+ // A half tilt isn't one of the LoRA's views, and out-of-range values are clamped.
+ expect(tools.anglesWords({ vertical_angle: 0.5, rotate_right_left: 400 })).toBe("将镜头向左旋转90度 Rotate the camera 90 degrees to the left.");
+ expect(tools.anglesWords({})).toBe("");
+ expect(() => tools.anglesPrompt({}, "")).toThrow(/Move the camera first/);
+ expect(tools.anglesPrompt({ rotate_right_left: 45 }, "keep the red scarf")).toBe("将镜头向左旋转45度 Rotate the camera 45 degrees to the left. keep the red scarf");
+ });
+
+ it("is an Original on both engines: the 2509 graph with the LoRA on your GPU, fal's LoRA gallery route in the cloud", () => {
+ const m = getModel("fuobe-angles")!;
+ expect(m.engines).toEqual(["open", "cloud"]);
+ const open = view("fuobe-angles", "open");
+ const cloud = view("fuobe-angles", "cloud");
+ expect(open.routes.map((r) => r.endpoint)).toEqual(["qwen-image-edit-2509-angles"]);
+ expect(cloud.routes.map((r) => r.endpoint)).toEqual(["fal-ai/qwen-image-edit-2509-lora-gallery/multiple-angles"]);
+ // Higgsfield's controls on both engines: rotate −90…90°, tilt −1…1, move forward 0–10 (the research's fields).
+ expect(m.options.sliders?.map((s) => [s.param, s.min, s.max])).toEqual([["rotate_right_left", -90, 90], ["vertical_angle", -1, 1], ["move_forward", 0, 10]]);
+ // The LoRA is the recipe's on the GPU (downloaded before a run, switchable); fal has it built in at 1.25, 6 steps.
+ expect(open.options.loras?.map((l) => [l.file, l.strength])).toEqual([["qwen-edit-2509-multiple-angles-dx8152.safetensors", 1.25]]);
+ expect(cloud.options.loras).toBeUndefined();
+ const record = research.studios.find((s: { id: string }) => s.id === "angles").original;
+ expect(cloud.routes[0].map?.defaults).toEqual(record.cloud.defaults);
+ expect(cloud.routes[0].map?.prompt).toBe(false);
+ });
+
+ it("the Angles app turns its picks into fal's fields in the cloud and the LoRA's words on your GPU", async () => {
+ const req = { feature: "app:app-angles", modelId: "fuobe-angles", presetId: "app-angles", prompt: "keep the logo", inputs: { images: ["/a.png"] }, presetOptions: { rotate: "90-right", height: "from-above", distance: "close-up", lens: "wide" } };
+ const open = plan(req, "open");
+ expect(open.prompt).toBe(
+ "将镜头向右旋转90度 Rotate the camera 90 degrees to the right. 将镜头转为特写镜头 Turn the camera to a close-up. 将相机转向鸟瞰视角 Turn the camera to a bird's-eye view. 将镜头转为广角镜头 Turn the camera to a wide-angle lens. keep the logo",
+ );
+ expect(open.loras.map((l) => l.file)).toEqual(["qwen-edit-2509-multiple-angles-dx8152.safetensors"]);
+ const cloud = plan(req, "cloud");
+ expect(cloud.prompt).toBe("");
+ expect(cloud.params.extra).toMatchObject({ rotate_right_left: -90, vertical_angle: -1, move_forward: 10, wide_angle_lens: true });
+ expect(cloud.notes?.join(" ")).toMatch(/takes no words/);
+ // The app's default turns the camera 45° left; an unmoved camera is refused before anything runs.
+ expect(plan({ ...req, presetOptions: undefined }, "cloud").params.extra).toMatchObject({ rotate_right_left: 45 });
+ expect(() => plan({ ...req, presetOptions: { rotate: "front" } }, "cloud")).toThrow(/Move the camera first/);
+ // fal's payload: the fields as they are, the LoRA scale and steps from the research, no prompt.
+ setSetting("falKey", "fal_test_key_123456");
+ try {
+ const model = view("fuobe-angles", "cloud");
+ const sent = await submit(model, model.routes[0], { prompt: "", images: ["https://x/a.png"], extra: cloud.params.extra, seed: 3 });
+ expect(sent.url).toMatch(/fal-ai\/qwen-image-edit-2509-lora-gallery\/multiple-angles$/);
+ expect(sent.body).toMatchObject({ image_urls: ["https://x/a.png"], rotate_right_left: -90, vertical_angle: -1, move_forward: 10, wide_angle_lens: true, lora_scale: 1.25, num_inference_steps: 6, seed: 3 });
+ expect(sent.body.prompt).toBeUndefined();
+ } finally {
+ setSetting("falKey", "");
+ }
+ });
+
+ it("the GPU graph: Lightning, then the Multiple-angles LoRA at 1.25, 6 steps, the words as the instruction", async () => {
+ const wf = await prepare(
+ "qwen-image-edit-2509-angles",
+ { prompt: tools.anglesWords({ rotate_right_left: 45 }), images: ["a.png"], loras: tools.ANGLES_LORA ? [tools.ANGLES_LORA] : [] },
+ "edit",
+ );
+ const loras = Object.fromEntries(Object.entries(wf).filter(([, n]) => n.class_type === "LoraLoaderModelOnly").map(([id, n]) => [String(n.inputs.lora_name), { id, strength: n.inputs.strength_model, from: n.inputs.model }]));
+ // The recipe's LoRA is the graph's own: not loaded twice. Lightning on the model, the Multiple-angles LoRA after it.
+ expect(Object.keys(loras).sort()).toEqual(["Qwen-Image-Edit-2509-Lightning-4steps-V1.0-bf16.safetensors", "qwen-edit-2509-multiple-angles-dx8152.safetensors"]);
+ expect(loras["qwen-edit-2509-multiple-angles-dx8152.safetensors"]).toMatchObject({ strength: 1.25, from: [loras["Qwen-Image-Edit-2509-Lightning-4steps-V1.0-bf16.safetensors"].id, 0] });
+ expect(wf["433:111"].inputs.prompt).toBe("将镜头向左旋转45度 Rotate the camera 45 degrees to the left.");
+ expect(wf["433:436"].inputs.value).toBe(6);
+ expect(wf["78"].inputs.image).toBe("a.png");
+ });
+});
+
+describe("Fuobe Speak", () => {
+ it("is InfiniteTalk on both engines and Speak · Motion is Wan 2.2 S2V, each as long as the voice", () => {
+ expect(view("fuobe-speak", "open").routes.map((r) => r.endpoint)).toEqual(["infinitetalk-wanwrapper"]);
+ expect(view("fuobe-speak", "cloud").routes.map((r) => r.endpoint)).toEqual(["fal-ai/infinitalk"]);
+ expect(view("fuobe-speak-motion", "open").routes.map((r) => r.endpoint)).toEqual(["wan22-s2v-14b"]);
+ expect(view("fuobe-speak-motion", "cloud").routes.map((r) => r.endpoint)).toEqual(["fal-ai/wan/v2.2-14b/speech-to-video"]);
+ // fal's InfiniteTalk renders 25 fps frames (41–721): 6 s of voice is 150; S2V 16 fps, a multiple of 4 up to 120.
+ const it = view("fuobe-speak", "cloud").routes[0].map!.numFrames!;
+ expect(numFramesValue(it, { sourceDuration: 6 })).toBe(150);
+ expect(numFramesValue(it, { sourceDuration: 60 })).toBe(721);
+ const s2v = view("fuobe-speak-motion", "cloud").routes[0].map!.numFrames!;
+ expect(numFramesValue(s2v, { sourceDuration: 5.1 })).toBe(80);
+ expect(numFramesValue(s2v, { sourceDuration: 1 })).toBe(40);
+ expect(numFramesValue(s2v, { sourceDuration: 30 })).toBe(120);
+ // The hosted InfiniteTalk used to be sent seconds as num_frames: it follows the voice now too.
+ expect(getModel("infinitetalk-cloud")!.routes[0].map?.numFrames).toMatchObject({ key: "num_frames", fps: 25 });
+ // Prices before a run: $0.20 a second (InfiniteTalk); $0.10 / $0.15 / $0.20 by resolution (S2V).
+ expect(estimateCost(view("fuobe-speak", "cloud"), { duration: 10 })).toBeCloseTo(2, 5);
+ expect(estimateCost(view("fuobe-speak-motion", "cloud"), { duration: 5, resolution: "720p" })).toBeCloseTo(1, 5);
+ expect(estimateCost(view("fuobe-speak", "open"), { duration: 10 })).toBe(0);
+ });
+
+ it("sends Higgsfield's Infinite Talk settings on your GPU: FusioniX in the wrapper's LoRA slot, 15 motion frames, 25 steps, shift 10, guidance 5 / 5", async () => {
+ const m = view("fuobe-speak", "open");
+ expect(m.options.loras?.map((l) => l.file)).toEqual(["Wan2.1_I2V_14B_FusionX_LoRA.safetensors"]);
+ const route = m.routes[0];
+ expect(route.extra).toEqual(tools.SPEAK_GRAPH);
+ const record = research.studios.find((s: { id: string }) => s.id === "speak").original.open.defaults;
+ expect(route.extra).toMatchObject({ motionFrame: record.motionFrame, steps: record.steps, shift: record.shift, cfg: record.cfg, audioCfg: record.audioCfg, scheduler: record.scheduler });
+ // The provider merges the route's settings under the run's own (a run that asks for 30 steps gets 30).
+ const run = async (extra?: Record<string, unknown>) =>
+ prepare("infinitetalk-wanwrapper", { prompt: tools.SPEAK_PROMPT, images: ["face.png"], audio: "voice.wav", loras: m.options.loras, extra: { ...route.extra, ...extra } }, "avatar");
+ const wf = await run();
+ expect(wf["138"].inputs).toMatchObject({ lora: "Wan2.1_I2V_14B_FusionX_LoRA.safetensors", strength: 1 });
+ expect(wf["128"].inputs).toMatchObject({ steps: 25, cfg: 5, shift: 10, scheduler: "unipc" });
+ expect(wf["192"].inputs).toMatchObject({ motion_frame: 15, colormatch: "reinhard", mode: "infinitetalk" });
+ expect(wf["194"].inputs.audio_cfg_scale).toBe(5);
+ expect((await run({ steps: 30 }))["128"].inputs.steps).toBe(30);
+ // The solver and colour match it sends are ones the wrapper's nodes take (object_info, the validation server's).
+ const subset = JSON.parse(fs.readFileSync(path.join(__dirname, "../workflows/comfyui/object_info.subset.json"), "utf8"));
+ expect(subset.WanVideoSampler.input.required.scheduler[0]).toContain("unipc");
+ expect(subset.WanVideoImageToVideoMultiTalk.input.required.colormatch[0]).toContain("reinhard");
+ // The graph's own defaults stay the fast lightx2v pass (InfiniteTalk Long runs it as before).
+ const plain = await prepare("infinitetalk-wanwrapper", { prompt: "talk", images: ["face.png"], audio: "voice.wav" }, "avatar");
+ expect(plain["138"].inputs.lora).toBe("lightx2v_I2V_14B_480p_cfg_step_distill_rank64_bf16.safetensors");
+ expect(plain["128"].inputs.steps).toBe(6);
+ // Two LoRAs don't fit the wrapper's one slot.
+ await expect(prepare("infinitetalk-wanwrapper", { prompt: "talk", images: ["f.png"], audio: "v.wav", loras: [{ file: "a.safetensors" }, { file: "b.safetensors" }] }, "avatar")).rejects.toThrow(/takes one LoRA/);
+ });
+
+ it("runs without words, in the portrait's shape on your GPU", () => {
+ const open = plan({ feature: "lipsync", modelId: "fuobe-speak", inputs: { images: ["/p.png"], audio: "/v.wav" } }, "open");
+ expect(open.prompt).toBe(tools.SPEAK_PROMPT);
+ expect(open.params.aspectRatio).toBe("auto");
+ expect(open.loras.map((l) => l.file)).toEqual(["Wan2.1_I2V_14B_FusionX_LoRA.safetensors"]);
+ const cloud = plan({ feature: "lipsync", modelId: "fuobe-speak", inputs: { images: ["/p.png"], audio: "/v.wav" } }, "cloud");
+ expect(cloud.loras).toEqual([]);
+ expect(cloud.prompt).toBe(tools.SPEAK_PROMPT);
+ });
+
+ it("lists FusioniX and the Multiple-angles LoRA with their licences in Settings → Models & licences", () => {
+ const list = accessList();
+ const fusionix = list.loras.find((l) => l.file === "Wan2.1_I2V_14B_FusionX_LoRA.safetensors")!;
+ expect(fusionix).toMatchObject({ group: "adapter", on: true, licence: { name: "Apache-2.0", class: "commercial" } });
+ expect(fusionix.licence.note).toMatch(/merges other LoRAs.*not checked/);
+ expect(list.models.find((m) => m.id === "oss-video-depth-vda-large")).toMatchObject({ on: true, licence: { class: "non-commercial" } });
+ expect(list.models.find((m) => m.id === "fuobe-speak")).toBeTruthy();
+ });
+});
+
+describe("Depth Map and Upscale routes", () => {
+ it("offers Video Depth Anything Large on your GPU, labelled non-commercial, without making it the default", async () => {
+ const m = getModel("oss-video-depth-vda-large")!;
+ expect(m.tagline).toMatch(/non-commercial/);
+ const wf = await prepare("video-depth-vda-large", { video: "clip.mp4", colormap: "inferno" }, "depth-video");
+ expect(Object.values(wf).find((n) => n.class_type === "LoadVideoDepthAnythingModel")?.inputs.model).toBe("video_depth_anything_vitl.pth");
+ expect(licenceInfo(getWorkflow("video-depth-vda-large").manifest.license ?? "").class).toBe("non-commercial");
+ const { VIDEO_DEPTH_STUDIO } = await import("@/lib/studios");
+ expect(VIDEO_DEPTH_STUDIO.defaultModels).toEqual({ cloud: "depth-anything-video-cloud", open: "oss-video-depth-vda" });
+ });
+
+ it("SDR to HDR on fal switches to the /lora endpoint when a LoRA rides along", () => {
+ const r = getModel("ltx-2-3-hdr")!.routes[0];
+ expect(r.loraEndpoint).toBe("fal-ai/ltx-2.3-quality/hdr/lora");
+ expect(r.map?.loras).toMatchObject({ key: "loras", max: 3, required: true });
+ });
+});
+
+describe("Soul's face mosaic", () => {
+ it("PixeletedFace asks for it; other looks and Soul Cinema don't", () => {
+ expect(soulLook("v1-pixeletedface")?.post).toBe("face-mosaic");
+ expect(soulPostStep("fuobe-soul", "v1-pixeletedface")).toBe("face-mosaic");
+ expect(soulPostStep("fuobe-soul", "v1-general")).toBeUndefined();
+ expect(soulPostStep("fuobe-soul-cinema", "v1-pixeletedface")).toBeUndefined();
+ expect(tools.faceMosaicStep("open")).toEqual({ modelId: "oss-face-mosaic", op: "face-mosaic", prompt: "face" });
+ expect(tools.faceMosaicStep("cloud").modelId).toBe("sam-3-1-face-mask");
+ });
+
+ it("chains the picture and the mosaic on the engine it runs on, one pair per picture", () => {
+ for (const engine of ["open", "cloud"] as const) {
+ const made = createGenerations({ feature: "image", modelId: "fuobe-soul", prompt: "a skater", engine, presetId: "v1-pixeletedface", params: { numOutputs: 2 } });
+ expect(made).toHaveLength(4);
+ const steps = made.map((g) => getGeneration(g.id)!).map((g) => [g.modelId, g.op, g.request?.step?.label]);
+ expect(steps).toEqual(
+ expect.arrayContaining([
+ ["fuobe-soul", "t2i", "Before the face mosaic 1 of 2"],
+ [tools.FACE_MOSAIC_MODELS[engine], "face-mosaic", "Face mosaic 1 of 2"],
+ ["fuobe-soul", "t2i", "Before the face mosaic 2 of 2"],
+ [tools.FACE_MOSAIC_MODELS[engine], "face-mosaic", "Face mosaic 2 of 2"],
+ ]),
+ );
+ expect(new Set(made.map((g) => g.batchId)).size).toBe(1);
+ }
+ // Another look runs as one job.
+ expect(createGenerations({ feature: "image", modelId: "fuobe-soul", prompt: "a skater", engine: "cloud", presetId: "v1-general" })).toHaveLength(1);
+ });
+
+ it("the GPU graph: SAM 3.1 on the words ('face' by default), the mask grown, a 25 px mosaic under it", async () => {
+ const p = plan({ feature: "image", modelId: "oss-face-mosaic", op: "face-mosaic", inputs: { images: ["/a.png"] } }, "open");
+ expect(p.prompt).toBe("face");
+ const wf = await prepare("image-face-mosaic-sam3", { prompt: p.prompt, images: ["a.png"] }, "face-mosaic");
+ expect(wf["1"].inputs.image).toBe("a.png");
+ expect(wf["3"].inputs.text).toBe("face");
+ expect(wf["7"].inputs.scale_by).toBe(tools.MOSAIC_SCALE);
+ expect(wf["9"].inputs.mask).toEqual(["5", 0]);
+ });
+
+ it("the cloud step: fal's SAM 3.1 masks, all of them kept, and the browser's finish pixelates the picture under them", async () => {
+ const m = getModel("sam-3-1-face-mask")!;
+ expect(m.hidden).toBe(true);
+ setSetting("falKey", "fal_test_key_123456");
+ try {
+ const sent = await submit(m, m.routes[0], { prompt: "face", images: ["https://x/a.png"] });
+ expect(sent.url).toMatch(/fal-ai\/sam-3-1\/image$/);
+ expect(sent.body).toMatchObject({ image_url: "https://x/a.png", prompt: "face", apply_mask: false, return_multiple_masks: true, max_masks: 16, output_format: "png" });
+ } finally {
+ setSetting("falKey", "");
+ }
+ const out = extractOutputs({ masks: [{ url: "https://f/m1.png", content_type: "image/png" }, { url: "https://f/m2.png" }], image: { url: "https://f/preview.png" } }, "face-mosaic");
+ expect(out).toEqual([{ url: "https://f/m1.png", kind: "image", contentType: "image/png", meta: { role: "mask", masks: ["https://f/m1.png", "https://f/m2.png"] } }]);
+ expect(extractOutputs({ masks: [] }, "face-mosaic")).toEqual([]);
+ // What the server writes on the step (meta.mosaic) is a finish the browser does once.
+ const steps = finishSteps({ kind: "image", meta: { role: "mask", mosaic: { source: "/api/files/a.png", masks: ["/api/files/m1.png"] } } });
+ expect(steps).toEqual({ mosaic: { source: "/api/files/a.png", masks: ["/api/files/m1.png"], scale: tools.MOSAIC_SCALE } });
+ expect(finishSteps({ kind: "image", meta: { finished: true, mosaic: { source: "/a.png", masks: ["/m.png"] } } })).toBeNull();
+ });
+
+ it("pixelates whole blocks wherever a mask touches them, and nothing else", () => {
+ const w = 60;
+ const h = 30;
+ const rgba = new Uint8ClampedArray(w * h * 4);
+ for (let i = 0; i < w * h; i++) rgba.set([i % w < 30 ? 200 : 20, (i * 7) % 255, 0, 255], i * 4);
+ const before = rgba.slice();
+ const mask = (x0: number, y0: number) => {
+ const m = new Uint8ClampedArray(w * h * 4);
+ m.set([255, 255, 255, 255], (y0 * w + x0) * 4);
+ return m;
+ };
+ // Two masks, one pixel each: blocks (0,0) and (2,1) of the 25 px grid (3 × 2 blocks over 60 × 30).
+ const changed = mosaicPixels(rgba, unionMasks([mask(3, 3), mask(55, 28)]), w, h, tools.MOSAIC_SCALE);
+ expect(changed).toBe(2);
+ const at = (x: number, y: number, a = rgba) => Array.from(a.slice((y * w + x) * 4, (y * w + x) * 4 + 4));
+ // Inside a block every pixel is the block's average; outside the touched blocks nothing moved.
+ expect(at(0, 0)).toEqual(at(24, 24));
+ expect(at(0, 0)[0]).toBe(200);
+ expect(at(30, 5)).toEqual(at(30, 5, before));
+ expect(at(26, 26)).toEqual(at(26, 26, before));
+ expect(at(50, 25)).toEqual(at(59, 29));
+ });
+
+ it("the preview prices the Soul picture; the mosaic step is $0.01 in the cloud and free on your GPU", () => {
+ expect(estimateCost(getModel("sam-3-1-face-mask")!, {})).toBeCloseTo(0.01, 5);
+ expect(estimateCost(getModel("oss-face-mosaic")!, {})).toBe(0);
+ expect(previewGeneration({ feature: "image", modelId: "oss-face-mosaic", op: "face-mosaic", inputs: { images: ["/a.png"] } }).op).toBe("face-mosaic");
+ });
+});
diff --git a/workflows/comfyui/manifest.json b/workflows/comfyui/manifest.json
index 04b3e790..ccc2b24c 100644
--- a/workflows/comfyui/manifest.json
+++ b/workflows/comfyui/manifest.json
@@ -1,6 +1,6 @@
{
"version": 1,
- "generatedAt": "2026-10-29T01:47:19.961Z",
+ "generatedAt": "2026-10-29T02:00:11.934Z",
"comfyuiCommit": "fc04da91b2ab12f99e4716371a7e4f98ac982597",
"comfyuiVersion": "0.41.0",
"workflowTemplatesVersion": "0.11.86",
@@ -8030,7 +8030,7 @@
},
{
"id": "video-depth-vda-large",
- "title": "Video Depth Map (Video Depth Anything Large: Higgsfield Depth Map's model, non-commercial weights)",
+ "title": "Video Depth Map (Video Depth Anything Large, non-commercial weights)",
"capability": "depth-video",
"file": "video-depth-vda-large.json",
"source": "hand-built (scripts/comfy/hand-built/video-depth-vda-small.json)",