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
Image to 3D: Trim spikes says what it needs on your ComfyUI, and the uncleaned card line fits every case
Claude31ee72e0c5eb
diff --git a/src/components/model3d/model-card.tsx b/src/components/model3d/model-card.tsxindex d1ef78f5..7e245f81 100644--- a/src/components/model3d/model-card.tsx+++ b/src/components/model3d/model-card.tsx@@ -320,7 +320,7 @@ export function ModelCard({ g, info, cloudAllowed }: { g: Generation; info: Reco{/* Idol 3D on your GPU: how clean the file is. Only the owner reads how to make it cleaner (it's their ComfyUI). */}{view.clean?.cleaned && <p className="text-[12px] font-medium">{view.clean.text}</p>}{view.clean && !view.clean.cleaned && owner && (- <p className="text-[12px] text-muted-foreground">Not cleaned: install ComfyUI-Idol on your ComfyUI for cleaner splat files.</p>+ <p className="text-[12px] text-muted-foreground">Not cleaned: this run used the core nodes. With ComfyUI-Idol installed and switched on, splat files come out cleaner.</p>)}<div className="flex flex-wrap gap-1.5">{view.splat ? (diff --git a/src/components/model3d/model3d-studio.tsx b/src/components/model3d/model3d-studio.tsxindex 2b70251b..3acf76e5 100644--- a/src/components/model3d/model3d-studio.tsx+++ b/src/components/model3d/model3d-studio.tsx@@ -16,7 +16,7 @@ import { MediaSlot, type SlotValue } from "@/components/studio/media-slot";import { MediaDrop } from "@/components/av/media-drop";import { Panel, ToolHero, ToolShell } from "@/components/av/tool-shell";import { SelfHostNote } from "@/components/self-host-note";-import { useCreateGeneration, useEngine, useGenerations, useHydrated, useLikelyVisitor, useModelAccess, useStatus } from "@/lib/api";+import { useCreateGeneration, useEngine, useGenerations, useHydrated, useIsOwner, useLikelyVisitor, useModelAccess, useStatus } from "@/lib/api";import {IDOL_QUALITIES,MAX_3D_PROMPT,@@ -102,6 +102,8 @@ function IdolSettings({onPhoto: (v: boolean) => void;trim?: { on: boolean; onChange: (v: boolean) => void };}) {+ // Only the owner reads what trimming needs on the ComfyUI (it's theirs to set up).+ const owner = useIsOwner();const refs = useRef<(HTMLButtonElement | null)[]>([]);const move = (from: number, by: number) => {const i = (from + by + IDOL_QUALITIES.length) % IDOL_QUALITIES.length;@@ -149,7 +151,7 @@ function IdolSettings({{trim && (<details className="group rounded-xl border px-3 py-2 [&_summary::-webkit-details-marker]:hidden"><summary className="cursor-pointer list-none text-[13px] font-medium outline-none select-none focus-visible:ring-2 focus-visible:ring-ring">- Advanced <span className="text-[12px] font-normal text-muted-foreground">· {trim.on ? "trimming spikes" : "edges"}</span>+ Advanced{trim.on && <span className="text-[12px] font-normal text-muted-foreground"> · trimming spikes</span>}</summary><div className="flex items-center justify-between gap-3 pt-3"><div className="min-w-0">@@ -159,6 +161,9 @@ function IdolSettings({<p id="m3d-idol-trim-hint" className="mt-0.5 text-[12px] text-muted-foreground">Drops the thin, needle-like bits around the edges of the 3D file.</p>+ {owner && (+ <p className="mt-0.5 text-[12px] text-muted-foreground">Needs the ComfyUI-Idol nodes on your ComfyUI; without them the file is saved untrimmed.</p>+ )}</div><Switch id="m3d-idol-trim" aria-describedby="m3d-idol-trim-hint" checked={trim.on} onCheckedChange={trim.onChange} /></div>diff --git a/tests/idol-clean.test.ts b/tests/idol-clean.test.tsindex 18575c81..202861b3 100644--- a/tests/idol-clean.test.ts+++ b/tests/idol-clean.test.ts@@ -19,7 +19,8 @@ process.env.COMFYUI_URL = "http://127.0.0.1:9";const root = process.cwd();const { setSetting } = await import("@/server/settings");-const { collectOutputs, comfyHasClass, forgetComfyClass, getWorkflow, prepareWorkflow } = await import("@/server/providers/comfyui");+const { collectOutputs, comfyHasClass, comfyProvider, forgetComfyClass, getWorkflow, prepareWorkflow } = await import("@/server/providers/comfyui");+const { changeAccess } = await import("@/server/model-access");const m3d = await import("@/lib/av/model3d");const { licenceTerms, NODE_PACKS, workflowLicence } = await import("@/lib/licences");@@ -33,10 +34,23 @@ const read = (id: string) => JSON.parse(fs.readFileSync(path.join(root, "workfloconst graph = read("image-to-splat-idol-clean");const coreGraph = read("image-to-splat-idol");-// A stand-in ComfyUI that answers GET /object_info/<class> (the pack's classes when `pack` is on) and counts the asks.+// A stand-in ComfyUI that answers GET /object_info/<class> (the pack's classes when `pack` is on) and counts the asks,+// and takes POST /prompt (or refuses it, as a ComfyUI without the pack does), keeping the graphs it was sent.let pack = true;let asks = 0;+let refuse = false;+const prompts: Record<string, Node>[] = [];const server = http.createServer((req, res) => {+ if (req.method === "POST" && req.url === "/prompt") {+ let body = "";+ req.on("data", (c) => (body += c));+ req.on("end", () => {+ prompts.push((JSON.parse(body) as { prompt: Record<string, Node> }).prompt);+ res.writeHead(refuse ? 400 : 200, { "Content-Type": "application/json" });+ res.end(JSON.stringify(refuse ? { error: { type: "missing_node_type", message: "Node 'IdolPruneSplat' not found" }, node_errors: {} } : { prompt_id: `p-${prompts.length}` }));+ });+ return;+ }const m = /^\/object_info\/(\w+)$/.exec(req.url ?? "");if (!m) {res.writeHead(404).end();@@ -232,6 +246,60 @@ describe("the provider: the clean graph where the server has the pack, idol-1's});});+describe("the provider's submit: Settings and a refused prompt", () => {+ // No progress socket here: the run is only sent.+ const realWs = globalThis.WebSocket;+ class NoSocket {+ readyState = 1;+ onmessage = null;+ onerror = null;+ close() {}+ }+ beforeAll(() => {+ globalThis.WebSocket = NoSocket as unknown as typeof WebSocket;+ });+ afterAll(() => {+ globalThis.WebSocket = realWs;+ changeAccess([{ kind: "pack", id: "ComfyUI-Idol", on: true }]);+ });+ const route = { op: "splat", provider: "comfyui", endpoint: "image-to-splat-idol" } as never;+ const model = { id: "oss-idol", routes: [route] } as never;+ const submit = (generationId: string) =>+ comfyProvider.submit({ generationId, model, route, input: { prompt: "", images: ["p.png"], seed: 7, extra: m3d.idolExtra("open", "best", false, true) } });+ const classes = (g: Record<string, Node>) => Object.values(g).map((n) => n.class_type);++ it("with ComfyUI-Idol switched off in Settings, sends the core graph without asking the server about the pack", async () => {+ pack = true;+ forgetComfyClass("IdolPruneSplat");+ changeAccess([{ kind: "pack", id: "ComfyUI-Idol", on: false }]);+ asks = 0;+ prompts.length = 0;+ const res = await submit("gen-off");+ expect(res.meta).toMatchObject({ workflowId: "image-to-splat-idol" });+ expect(asks).toBe(0);+ expect(classes(prompts[0]).some((c) => c.startsWith("Idol"))).toBe(false);+ changeAccess([{ kind: "pack", id: "ComfyUI-Idol", on: true }]);+ });++ it("switched on with the pack there, sends the clean graph; a refused prompt makes the next run ask again", async () => {+ pack = true;+ forgetComfyClass("IdolPruneSplat");+ asks = 0;+ prompts.length = 0;+ expect((await submit("gen-on")).meta).toMatchObject({ workflowId: "image-to-splat-idol-clean" });+ expect(asks).toBe(1);+ expect(prompts[0]["88:111"].inputs).toMatchObject({ max_scale: 0.05 });+ // The pack went: ComfyUI refuses the clean graph, and the cached answer is dropped.+ pack = false;+ refuse = true;+ await expect(submit("gen-gone")).rejects.toThrow();+ expect(asks).toBe(1);+ refuse = false;+ expect((await submit("gen-after")).meta).toMatchObject({ workflowId: "image-to-splat-idol" });+ expect(asks).toBe(2);+ });+});+describe("the outputs and the card", () => {const file = (filename: string) => ({ filename, subfolder: "fuobe", type: "output" });const history = (count?: string) => ({