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.
TypeScript ai-videocomfyuicreative-toolsgenerative-aiideogramimage-generationimage-to-3dimage-to-videoltx-videominimax-h3nextjsopen-sourceopen-weightsqwen-imagetext-to-imagevideo-generationwan
Originals O2: one model on both engines in every list, the canvas, the CLI and Assist
Claude2e09b62710a4
diff --git a/bin/lib/build.mjs b/bin/lib/build.mjsindex e561f0e5..8c9c6096 100644--- a/bin/lib/build.mjs+++ b/bin/lib/build.mjs@@ -104,10 +104,16 @@ export function generationRequest({ prompt, modelId, values: v, uploaded = new Mif (PARAMS.has(key)) params[key] = value;else (params.extra ??= {})[key] = value;}+ if (v["look-strength"] !== undefined && !(v["look-strength"] >= 0 && v["look-strength"] <= 1)) throw new UsageError("--look-strength is a number from 0 to 1", "generate");const text = prompt?.trim();return {feature: "cli",modelId,+ // A Fuobe Original runs on both engines: --engine picks one (other models ignore it; checkEngine says so).+ ...(v.engine && { engine: v.engine }),+ // A Fuobe Soul look (fuobe-soul, fuobe-soul-hd) and how strongly its LoRAs apply.+ ...(v.look && { presetId: v.look }),+ ...(v["look-strength"] !== undefined && { presetStrength: v["look-strength"] }),...(v.op && { op: v.op }),...(text && { prompt: text }),...(v.negative && { negativePrompt: v.negative }),diff --git a/bin/lib/commands.mjs b/bin/lib/commands.mjsindex 6cb6e4c4..f03e6646 100644--- a/bin/lib/commands.mjs+++ b/bin/lib/commands.mjs@@ -64,6 +64,8 @@ export const GEN_OPTIONS = {count: { type: "number", short: "n", value: "n", describe: "How many takes (1–8)" },seed: { type: "number", value: "n" },negative: { type: "string", value: "text", describe: "Negative prompt" },+ look: { type: "string", value: "id", describe: "A Fuobe Soul look (fuobe-soul, fuobe-soul-hd): v1-general, v1-y2k, v2-y2k-studio…" },+ "look-strength": { type: "number", value: "0-1", describe: "How strongly the look's LoRAs apply (default 1)" },sound: { type: "boolean", describe: "Native sound on (--no-sound for off), on video models that offer it" },enhance: { type: "boolean", describe: "Let Fuobe rewrite the prompt first" },voice: { type: "string", value: "id", describe: "Voice id for text to speech" },@@ -396,7 +398,8 @@ async function models(ctx) {// How a run goes today (Settings → Demo mode decides with the providers); an older server only says `connected`.const runs = (m) => m.runs ?? (m.connected ? "real" : "demo");const mark = { real: "", demo: " (demo)", refused: " (not set up)" };- const rows = items.map((m) => [m.id, m.name, m.engine === "open" ? "open" : "cloud", `${m.price}${mark[runs(m)] ?? ""}`, m.ops.join(", ")]);+ // A Fuobe Original runs on both engines (open+cloud); --engine lists it as that engine's model.+ const rows = items.map((m) => [m.id, m.name, (m.engines ?? [m.engine]).map((e) => (e === "open" ? "open" : "cloud")).join("+"), `${m.price}${mark[runs(m)] ?? ""}`, m.ops.join(", ")]);ctx.print(table(["ID", "NAME", "ENGINE", "PRICE", "DOES"], rows, ctx.io.columns));const count = (r) => items.filter((m) => runs(m) === r).length;const notes = [`${items.length} model${items.length === 1 ? "" : "s"}${items.length < res.items.length ? ` of ${res.items.length}` : ""}.`];diff --git a/src/app/api/models/route.ts b/src/app/api/models/route.tsindex 365965ac..43d830c6 100644--- a/src/app/api/models/route.ts+++ b/src/app/api/models/route.ts@@ -1,5 +1,6 @@import { connection } from "next/server";import { getModel, MODELS } from "@/lib/catalog";+import { onEngine, runsOn } from "@/lib/catalog/engines";import { ENGINE_MODELS } from "@/lib/catalog/faceless";import { OPERATION_LABELS, type Engine, type MediaKind, type ModelDef, type Operation } from "@/lib/catalog/types";import { findModels, MODEL_KINDS, toModelInfo } from "@/lib/model-list";@@ -57,9 +58,12 @@ export async function GET(request: Request) {const op = p.get("op") || undefined;if (op && !(op in OPERATION_LABELS)) return Response.json({ error: `Unknown operation ${op}` }, { status: 400 });const mode = engineMode();- const list = findModels(MODELS, { kind: kind as MediaKind | undefined, engine: engine as Engine | undefined, op: op as Operation | undefined, q: p.get("q") ?? undefined, hidden: p.get("hidden") === "1" }).filter(- (m) => mode === "both" || m.engine === mode,- );+ // A Fuobe Original runs on both engines: on a list for one engine (asked for, or the install's only one) it is+ // that engine's model (its routes, its price), else it is listed once with both.+ const only = (engine as Engine | undefined) ?? (mode === "both" ? undefined : mode);+ const list = findModels(MODELS, { kind: kind as MediaKind | undefined, engine: engine as Engine | undefined, op: op as Operation | undefined, q: p.get("q") ?? undefined, hidden: p.get("hidden") === "1" })+ .filter((m) => mode === "both" || runsOn(m, mode))+ .map((m) => (only ? onEngine(m, only) : m));const defaults = Object.fromEntries(Object.entries(DEFAULTS).map(([k, ids]) => [k, { ...(mode !== "open" && ids.cloud && { cloud: ids.cloud }), ...(mode !== "cloud" && ids.open && { open: ids.open }) }]),);diff --git a/src/components/canvas/canvas-editor.tsx b/src/components/canvas/canvas-editor.tsxindex e6943086..c8cbeaee 100644--- a/src/components/canvas/canvas-editor.tsx+++ b/src/components/canvas/canvas-editor.tsx@@ -42,6 +42,7 @@ import { Viewer } from "@/components/studio/viewer";import { useIsMobile } from "@/hooks/use-mobile";import { useElements, useEngine, useStatus, type EngineMode } from "@/lib/api";import { getModel } from "@/lib/catalog";+import { onEngine, runsOn } from "@/lib/catalog/engines";import {acceptsType,cleanGraph,@@ -640,7 +641,8 @@ function Editor({ id, initial, view }: { id: string; initial: Canvas; view: Canv? []: generators.filter((n) => {const m = n.data.modelId ? getModel(n.data.modelId) : undefined;- return m && m.engine !== mode;+ // A Fuobe Original runs on both engines: it's never off the install's engine.+ return m && !runsOn(m, mode);});const stuck = offEngine.filter((n) => !counterpart(graph, n, mode as Engine));const switchable = offEngine.length - stuck.length;@@ -777,7 +779,8 @@ function Editor({ id, initial, view }: { id: string; initial: Canvas; view: Canvconst entry = viewer ? viewerEntries[viewer.index] : undefined;const planDemo = plan.steps.some((s) => {const m = getModel(s.request.modelId);- return m && isDemo(m);+ // A Fuobe Original's step names its engine: a demo is about that engine's providers.+ return m && isDemo(s.request.engine ? onEngine(m, s.request.engine) : m);});const attention = new Set(plan.errors.map((e) => e.nodeId)).size;const summary = [diff --git a/src/components/canvas/node-list.tsx b/src/components/canvas/node-list.tsxindex 8a03efa7..93d2dd5e 100644--- a/src/components/canvas/node-list.tsx+++ b/src/components/canvas/node-list.tsx@@ -4,8 +4,7 @@ import { AlertCircle, PinOff, Play, RotateCcw, Sparkles, Square, Upload } from "import Link from "next/link";import { useRef } from "react";import { Button } from "@/components/ui/button";-import { getModel } from "@/lib/catalog";-import { CANVAS_TEXT_MAX, isGenerator, NODE_SPECS, nodeLabel, promptPlaceholder, topoOrder, type CanvasNode } from "@/lib/catalog/canvas";+import { CANVAS_TEXT_MAX, isGenerator, NODE_SPECS, nodeLabel, nodeModel, promptPlaceholder, topoOrder, type CanvasNode } from "@/lib/catalog/canvas";import type { MediaKind } from "@/lib/catalog/types";import { fileToSlot } from "@/components/studio/media-slot";import { cn } from "@/lib/utils";@@ -55,7 +54,7 @@ export function NodeList({ onQuickStart }: { onQuickStart: () => void }) {function NodeCard({ node, index }: { node: CanvasNode; index: number }) {const actions = useEditorActions();const { graph, views, globals } = useEditorSnapshot();- const model = node.data.modelId ? getModel(node.data.modelId) : undefined;+ const model = nodeModel(node, globals.mode);const kind = KIND[node.type];const file = useRef<HTMLInputElement>(null);const gen = isGenerator(node);diff --git a/src/components/canvas/nodes.tsx b/src/components/canvas/nodes.tsxindex 0741507b..1f756326 100644--- a/src/components/canvas/nodes.tsx+++ b/src/components/canvas/nodes.tsx@@ -62,7 +62,7 @@ import { ControlsChip } from "@/components/studio/model-controls";import { ModelPicker } from "@/components/studio/model-picker";import { ResponsivePanel } from "@/components/studio/responsive-panel";import { useAssets, useElements } from "@/lib/api";-import { getModel } from "@/lib/catalog";+import { dualEngine, onEngine } from "@/lib/catalog/engines";import {CANVAS_TEXT_MAX,connectionError,@@ -73,6 +73,7 @@ import {modelChoices,NODE_SPECS,nodeLabel,+ nodeModel,nodeOps,OUT,outputType,@@ -646,7 +647,8 @@ const GeneratorNode = memo(function GeneratorNode({ id, type, data, selected }:const g = useEditorGlobals();const v = useNodeView(id);const node = useMemo(() => asNode(id, type, data), [id, type, data]);- const model = data.modelId ? getModel(data.modelId) : undefined;+ // A Fuobe Original as it runs on this node's engine (its routes and price).+ const model = useMemo(() => nodeModel(node, g.mode), [node, g.mode]);const ports = useMemo(() => inputPorts(node), [node]);const out = outputType(EMPTY_GRAPH, node);const r = v.results;@@ -655,7 +657,8 @@ const GeneratorNode = memo(function GeneratorNode({ id, type, data, selected }:// The picker opens on the node's own engine (or the install's only one); its switch browses the other.const [browseEngine, setBrowseEngine] = useState<Engine | null>(null);const pickerEngine: Engine = g.mode !== "both" ? g.mode : (browseEngine ?? model?.engine ?? g.engine);- const choices = useMemo(() => modelChoices(node), [node]);+ // A Fuobe Original is listed on the engine being browsed (it runs on both).+ const choices = useMemo(() => modelChoices(node).map((m) => onEngine(m, pickerEngine)), [node, pickerEngine]);const error = v.runError ?? v.error;// Handles change with the model and op: tell React Flow to re-measure them (React Flow measures new nodes itself).@@ -670,7 +673,8 @@ const GeneratorNode = memo(function GeneratorNode({ id, type, data, selected }:const pickModel = (m: ModelDef) => {const keepOp = data.op && m.routes.some((x) => x.op === data.op) ? data.op : undefined;- actions.update(id, { modelId: m.id, op: keepOp, params: sanitizeParams(m, data.params) });+ // A Fuobe Original runs on the engine it was picked on.+ actions.update(id, { modelId: m.id, op: keepOp, params: sanitizeParams(m, data.params), engine: dualEngine(m) ? m.engine : undefined });setBrowseEngine(null);};diff --git a/src/components/models-table.tsx b/src/components/models-table.tsxindex 77b07761..e7d4076a 100644--- a/src/components/models-table.tsx+++ b/src/components/models-table.tsx@@ -7,7 +7,7 @@ import { useProgressive } from "@/components/use-progressive";import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover";import { useEngine } from "@/lib/api";import type { Engine, MediaKind } from "@/lib/catalog/types";-import { modelSearchText, type ModelRow } from "@/lib/model-rows";+import { enginesLabel, modelSearchText, type ModelRow } from "@/lib/model-rows";import { cn } from "@/lib/utils";const KIND_LABEL: Partial<Record<MediaKind, string>> = { image: "Image", video: "Video", audio: "Audio", text: "Text", model3d: "3D" };@@ -55,7 +55,8 @@ const Row = memo(function Row({ m }: { m: ModelRow }) {<tr className="align-top hover:bg-accent/50"><td className="px-3 py-3 sm:px-4"><div className="flex flex-wrap items-center gap-1.5 font-medium">- {m.engine === "open" ? <Cpu className="size-3.5 shrink-0 md:hidden" aria-label="Open source" /> : <Cloud className="size-3.5 shrink-0 md:hidden" aria-label="Cloud" />}+ {m.engines.includes("open") && <Cpu className="size-3.5 shrink-0 md:hidden" aria-label="Open source" />}+ {m.engines.includes("cloud") && <Cloud className="size-3.5 shrink-0 md:hidden" aria-label="Cloud" />}{m.name}{m.badges.map((b) => (<span@@ -81,8 +82,9 @@ const Row = memo(function Row({ m }: { m: ModelRow }) {</td><td className="hidden px-4 py-3 whitespace-nowrap md:table-cell"><span className="inline-flex items-center gap-1">- {m.engine === "open" ? <Cpu className="size-3.5" /> : <Cloud className="size-3.5" />}- {m.engine === "open" ? "Open source" : "Cloud"}+ {m.engines.includes("open") && <Cpu className="size-3.5" />}+ {m.engines.includes("cloud") && <Cloud className="size-3.5" />}+ {enginesLabel(m.engines)}</span></td><td className="hidden px-4 py-3 text-[12px] text-muted-foreground md:table-cell">{m.ops.join(" · ")}</td>@@ -116,7 +118,7 @@ export function ModelsTable({ models }: { models: ModelRow[] }) {const index = useMemo(() => models.map((m) => [m, modelSearchText(m)] as const), [models]);const kinds = useMemo(() => [...new Set(models.map((m) => m.kind))], [models]);const list = useMemo(- () => index.filter(([m, text]) => (engine === "all" || m.engine === engine) && (kind === "all" || m.kind === kind) && (!term || text.includes(term))).map(([m]) => m),+ () => index.filter(([m, text]) => (engine === "all" || m.engines.includes(engine)) && (kind === "all" || m.kind === kind) && (!term || text.includes(term))).map(([m]) => m),[index, engine, kind, term],);// 40 rows in the page's HTML, the rest as you scroll.diff --git a/src/lib/catalog/canvas.ts b/src/lib/catalog/canvas.tsindex a4f7c956..0574da97 100644--- a/src/lib/catalog/canvas.ts+++ b/src/lib/catalog/canvas.ts@@ -8,6 +8,7 @@* the server (POST /api/canvases/:id/run) plan a graph exactly the same way.*/import { getModel, getPreset, MODELS, supportsOp } from "./index";+import { dualEngine, onEngine, runsOn } from "./engines";import { chainedWaitMessage, keyframeChain } from "./keyframes";import { estimateCost, inferOperation, planGeneration, type Plan } from "./plan";import {@@ -68,6 +69,8 @@ export interface CanvasNodeData {preview?: string;/** Generator nodes. `op` undefined = worked out from what's connected. */modelId?: string;+ /** A Fuobe Original (runs on both engines, ModelDef.engines): the engine this node runs it on. */+ engine?: Engine;op?: Operation;prompt?: string;params?: GenParams;@@ -325,6 +328,22 @@ export function defaultModelForNode(n: Pick<CanvasNode, "type" | "data">, enginereturn op ? defaultModelFor(op, engine, { hidden: true }) : undefined;}+/**+ * The engine a node runs its model on: the model's own, or for a Fuobe Original (both engines) the install's only+ * engine, else the node's pick, else the model's first (the open engine: free).+ */+export function nodeEngine(n: Pick<CanvasNode, "data">, m: ModelDef, mode: "both" | Engine = "both"): Engine {+ if (!dualEngine(m)) return m.engine;+ if (mode !== "both" && runsOn(m, mode)) return mode;+ return n.data.engine && runsOn(m, n.data.engine) ? n.data.engine : m.engine;+}++/** A node's model as it runs: a Fuobe Original keeps its engine's routes and price (onEngine). */+export function nodeModel(n: Pick<CanvasNode, "data">, mode: "both" | Engine = "both"): ModelDef | undefined {+ const m = n.data.modelId ? getModel(n.data.modelId) : undefined;+ return m && onEngine(m, nodeEngine(n, m, mode));+}+/** Models the node's picker offers. */export function modelChoices(n: Pick<CanvasNode, "type" | "data">): ModelDef[] {if (n.type === "model") {@@ -834,6 +853,8 @@ function buildRequest(graph: CanvasGraph, n: CanvasNode, model: ModelDef): NodeRconst request: GenerationRequest = {feature: "canvas",modelId: model.id,+ // A Fuobe Original runs on the engine the node picked (the server would otherwise take the first one ready).+ ...(dualEngine(model) && { engine: model.engine }),...(op && { op }),...(prompt && { prompt }),...(Object.keys(inputs).length && { inputs }),@@ -850,10 +871,11 @@ export interface DescribeContext {/** Everything the editor and the planner need about one generator node. */export function describeNode(graph: CanvasGraph, n: CanvasNode, ctx: DescribeContext = {}): NodeDescription {if (!isGenerator(n)) return { costUsd: null, error: "Not a generator" };- const model = n.data.modelId ? getModel(n.data.modelId) : undefined;- if (!model) return { costUsd: null, error: n.data.modelId ? "That model is no longer in the catalog — pick another" : "Pick a model" };const mode = ctx.engineMode ?? "both";- if (mode !== "both" && model.engine !== mode) {+ // A Fuobe Original as it runs on the node's engine (its routes, its price).+ const model = nodeModel(n, mode);+ if (!model) return { costUsd: null, error: n.data.modelId ? "That model is no longer in the catalog — pick another" : "Pick a model" };+ if (mode !== "both" && !runsOn(model, mode)) {return {model,costUsd: null,@@ -866,7 +888,7 @@ export function describeNode(graph: CanvasGraph, n: CanvasNode, ctx: DescribeConconst built = buildRequest(graph, n, model);if ("error" in built) return { model, costUsd: null, error: built.error };try {- const plan = planGeneration(withPlaceholders(built.request), getModel, getPreset);+ const plan = planGeneration(withPlaceholders(built.request), (id) => (id === model.id ? model : getModel(id)), getPreset);// A film built clip by clip is planned from its inputs when it starts: it can't wait for another node (said before Run).if (built.deps.length && plan.op === "keyframes" && keyframeChain(plan.model)) return { ...built, model, costUsd: null, error: chainedWaitMessage(plan.model.name) };return { ...built, model, plan, costUsd: estimateCost(plan.model, plan.params, plan.jobs, plan.op) };@@ -1040,7 +1062,8 @@ export function planCanvas(graph: CanvasGraph, opts: PlanOptions = {}): CanvasPl/** The equivalent model on the other engine for a node, if there is one. */export function counterpart(graph: CanvasGraph, n: CanvasNode, engine: Engine): ModelDef | undefined {const current = n.data.modelId ? getModel(n.data.modelId) : undefined;- if (current?.engine === engine) return current;+ // A Fuobe Original runs on both: it stays, on the other engine.+ if (current && runsOn(current, engine)) return current;if (n.type !== "model") return defaultModelForNode(n, engine);const op = n.data.op ?? effectiveOp(graph, n) ?? (current ? current.routes[0].op : KIND_OP[n.data.mediaKind ?? "image"]);const kind = current?.kind ?? n.data.mediaKind;@@ -1054,7 +1077,12 @@ export function convertEngine(graph: CanvasGraph, engine: Engine): { graph: Canvconst nodes = graph.nodes.map((n) => {if (!isGenerator(n)) return n;const current = n.data.modelId ? getModel(n.data.modelId) : undefined;- if (current?.engine === engine) return n;+ if (current && runsOn(current, engine)) {+ // A Fuobe Original keeps its model and its settings; only the engine it runs on changes.+ if (!dualEngine(current) || nodeEngine(n, current) === engine) return n;+ changed++;+ return { ...n, data: { ...n.data, engine } };+ }const m = counterpart(graph, n, engine);if (!m) {missing.push(n.id);@@ -1062,7 +1090,7 @@ export function convertEngine(graph: CanvasGraph, engine: Engine): { graph: Canv}changed++;const keepOp = n.data.op && supportsOp(m, n.data.op) ? n.data.op : undefined;- return { ...n, data: { ...n.data, modelId: m.id, op: keepOp, params: sanitizeParams(m, n.data.params) } };+ return { ...n, data: { ...n.data, modelId: m.id, op: keepOp, params: sanitizeParams(m, n.data.params), engine: dualEngine(m) ? engine : undefined } };});return { graph: { ...graph, nodes }, changed, missing };}@@ -1086,7 +1114,7 @@ export function graphEngine(graph: CanvasGraph): Engine | null {let cloud = 0;let open = 0;for (const n of graph.nodes) {- const m = isGenerator(n) && n.data.modelId ? getModel(n.data.modelId) : undefined;+ const m = isGenerator(n) ? nodeModel(n) : undefined;if (m?.engine === "cloud") cloud++;if (m?.engine === "open") open++;}diff --git a/src/lib/command-search.ts b/src/lib/command-search.tsindex 502bfe72..e704dcb5 100644--- a/src/lib/command-search.ts+++ b/src/lib/command-search.ts@@ -169,6 +169,8 @@ export interface PaletteModel {name: string;vendor: string;engine: "cloud" | "open";+ /** Every engine it runs on, when that's both (a Fuobe Original). */+ engines?: ("cloud" | "open")[];/** The studio that runs it (with ?model=), or the Models page. */href: string;/** What it does ("Text to image, Edit"). */@@ -188,15 +190,18 @@ export function indexEntries(index: PaletteIndex, mode: "both" | "cloud" | "open...presets(index.motions, "motion", (id) => `/video?preset=${id}`),...presets(index.effects, "effect", (id) => `/video?preset=${id}`),...index.models- .filter((m) => mode === "both" || m.engine === mode)- .map((m): PaletteEntry => ({- key: `model:${m.id}`,- kind: "model",- label: m.name,- // With both engines on, a model on each (TRELLIS.2, Join clips) would show twice under one name.- hint: mode === "both" && m.engine === "open" ? `${m.vendor} · Open source` : m.vendor,- href: m.href,- keywords: `${m.ops} ${m.engine === "open" ? "open source free" : "cloud"}`,- })),+ .filter((m) => mode === "both" || (m.engines ?? [m.engine]).includes(mode))+ .map((m): PaletteEntry => {+ const both = (m.engines?.length ?? 0) > 1;+ return {+ key: `model:${m.id}`,+ kind: "model",+ label: m.name,+ // With both engines on, a model on each (TRELLIS.2, Join clips) would show twice under one name; a Fuobe Original is one model on both.+ hint: mode === "both" && both ? `${m.vendor} · Open source + cloud` : mode === "both" && m.engine === "open" ? `${m.vendor} · Open source` : m.vendor,+ href: m.href,+ keywords: `${m.ops} ${both ? "open source free cloud" : m.engine === "open" ? "open source free" : "cloud"}`,+ };+ }),];}diff --git a/src/lib/model-list.ts b/src/lib/model-list.tsindex a7663275..3737b170 100644--- a/src/lib/model-list.ts+++ b/src/lib/model-list.ts@@ -4,6 +4,7 @@* CLI asks (kind, engine, operation, search words).*/import { modelSearchText, toModelRow, type ModelRow } from "./model-rows";+import { runsOn } from "./catalog/engines";import type { Engine, MediaKind, ModelDef, Operation } from "./catalog/types";export const MODEL_KINDS: MediaKind[] = ["image", "video", "audio", "text", "model3d"];@@ -61,7 +62,8 @@ export interface ModelQuery {export function findModels(models: ModelDef[], query: ModelQuery): ModelDef[] {const words = (query.q ?? "").toLowerCase().split(/\s+/).filter(Boolean);return models.filter((m) => {- if ((m.hidden && !query.hidden) || (query.kind && m.kind !== query.kind) || (query.engine && m.engine !== query.engine)) return false;+ // A Fuobe Original runs on both engines, so either engine's list has it.+ if ((m.hidden && !query.hidden) || (query.kind && m.kind !== query.kind) || (query.engine && !runsOn(m, query.engine))) return false;if (query.op && !m.routes.some((r) => r.op === query.op)) return false;if (!words.length) return true;const text = `${modelSearchText(toModelRow(m))} ${m.family} ${m.routes.map((r) => r.op).join(" ")}`.toLowerCase();diff --git a/src/lib/model-rows.ts b/src/lib/model-rows.tsindex 4bc3f450..f8e2a8cc 100644--- a/src/lib/model-rows.ts+++ b/src/lib/model-rows.ts@@ -1,5 +1,6 @@/** Slim rows for the Models page: what the table shows, computed on the server from the catalog. */import { formatCost } from "./format";+import { enginesOf, providerEngine } from "./catalog/engines";import { OPERATION_LABELS, type Engine, type MediaKind, type ModelDef } from "./catalog/types";export interface ModelRow {@@ -7,7 +8,10 @@ export interface ModelRow {name: string;vendor: string;tagline: string;+ /** The engine it shows first (a Fuobe Original's is open: it's free there). */engine: Engine;+ /** Every engine it runs on: a Fuobe Original runs on both (ComfyUI on your GPU, hosted open weights in the cloud). */+ engines: Engine[];kind: MediaKind;/** Display badges ("New", "Top"…), without the redundant "open". */badges: string[];@@ -36,20 +40,29 @@ const BADGE_LABEL: Record<string, string> = {};export function toModelRow(m: ModelDef): ModelRow {+ // A Fuobe Original's view on one engine (onEngine) keeps only that engine's routes: it lists that engine alone.+ const engines = enginesOf(m).filter((e) => e === m.engine || m.routes.some((r) => providerEngine(r.provider) === e));+ const cloudPrice = m.pricing ? `${formatCost(m.pricing.usd)} / ${m.pricing.unit}` : "—";return {id: m.id,name: m.name,vendor: m.vendor,tagline: m.tagline,engine: m.engine,+ engines,kind: m.kind,badges: (m.badges ?? []).filter((b) => b !== "open").map((b) => BADGE_LABEL[b] ?? b),ops: [...new Set(m.routes.map((r) => OPERATION_LABELS[r.op] ?? r.op))],routes: [...new Set(m.routes.map((r) => `${r.provider}: ${r.endpoint}`))],- price: m.engine === "open" ? "Free" : m.pricing ? `${formatCost(m.pricing.usd)} / ${m.pricing.unit}` : "—",+ // A Fuobe Original is free on your GPU and priced on the cloud.+ price: engines.length > 1 ? `Free · ${cloudPrice}` : m.engine === "open" ? "Free" : cloudPrice,...(m.worker === "isolated" && { note: ISOLATED_NOTE }),};}+/** "Open source", "Cloud", or both for a Fuobe Original. */+export const enginesLabel = (engines: Engine[]): string =>+ engines.length > 1 ? "Open source + cloud" : engines[0] === "open" ? "Open source" : "Cloud";+/** Lower-cased text the Models search matches against. */export const modelSearchText = (r: ModelRow) => `${r.name} ${r.vendor} ${r.tagline} ${r.ops.join(" ")} ${r.id} ${r.note ?? ""}`.toLowerCase();diff --git a/src/lib/palette-index.ts b/src/lib/palette-index.tsindex 305640fc..5b98dc3f 100644--- a/src/lib/palette-index.ts+++ b/src/lib/palette-index.ts@@ -4,6 +4,7 @@*/import { MODELS_3D } from "@/lib/av/model3d";import { APPS, EFFECTS, MODELS, MOTIONS } from "@/lib/catalog";+import { enginesOf } from "@/lib/catalog/engines";import { OPERATION_LABELS, type ModelDef, type Operation, type Preset } from "@/lib/catalog/types";import type { PaletteIndex, PaletteModel, PalettePreset } from "@/lib/command-search";import { TOOL_MODELS } from "@/lib/layers";@@ -98,6 +99,8 @@ const model = (m: ModelDef): PaletteModel => ({name: m.name,vendor: m.vendor,engine: m.engine,+ // A Fuobe Original runs on both engines.+ ...(enginesOf(m).length > 1 && { engines: enginesOf(m) }),href: modelHref(m),ops: [...new Set(m.routes.map((r) => OPERATION_LABELS[r.op] ?? r.op))].join(", "),});diff --git a/src/server/assist/tools.ts b/src/server/assist/tools.tsindex a01fd04e..3e3c3741 100644--- a/src/server/assist/tools.ts+++ b/src/server/assist/tools.ts@@ -289,7 +289,11 @@ function shotList(model: ModelDef | undefined, n: number): { prompt: string; durreturn Array.from({ length: count }, (_, i) => ({ prompt: SHOT_TYPES[i % SHOT_TYPES.length], duration: each }));}-function toRequest(j: JobInput): GenerationRequest {+/** The engine the user works on (the install's only one when Settings → Engine mode allows one). */+const engineOf = (ctx: ToolContext): "cloud" | "open" => (engineMode() === "both" ? ctx.engine : (engineMode() as "cloud" | "open"));++/** A job as a request; `engine` is the user's, which a Fuobe Original (both engines) runs on unless the job names one. */+function toRequest(j: JobInput, engine?: "cloud" | "open"): GenerationRequest {const inputs = {...(j.images?.length && { images: j.images }),...(j.end_image && { endImage: j.end_image }),@@ -303,7 +307,7 @@ function toRequest(j: JobInput): GenerationRequest {feature: "assist",modelId: j.model_id,...(j.look && { presetId: j.look }),- ...(j.engine && { engine: j.engine }),+ ...((j.engine ?? (engine && dualEngine(getModel(j.model_id)) ? engine : undefined)) && { engine: j.engine ?? engine }),op: j.op as Operation | undefined,prompt: j.prompt,negativePrompt: j.negative_prompt,@@ -348,10 +352,10 @@ interface ChainedJob {}/** Validate and price the jobs of one generate call, wiring `after` into chain slots. Never throws. */-function chainJobs(jobs: JobInput[]): ChainedJob[] {+function chainJobs(jobs: JobInput[], engine?: "cloud" | "open"): ChainedJob[] {const out: ChainedJob[] = [];jobs.forEach((job, i) => {- const req = toRequest(job);+ const req = toRequest(job, engine);const after = job.after;if (after === undefined) {try {@@ -406,18 +410,18 @@ const generate = defineTool({// job has more. Calls are validated with zod (validateInput / planFor / executeTool) instead, and// a malformed one goes back to the model as an error it can fix.// Chained jobs are one pipeline (all or nothing); separate jobs start one by one.- plan: ({ jobs }) => {+ plan: ({ jobs }, ctx) => {const list = jobs.slice(0, 6);const atomic = list.some((j) => j.after !== undefined) || undefined;- return chainJobs(list).map((c) => ({ ...plannedJob(c), atomic }));+ return chainJobs(list, engineOf(ctx)).map((c) => ({ ...plannedJob(c), atomic }));},- async run({ summary, jobs }) {+ async run({ summary, jobs }, ctx) {const list = jobs.slice(0, 6);// The plan's jobs share a batch, so the Library stacks them under the plan's summary.const batchTitle = summary.trim().slice(0, 200) || undefined;if (list.some((j) => j.after !== undefined)) {// Chained jobs: one pipeline, created only if every step is valid.- const chained = chainJobs(list);+ const chained = chainJobs(list, engineOf(ctx));const bad = chained.findIndex((c) => c.error);if (bad >= 0) return { content: JSON.stringify({ error: `Job ${bad}: ${chained[bad].error}` }), isError: true };const p = createPipeline(chained.map((c, i) => ({ key: `job${i}`, request: { ...c.req, batchTitle }, ...(c.after !== undefined && { after: `job${c.after}` }) })));@@ -435,7 +439,7 @@ const generate = defineTool({const batch = list.length > 1 ? { batchId: nanoid(10) } : {};for (const j of list) {try {- const gens = createGenerations({ ...toRequest(j), batchTitle }, batch);+ const gens = createGenerations({ ...toRequest(j, engineOf(ctx)), batchTitle }, batch);ids.push(...gens.map((g) => g.id));results.push({ model: j.model_id, started: gens.map((g) => g.id), demo: gens.some((g) => g.provider === "mock") || undefined, costUsd: gens.reduce((s, g) => s + (g.costUsd ?? 0), 0) || undefined });} catch (e) {diff --git a/src/server/canvas.ts b/src/server/canvas.tsindex 7a942f7d..2058e397 100644--- a/src/server/canvas.ts+++ b/src/server/canvas.ts@@ -93,6 +93,8 @@ const NodeData = z.object({handle: Handle.optional(),preview: z.string().startsWith("/api/files/").max(2000).optional(),modelId: z.string().max(120).optional(),+ // A Fuobe Original (runs on both engines): the engine the node runs it on.+ engine: z.enum(["open", "cloud"]).optional(),op: z.string().max(40).optional(),prompt: clamped(TEXT_MAX).optional(),params: Params.optional(),diff --git a/tests/shell-pages.test.ts b/tests/shell-pages.test.tsindex 68821a42..76fed1de 100644--- a/tests/shell-pages.test.ts+++ b/tests/shell-pages.test.ts@@ -49,15 +49,18 @@ describe("model rows", () => {it("keeps only what the table shows", () => {const m = MODELS.find((x) => x.engine === "cloud" && x.pricing)!;const row = toModelRow(m);- expect(Object.keys(row).sort()).toEqual(["badges", "engine", "id", "kind", "name", "ops", "price", "routes", "tagline", "vendor"]);+ expect(Object.keys(row).sort()).toEqual(["badges", "engine", "engines", "id", "kind", "name", "ops", "price", "routes", "tagline", "vendor"]);expect(row.routes.every((r) => /^[a-z]+: /.test(r))).toBe(true);expect(row.badges).not.toContain("open");expect(JSON.stringify(row)).not.toMatch(/"map"|fieldMap|"defaults"/);});it("prices open models as free and shrinks the payload", () => {- const open = MODELS.find((x) => x.engine === "open")!;+ const open = MODELS.find((x) => x.engine === "open" && !x.engines)!;expect(toModelRow(open).price).toBe("Free");+ // A Fuobe Original is free on the GPU and priced on the cloud.+ const original = MODELS.find((x) => x.engines?.length === 2)!;+ expect(toModelRow(original).price).toMatch(/^Free · .+ \/ megapixel$/);const full = JSON.stringify(MODELS).length;const slim = JSON.stringify(MODELS.map(toModelRow)).length;expect(slim / full).toBeLessThan(0.5);