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.

Merge branch 'r4/cinema-3d' into claude/fuobe-parity-4

Claudefd6a5050e63b
diff --cc src/server/providers/mock.ts
index 3984950e,a2c4d6c1..d1cff7c5
--- a/src/server/providers/mock.ts
+++ b/src/server/providers/mock.ts
@@@ -1,12 -1,12 +1,14 @@@
import "server-only";
import { nanoid } from "nanoid";
import { cueText, parseCues, type Cue } from "@/lib/cues";
+import { HAND_OFF } from "@/lib/catalog/remove-object";
import { OPERATION_OUTPUT, type MediaKind, type Operation } from "@/lib/catalog/types";
+ import { spectralColor } from "@/lib/scene3d";
import type { ProviderAdapter, RemoteOutput } from "./types";
import { textOutput } from "./llm";
+ import { encodePng } from "../png";
import { toDataUri } from "../storage";
+import { zip } from "../zip";
/**
* Demo provider: lets anyone click through the whole product with no API keys or GPU.
@@@ -230,14 -230,36 +232,42 @@@ function demoOcr(brief: string): DemoOu
return textOutput(lines.map((l) => l.text).join("\n"), null, { lines, demo: true });
}
+/** A black-and-white mask (white = the object) in the picture's shape. */
+function demoMaskSvg(ar: string): string {
+ const [w, h] = ar === "9:16" || ar === "3:4" || ar === "2:3" ? [360, 640] : ar === "1:1" ? [512, 512] : [640, 360];
+ return `<svg xmlns="http://www.w3.org/2000/svg" width="${w}" height="${h}"><rect width="100%" height="100%" fill="#000"/><ellipse cx="${w * 0.55}" cy="${h * 0.6}" rx="${w * 0.12}" ry="${h * 0.14}" fill="#fff"/></svg>`;
+}
+
const clamp = (n: number, lo: number, hi: number) => Math.max(lo, Math.min(hi, Number.isFinite(n) ? n : lo));
+ /**
+ * A depth map like a depth model's PNG, 512 px wide in the request's shape: a back wall, a floor that comes closer
+ * toward the bottom of the frame and three rounded subjects standing on it. Grey (bright = near) like MoGe's on the
+ * open engine; painted with the Spectral colour map (red = near) like Marigold's on the cloud.
+ */
+ function demoDepth(prompt: string, aspectRatio: string, spectral: boolean): DemoOutput {
+ const { w: cw, h: ch } = canvas(aspectRatio);
+ const w = 512;
+ const h = Math.max(16, Math.round((w * ch) / cw));
+ const r = rng(hash(`${prompt}#depth`));
+ const blobs = Array.from({ length: 3 }, (_, i) => ({ x: 0.2 + i * 0.3 + (r() - 0.5) * 0.1, y: 0.5 + r() * 0.2, rx: 0.07 + r() * 0.07, ry: 0.14 + r() * 0.12, near: 0.5 + r() * 0.3 }));
+ const data = Buffer.alloc(w * h * 4);
+ for (let y = 0; y < h; y++)
+ for (let x = 0; x < w; x++) {
+ const u = x / (w - 1);
+ const v = y / (h - 1);
+ let near = 0.12 + 0.68 * Math.max(0, (v - 0.4) / 0.6) ** 1.3;
+ for (const b of blobs) {
+ const d = ((u - b.x) / b.rx) ** 2 + ((v - b.y) / b.ry) ** 2;
+ if (d < 1) near = Math.max(near, b.near + 0.08 * Math.sqrt(1 - d));
+ }
+ const n = clamp(near, 0, 1);
+ const g = Math.round(n * 255);
+ data.set(spectral ? [...spectralColor(1 - n), 255] : [g, g, g, 255], (y * w + x) * 4);
+ }
+ return { url: toDataUri(encodePng({ width: w, height: h, data }), "image/png"), kind: "image", contentType: "image/png", meta: { role: "depth", demo: true } };
+ }
+
function demoOutputs(op: Operation | undefined, kind: MediaKind, prompt: string, ar: string, meta: Record<string, unknown>): DemoOutput[] {
// The prompt falls back to the op name when a step has none.
const brief = prompt === op ? "" : prompt;