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.

Tools: visitors learn up front that self-hosted-only tools don't run here

Adarsh25eac1ff091a
diff --git a/src/components/brand/products.tsx b/src/components/brand/products.tsx
index 2bd364d3..a2b55302 100644
--- a/src/components/brand/products.tsx
+++ b/src/components/brand/products.tsx
@@ -113,12 +113,32 @@ function ProductForm({ onOpenChange, brandId, product, onSaved }: { onOpenChange
);
}
-/** "Add product from link": reads the page, adds what it finds. */
-export function AddFromLink({ brandId, onAdded, limit = 3, withBrand, className, placeholder = "Paste a product link" }: { brandId?: string | null; onAdded?: (ps: Product[], extra: { brand?: { logo?: string; colors: string[]; name?: string } }) => void; limit?: number; withBrand?: boolean; className?: string; placeholder?: string }) {
+/** Refusals that say what this visitor can't do here (a tool, the owner's library, a GPU first): not worth a retry. */
+const REFUSED = new Set(["own-gpu-tool", "library", "connect-gpu"]);
+
+/** "Add product from link": reads the page, adds what it finds. disabled: a visitor, who can't save a product here. */
+export function AddFromLink({
+ brandId,
+ onAdded,
+ limit = 3,
+ withBrand,
+ className,
+ placeholder = "Paste a product link",
+ disabled,
+}: {
+ brandId?: string | null;
+ onAdded?: (ps: Product[], extra: { brand?: { logo?: string; colors: string[]; name?: string } }) => void;
+ limit?: number;
+ withBrand?: boolean;
+ className?: string;
+ placeholder?: string;
+ disabled?: boolean;
+}) {
const { read } = useProductActions();
const [url, setUrl] = useState("");
const [slow, setSlow] = useState(false);
const go = () => {
+ if (disabled) return;
// The server's own rule (it would refuse the link anyway), before the "Reading…" and the kit animation start.
const link = normalizeWebsite(url);
if (!link) return void toast("Use a valid product link.");
@@ -136,8 +156,12 @@ export function AddFromLink({ brandId, onAdded, limit = 3, withBrand, className,
setUrl("");
onAdded?.(r.duplicate ? [r.duplicate] : r.products, { brand: r.brand });
},
- // A refusal that opened its own card (sign up, connect your GPU): the card alone, no "try again" toast on top.
- onError: (e) => (refusalShown(e) ? toast.dismiss(id) : toast.error((e as Error).message, { id, description: "Try again, or add it by hand." })),
+ // A refusal that opened its own card (sign up, connect your GPU): the card alone, no "try again" toast on top. One
+ // that says what isn't open to this visitor gets no "try again" either: trying again wouldn't change it.
+ onError: (e) =>
+ refusalShown(e)
+ ? toast.dismiss(id)
+ : toast.error((e as Error).message, { id, description: REFUSED.has((e as { code?: string }).code ?? "") ? undefined : "Try again, or add it by hand." }),
onSettled: () => clearTimeout(t),
},
);
@@ -152,9 +176,9 @@ export function AddFromLink({ brandId, onAdded, limit = 3, withBrand, className,
>
<div className="relative min-w-0 flex-1">
<Link2 className="pointer-events-none absolute top-1/2 left-3 size-3.5 -translate-y-1/2 text-muted-foreground" />
- <input value={url} onChange={(e) => setUrl(e.target.value)} placeholder={placeholder} aria-label="Product link" className={cn(inputCls, "pl-8")} />
+ <input value={url} onChange={(e) => setUrl(e.target.value)} placeholder={placeholder} aria-label="Product link" disabled={disabled} className={cn(inputCls, "pl-8 disabled:opacity-60")} />
</div>
- <Button type="submit" variant="outline" disabled={read.isPending}>
+ <Button type="submit" variant="outline" disabled={read.isPending || disabled}>
{read.isPending ? <Loader2 className="animate-spin" /> : <Plus />} Add
</Button>
{read.isPending && slow && <span className="sr-only">This is taking longer than usual</span>}
@@ -211,12 +235,12 @@ export function ProductCard({ product, selected, onToggle, onEdit, onDelete, dis
);
}
-/** The "Upload product" button with its dialog. */
-export function UploadProductButton({ brandId, onSaved, variant = "outline" }: { brandId?: string | null; onSaved?: (p: Product) => void; variant?: "outline" | "ghost" | "secondary" }) {
+/** The "Upload product" button with its dialog. disabled: a visitor, who can't save a product here. */
+export function UploadProductButton({ brandId, onSaved, variant = "outline", disabled }: { brandId?: string | null; onSaved?: (p: Product) => void; variant?: "outline" | "ghost" | "secondary"; disabled?: boolean }) {
const [open, setOpen] = useState(false);
return (
<>
- <Button variant={variant} onClick={() => setOpen(true)}>
+ <Button variant={variant} onClick={() => setOpen(true)} disabled={disabled}>
<Upload /> Upload product
</Button>
<ProductDialog open={open} onOpenChange={setOpen} brandId={brandId} onSaved={onSaved} />
diff --git a/src/components/content-factory/home.tsx b/src/components/content-factory/home.tsx
index 022e8c12..de51c40c 100644
--- a/src/components/content-factory/home.tsx
+++ b/src/components/content-factory/home.tsx
@@ -258,10 +258,11 @@ export function ContentFactoryHome({ voices }: { voices: PickerData["voices"] })
<ReferenceCard reference={{ kind: "preset", presetId: preset.id, title: `Preset: ${preset.name}` }} analysis={null} styleId={preset.brief.styleId} />
) : null}
<div className="flex flex-wrap items-center gap-1.5">
+ {/* A guest's or an account's clip would be uploaded and read for a series that can't start here. */}
<button
type="button"
onClick={() => file.current?.click()}
- disabled={uploading || create.isPending}
+ disabled={uploading || create.isPending || visitor}
className="inline-flex h-8 items-center gap-1.5 rounded-full bg-secondary px-3 text-[13px] font-medium hover:bg-accent disabled:opacity-60"
>
{uploading ? <Loader2 className="size-3.5 animate-spin" /> : <Upload className="size-3.5" />}
@@ -270,9 +271,10 @@ export function ContentFactoryHome({ voices }: { voices: PickerData["voices"] })
<button
type="button"
onClick={() => setLinkOpen((v) => !v)}
- aria-expanded={linkOpen}
+ disabled={visitor}
+ aria-expanded={linkOpen && !visitor}
aria-controls={ids.link}
- className={cn("inline-flex h-8 items-center gap-1.5 rounded-full px-3 text-[13px] font-medium", linkOpen ? "bg-brand-faint text-brand-text" : "bg-secondary hover:bg-accent")}
+ className={cn("inline-flex h-8 items-center gap-1.5 rounded-full px-3 text-[13px] font-medium disabled:opacity-60", linkOpen && !visitor ? "bg-brand-faint text-brand-text" : "bg-secondary hover:bg-accent")}
>
<Link2 className="size-3.5" /> TikTok or Instagram link
</button>
@@ -284,7 +286,7 @@ export function ContentFactoryHome({ voices }: { voices: PickerData["voices"] })
</span>
<input ref={file} type="file" accept="video/mp4,video/quicktime,video/webm,.mp4,.mov,.m4v,.webm" hidden onChange={(e) => (void onFile(e.target.files?.[0]), (e.target.value = ""))} />
</div>
- {linkOpen && (
+ {linkOpen && !visitor && (
<div id={ids.link} className="space-y-1.5 rounded-2xl bg-muted/60 p-2.5">
<form
className="flex min-w-0 items-center gap-2"
diff --git a/src/components/dub/dub-studio.tsx b/src/components/dub/dub-studio.tsx
index db054371..d4462ece 100644
--- a/src/components/dub/dub-studio.tsx
+++ b/src/components/dub/dub-studio.tsx
@@ -15,7 +15,8 @@ import { SourceLanguageSelect, TargetLanguages } from "@/components/av/language-
import { MediaDrop } from "@/components/av/media-drop";
import { StepList, type StepRow } from "@/components/av/step-list";
import { Panel, ToolHero, ToolShell } from "@/components/av/tool-shell";
-import { useEngine, useModelAccess } from "@/lib/api";
+import { SelfHostNote } from "@/components/self-host-note";
+import { useEngine, useIsVisitor, useModelAccess } from "@/lib/api";
import { keepOffered, offered } from "@/lib/model-access";
import { cueProblems } from "@/lib/av/cue-edit";
import { BACKGROUND_DB, crowdedLines, dubResult, languageStage, ONE_SHOT_MODELS, priceLine, reviewCues, takeLines, translateKey, voiceOnly, type DubPrice, type DubSessionView, type DubStage, type OneShotModel } from "@/lib/av/dub";
@@ -91,6 +92,9 @@ export function DubStudio({ tabs }: { tabs?: React.ReactNode }) {
function NewDub({ onStarted }: { onStarted: (id: string) => void }) {
const [engine, , engineMode] = useEngine();
+ // A dub doesn't run on an account's own GPU or key yet (only the studios' generations do): said up front, and the
+ // upload and Translate are off, instead of a run the server refuses.
+ const visitor = useIsVisitor();
const { create } = useDubActions();
const [video, setVideo] = useState<SlotValue | null>(null);
const [duration, setDuration] = useState<number | undefined>(undefined);
@@ -112,6 +116,7 @@ function NewDub({ onStarted }: { onStarted: (id: string) => void }) {
const body = video && !video.uploading && usable.length ? { engine, mode: oneShot ? ("oneshot" as const) : ("steps" as const), model: oneShot ? model : undefined, video: video.ref, source, targets: usable, duration } : null;
const price = useDubPrice(body);
const start = () => {
+ if (visitor) return;
if (blocker || !body) return void toast(blocker, { id: "dub-blocker" });
create.mutate(
{ ...body, title: video!.name?.replace(/\.[a-z0-9]+$/i, "") },
@@ -128,20 +133,25 @@ function NewDub({ onStarted }: { onStarted: (id: string) => void }) {
};
return (
<div className="pb-10">
- <ToolHero title="Speak every language" subtitle="Translate the speech, keep the speaker's voice and re-sync the lips. Review every line before it's spoken." />
+ <ToolHero title="Speak every language" subtitle="Translate the speech, keep the speaker's voice and re-sync the lips. Review every line before it's spoken.">
+ {visitor && <SelfHostNote className="mt-3 max-w-xl">Translate &amp; dub runs on a self-hosted Fuobe for now.</SelfHostNote>}
+ </ToolHero>
<div className="mx-auto mt-8 max-w-[760px] space-y-3">
- <MediaDrop
- kind="video"
- value={video}
- onChange={(v) => {
- setVideo(v);
- if (!v) setDuration(undefined);
- }}
- onDuration={setDuration}
- title="Add the video to translate"
- hint="MP4, MOV or WebM up to 200 MB · one clear speaker works best"
- compact
- />
+ {/* A guest's or an account's video would be uploaded for a dub that can't start here. */}
+ <div inert={visitor} className={cn(visitor && "opacity-50")}>
+ <MediaDrop
+ kind="video"
+ value={video}
+ onChange={(v) => {
+ setVideo(v);
+ if (!v) setDuration(undefined);
+ }}
+ onDuration={setDuration}
+ title="Add the video to translate"
+ hint="MP4, MOV or WebM up to 200 MB · one clear speaker works best"
+ compact
+ />
+ </div>
<Panel title="How">
<div role="radiogroup" aria-label="How to dub" className="grid gap-2 sm:grid-cols-2">
<ModeCard on={!oneShot} icon={<Languages className="size-4" />} title="Review the script first" onClick={() => setMode("steps")} note={engineMode === "open" ? "Transcribe and translate, edit every line, then voice it." : "Transcribe and translate, edit every line, then voice it. Cloud and open source."} />
@@ -206,7 +216,7 @@ function NewDub({ onStarted }: { onStarted: (id: string) => void }) {
</p>
<div className="flex shrink-0 items-center gap-3 self-end sm:self-auto">
<PriceNote price={price.data} loading={price.isFetching && !price.data} error={price.error as Error | null} hint={oneShot ? undefined : "Translating costs little; you'll see the voice's price before it speaks"} />
- <Button size="lg" className={cn("shrink-0 rounded-full", blocker && "bg-muted text-muted-foreground hover:bg-muted")} onClick={start} disabled={create.isPending} aria-describedby={blocker ? "dub-blocker" : undefined}>
+ <Button size="lg" className={cn("shrink-0 rounded-full", blocker && "bg-muted text-muted-foreground hover:bg-muted")} onClick={start} disabled={create.isPending || visitor} aria-describedby={blocker ? "dub-blocker" : undefined}>
{create.isPending ? <Loader2 className="size-4 animate-spin" /> : <Sparkles className="size-4" />}
{oneShot ? "Dub it" : "Translate"}
</Button>
diff --git a/src/components/evolution/evolution-tool.tsx b/src/components/evolution/evolution-tool.tsx
index 468f2d74..9c6f8608 100644
--- a/src/components/evolution/evolution-tool.tsx
+++ b/src/components/evolution/evolution-tool.tsx
@@ -9,6 +9,7 @@ import { Textarea } from "@/components/ui/textarea";
import { StepList, type StepRow } from "@/components/av/step-list";
import { Panel, ToolHero, ToolShell } from "@/components/av/tool-shell";
import { useGenerationList } from "@/components/av/use-generation";
+import { SelfHostNote } from "@/components/self-host-note";
import { VideoCompare } from "@/components/remove-object/video-compare";
import { useSubmitGuard } from "@/components/shorts/hooks";
import { ClipBar, ClipDrop, costText, Field, Segmented } from "@/components/shorts/ui";
@@ -16,7 +17,7 @@ import { clipDuration, clipSize, useSourceClip } from "@/components/shorts/use-s
import { Feed } from "@/components/studio/feed";
import { fileToList, MediaSlot, type SlotValue } from "@/components/studio/media-slot";
import { VideoTrimmer, type TrimRange, type VideoTrimmerHandle } from "@/components/studio/video-trimmer";
-import { useEngine, useGenerations } from "@/lib/api";
+import { useEngine, useGenerations, useIsVisitor } from "@/lib/api";
import { DIRECTION_CUT_NOTE, directionPrompt, EVOLUTION, EVOLUTION_DEFAULT_RESOLUTION, EVOLUTION_RESOLUTIONS, INTENSITIES, type Intensity } from "@/lib/catalog/evolution";
import { chainState } from "@/lib/catalog/shorts";
import { downloadHref, downloadName } from "@/lib/library";
@@ -55,6 +56,9 @@ async function frameDataUrl(blob: Blob | null | undefined): Promise<string | und
*/
export function EvolutionTool({ tabs }: { tabs?: React.ReactNode }) {
const [engine] = useEngine();
+ // Evolution doesn't run on an account's own GPU or key yet (only the studios' generations do): said up front, and
+ // the upload and Evolve are off, instead of a run the server refuses.
+ const visitor = useIsVisitor();
const source = useSourceClip(EVOLUTION.maxBytes);
const clip = source.clip;
const trimmer = useRef<VideoTrimmerHandle>(null);
@@ -93,7 +97,7 @@ export function EvolutionTool({ tabs }: { tabs?: React.ReactNode }) {
const cut = useMemo(() => directionPrompt(direction).cut, [direction]);
const notes = est ? [...est.notes.filter((n) => n !== DIRECTION_CUT_NOTE), ...(cut ? [DIRECTION_CUT_NOTE] : [])] : [];
- const blocker = !clip
+ const setupBlocker = !clip
? "Add a clip"
: clip.error
? clip.error
@@ -108,6 +112,7 @@ export function EvolutionTool({ tabs }: { tabs?: React.ReactNode }) {
: estimate.isError
? (estimate.error as Error).message
: null;
+ const blocker = visitor ? "Evolution runs on a self-hosted Fuobe for now" : setupBlocker;
const reset = () => {
source.clear();
@@ -159,13 +164,16 @@ export function EvolutionTool({ tabs }: { tabs?: React.ReactNode }) {
<ToolHero
title="Take a clip further"
subtitle="Evolution keeps your clip's motion and timing and takes the rest where your references and words point. Priced before it runs; free on your own ComfyUI."
- />
+ >
+ {visitor && <SelfHostNote className="mt-3 max-w-xl">Evolution runs on a self-hosted Fuobe for now.</SelfHostNote>}
+ </ToolHero>
)}
<div className={cn("mx-auto", clip ? "pt-4" : "mt-8 max-w-[640px]")}>
{!clip ? (
<ClipDrop
accept={EVOLUTION.accept}
limits={LIMITS}
+ disabled={visitor}
onFile={(f) => {
const err = source.pick(f);
if (err) toast.error(err);
@@ -258,7 +266,7 @@ export function EvolutionTool({ tabs }: { tabs?: React.ReactNode }) {
className="max-h-64 resize-y"
/>
<div className="flex flex-wrap items-center gap-2">
- <Button size="sm" variant="outline" className="rounded-full" onClick={() => void write()} disabled={actions.direction.isPending || !clip || refs.some((r) => r.uploading)}>
+ <Button size="sm" variant="outline" className="rounded-full" onClick={() => void write()} disabled={actions.direction.isPending || !clip || refs.some((r) => r.uploading) || visitor}>
{actions.direction.isPending ? <Loader2 className="size-3.5 animate-spin" /> : <Sparkles className="size-3.5" />} Write it for me
</Button>
<span className="text-[12px] text-muted-foreground">
@@ -291,7 +299,7 @@ export function EvolutionTool({ tabs }: { tabs?: React.ReactNode }) {
</>
)}
</div>
- <Button className="rounded-full" onClick={start} disabled={!!blocker || actions.run.isPending}>
+ <Button className="rounded-full" onClick={start} disabled={!!blocker || actions.run.isPending || visitor}>
{actions.run.isPending ? <Loader2 className="size-4 animate-spin" /> : <Wand2 className="size-4" />} Evolve
</Button>
</div>
diff --git a/src/components/fashion/character-sheet.tsx b/src/components/fashion/character-sheet.tsx
index 397cb005..b0cf482b 100644
--- a/src/components/fashion/character-sheet.tsx
+++ b/src/components/fashion/character-sheet.tsx
@@ -5,6 +5,7 @@ import Link from "next/link";
import { useMemo, useRef, useState } from "react";
import { toast } from "sonner";
import { PageHeader, PageShell } from "@/components/page-shell";
+import { SelfHostNote } from "@/components/self-host-note";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { Textarea } from "@/components/ui/textarea";
@@ -15,7 +16,7 @@ import { useRun, useRunPreview } from "@/components/photodump/hooks";
import { ResultsGrid } from "@/components/photodump/results";
import { RunLine } from "@/components/photodump/steps";
import { TurnaroundButton } from "@/components/turnaround/turnaround-dialog";
-import { useElements, useEngine, useGenerations, useSaveElement } from "@/lib/api";
+import { useElements, useEngine, useGenerations, useIsVisitor, useSaveElement } from "@/lib/api";
import { castFieldVisible, castNameFor, randomCast, SHEET_MAX_REFS, type CastAnswers, type CastFieldData } from "@/lib/catalog/packs";
import { sheetPictures } from "@/lib/catalog/turnaround";
import type { Generation } from "@/lib/catalog/types";
@@ -153,6 +154,9 @@ export function SaveCharacter({ item, extra, defaultName }: { item: Generation;
*/
export function CharacterSheetView({ fields, defaults }: { fields: CastFieldData[]; defaults: CastAnswers }) {
const [engine, setEngine] = useEngine();
+ // A sheet doesn't run on an account's own GPU or key yet (only the studios' generations do): said up front, and the
+ // uploads and Create are off, instead of a run the server refuses.
+ const visitor = useIsVisitor();
const [mode, setMode] = useState<Mode>("reference");
const [photos, setPhotos] = useState<SlotValue[]>([]);
const [details, setDetails] = useState("");
@@ -180,11 +184,13 @@ export function CharacterSheetView({ fields, defaults }: { fields: CastFieldData
: null;
const preview = useRunPreview("/api/photodump/character", body);
const addFiles = (files: Iterable<File>) => {
+ if (visitor) return;
const list = [...files].filter((f) => /^image\//.test(f.type));
if (photos.length + list.length > SHEET_MAX_REFS) toast(`Maximum ${SHEET_MAX_REFS} images`);
list.slice(0, SHEET_MAX_REFS - photos.length).forEach((f) => fileToList(f, setPhotos, "image"));
};
const create = () => {
+ if (visitor) return;
if (mode === "reference" && !photos.length) return toast("Upload at least 1 image");
if (!body) return toast(mode === "describe" ? "Describe your character first" : "Wait for the uploads to finish");
run.mutate(body, {
@@ -199,6 +205,7 @@ export function CharacterSheetView({ fields, defaults }: { fields: CastFieldData
<PageHeader title="Character Sheet" description="Build your AI avatar: a consistent character for your videos, from a reference or defined from scratch.">
<EngineSwitch value={engine} onChange={setEngine} />
</PageHeader>
+ {visitor && <SelfHostNote className="-mt-3 mb-6 max-w-2xl">Character Sheet runs on a self-hosted Fuobe for now.</SelfHostNote>}
<div className="grid gap-6 lg:grid-cols-[minmax(0,1fr)_minmax(0,1fr)]">
<section className="min-w-0 space-y-4">
<div role="tablist" aria-label="How to build it" className="scrollbar-none inline-flex max-w-full overflow-x-auto rounded-full bg-muted p-0.5">
@@ -220,12 +227,13 @@ export function CharacterSheetView({ fields, defaults }: { fields: CastFieldData
addFiles(e.dataTransfer.files);
}}
onPaste={(e) => addFiles(e.clipboardData.files)}
- className={cn("rounded-2xl border border-dashed transition-colors", over && "border-primary bg-brand-faint")}
+ className={cn("rounded-2xl border border-dashed transition-colors", over && !visitor && "border-primary bg-brand-faint")}
>
<button
type="button"
onClick={() => fileInput.current?.click()}
- className="flex w-full flex-col items-center justify-center gap-2 rounded-2xl px-4 py-10 text-center outline-none transition-colors hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset"
+ disabled={visitor}
+ className="flex w-full flex-col items-center justify-center gap-2 rounded-2xl px-4 py-10 text-center outline-none transition-colors hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset disabled:pointer-events-none disabled:opacity-50"
>
<ImagePlus className="size-6 text-muted-foreground" />
<span className="text-[14px] font-medium">Drop images here</span>
@@ -291,7 +299,7 @@ export function CharacterSheetView({ fields, defaults }: { fields: CastFieldData
<div className="min-w-0 flex-1">
<RunLine preview={body ? preview.data : undefined} loading={preview.isFetching} />
</div>
- <Button onClick={create} disabled={run.isPending || uploading}>
+ <Button onClick={create} disabled={run.isPending || uploading || visitor}>
{run.isPending ? <Loader2 className="animate-spin" /> : <Sparkles />} {run.isPending ? "Submitting..." : "Create AI Avatar"}
</Button>
</div>
diff --git a/src/components/fashion/fashion-view.tsx b/src/components/fashion/fashion-view.tsx
index 680515fe..8080d7d8 100644
--- a/src/components/fashion/fashion-view.tsx
+++ b/src/components/fashion/fashion-view.tsx
@@ -5,6 +5,7 @@ import Link from "next/link";
import { useMemo, useState, useSyncExternalStore } from "react";
import { toast } from "sonner";
import { PageHeader, PageShell } from "@/components/page-shell";
+import { SelfHostNote } from "@/components/self-host-note";
import { Button } from "@/components/ui/button";
import { EngineSwitch } from "@/components/studio/engine-switch";
import type { SlotValue } from "@/components/studio/media-slot";
@@ -14,7 +15,7 @@ import { useRun, useRunPreview } from "@/components/photodump/hooks";
import { RunLine, Steps } from "@/components/photodump/steps";
import { CharacterPicker } from "@/components/photodump/subject";
import { UploadBox } from "@/components/photodump/upload-box";
-import { useEngine, useGenerations, useModelAccess } from "@/lib/api";
+import { useEngine, useGenerations, useIsVisitor, useModelAccess } from "@/lib/api";
import { keepOffered, offered } from "@/lib/model-access";
import { FASHION, FASHION_MODELS, FASHION_START, FASHION_STEPS, fashionBlocker, fashionReducer, getTemplate, type FashionState } from "@/lib/catalog/packs";
import type { Generation } from "@/lib/catalog/types";
@@ -72,6 +73,9 @@ function useBannerSeen(): [boolean, () => void] {
export function FashionView() {
const [s, dispatch] = useStoredReducer<FashionState, Parameters<typeof fashionReducer>[1]>("fuobe.fashion", fashionReducer, FASHION_START);
const [engine, setEngine] = useEngine();
+ // A shoot doesn't run on an account's own GPU or key yet (only the studios' generations do): said up front, and the
+ // steps that run or upload are off. The templates stay open to browse.
+ const visitor = useIsVisitor();
const [garment, setGarment] = useState<SlotValue | null>(null);
const [pickedOutfit, setOutfitModel] = useState<string>();
const [pickedSet, setSetModel] = useState<string>();
@@ -114,21 +118,21 @@ export function FashionView() {
return !!msg;
};
const startBase = () => {
- if (block(fashionBlocker(s)) || !baseBody) return;
+ if (visitor || block(fashionBlocker(s)) || !baseBody) return;
base.mutate(baseBody, {
onSuccess: (r) => dispatch({ type: "baseStarted", ids: r.items.map((g) => g.id) }),
onError: (e) => toastError(e, "JobSet wasn't created"),
});
};
const startOutfit = () => {
- if (block(fashionBlocker(s, "outfit")) || !outfitBody) return;
+ if (visitor || block(fashionBlocker(s, "outfit")) || !outfitBody) return;
outfit.mutate(outfitBody, {
onSuccess: (r) => dispatch({ type: "outfitStarted", ids: r.items.map((g) => g.id) }),
onError: (e) => toastError(e, "JobSet wasn't created"),
});
};
const startSet = () => {
- if (block(fashionBlocker(s)) || !setBody) return;
+ if (visitor || block(fashionBlocker(s)) || !setBody) return;
photoset.mutate(setBody, {
onSuccess: (r) => dispatch({ type: "photosetStarted", batchId: r.batchId ?? r.items[0]?.batchId ?? r.items[0]?.id }),
onError: (e) => toastError(e, "JobSet wasn't created"),
@@ -147,6 +151,7 @@ export function FashionView() {
<EngineSwitch value={engine} onChange={setEngine} />
</div>
</PageHeader>
+ {visitor && <SelfHostNote className="-mt-3 mb-6 max-w-2xl">Fashion Factory runs on a self-hosted Fuobe for now.</SelfHostNote>}
{!bannerSeen && at === 0 && (
<div className="relative mb-6 overflow-hidden rounded-2xl border bg-gradient-to-br from-brand-faint to-background p-5">
@@ -214,7 +219,7 @@ export function FashionView() {
</div>
<CharacterPicker value={s.elementId} onChange={(id) => dispatch({ type: "element", id })} />
<Footer onBack={() => dispatch({ type: "back" })} line={<RunLine preview={baseBody ? preview.data : undefined} loading={preview.isFetching} />}>
- <Button onClick={startBase} disabled={base.isPending || !!(baseBody && preview.data?.error)}>
+ <Button onClick={startBase} disabled={base.isPending || !!(baseBody && preview.data?.error) || visitor}>
{base.isPending ? <Loader2 className="animate-spin" /> : null} {base.isPending ? "Generating..." : "Next"}
</Button>
</Footer>
@@ -228,7 +233,7 @@ export function FashionView() {
<h2 className="font-heading text-[26px] leading-tight">See instant variations of the selected character</h2>
<p className="text-[14px] text-muted-foreground">Pick the base shot to dress.</p>
</div>
- <Button variant="outline" size="sm" onClick={startBase} disabled={base.isPending || busy(baseItems)}>
+ <Button variant="outline" size="sm" onClick={startBase} disabled={base.isPending || busy(baseItems) || visitor}>
<RefreshCw /> Regenerate
</Button>
</div>
@@ -252,11 +257,14 @@ export function FashionView() {
<img src={s.base} alt="Base shot" className="aspect-[3/4] w-full object-cover" />
)}
</div>
- <UploadBox value={garmentValue} onChange={setGarmentValue} title="Upload outfit" hint="The product: a garment on a model or flat-lay" className="aspect-[3/4]" />
+ {/* A guest's or an account's outfit would be uploaded for a shoot that can't start here. */}
+ <div inert={visitor} className={cn(visitor && "opacity-50")}>
+ <UploadBox value={garmentValue} onChange={setGarmentValue} title="Upload outfit" hint="The product: a garment on a model or flat-lay" className="aspect-[3/4]" />
+ </div>
</div>
<ModelChips label="Outfit model" ids={outfitModels} value={outfitModel} onChange={setOutfitModel} />
<RunLine preview={outfitBody && !s.outfit ? preview.data : undefined} loading={!s.outfit && preview.isFetching} />
- <Button className="w-full" variant={s.outfitIds.length ? "outline" : "default"} onClick={startOutfit} disabled={outfit.isPending}>
+ <Button className="w-full" variant={s.outfitIds.length ? "outline" : "default"} onClick={startOutfit} disabled={outfit.isPending || visitor}>
{outfit.isPending ? <Loader2 className="animate-spin" /> : <Sparkles />} {outfit.isPending ? "Generating..." : "Generate outfit"}
</Button>
</div>
@@ -277,7 +285,7 @@ export function FashionView() {
)}
{s.outfit && <ModelChips label="Photoset model" ids={setModels} value={setModel} onChange={setSetModel} />}
<Footer onBack={() => dispatch({ type: "back" })} line={s.outfit ? <RunLine preview={preview.data} loading={preview.isFetching} /> : undefined}>
- <Button onClick={startSet} disabled={photoset.isPending}>
+ <Button onClick={startSet} disabled={photoset.isPending || visitor}>
{photoset.isPending ? <Loader2 className="animate-spin" /> : null} {photoset.isPending ? "Generating..." : "Get your photoset"}
</Button>
</Footer>
diff --git a/src/components/influencer/influencer-builder.tsx b/src/components/influencer/influencer-builder.tsx
index dc4472f8..32b99b2f 100644
--- a/src/components/influencer/influencer-builder.tsx
+++ b/src/components/influencer/influencer-builder.tsx
@@ -9,13 +9,14 @@ import { PageHeader, PageShell } from "@/components/page-shell";
import { useRun, useRunPreview, type RunPreview } from "@/components/photodump/hooks";
import { ResultsGrid } from "@/components/photodump/results";
import { UploadBox } from "@/components/photodump/upload-box";
+import { SelfHostNote } from "@/components/self-host-note";
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 { Button } from "@/components/ui/button";
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
import { Textarea } from "@/components/ui/textarea";
-import { useEngine, useGenerations, useModelAccess } from "@/lib/api";
+import { useEngine, useGenerations, useIsVisitor, useModelAccess } from "@/lib/api";
import { keepOffered, offered } from "@/lib/model-access";
import {
categoriesFor,
@@ -118,6 +119,9 @@ function RunInfo({ preview, loading, blocker }: { preview?: RunPreview & { steps
*/
export function InfluencerBuilder() {
const [engine, setEngine] = useEngine();
+ // A sheet doesn't run on an account's own GPU or key yet (only the studios' generations do): said up front, and the
+ // uploads and Generate are off. The builder itself stays open to play with.
+ const visitor = useIsVisitor();
const wide = useWide();
const [state, setState] = useState<InfluencerState>(INFLUENCER_START);
const [active, setActive] = useState("tier");
@@ -187,6 +191,7 @@ export function InfluencerBuilder() {
list.slice(0, MAX_CLOTHING - clothing.length).forEach((f) => fileToList(f, setClothing, "image"));
};
const create = () => {
+ if (visitor) return;
if (blocker) return toast(blocker);
if (!body) return toast("Wait for the uploads to finish");
run.mutate(body, {
@@ -200,6 +205,7 @@ export function InfluencerBuilder() {
<PageHeader title="AI Influencer" description="Build an original character, game-style: pick a character type, then a look in up to 18 categories or Shuffle, and get a character sheet to save as a character.">
<EngineSwitch value={engine} onChange={setEngine} />
</PageHeader>
+ {visitor && <SelfHostNote className="-mt-3 mb-6 max-w-2xl">AI Influencer runs on a self-hosted Fuobe for now.</SelfHostNote>}
<div className="grid gap-4 lg:grid-cols-[212px_minmax(0,1fr)] xl:grid-cols-[212px_minmax(0,1fr)_340px]">
{/* The rail: Character type, then the categories this type shows. Phones scroll it sideways inside itself. */}
@@ -315,13 +321,16 @@ export function InfluencerBuilder() {
</div>
{start !== "scratch" && (
<div className="space-y-1.5">
- <UploadBox
- value={photo}
- onChange={setPhoto}
- title={start === "face" ? "Your photo" : "Reference image"}
- hint={start === "face" ? "A clear, front-facing photo of your face" : "A character whose look to start from"}
- className="h-44"
- />
+ {/* A guest's or an account's photo would be uploaded for a sheet that can't start here. */}
+ <div inert={visitor} className={cn(visitor && "opacity-50")}>
+ <UploadBox
+ value={photo}
+ onChange={setPhoto}
+ title={start === "face" ? "Your photo" : "Reference image"}
+ hint={start === "face" ? "A clear, front-facing photo of your face" : "A character whose look to start from"}
+ className="h-44"
+ />
+ </div>
<p className="text-[12px] text-muted-foreground">
{start === "face" ? "Your face goes on the character you build." : "The character starts from this look; your picks change it."} Shuffle keeps the gender, ethnicity and age{state.tier === "normal" ? ", skin and eye colour" : ""} the photo decides.
</p>
@@ -352,7 +361,8 @@ export function InfluencerBuilder() {
onClick={() => clothingInput.current?.click()}
onDragOver={(e) => e.preventDefault()}
onDrop={(e) => (e.preventDefault(), addClothing(e.dataTransfer.files))}
- className="grid aspect-square place-items-center rounded-lg border border-dashed text-muted-foreground transition-colors outline-none hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring"
+ disabled={visitor}
+ className="grid aspect-square place-items-center rounded-lg border border-dashed text-muted-foreground transition-colors outline-none hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50"
aria-label="Add clothing references"
>
<ImagePlus className="size-5" />
@@ -400,7 +410,7 @@ export function InfluencerBuilder() {
</p>
)}
<RunInfo preview={blocker ? undefined : (settled ? preview.data : undefined)} loading={preview.isFetching} blocker={blocker} />
- <Button className="w-full" onClick={create} disabled={run.isPending || uploading}>
+ <Button className="w-full" onClick={create} disabled={run.isPending || uploading || visitor}>
{run.isPending ? <Loader2 className="animate-spin" /> : <Sparkles />} {run.isPending ? "Starting…" : "Generate character sheet"}
</Button>
</div>
diff --git a/src/components/katana/katana-studio.tsx b/src/components/katana/katana-studio.tsx
index ef80233e..ce921b53 100644
--- a/src/components/katana/katana-studio.tsx
+++ b/src/components/katana/katana-studio.tsx
@@ -18,7 +18,8 @@ import { frameDiff, openVideo, releaseVideo, sampleFrames } from "@/components/a
import { MediaDrop } from "@/components/av/media-drop";
import { StepList, type StepRow } from "@/components/av/step-list";
import { Panel, ToolHero, ToolShell } from "@/components/av/tool-shell";
-import { useEngine, useModelAccess } from "@/lib/api";
+import { SelfHostNote } from "@/components/self-host-note";
+import { useEngine, useIsVisitor, useModelAccess } from "@/lib/api";
import { formatCueTime } from "@/lib/av/cue-edit";
import { detectCutIndices, KATANA_LIMITS, katanaProgress, katanaStage, motionModel, MOTION_MODELS, nearestAspect, planSegments, refineCut, refineTimes, type KatanaJobView, type Segment } from "@/lib/av/katana";
import { keepOffered, offered } from "@/lib/model-access";
@@ -59,6 +60,9 @@ const money = (usd: number | null | undefined, demo?: boolean, open?: boolean) =
/** Katana: rebuild a reference edit with your subject, shot for shot. */
export function KatanaStudio() {
const [engine] = useEngine();
+ // An edit doesn't run on an account's own GPU or key yet (only the studios' generations do): said up front, and the
+ // uploads and Recreate are off, instead of a run the server refuses.
+ const visitor = useIsVisitor();
const jobs = useKatanaJobs();
const { start } = useKatanaActions();
const [reference, setReference] = useState<SlotValue | null>(null);
@@ -140,6 +144,7 @@ export function KatanaStudio() {
};
const go = () => {
+ if (visitor) return;
if (blocker || !body) return void toast(blocker ?? "Not ready yet", { id: "katana-blocker" });
start.mutate(body, {
onSuccess: (j) => toast.success(`Katana started · ${j.segments.length} segment${j.segments.length === 1 ? "" : "s"}`),
@@ -149,9 +154,12 @@ export function KatanaStudio() {
return (
<ToolShell title="Katana">
- <ToolHero title="Recreate the edit. Make it yours." subtitle="Drop a reference edit and up to 5 photos of your subject — Katana rebuilds it shot for shot, at the original cut times, with the original sound." />
+ <ToolHero title="Recreate the edit. Make it yours." subtitle="Drop a reference edit and up to 5 photos of your subject — Katana rebuilds it shot for shot, at the original cut times, with the original sound.">
+ {visitor && <SelfHostNote className="mt-3 max-w-xl">Katana runs on a self-hosted Fuobe for now.</SelfHostNote>}
+ </ToolHero>
<div className="mx-auto mt-8 grid max-w-[1040px] gap-4 lg:grid-cols-[minmax(0,6fr)_minmax(0,5fr)]">
- <div className="min-w-0 space-y-3">
+ {/* A guest's or an account's files would be uploaded for an edit that can't start here. */}
+ <div inert={visitor} className={cn("min-w-0 space-y-3", visitor && "opacity-50")}>
<MediaDrop
kind="video"
value={reference}
@@ -225,7 +233,7 @@ export function KatanaStudio() {
</div>
<div className="min-w-0 space-y-3">
<Panel title="Your subject" aside={<span className="text-[12px] text-muted-foreground">{photos.length}/5</span>}>
- <div className="flex flex-wrap gap-2">
+ <div inert={visitor} className={cn("flex flex-wrap gap-2", visitor && "opacity-50")}>
{photos.map((p) => (
<MediaSlot key={p.id} label="Photo" kind="image" value={p} onChange={(v) => setPhotos((xs) => (v ? xs.map((x) => (x.id === p.id ? { ...v, id: p.id } : x)) : xs.filter((x) => x.id !== p.id)))} size="lg" />
))}
@@ -285,7 +293,7 @@ export function KatanaStudio() {
(blocker ?? "Pricing…")
)}
</p>
- <Button size="lg" className={cn("rounded-full", blocker && "bg-muted text-muted-foreground hover:bg-muted")} onClick={go} disabled={start.isPending || scanning !== null}>
+ <Button size="lg" className={cn("rounded-full", blocker && "bg-muted text-muted-foreground hover:bg-muted")} onClick={go} disabled={start.isPending || scanning !== null || visitor}>
{start.isPending ? <Loader2 className="size-4 animate-spin" /> : <Sparkles className="size-4" />} Recreate
</Button>
</div>
diff --git a/src/components/layers/projects-view.tsx b/src/components/layers/projects-view.tsx
index ee323679..4b45eaa6 100644
--- a/src/components/layers/projects-view.tsx
+++ b/src/components/layers/projects-view.tsx
@@ -15,7 +15,8 @@ import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover
import { Skeleton } from "@/components/ui/skeleton";
import { LibraryGrid } from "@/components/studio/media-slot";
import { PageShell } from "@/components/page-shell";
-import { uploadFile, useHydrated } from "@/lib/api";
+import { SelfHostNote } from "@/components/self-host-note";
+import { uploadFile, useHydrated, useIsVisitor, useViewer } from "@/lib/api";
import { timeAgo } from "@/lib/format";
import type { LayerProject } from "@/lib/layers";
import { cn } from "@/lib/utils";
@@ -195,6 +196,10 @@ 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.
+ const visitor = useIsVisitor();
+ const viewer = useViewer().data;
const [picking, setPicking] = useState(false);
const [renaming, setRenaming] = useState<LayerProject | null>(null);
const [draft, setDraft] = useState("");
@@ -208,14 +213,16 @@ function ProjectsInner() {
const deep = params.get("image");
const link = deep ? `${bfcacheId}|${params.toString()}` : null;
useEffect(() => {
- if (!deep || !link || started.current === link) return;
+ // Once it's known who is looking: a guest's or an account's link opens nothing (the page says why).
+ if (!deep || !link || started.current === link || !viewer) return;
started.current = link;
+ if (!viewer.owner) return;
if (!deep.startsWith("/api/files/")) {
toast.error("Only images from your library can be edited here. Pick an image or upload one.");
return;
}
void open(deep, { generationId: params.get("generation") ?? undefined, name: params.get("name") ?? undefined });
- }, [deep, link, params, open]);
+ }, [deep, link, params, open, viewer]);
const items = projects.data ?? [];
@@ -226,7 +233,7 @@ function ProjectsInner() {
onDragOver={(e) => {
if (e.dataTransfer.types.includes("Files")) {
e.preventDefault();
- setDragging(true);
+ if (!visitor) setDragging(true);
}
}}
onDragLeave={(e) => {
@@ -236,7 +243,7 @@ function ProjectsInner() {
e.preventDefault();
setDragging(false);
const f = e.dataTransfer.files[0];
- if (f) void openFile(f);
+ if (f && !visitor) void openFile(f);
}}
>
<section className="mx-auto max-w-[820px] pt-[4vh] text-center">
@@ -266,12 +273,12 @@ function ProjectsInner() {
}}
/>
)}
- <Button size="lg" className="rounded-full px-5" onClick={() => file.current?.click()} disabled={!!busy}>
+ <Button size="lg" className="rounded-full px-5" onClick={() => file.current?.click()} disabled={!!busy || visitor}>
{busy ? <Loader2 className="animate-spin" /> : <Upload />} Upload Media
</Button>
- <Popover open={picking} onOpenChange={setPicking}>
+ <Popover open={picking && !visitor} onOpenChange={setPicking}>
<PopoverTrigger asChild>
- <Button size="lg" variant="secondary" className="rounded-full px-5" disabled={!!busy}>
+ <Button size="lg" variant="secondary" className="rounded-full px-5" disabled={!!busy || visitor}>
<Library /> From your library
</Button>
</PopoverTrigger>
@@ -289,7 +296,11 @@ function ProjectsInner() {
</PopoverContent>
</Popover>
</div>
- <p className="mt-3 text-[12px] text-muted-foreground">Upload an image, or pick one you already generated. Images only — JPG, PNG or WebP.</p>
+ {visitor ? (
+ <SelfHostNote className="mx-auto mt-3 max-w-[560px]">Layers projects aren&apos;t on free accounts yet.</SelfHostNote>
+ ) : (
+ <p className="mt-3 text-[12px] text-muted-foreground">Upload an image, or pick one you already generated. Images only — JPG, PNG or WebP.</p>
+ )}
<p className="mx-auto mt-4 flex max-w-md items-center justify-center gap-2 rounded-full bg-muted px-3 py-1.5 text-[12px] text-muted-foreground md:hidden">
<MonitorSmartphone className="size-3.5 shrink-0" /> Layers works best on a larger screen — on a phone you can preview and download.
</p>
@@ -343,11 +354,13 @@ 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>
- <EmptyContent>
- <Button className="rounded-full" onClick={() => file.current?.click()} disabled={!!busy}>
- <Upload /> Upload Media
- </Button>
- </EmptyContent>
+ {!visitor && (
+ <EmptyContent>
+ <Button className="rounded-full" onClick={() => file.current?.click()} disabled={!!busy}>
+ <Upload /> Upload Media
+ </Button>
+ </EmptyContent>
+ )}
</Empty>
)}
</section>
diff --git a/src/components/marketing/click-to-ad.tsx b/src/components/marketing/click-to-ad.tsx
index 32691f06..0c1a5e84 100644
--- a/src/components/marketing/click-to-ad.tsx
+++ b/src/components/marketing/click-to-ad.tsx
@@ -11,8 +11,9 @@ import { LogoField } from "@/components/brand/brand-kit-form";
import { areaCls, ColorList, inputCls } from "@/components/brand/fields";
import { ImageList } from "@/components/brand/image-list";
import { AddFromLink, priceText, ProductThumb, UploadProductButton } from "@/components/brand/products";
+import { SelfHostNote } from "@/components/self-host-note";
import type { SlotValue } from "@/components/studio/media-slot";
-import { uploadFile } from "@/lib/api";
+import { uploadFile, useIsVisitor } from "@/lib/api";
import { AD_STYLES, END_CARD, KIT_LABELS, type BrandKit, type MarketingRun, type Product, type RunEstimate } from "@/lib/catalog/marketing";
import { formatCost } from "@/lib/format";
import { cn } from "@/lib/utils";
@@ -151,6 +152,9 @@ export function ClickToAd({ models }: { models: Record<string, ModelInfo> }) {
const [script, setScript] = useState<string | null>(null);
const [writing, setWriting] = useState(false);
const [busy, setBusy] = useState(false);
+ // A product is saved to the studio's library and an ad doesn't run on an account's own GPU or key yet: a guest or an
+ // account is told so up front, and can't add a product or start one.
+ const visitor = useIsVisitor();
const resultsRef = useRef<HTMLDivElement>(null);
const product = products.data?.find((p) => p.id === productId) ?? null;
const brand = useBrand(product?.brandId).data?.brand;
@@ -234,6 +238,7 @@ export function ClickToAd({ models }: { models: Record<string, ModelInfo> }) {
}
};
const generate = async () => {
+ if (visitor) return;
if (blocker) return void toast(blocker, { id: "c2a-blocker" });
setBusy(true);
try {
@@ -257,15 +262,16 @@ export function ClickToAd({ models }: { models: Record<string, ModelInfo> }) {
<div className="pb-2 text-center">
<h2 className="font-heading text-display text-balance">Make a video ad in one click</h2>
<p className="mx-auto mt-2 max-w-xl text-[15px] text-muted-foreground">Drop a product link, get a 9:16 ad with voiceover and captions — ready for TikTok, Reels and Shorts. No filming, no editing, no brief.</p>
+ {visitor && <SelfHostNote className="mx-auto mt-3 max-w-xl">Click to Ad runs on a self-hosted Fuobe for now.</SelfHostNote>}
</div>
<Step n={1} title="Your product" hint="Paste the product's own page, or pick one you saved." done={!!product}>
- <AddFromLink limit={1} withBrand placeholder="https://yourshop.com/products/…" onAdded={(ps, extra) => ps[0] && choose(ps[0], extra.brand)} />
+ <AddFromLink limit={1} withBrand placeholder="https://yourshop.com/products/…" onAdded={(ps, extra) => ps[0] && choose(ps[0], extra.brand)} disabled={visitor} />
{reading && <KitProgress />}
<div className="mt-5">
<div className="mb-2 flex items-center justify-between gap-2">
<p className="text-[12px] font-medium text-muted-foreground">Or select your product</p>
- <UploadProductButton variant="ghost" onSaved={(p) => choose(p)} />
+ <UploadProductButton variant="ghost" onSaved={(p) => choose(p)} disabled={visitor} />
</div>
{products.data?.length ? (
<div className="scrollbar-none -mx-1 flex gap-2 overflow-x-auto px-1 pb-1">
@@ -432,7 +438,7 @@ export function ClickToAd({ models }: { models: Record<string, ModelInfo> }) {
{est.data?.steps.length ? ` · ${est.data.steps.length} steps` : ""}
</p>
{cost && <span className="font-mono text-[13px] text-muted-foreground">{cost}</span>}
- <Button size="lg" onClick={() => void generate()} aria-disabled={!!blocker || busy} className={cn(blocker && "bg-muted text-muted-foreground hover:bg-muted")} title={blocker}>
+ <Button size="lg" onClick={() => void generate()} disabled={visitor} aria-disabled={!!blocker || busy} className={cn(blocker && "bg-muted text-muted-foreground hover:bg-muted")} title={blocker}>
{busy ? <Loader2 className="animate-spin" /> : <Wand2 />} Generate video
</Button>
</div>
diff --git a/src/components/marketing/hooks.ts b/src/components/marketing/hooks.ts
index 920a2ff4..ed0bc120 100644
--- a/src/components/marketing/hooks.ts
+++ b/src/components/marketing/hooks.ts
@@ -14,8 +14,8 @@ import { responseError } from "@/lib/refusals";
async function json<T>(res: Response): Promise<T> {
if (res.status === 204) return undefined as T;
- const body = (await res.json().catch(() => ({}))) as T & { error?: string };
- if (!res.ok) throw Object.assign(responseError(res, body.error ?? `Request failed (${res.status})`), { status: res.status });
+ const body = (await res.json().catch(() => ({}))) as T & { error?: string; code?: string };
+ if (!res.ok) throw Object.assign(responseError(res, body.error ?? `Request failed (${res.status})`), { status: res.status, code: body.code });
return body;
}
diff --git a/src/components/marketing/marketing-studio.tsx b/src/components/marketing/marketing-studio.tsx
index a866fe11..9ed3d0ff 100644
--- a/src/components/marketing/marketing-studio.tsx
+++ b/src/components/marketing/marketing-studio.tsx
@@ -12,8 +12,9 @@ import { ResponsivePanel } from "@/components/studio/responsive-panel";
import { BrandChip } from "@/components/brand/brand-dialog";
import { inputCls } from "@/components/brand/fields";
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 { useModelAccess } from "@/lib/api";
+import { useIsVisitor, useModelAccess } from "@/lib/api";
import { keepOffered, offered } from "@/lib/model-access";
import { cn } from "@/lib/utils";
import { addRuns, send, useBrands, useEstimate } from "./hooks";
@@ -286,6 +287,9 @@ export function MarketingStudio({ models }: { models: Record<string, ModelInfo>
const [engaged, setEngaged] = useState(false);
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.
+ const visitor = useIsVisitor();
const set = (p: Partial<Draft>) => setDraft((d) => ({ ...d, ...p }));
const f = FORMATS[draft.format];
const template = draft.templateId ? TEMPLATE_INDEX.get(draft.templateId) : undefined;
@@ -328,7 +332,13 @@ export function MarketingStudio({ models }: { models: Record<string, ModelInfo>
);
const est = useEstimate<RunEstimate>("/api/marketing/estimate", draft.avatar?.uploading || draft.voiceSample?.uploading ? null : body);
const badSite = !!f.oneOf?.includes("website") && !!draft.website.trim() && !looksLikeWebsite(draft.website);
- const blocker = draft.product === null && f.product === "required" ? "Attach a product to generate" : badSite ? "Enter a valid website URL" : est.data?.blocker;
+ const blocker = visitor
+ ? "Marketing Studio runs on a self-hosted Fuobe for now"
+ : draft.product === null && f.product === "required"
+ ? "Attach a product to generate"
+ : badSite
+ ? "Enter a valid website URL"
+ : est.data?.blocker;
const cost = est.data && !est.data.blocker ? (est.data.demo ? "Demo · free" : est.data.costUsd == null ? "" : est.data.costUsd === 0 ? "Free" : `≈ ${formatCost(est.data.costUsd)}`) : "";
// Until a template is picked or you start on the composer it stays slim (the attachment tiles fold
@@ -341,6 +351,7 @@ export function MarketingStudio({ models }: { models: Record<string, ModelInfo>
});
const generate = async () => {
+ if (visitor) return;
if (blocker) {
setEngaged(true);
toast(blocker, { id: "marketing-blocker" });
@@ -380,6 +391,7 @@ export function MarketingStudio({ models }: { models: Record<string, ModelInfo>
<p className="mx-auto mt-2 max-w-xl text-[15px] text-muted-foreground">
Product shots, motion, UGC presenters, ads, posters and listings — from Fuobe&apos;s templates, on {engine === "open" ? "your own GPU, free" : "Fuobe Marketing Image or partner models in the cloud"}.
</p>
+ {visitor && <SelfHostNote className="mx-auto mt-3 max-w-xl">Marketing Studio runs on a self-hosted Fuobe for now.</SelfHostNote>}
</div>
<div role="tablist" aria-label="View" className="mx-auto mt-4 flex w-fit rounded-full bg-muted p-0.5">
{(["templates", "generations"] as const).map((t) => (
@@ -443,9 +455,10 @@ export function MarketingStudio({ models }: { models: Record<string, ModelInfo>
</button>
</div>
)}
- {f.product !== "none" && <ProductSlot value={draft.product} onChange={(p) => set({ product: p })} required={f.product === "required"} brandId={brandId} pulse={pulse === "product"} />}
- {f.avatar !== "none" && <AvatarSlot value={draft.avatar} onChange={(a) => set({ avatar: a })} pulse={pulse === "avatar"} />}
- {f.pipeline !== "ugc" && <MediaSlot label="Reference" kind="image" value={draft.reference} onChange={(v) => set({ reference: v })} />}
+ {/* 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 })} />}
</div>
<textarea
ref={prompt}
@@ -490,6 +503,7 @@ export function MarketingStudio({ models }: { models: Record<string, ModelInfo>
<button
type="button"
onClick={() => void generate()}
+ disabled={visitor}
aria-label={template ? "Recreate template" : "Generate"}
aria-disabled={!!blocker || busy}
className={cn("grid size-10 shrink-0 place-items-center rounded-full text-primary-foreground transition-colors", blocker ? "bg-primary/70 hover:bg-primary/80" : "bg-primary hover:bg-primary/90")}
diff --git a/src/components/mixed-media/mixed-studio.tsx b/src/components/mixed-media/mixed-studio.tsx
index 70767fc2..66c9b455 100644
--- a/src/components/mixed-media/mixed-studio.tsx
+++ b/src/components/mixed-media/mixed-studio.tsx
@@ -5,6 +5,7 @@ import { useDeferredValue, useEffect, useMemo, useRef, useState } from "react";
import { toast } from "sonner";
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
import { SidebarTrigger } from "@/components/ui/sidebar";
+import { SelfHostNote } from "@/components/self-host-note";
import { EngineSwitch } from "@/components/studio/engine-switch";
import { MediaThumb } from "@/components/studio/result-media";
import { VideoTrimmer, type VideoTrimmerHandle } from "@/components/studio/video-trimmer";
@@ -12,7 +13,7 @@ import { LookCard } from "@/components/shorts/preset-card";
import { useSubmitGuard } from "@/components/shorts/hooks";
import { ClipBar, ClipDrop, costText, Field, Segmented, tabKeys } from "@/components/shorts/ui";
import { clipDuration, clipSize, useSourceClip } from "@/components/shorts/use-source-clip";
-import { uploadFile, useEngine, useModelAccess } from "@/lib/api";
+import { uploadFile, useEngine, useIsVisitor, useModelAccess } from "@/lib/api";
import { keepOffered, offered } from "@/lib/model-access";
import {
clampFps,
@@ -73,6 +74,9 @@ const MODE_OPTIONS: { value: MixedMode; label: string; title: string }[] = [
export function MixedStudio({ models, frameModels }: { models: Record<Engine, RestyleModelInfo[]>; frameModels: Record<Engine, RestyleModelInfo[]> }) {
const [tab, setTab] = useState<Tab>("presets");
const [engine, setEngine, engineMode] = useEngine();
+ // A render doesn't run on an account's own GPU or key yet (only the studios' generations do): said up front, and the
+ // upload, the preview and Generate are off, instead of a run the server refuses.
+ const visitor = useIsVisitor();
useEffect(() => {
const t = new URLSearchParams(window.location.search).get("tab");
// eslint-disable-next-line react-hooks/set-state-in-effect -- read once after hydration
@@ -123,8 +127,9 @@ export function MixedStudio({ models, frameModels }: { models: Record<Engine, Re
<p className="mx-auto mt-2 max-w-[560px] text-body text-pretty text-muted-foreground">
33 looks, each with its own colours and materials. Preview one frame first, then render the clip frame by frame at the rate you choose — on Fuobe Mixed Media, free on your GPU.
</p>
+ {visitor && <SelfHostNote className="mx-auto mt-3 max-w-[560px]">Mixed Media runs on a self-hosted Fuobe for now.</SelfHostNote>}
</div>
- <Workspace engine={engine} models={models[engine]} frameModels={frameModels[engine]} />
+ <Workspace visitor={visitor} engine={engine} models={models[engine]} frameModels={frameModels[engine]} />
</>
)}
</div>
@@ -173,7 +178,7 @@ function How({ onStart, cloud }: { onStart: () => void; cloud: boolean }) {
);
}
-function Workspace({ engine, models, frameModels }: { engine: Engine; models: RestyleModelInfo[]; frameModels: RestyleModelInfo[] }) {
+function Workspace({ visitor, engine, models, frameModels }: { visitor: boolean; engine: Engine; models: RestyleModelInfo[]; frameModels: RestyleModelInfo[] }) {
const [hasClip, setHasClip] = useState(false);
const [presetId, setPresetId] = useState<string | null>(null);
const preset = MIXED_PRESETS.find((p) => p.id === presetId) ?? null;
@@ -250,7 +255,7 @@ function Workspace({ engine, models, frameModels }: { engine: Engine; models: Re
)}
</section>
<aside ref={panel} id="mm-editor" className="scrollbar-none min-w-0 scroll-mt-16 lg:sticky lg:top-16 lg:max-h-[calc(100svh-4.5rem)] lg:overflow-y-auto lg:overscroll-contain lg:rounded-2xl">
- <Editor engine={engine} models={models} frameModels={frameModels} preset={preset} values={values} setValues={setValues} onClip={setHasClip} />
+ <Editor visitor={visitor} engine={engine} models={models} frameModels={frameModels} preset={preset} values={values} setValues={setValues} onClip={setHasClip} />
</aside>
{preset && !panelVisible && (
<div className="fixed inset-x-3 bottom-[max(0.75rem,env(safe-area-inset-bottom))] z-30 lg:hidden">
@@ -275,6 +280,7 @@ const LIMITS = "MP4 or MOV · 1 to 10 s · up to 50 MB · at least 4 FPS";
type FpsChoice = number | "manual";
function Editor({
+ visitor,
engine,
models: restyleModels,
frameModels,
@@ -283,6 +289,8 @@ function Editor({
setValues,
onClip,
}: {
+ /** A guest or an account: the upload, the preview and Generate are off (the page says it runs on a self-hosted Fuobe). */
+ visitor: boolean;
engine: Engine;
models: RestyleModelInfo[];
frameModels: RestyleModelInfo[];
@@ -405,7 +413,7 @@ function Editor({
setAnchorOff(false);
}
- const blocker = !preset
+ const setupBlocker = !preset
? "Pick a preset first"
: !clip
? "Add a clip"
@@ -424,6 +432,7 @@ function Editor({
: estimate.error
? (estimate.error as Error).message
: null;
+ const blocker = visitor ? "Mixed Media runs on a self-hosted Fuobe for now" : setupBlocker;
// One preview and one render per click: a second click while one is on its way does nothing,
// and the server answers a repeated request id with what the first one started.
@@ -481,6 +490,7 @@ function Editor({
<ClipDrop
accept={MIXED.accept}
limits={LIMITS}
+ disabled={visitor}
onFile={(f) => {
const err = source.pick(f);
if (err) toast.error(err);
@@ -655,7 +665,7 @@ function Editor({
<button
type="button"
onClick={makePreview}
- disabled={previewBusy}
+ disabled={previewBusy || visitor}
aria-disabled={!!blocker || previewBusy}
className={cn(
"flex h-9 w-full items-center justify-center gap-2 rounded-full border text-[13px] font-medium",
@@ -703,7 +713,7 @@ function Editor({
<button
type="button"
onClick={generate}
- disabled={actions.render.isPending}
+ disabled={actions.render.isPending || visitor}
aria-disabled={!!blocker || actions.render.isPending}
aria-describedby={blocker ? "mm-blocker" : undefined}
className={cn(
diff --git a/src/components/model3d/model3d-studio.tsx b/src/components/model3d/model3d-studio.tsx
index 659cf78f..8e5ecbac 100644
--- a/src/components/model3d/model3d-studio.tsx
+++ b/src/components/model3d/model3d-studio.tsx
@@ -15,7 +15,8 @@ import { FailedTile, PendingTile } from "@/components/studio/feed";
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 { useCreateGeneration, useEngine, useGenerations, useHydrated, useModelAccess, useStatus } from "@/lib/api";
+import { SelfHostNote } from "@/components/self-host-note";
+import { useCreateGeneration, useEngine, useGenerations, useHydrated, useIsVisitor, useModelAccess, useStatus } from "@/lib/api";
import {
MAX_3D_PROMPT,
MODEL3D_FEATURE,
@@ -124,6 +125,9 @@ function ModePicker({ mode, onChange }: { mode: Model3dMode; onChange: (m: Model
/** Image to 3D: a photo, several photos, words, an object in a photo or a splat → a model to spin, download, rig and animate. */
export function Model3dStudio({ info }: { info: Record<string, Model3dInfo> }) {
const [engine, setEngine, engineMode] = useEngine();
+ // A 3D model is finished on this server, so accounts don't get Image to 3D yet, even on their own GPU or key: said up
+ // front, and the uploads and Make it 3D are off, instead of a run the server refuses.
+ const visitor = useIsVisitor();
const access = useModelAccess();
const create = useCreateGeneration();
const results = useGenerations({ features: [MODEL3D_FEATURE, "app:app-image-to-3d"], limit: 24 });
@@ -169,6 +173,7 @@ export function Model3dStudio({ info }: { info: Record<string, Model3dInfo> }) {
const price = priceLine(preview.data);
const cloudAllowed = engineMode !== "open";
const go = () => {
+ if (visitor) return;
if (blocker) return void toast(blocker, { id: "3d-blocker" });
create.mutate(model3dRequest(input), {
onSuccess: () => toast.success(mode === "splat" ? "Making your splat" : mode === "text" && engine === "open" ? "Drawing the object, then building it in 3D" : "Building your 3D model"),
@@ -183,7 +188,9 @@ export function Model3dStudio({ info }: { info: Record<string, Model3dInfo> }) {
<Suspense fallback={null}>
<UrlModel onModel={fromUrl} onMode={setMode} onRig={showRigHint} />
</Suspense>
- <ToolHero title="Your product, in 3D" subtitle={HINTS[mode]} />
+ <ToolHero title="Your product, in 3D" subtitle={HINTS[mode]}>
+ {visitor && <SelfHostNote className="mt-3 max-w-xl">Image to 3D runs on a self-hosted Fuobe for now.</SelfHostNote>}
+ </ToolHero>
<ModePicker mode={mode} onChange={pickMode} />
{rigHint && (
<p role="status" className="mx-auto mt-4 max-w-[880px] rounded-2xl border bg-brand-faint px-4 py-3 text-[13px] text-brand-text">
@@ -206,7 +213,8 @@ export function Model3dStudio({ info }: { info: Record<string, Model3dInfo> }) {
<Panel title="Photos of each side" aside={<span className="text-[12px] text-muted-foreground">{Object.keys(sides).length} of 4</span>}>
{/* Four 80 px slots in a row when the panel has room for them (22rem), two by two when it doesn't. */}
<div className="@container">
- <div className="grid grid-cols-2 justify-items-center gap-2 @[22rem]:grid-cols-4">
+ {/* A guest's or an account's photos would be uploaded for a model that can't be made here. */}
+ <div inert={visitor} className={cn("grid grid-cols-2 justify-items-center gap-2 @[22rem]:grid-cols-4", visitor && "opacity-50")}>
{VIEW_SIDES.map((s) => (
<div key={s} className="flex flex-col items-center gap-1">
<MediaSlot label={SIDE_LABELS[s]} kind="image" value={views[s] ?? null} onChange={setSide(s)} required={s === "front"} size="lg" caption />
@@ -241,14 +249,16 @@ export function Model3dStudio({ info }: { info: Record<string, Model3dInfo> }) {
</Panel>
) : (
<div className="grid min-w-0 gap-3">
- <MediaDrop
- kind="image"
- value={photo}
- onChange={setPhoto}
- title={mode === "objects" ? "Add a photo" : "Add a photo of the object"}
- hint={mode === "objects" ? "A room, a shelf, a street: anything with the object in it" : "One object, plain background, well lit"}
- compact
- />
+ <div inert={visitor} className={cn("min-w-0", visitor && "opacity-50")}>
+ <MediaDrop
+ kind="image"
+ value={photo}
+ onChange={setPhoto}
+ title={mode === "objects" ? "Add a photo" : "Add a photo of the object"}
+ hint={mode === "objects" ? "A room, a shelf, a street: anything with the object in it" : "One object, plain background, well lit"}
+ compact
+ />
+ </div>
{mode === "objects" && (
<Panel title="What to take out">
<Label htmlFor="m3d-object" className="sr-only">
@@ -314,7 +324,7 @@ export function Model3dStudio({ info }: { info: Record<string, Model3dInfo> }) {
</p>
)}
</div>
- <Button size="lg" className={cn("mt-4 w-full rounded-full", blocker && "bg-muted text-muted-foreground hover:bg-muted")} onClick={go} disabled={create.isPending}>
+ <Button size="lg" className={cn("mt-4 w-full rounded-full", blocker && "bg-muted text-muted-foreground hover:bg-muted")} onClick={go} disabled={create.isPending || visitor}>
{create.isPending ? <Loader2 className="size-4 animate-spin" /> : <Box className="size-4" />} {mode === "splat" ? "Make the splat" : "Make it 3D"}
</Button>
<p className="mt-2 text-[12px] text-muted-foreground" aria-live="polite">
diff --git a/src/components/photodump/photodump-view.tsx b/src/components/photodump/photodump-view.tsx
index c14a87f8..f20c7889 100644
--- a/src/components/photodump/photodump-view.tsx
+++ b/src/components/photodump/photodump-view.tsx
@@ -5,13 +5,14 @@ import Link from "next/link";
import { useMemo, useRef, useState } from "react";
import { toast } from "sonner";
import { PageHeader, PageShell } from "@/components/page-shell";
+import { SelfHostNote } from "@/components/self-host-note";
import { Button } from "@/components/ui/button";
import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle } from "@/components/ui/dialog";
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, useModelAccess } from "@/lib/api";
+import { useElements, useEngine, useGenerations, 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";
@@ -148,6 +149,9 @@ function useRuns(feature: string) {
/** /photodump: Photodump (trained characters) and Instadump (one selfie) — choose a pack, add your photo, get the set. */
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.
+ const visitor = useIsVisitor();
const [step, setStep] = useState(0);
const [reached, setReached] = useState(0);
const [tab, setTab] = useState<(typeof TABS)[number][0]>("all");
@@ -203,6 +207,7 @@ export function PhotodumpView() {
const product = pack?.product === "photodump" ? "Photodump" : "Instadump";
const generate = () => {
+ if (visitor) return;
if (!body) return toast(subjectMode === "selfie" ? "Add your photo first" : "Pick a character first");
run.mutate(body, {
// The run line showed the model and its notes before Generate: no toast.
@@ -219,6 +224,7 @@ export function PhotodumpView() {
<PageHeader title="Photodump" description="A whole set of photos of you in one go — from one selfie (Instadump) or a saved character, in a pack of styles.">
<EngineSwitch value={engine} onChange={setEngine} />
</PageHeader>
+ {visitor && <SelfHostNote className="-mt-3 mb-6 max-w-2xl">Photodump runs on a self-hosted Fuobe for now.</SelfHostNote>}
<div className="mb-6">
<Steps steps={STEPS} current={step} reached={reached} onGo={go} />
</div>
@@ -239,15 +245,18 @@ export function PhotodumpView() {
</label>
</div>
<div className="grid grid-cols-2 gap-3 sm:grid-cols-3 lg:grid-cols-5">
- <button
- type="button"
- onClick={() => setCreatingPack(true)}
- className="flex aspect-[3/4] flex-col items-center justify-center gap-2 rounded-xl border border-dashed p-4 text-center text-muted-foreground transition-colors hover:bg-accent hover:text-foreground"
- >
- <Plus className="size-6" />
- <span className="text-[13.5px] font-medium">Create pack</span>
- <span className="text-[12px]">From up to {MAX_PACK_REFS} reference photos</span>
- </button>
+ {/* A pack of your own is saved to the studio's library, which is its owner's. */}
+ {!visitor && (
+ <button
+ type="button"
+ onClick={() => setCreatingPack(true)}
+ className="flex aspect-[3/4] flex-col items-center justify-center gap-2 rounded-xl border border-dashed p-4 text-center text-muted-foreground transition-colors hover:bg-accent hover:text-foreground"
+ >
+ <Plus className="size-6" />
+ <span className="text-[13.5px] font-medium">Create pack</span>
+ <span className="text-[12px]">From up to {MAX_PACK_REFS} reference photos</span>
+ </button>
+ )}
{shown.map((p) => {
const sel = p.id === packId;
return (
@@ -331,7 +340,10 @@ export function PhotodumpView() {
</div>
{subjectMode === "selfie" ? (
<div className="space-y-2">
- <UploadBox value={selfie} onChange={setSelfie} title="Add your photo" hint="Use a clear, well-lit photo for best results." maxMb={MAX_SELFIE_MB} className="aspect-[4/3] max-h-[420px] w-full" />
+ {/* A guest's or an account's selfie would be uploaded for a set that can't start here. */}
+ <div inert={visitor} className={cn(visitor && "opacity-50")}>
+ <UploadBox value={selfie} onChange={setSelfie} title="Add your photo" hint="Use a clear, well-lit photo for best results." maxMb={MAX_SELFIE_MB} className="aspect-[4/3] max-h-[420px] w-full" />
+ </div>
<p className="text-[12px] text-muted-foreground">Portrait-to-portrait works best: a clear, high-resolution photo with a visible face, without heavy stylization.</p>
</div>
) : (
@@ -403,7 +415,7 @@ export function PhotodumpView() {
<Button variant="outline" onClick={() => go(0)}>
<ArrowLeft /> Back
</Button>
- <Button className="flex-1" disabled={!body || run.isPending || !!preview.data?.error} onClick={generate}>
+ <Button className="flex-1" disabled={!body || run.isPending || !!preview.data?.error || visitor} onClick={generate}>
{run.isPending && <Loader2 className="animate-spin" />} Generate {pack.count}
</Button>
</div>
diff --git a/src/components/remove-object/remove-object-tool.tsx b/src/components/remove-object/remove-object-tool.tsx
index 53492a3d..f635aee4 100644
--- a/src/components/remove-object/remove-object-tool.tsx
+++ b/src/components/remove-object/remove-object-tool.tsx
@@ -10,6 +10,7 @@ import { Textarea } from "@/components/ui/textarea";
import { StepList, type StepRow } from "@/components/av/step-list";
import { Panel, ToolHero, ToolShell } from "@/components/av/tool-shell";
import { useGeneration, useGenerationList } from "@/components/av/use-generation";
+import { SelfHostNote } from "@/components/self-host-note";
import { useSubmitGuard } from "@/components/shorts/hooks";
import { ClipBar, ClipDrop, costText, Field, Segmented } from "@/components/shorts/ui";
import { clipDuration, clipSize, useSourceClip } from "@/components/shorts/use-source-clip";
@@ -17,7 +18,7 @@ import { Feed } from "@/components/studio/feed";
import { radioKeys, radioTab } from "@/components/studio/radio-keys";
import { SketchEditor, type Stroke } from "@/components/studio/sketch-editor";
import { VideoTrimmer, type TrimRange, type VideoTrimmerHandle } from "@/components/studio/video-trimmer";
-import { useEngine, useGenerations, useModelAccess } from "@/lib/api";
+import { useEngine, useGenerations, useIsVisitor, useModelAccess } from "@/lib/api";
import {
CLICK_OPEN_PROBLEM,
chooseEraser,
@@ -71,6 +72,9 @@ interface Run {
*/
export function RemoveObjectTool({ tabs }: { tabs?: React.ReactNode }) {
const [engine, setEngine, engineMode] = useEngine();
+ // Removing an object doesn't run on an account's own GPU or key yet (only the studios' generations do): said up front,
+ // and the upload, the mask preview and Remove are off, instead of a run the server refuses.
+ const visitor = useIsVisitor();
const access = useModelAccess();
const source = useSourceClip(REMOVE.maxBytes);
const clip = source.clip;
@@ -185,7 +189,7 @@ export function RemoveObjectTool({ tabs }: { tabs?: React.ReactNode }) {
const estimate = useRemovalEstimate(body);
const est = estimate.data && !estimate.isError ? estimate.data : undefined;
- const blocker = !clip
+ const setupBlocker = !clip
? "Add a clip"
: clip.error
? clip.error
@@ -210,6 +214,7 @@ export function RemoveObjectTool({ tabs }: { tabs?: React.ReactNode }) {
: estimate.isError
? (estimate.error as Error).message
: null;
+ const blocker = visitor ? "Remove object runs on a self-hosted Fuobe for now" : setupBlocker;
const start = () => {
if (blocker || !body) return void toast(blocker ?? "Not ready yet", { id: "remove-blocker" });
@@ -225,7 +230,7 @@ export function RemoveObjectTool({ tabs }: { tabs?: React.ReactNode }) {
const canPreview = !!body && est?.previewUsd != null;
const makePreview = () => {
- if (!body || !canPreview || !est) return;
+ if (visitor || !body || !canPreview || !est) return;
const of = { exact: est.previewExact, eraser: est.modelName };
void previewGuard(JSON.stringify(body), (requestId) => actions.preview.mutateAsync({ ...body, requestId }))
.then((g) => g && setPreviewOf({ id: g.id, ...of }))
@@ -239,13 +244,16 @@ export function RemoveObjectTool({ tabs }: { tabs?: React.ReactNode }) {
<ToolHero
title="Remove anything from a video"
subtitle="Type what goes, click it, or paint over it — the gap is filled frame by frame and the sound stays. Priced before it runs; free on your own ComfyUI."
- />
+ >
+ {visitor && <SelfHostNote className="mt-3 max-w-xl">Remove object runs on a self-hosted Fuobe for now.</SelfHostNote>}
+ </ToolHero>
)}
<div className={cn("mx-auto", clip ? "pt-4" : "mt-8 max-w-[640px]")}>
{!clip ? (
<ClipDrop
accept={REMOVE.accept}
limits={LIMITS}
+ disabled={visitor}
onFile={(f) => {
const err = source.pick(f);
if (err) toast.error(err);
@@ -437,7 +445,7 @@ export function RemoveObjectTool({ tabs }: { tabs?: React.ReactNode }) {
<div className="space-y-3 border-t pt-3">
{body && est?.previewUsd != null && (
<div className="flex items-center gap-2">
- <Button variant="outline" size="sm" className="rounded-full" onClick={makePreview} disabled={actions.preview.isPending || (preview && (preview.status === "queued" || preview.status === "running"))}>
+ <Button variant="outline" size="sm" className="rounded-full" onClick={makePreview} disabled={actions.preview.isPending || (preview && (preview.status === "queued" || preview.status === "running")) || visitor}>
{actions.preview.isPending ? <Loader2 className="size-3.5 animate-spin" /> : <Eye className="size-3.5" />} Preview the mask
</Button>
<span className="min-w-0 text-[12px] leading-snug text-muted-foreground">
@@ -464,7 +472,7 @@ export function RemoveObjectTool({ tabs }: { tabs?: React.ReactNode }) {
</>
)}
</div>
- <Button className="rounded-full" onClick={start} disabled={!!blocker || actions.run.isPending}>
+ <Button className="rounded-full" onClick={start} disabled={!!blocker || actions.run.isPending || visitor}>
{actions.run.isPending ? <Loader2 className="size-4 animate-spin" /> : <EraserIcon className="size-4" />} Remove it
</Button>
</div>
diff --git a/src/components/shorts/shorts-studio.tsx b/src/components/shorts/shorts-studio.tsx
index a7d6fc2f..803b7fc3 100644
--- a/src/components/shorts/shorts-studio.tsx
+++ b/src/components/shorts/shorts-studio.tsx
@@ -6,9 +6,10 @@ import { useDeferredValue, useEffect, useMemo, useRef, useState } from "react";
import { toast } from "sonner";
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
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, useModelAccess } from "@/lib/api";
+import { useEngine, useIsVisitor, useModelAccess } from "@/lib/api";
import {
clipShapeProblem,
rangeProblem,
@@ -51,6 +52,9 @@ export function ShortsStudio({ models }: { models: Record<Engine, ModelChoice[]>
const source = useSourceClip(SHORTS.maxBytes);
const { clip } = source;
const [range, setRange] = useState<TrimRange | null>(null);
+ // A short doesn't run on an account's own GPU or key yet (only the studios' generations do): said up front, and the
+ // upload and Generate are off, instead of a run the server refuses.
+ const visitor = useIsVisitor();
// Hand-offs: /shorts?tab=history, ?preset=shorts-claymation, ?video=/api/files/….
useEffect(() => {
@@ -110,9 +114,11 @@ export function ShortsStudio({ models }: { models: Record<Engine, ModelChoice[]>
<p className="mx-auto mt-2 max-w-[560px] text-body text-pretty text-muted-foreground">
Upload a clip, pick a look, get a finished short. Motion stays yours — up to 2 minutes in, cut into segments and stitched back under your sound.
</p>
+ {visitor && <SelfHostNote className="mx-auto mt-3 max-w-[560px]">Shorts Studio runs on a self-hosted Fuobe for now.</SelfHostNote>}
<Steps steps={STEPS} current={!presetId ? 0 : !clip?.url ? 1 : 1} className="mt-5" />
</div>
<Workspace
+ visitor={visitor}
engine={engine}
models={engineModels}
presetId={presetId}
@@ -129,6 +135,7 @@ export function ShortsStudio({ models }: { models: Record<Engine, ModelChoice[]>
}
function Workspace({
+ visitor,
engine,
models,
presetId,
@@ -137,6 +144,7 @@ function Workspace({
range,
setRange,
}: {
+ visitor: boolean;
engine: Engine;
models: ModelChoice[];
presetId: string | null;
@@ -169,12 +177,14 @@ function Workspace({
custom={custom.data ?? []}
presetId={presetId}
onSelect={setPresetId}
- onCreate={() => setDialog({ open: true })}
+ // A preset of your own is saved to the studio's library, which is its owner's.
+ onCreate={visitor ? undefined : () => setDialog({ open: true })}
onEdit={(id) => setDialog({ open: true, preset: custom.data?.find((p) => p.id === id) })}
/>
</section>
<aside ref={setup} id="shorts-setup" aria-labelledby="shorts-step-2" className="scrollbar-none min-w-0 scroll-mt-16 lg:sticky lg:top-16 lg:max-h-[calc(100svh-4.5rem)] lg:overflow-y-auto lg:overscroll-contain lg:rounded-2xl">
<SetupPanel
+ visitor={visitor}
engine={engine}
models={models}
presetId={presetId}
@@ -216,7 +226,8 @@ function PresetGrid({
custom: ShortsCustomPreset[];
presetId: string | null;
onSelect: (id: string) => void;
- onCreate: () => void;
+ /** None for a guest or an account: no "Create preset" card. */
+ onCreate?: () => void;
onEdit: (id: string) => void;
}) {
const [q, setQ] = useState("");
@@ -267,7 +278,7 @@ function PresetGrid({
))}
</div>
<div className="grid grid-cols-2 gap-1 sm:grid-cols-3 xl:grid-cols-4">
- {!query && (cat === "All" || cat === CUSTOM) && <CreateCard onClick={onCreate} />}
+ {onCreate && !query && (cat === "All" || cat === CUSTOM) && <CreateCard onClick={onCreate} />}
{mine.map((p) => (
<CustomCard key={p.id} {...p} selected={presetId === p.id} onSelect={onSelect} onEdit={onEdit} />
))}
@@ -291,6 +302,7 @@ function PresetGrid({
const LIMITS = "MP4 or MOV · 4 s to 2 min · up to 200 MB";
function SetupPanel({
+ visitor,
engine,
models,
presetId,
@@ -301,6 +313,8 @@ function SetupPanel({
range,
setRange,
}: {
+ /** A guest or an account: the upload and Generate are off (the page says shorts run on a self-hosted Fuobe). */
+ visitor: boolean;
engine: Engine;
models: ModelChoice[];
presetId: string | null;
@@ -352,7 +366,7 @@ function SetupPanel({
const estimate = useShortsEstimate(estimateBody);
const est = estimate.data;
- const blocker = !presetId
+ const setupBlocker = !presetId
? "Pick a preset first"
: !clip
? "Upload a video"
@@ -371,6 +385,7 @@ function SetupPanel({
: estimate.error
? (estimate.error as Error).message
: null;
+ const blocker = visitor ? "Shorts Studio runs on a self-hosted Fuobe for now" : setupBlocker;
const guard = useSubmitGuard();
const [leaving, setLeaving] = useState(false);
@@ -410,6 +425,7 @@ function SetupPanel({
<ClipDrop
accept={SHORTS.accept}
limits={LIMITS}
+ disabled={visitor}
onFile={(f) => {
const err = source.pick(f);
if (err) toast.error(err);
@@ -536,7 +552,7 @@ function SetupPanel({
<button
type="button"
onClick={generate}
- disabled={busy}
+ disabled={busy || visitor}
aria-disabled={!!blocker || busy}
aria-describedby={blocker ? "shorts-blocker" : undefined}
className={cn(
diff --git a/src/components/shorts/ui.tsx b/src/components/shorts/ui.tsx
index 7dff1d5e..3dced647 100644
--- a/src/components/shorts/ui.tsx
+++ b/src/components/shorts/ui.tsx
@@ -84,23 +84,39 @@ export function Field({ label, htmlFor, hint, children }: { label: string; htmlF
);
}
-/** "Upload a video to edit": click, drop, or pick from the Library. */
-export function ClipDrop({ accept, limits, onFile, onLibrary }: { accept: string; limits: string; onFile: (f: File) => void; onLibrary: (url: string, name?: string) => void }) {
+/**
+ * "Upload a video to edit": click, drop, or pick from the Library. disabled: a tool that can't run here for this
+ * visitor (the page says why), so nothing is uploaded only to be refused.
+ */
+export function ClipDrop({
+ accept,
+ limits,
+ onFile,
+ onLibrary,
+ disabled,
+}: {
+ accept: string;
+ limits: string;
+ onFile: (f: File) => void;
+ onLibrary: (url: string, name?: string) => void;
+ disabled?: boolean;
+}) {
const input = useRef<HTMLInputElement>(null);
const [over, setOver] = useState(false);
const [lib, setLib] = useState(false);
return (
<div
+ aria-disabled={disabled || undefined}
onDragOver={(e) => {
e.preventDefault();
- setOver(true);
+ if (!disabled) setOver(true);
}}
onDragLeave={() => setOver(false)}
onDrop={(e) => {
e.preventDefault();
setOver(false);
const f = e.dataTransfer.files?.[0];
- if (f) onFile(f);
+ if (f && !disabled) onFile(f);
}}
className={cn(
"flex flex-col items-center gap-3 rounded-xl border border-dashed border-border-strong px-4 py-7 text-center transition-colors",
@@ -113,12 +129,17 @@ export function ClipDrop({ accept, limits, onFile, onLibrary }: { accept: string
<p className="mt-0.5 text-[12px] text-muted-foreground">{limits}</p>
</div>
<div className="flex flex-wrap justify-center gap-2">
- <button type="button" onClick={() => input.current?.click()} className="inline-flex h-8 items-center gap-1.5 rounded-full bg-primary px-3.5 text-[13px] font-medium text-primary-foreground hover:bg-primary/90">
+ <button
+ type="button"
+ onClick={() => input.current?.click()}
+ disabled={disabled}
+ className="inline-flex h-8 items-center gap-1.5 rounded-full bg-primary px-3.5 text-[13px] font-medium text-primary-foreground hover:bg-primary/90 disabled:pointer-events-none disabled:opacity-50"
+ >
<Upload className="size-3.5" /> Choose a video
</button>
- <Popover open={lib} onOpenChange={setLib}>
+ <Popover open={lib && !disabled} onOpenChange={setLib}>
<PopoverTrigger asChild>
- <button type="button" className="inline-flex h-8 items-center gap-1.5 rounded-full border bg-background px-3.5 text-[13px] font-medium hover:bg-accent">
+ <button type="button" disabled={disabled} className="inline-flex h-8 items-center gap-1.5 rounded-full border bg-background px-3.5 text-[13px] font-medium hover:bg-accent disabled:pointer-events-none disabled:opacity-50">
<Library className="size-3.5" /> From library
</button>
</PopoverTrigger>
@@ -136,12 +157,13 @@ export function ClipDrop({ accept, limits, onFile, onLibrary }: { accept: string
</PopoverContent>
</Popover>
</div>
- <p className="text-[11px] text-muted-foreground">or drop it here</p>
+ <p className={cn("text-[11px] text-muted-foreground", disabled && "invisible")}>or drop it here</p>
<input
ref={input}
type="file"
accept={accept}
hidden
+ disabled={disabled}
onChange={(e) => {
const f = e.target.files?.[0];
if (f) onFile(f);