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
Tools: fixes from the review of the self-hosted-only notes
Adarsh4e6f944d940d
diff --git a/src/components/genjutsu/genjutsu-studio.tsx b/src/components/genjutsu/genjutsu-studio.tsxindex 5ab56988..aff303f6 100644--- a/src/components/genjutsu/genjutsu-studio.tsx+++ b/src/components/genjutsu/genjutsu-studio.tsx@@ -53,6 +53,7 @@ import {type Maker,} from "@/lib/catalog/genjutsu";import { chainState } from "@/lib/catalog/shorts";+import { withoutOwnGpu } from "@/lib/catalog/engines";import type { Generation, PixelPoint } from "@/lib/catalog/types";import { downloadHref, downloadName } from "@/lib/library";import { keepOffered, offered } from "@/lib/model-access";@@ -482,6 +483,7 @@ export function GenjutsuStudio() {Whole clips, shot by shot? Open in Character Swap Studio</Link>)}+ {visitor && <SelfHostNote className="mt-3 max-w-xl">Genjutsu runs on a self-hosted Fuobe for now.</SelfHostNote>}</ToolHero>)}<div className={cn("mx-auto", clip ? "pt-4" : "mt-8 max-w-[640px]")}>@@ -489,6 +491,7 @@ export function GenjutsuStudio() {<ClipDropaccept={GENJUTSU.accept}limits={limits(mode === "character")}+ disabled={visitor}onFile={(f) => {const err = source.pick(f);if (err) toast.error(err);@@ -707,7 +710,7 @@ export function GenjutsuStudio() {)}{maker && options.length <= 1 && (<p className="text-[12px] text-muted-foreground">- <SourceBadge source={maker.source} /> <span className="font-medium text-foreground">{maker.label}</span> · {maker.note} · {makerLicence(maker, !(visitor && maker.engine === "open") && !/your GPU|on fal/.test(maker.note ?? ""))}+ <SourceBadge source={maker.source} /> <span className="font-medium text-foreground">{maker.label}</span> · {visitor ? withoutOwnGpu(maker.note) : maker.note} · {makerLicence(maker, !(visitor && maker.engine === "open") && !/your GPU|on fal/.test(maker.note ?? ""))}</p>)}@@ -954,7 +957,7 @@ function MakerList({ options, value, onChange }: { options: Maker[]; value: stri<span className="flex flex-wrap items-center gap-1.5 text-[13px] font-medium">{m.label} <SourceBadge source={m.source} /></span>- <span className="block text-[12px] leading-snug text-muted-foreground">{m.note}</span>+ <span className="block text-[12px] leading-snug text-muted-foreground">{visitor ? withoutOwnGpu(m.note) : m.note}</span><span className="mt-0.5 block text-[11px] leading-snug text-muted-foreground/90">{makerLicence(m, !(visitor && m.engine === "open"))}</span></span></button>diff --git a/src/components/layers/projects-view.tsx b/src/components/layers/projects-view.tsxindex 4b45eaa6..d113fcf9 100644--- a/src/components/layers/projects-view.tsx+++ b/src/components/layers/projects-view.tsx@@ -16,7 +16,7 @@ import { Skeleton } from "@/components/ui/skeleton";import { LibraryGrid } from "@/components/studio/media-slot";import { PageShell } from "@/components/page-shell";import { SelfHostNote } from "@/components/self-host-note";-import { uploadFile, useHydrated, useIsVisitor, useViewer } from "@/lib/api";+import { uploadFile, useHydrated, useIsOwner, useIsVisitor, useViewer } from "@/lib/api";import { timeAgo } from "@/lib/format";import type { LayerProject } from "@/lib/layers";import { cn } from "@/lib/utils";@@ -197,8 +197,9 @@ function ProjectsInner() {const file = useRef<HTMLInputElement>(null);const hydrated = useHydrated();// A project is saved to the studio's library, which is its owner's: a guest or an account is told so up front, and- // nothing is uploaded only to be refused.+ // nothing is uploaded only to be refused. The empty list's Upload shows once the owner is known (useIsOwner).const visitor = useIsVisitor();+ const isOwner = useIsOwner();const viewer = useViewer().data;const [picking, setPicking] = useState(false);const [renaming, setRenaming] = useState<LayerProject | null>(null);@@ -354,7 +355,7 @@ function ProjectsInner() {<EmptyTitle className="font-heading text-[22px]">Your edit projects will appear here</EmptyTitle><EmptyDescription>Upload an image to separate it into editable layers — every project you start is saved here.</EmptyDescription></EmptyHeader>- {!visitor && (+ {isOwner && (<EmptyContent><Button className="rounded-full" onClick={() => file.current?.click()} disabled={!!busy}><Upload /> Upload Mediadiff --git a/src/components/marketing/marketing-studio.tsx b/src/components/marketing/marketing-studio.tsxindex 0c9bb715..2817eb8a 100644--- a/src/components/marketing/marketing-studio.tsx+++ b/src/components/marketing/marketing-studio.tsx@@ -11,10 +11,11 @@ import { MediaSlot, type SlotValue } from "@/components/studio/media-slot";import { ResponsivePanel } from "@/components/studio/responsive-panel";import { BrandChip } from "@/components/brand/brand-dialog";import { inputCls } from "@/components/brand/fields";+import { withoutOwnGpu } from "@/lib/catalog/engines";import { FORMATS, formatModels, looksLikeWebsite, MAX_PROMPT, openingAspect, TEMPLATE_INDEX, type FormatId, type MarketingCategory, type MarketingTemplate, type RunEstimate } from "@/lib/catalog/marketing";import { SelfHostNote } from "@/components/self-host-note";import { formatCost } from "@/lib/format";-import { useIsVisitor, useModelAccess } from "@/lib/api";+import { useIsOwner, useIsVisitor, useModelAccess } from "@/lib/api";import { keepOffered, offered } from "@/lib/model-access";import { cn } from "@/lib/utils";import { addRuns, send, useBrands, useEstimate } from "./hooks";@@ -106,6 +107,8 @@ function SettingsPanel({ draft, set, models, engine }: { draft: Draft; set: (p:const f = FORMATS[draft.format];// Models switched off in Settings → Models & licences leave the menu, and the pick falls back to one that is on.const access = useModelAccess();+ // A guest or an account: Marketing Studio runs on a self-hosted Fuobe only, so no model reads "on your GPU".+ const visitor = useIsVisitor();const choices = keepOffered(formatModels(f, engine, { product: !!draft.product, avatar: !!draft.avatar }), (c) => offered(access, c.id, engine));const model = choices.find((c) => c.id === draft.modelId) ?? choices[0];const summary = [draft.aspectRatio, f.durations && `${draft.duration}s`, draft.batch > 1 && `×${draft.batch}`].filter(Boolean).join(" · ");@@ -163,7 +166,7 @@ function SettingsPanel({ draft, set, models, engine }: { draft: Draft; set: (p:{choices.map((c) => (<button key={c.id} type="button" onClick={() => set({ modelId: c.id })} className={cn("w-full rounded-lg px-2.5 py-1.5 text-left hover:bg-accent", model.id === c.id && "bg-brand-faint")}><span className={cn("block text-[13px] font-medium", model.id === c.id && "text-brand-text")}>{models[c.id]?.name ?? c.id}</span>- <span className="block text-[11px] text-muted-foreground">{c.note ?? models[c.id]?.tagline}</span>+ <span className="block text-[11px] text-muted-foreground">{visitor ? withoutOwnGpu(c.note ?? models[c.id]?.tagline ?? "") : (c.note ?? models[c.id]?.tagline)}</span></button>))}</div>@@ -288,8 +291,10 @@ export function MarketingStudio({ models }: { models: Record<string, ModelInfo>const composer = useRef<HTMLDivElement>(null);const prompt = useRef<HTMLTextAreaElement>(null);// A run doesn't go to an account's own GPU or key yet (only the studios' generations do): said up front, with no- // upload slots and no Generate, instead of a run the server refuses.+ // upload slots and no Generate, instead of a run the server refuses. The slots show once the owner is known+ // (useIsOwner), so a visitor never sees them and then gone.const visitor = useIsVisitor();+ const isOwner = useIsOwner();const set = (p: Partial<Draft>) => setDraft((d) => ({ ...d, ...p }));const f = FORMATS[draft.format];const template = draft.templateId ? TEMPLATE_INDEX.get(draft.templateId) : undefined;@@ -456,9 +461,9 @@ export function MarketingStudio({ models }: { models: Record<string, ModelInfo></div>)}{/* A guest or an account gets no upload slots: nothing is uploaded for a run that can't start here. */}- {!visitor && f.product !== "none" && <ProductSlot value={draft.product} onChange={(p) => set({ product: p })} required={f.product === "required"} brandId={brandId} pulse={pulse === "product"} />}- {!visitor && f.avatar !== "none" && <AvatarSlot value={draft.avatar} onChange={(a) => set({ avatar: a })} pulse={pulse === "avatar"} />}- {!visitor && f.pipeline !== "ugc" && <MediaSlot label="Reference" kind="image" value={draft.reference} onChange={(v) => set({ reference: v })} />}+ {isOwner && f.product !== "none" && <ProductSlot value={draft.product} onChange={(p) => set({ product: p })} required={f.product === "required"} brandId={brandId} pulse={pulse === "product"} />}+ {isOwner && f.avatar !== "none" && <AvatarSlot value={draft.avatar} onChange={(a) => set({ avatar: a })} pulse={pulse === "avatar"} />}+ {isOwner && f.pipeline !== "ugc" && <MediaSlot label="Reference" kind="image" value={draft.reference} onChange={(v) => set({ reference: v })} />}</div><textarearef={prompt}diff --git a/src/components/photodump/photodump-view.tsx b/src/components/photodump/photodump-view.tsxindex f20c7889..8b5b9946 100644--- a/src/components/photodump/photodump-view.tsx+++ b/src/components/photodump/photodump-view.tsx@@ -12,7 +12,7 @@ import { Input } from "@/components/ui/input";import { EngineSwitch } from "@/components/studio/engine-switch";import { fileToList, type SlotValue } from "@/components/studio/media-slot";import { radioKeys, radioTab } from "@/components/studio/radio-keys";-import { useElements, useEngine, useGenerations, useIsVisitor, useModelAccess } from "@/lib/api";+import { useElements, useEngine, useGenerations, useIsOwner, useIsVisitor, useModelAccess } from "@/lib/api";import { keepOffered, offered } from "@/lib/model-access";import { customPack, DEFAULT_ASPECT, MAX_PACK_REFS, MAX_SELFIE_MB, PACKS, PHOTODUMP_ASPECTS, PHOTODUMP_MODELS, PHOTODUMP_SOUL, soulIdOf, type Pack } from "@/lib/catalog/packs";import type { Generation } from "@/lib/catalog/types";@@ -150,8 +150,10 @@ function useRuns(feature: string) {export function PhotodumpView() {const [engine, setEngine] = useEngine();// A set doesn't run on an account's own GPU or key yet (only the studios' generations do), and a pack of your own is- // saved to the owner's library: said up front, and the upload, Create pack and Generate are off. The packs stay open.+ // saved to the owner's library: said up front, and the upload and Generate are off. The packs stay open. Create pack+ // shows once the owner is known (useIsOwner), so a visitor never sees it in the grid and then gone.const visitor = useIsVisitor();+ const isOwner = useIsOwner();const [step, setStep] = useState(0);const [reached, setReached] = useState(0);const [tab, setTab] = useState<(typeof TABS)[number][0]>("all");@@ -246,7 +248,7 @@ export function PhotodumpView() {</div><div className="grid grid-cols-2 gap-3 sm:grid-cols-3 lg:grid-cols-5">{/* A pack of your own is saved to the studio's library, which is its owner's. */}- {!visitor && (+ {isOwner && (<buttontype="button"onClick={() => setCreatingPack(true)}diff --git a/src/components/shorts/shorts-studio.tsx b/src/components/shorts/shorts-studio.tsxindex 12e4af0b..504369ee 100644--- a/src/components/shorts/shorts-studio.tsx+++ b/src/components/shorts/shorts-studio.tsx@@ -9,7 +9,7 @@ import { SidebarTrigger } from "@/components/ui/sidebar";import { SelfHostNote } from "@/components/self-host-note";import { EngineSwitch } from "@/components/studio/engine-switch";import { VideoTrimmer } from "@/components/studio/video-trimmer";-import { useEngine, useIsVisitor, useModelAccess } from "@/lib/api";+import { useEngine, useIsOwner, useIsVisitor, useModelAccess } from "@/lib/api";import {clipShapeProblem,rangeProblem,@@ -82,8 +82,8 @@ export function ShortsStudio({ models }: { models: Record<Engine, ModelChoice[]><div className="flex min-h-svh min-w-0 flex-col"><header className="sticky top-0 z-20 flex h-14 items-center gap-2 bg-background/85 px-3 backdrop-blur sm:px-6"><SidebarTrigger className="md:hidden" />- <h1 className="shrink-0 truncate font-heading text-[22px] leading-none">Shorts Studio</h1>- <div role="tablist" aria-label="Shorts Studio" onKeyDown={tabKeys} className="ml-2 flex h-8 items-center rounded-full bg-muted p-0.5 sm:ml-4">+ <h1 className="min-w-0 truncate font-heading text-[22px] leading-none">Shorts Studio</h1>+ <div role="tablist" aria-label="Shorts Studio" onKeyDown={tabKeys} className="ml-2 flex h-8 shrink-0 items-center rounded-full bg-muted p-0.5 sm:ml-4">{(["presets", "history"] as const).map((t) => (<buttonkey={t}@@ -98,7 +98,7 @@ export function ShortsStudio({ models }: { models: Record<Engine, ModelChoice[]></button>))}</div>- <div className="ml-auto">+ <div className="ml-auto shrink-0">{/* A phone's header has room for the title and the tabs, not "Add key" too. */}<EngineSwitch value={engine} onChange={setEngine} wordless /></div>@@ -159,6 +159,9 @@ function Workspace({const selectedBuiltIn = SHORTS_PRESETS.find((p) => p.id === presetId);const selectedCustom = custom.data?.find((p) => p.id === presetId);const selectedName = selectedBuiltIn?.name ?? selectedCustom?.name;+ // A preset of your own is saved to the studio's library, which is its owner's: its card shows once that's known, so+ // a visitor never sees it in the grid and then gone.+ const isOwner = useIsOwner();// Phones: after picking a look, a bar points down to the upload step until it's on screen.const [setupVisible, setSetupVisible] = useState(false);@@ -177,8 +180,7 @@ function Workspace({custom={custom.data ?? []}presetId={presetId}onSelect={setPresetId}- // A preset of your own is saved to the studio's library, which is its owner's.- onCreate={visitor ? undefined : () => setDialog({ open: true })}+ onCreate={isOwner ? () => setDialog({ open: true }) : undefined}onEdit={(id) => setDialog({ open: true, preset: custom.data?.find((p) => p.id === id) })}/></section>diff --git a/src/lib/catalog/engines.ts b/src/lib/catalog/engines.tsindex c629ecb2..20243c65 100644--- a/src/lib/catalog/engines.ts+++ b/src/lib/catalog/engines.ts@@ -65,3 +65,24 @@ export function pickEngine(if (mode !== "both" && engines.includes(mode)) return mode;return engines.find(ready) ?? m.engine;}++const FREE_ON_GPU = String.raw`free on your GPU(?: \([^)]*\))?`;++/**+ * A model's note as a guest or a free account reads it, in a tool that doesn't run on their own GPU yet (the page says+ * so): without "free", "free on your GPU (24 GB)" and "on your GPU". "… · free on your GPU (24 GB) · Apache-2.0" →+ * "… · Apache-2.0"; "Qwen-Image-Edit 2511 on your GPU" → "Qwen-Image-Edit 2511".+ */+export function withoutOwnGpu(note: string): string {+ return note+ .split(" · ")+ .map((part) =>+ part+ .replace(new RegExp(`^(?:${FREE_ON_GPU}|free)(?:, (?:or )?|$)`), "")+ .replace(/^on your GPU(?:, |$)/, "")+ .replace(new RegExp(`,? ${FREE_ON_GPU}`, "g"), "")+ .replace(/ on your GPU\b/g, ""),+ )+ .filter(Boolean)+ .join(" · ");+}diff --git a/tests/genjutsu.test.ts b/tests/genjutsu.test.tsindex e8870ec1..99b3a97a 100644--- a/tests/genjutsu.test.ts+++ b/tests/genjutsu.test.ts@@ -25,6 +25,8 @@ import {type Maker,} from "@/lib/catalog/genjutsu";import { ANCHOR_FALLBACK, CLOUD_NO_LORA } from "@/lib/catalog/character-swap";+import { withoutOwnGpu } from "@/lib/catalog/engines";+import { MARKETING_IMAGE_NOTE } from "@/lib/catalog/marketing";import { buildPayload } from "@/lib/catalog/payload";import { estimateCost, planGeneration } from "@/lib/catalog/plan";import { getModel, getPreset } from "@/lib/catalog";@@ -93,6 +95,19 @@ describe("Genjutsu: which model runs", () => {expect(MAKERS.every((m) => makerLicence(m).length > 10)).toBe(true);});+ it("a guest or an account reads the open models' notes without 'free on your GPU' (Genjutsu doesn't run there)", () => {+ for (const m of MAKERS) {+ const note = withoutOwnGpu(m.note);+ expect(note, m.id).not.toMatch(/your GPU|^free\b| · free\b/);+ expect(note.length, m.id).toBeGreaterThan(10);+ if (!/your GPU|free/.test(m.note)) expect(note, m.id).toBe(m.note);+ }+ expect(withoutOwnGpu("Wan Animate 2 at 480p in 4 steps · free on your GPU (24 GB) · Apache-2.0")).toBe("Wan Animate 2 at 480p in 4 steps · Apache-2.0");+ expect(withoutOwnGpu("MiniMax H3 + the swap LoRA on your GPU: SAM 3.1 picks the person · free · 48 GB+ advised")).toBe("MiniMax H3 + the swap LoRA: SAM 3.1 picks the person · 48 GB+ advised");+ expect(withoutOwnGpu(MARKETING_IMAGE_NOTE.open)).toBe("Fuobe Original · Qwen-Image-Edit 2511");+ expect(withoutOwnGpu("Lip sync · free on your GPU (24 GB), or hosted on fal")).toBe("Lip sync · hosted on fal");+ });+it("refuses in words what an engine can't do", () => {expect(chooseMaker({ engine: "cloud", mode: "character", target: "click" })).toEqual({ problem: CLOUD_CLICK_PROBLEM });expect(chooseMaker({ engine: "open", mode: "character", target: "click" })).toMatchObject({ maker: { id: ORIGINALS.character, engine: "open" } });