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: fixes from the second review of the self-hosted-only tools

Adarshad86aa5c0b17
diff --git a/src/components/av/tool-shell.tsx b/src/components/av/tool-shell.tsx
index 84b2530f..68092428 100644
--- a/src/components/av/tool-shell.tsx
+++ b/src/components/av/tool-shell.tsx
@@ -15,6 +15,7 @@ export function ToolShell({
tabs,
header,
engineSwitch = true,
+ selfHostedOnly,
children,
wide,
}: {
@@ -23,6 +24,8 @@ export function ToolShell({
header?: React.ReactNode;
/** Tools that run in the browser only (Virality) have no engine to pick. */
engineSwitch?: boolean;
+ /** A tool that runs on a self-hosted Fuobe only: the engine badge says so to anyone but the owner (EngineSwitch). */
+ selfHostedOnly?: boolean;
children: React.ReactNode;
wide?: boolean;
}) {
@@ -35,7 +38,7 @@ export function ToolShell({
<h1 className="min-w-0 truncate font-heading text-[22px] leading-[1.15]">{title}</h1>
<div className="ml-auto flex shrink-0 items-center gap-2">
{header}
- {engineSwitch && <EngineSwitch value={engine} onChange={setEngine} />}
+ {engineSwitch && <EngineSwitch value={engine} onChange={setEngine} selfHostedOnly={selfHostedOnly} />}
</div>
</header>
{tabs}
diff --git a/src/components/brand/brand-dialog.tsx b/src/components/brand/brand-dialog.tsx
index 954d7b99..b5d5a174 100644
--- a/src/components/brand/brand-dialog.tsx
+++ b/src/components/brand/brand-dialog.tsx
@@ -9,6 +9,7 @@ import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } f
import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover";
import { kmeans, samplePixels } from "@/components/cinema/color-math";
import { chipBase, chipIdle, chipOn } from "@/components/studio/chip";
+import { useIsOwner } from "@/lib/api";
import { BRAND_EXAMPLES, type BrandKit } from "@/lib/catalog/marketing";
import { cn } from "@/lib/utils";
import { toastError } from "@/lib/refusals";
@@ -170,6 +171,9 @@ export function BrandChip({ value, onChange }: { value: string | null; onChange:
const [open, setOpen] = useState(false);
const [adding, setAdding] = useState(false);
const brands = useBrands();
+ // A brand kit is saved to the studio's library, which is its owner's: anyone else gets no Add or Manage, whose
+ // research and save would be refused, and reads where kits are made.
+ const isOwner = useIsOwner();
const current = brands.data?.find((b) => b.id === value);
const ready = brands.data?.filter((b) => b.status !== "researching") ?? [];
return (
@@ -206,38 +210,48 @@ export function BrandChip({ value, onChange }: { value: string | null; onChange:
{b.id === value && <Check className="size-3.5 shrink-0 text-brand-text" />}
</button>
))}
- {!ready.length && <p className="px-2 py-3 text-[13px] text-muted-foreground">No brand kit added yet — paste a link or create one manually to get started.</p>}
- </div>
- <div className="mt-1 flex gap-1 border-t pt-1.5">
- <button
- type="button"
- onClick={() => {
- setOpen(false);
- setAdding(true);
- }}
- className="flex h-8 flex-1 items-center gap-1.5 rounded-lg px-2 text-[13px] font-medium hover:bg-accent"
- >
- <Plus className="size-3.5" /> Add brand kit
- </button>
- {value && (
- <button
- type="button"
- onClick={() => {
- onChange(null);
- setOpen(false);
- }}
- className="h-8 rounded-lg px-2 text-[13px] text-muted-foreground hover:bg-accent"
- >
- No brand kit
- </button>
+ {!ready.length && (
+ <p className="px-2 py-3 text-[13px] text-muted-foreground">
+ {isOwner ? "No brand kit added yet — paste a link or create one manually to get started." : "Brand kits are saved on a self-hosted Fuobe."}
+ </p>
)}
- <Link href="/ads" className="flex h-8 items-center gap-1 rounded-lg px-2 text-[13px] text-muted-foreground hover:bg-accent" onClick={() => setOpen(false)}>
- Manage <ArrowRight className="size-3" />
- </Link>
</div>
+ {(isOwner || value) && (
+ <div className="mt-1 flex gap-1 border-t pt-1.5">
+ {isOwner && (
+ <button
+ type="button"
+ onClick={() => {
+ setOpen(false);
+ setAdding(true);
+ }}
+ className="flex h-8 flex-1 items-center gap-1.5 rounded-lg px-2 text-[13px] font-medium hover:bg-accent"
+ >
+ <Plus className="size-3.5" /> Add brand kit
+ </button>
+ )}
+ {value && (
+ <button
+ type="button"
+ onClick={() => {
+ onChange(null);
+ setOpen(false);
+ }}
+ className="h-8 rounded-lg px-2 text-[13px] text-muted-foreground hover:bg-accent"
+ >
+ No brand kit
+ </button>
+ )}
+ {isOwner && (
+ <Link href="/ads" className="flex h-8 items-center gap-1 rounded-lg px-2 text-[13px] text-muted-foreground hover:bg-accent" onClick={() => setOpen(false)}>
+ Manage <ArrowRight className="size-3" />
+ </Link>
+ )}
+ </div>
+ )}
</PopoverContent>
</Popover>
- <BrandKitDialog open={adding} onOpenChange={setAdding} onUse={(b) => onChange(b.id, b)} />
+ <BrandKitDialog open={adding && isOwner} onOpenChange={setAdding} onUse={(b) => onChange(b.id, b)} />
</>
);
}
diff --git a/src/components/content-factory/home.tsx b/src/components/content-factory/home.tsx
index 1593f6e0..467a029a 100644
--- a/src/components/content-factory/home.tsx
+++ b/src/components/content-factory/home.tsx
@@ -17,7 +17,7 @@ import { NarratorChip } from "@/components/faceless/narrator";
import { StyleArt } from "@/components/faceless/style-art";
import { SelfHostNote } from "@/components/self-host-note";
import { useEdgeFade } from "@/components/studio/use-edge-fade";
-import { uploadFile, useEngine, useHydrated, useIsVisitor } from "@/lib/api";
+import { uploadFile, useEngine, useHydrated, useLikelyVisitor } from "@/lib/api";
import {
ANIMATION_STYLES,
CF_LENGTHS,
@@ -88,7 +88,7 @@ export function ContentFactoryHome({ voices }: { voices: PickerData["voices"] })
// The estimate's problem (no narrator voice yet…) is a hint until Generate is pressed.
const [tried, setTried] = useState(false);
// A series doesn't run on an account's own GPU yet (only the studios' generations do): said here, not after Generate.
- const visitor = useIsVisitor();
+ const visitor = useLikelyVisitor();
const [exampleRow, exampleFade] = useEdgeFade<HTMLDivElement>();
const file = useRef<HTMLInputElement>(null);
const promptRef = useRef<HTMLTextAreaElement>(null);
@@ -219,7 +219,7 @@ export function ContentFactoryHome({ voices }: { voices: PickerData["voices"] })
<SidebarTrigger className="md:hidden" />
<h1 className="truncate font-heading text-[22px] leading-none">Content Factory</h1>
<div className="ml-auto">
- <EngineSwitch value={engine} onChange={setEngine} />
+ <EngineSwitch value={engine} onChange={setEngine} selfHostedOnly />
</div>
</header>
<div className="mx-auto w-full max-w-[1240px] min-w-0 flex-1 space-y-12 px-3 pb-16 sm:px-6">
diff --git a/src/components/content-factory/parts.tsx b/src/components/content-factory/parts.tsx
index 22556583..13915476 100644
--- a/src/components/content-factory/parts.tsx
+++ b/src/components/content-factory/parts.tsx
@@ -24,7 +24,7 @@ import {
} from "@/lib/catalog/content-factory";
import { formatLength } from "@/lib/catalog/faceless";
import type { Engine } from "@/lib/catalog/types";
-import { useIsVisitor } from "@/lib/api";
+import { useLikelyVisitor } from "@/lib/api";
import { copyText } from "@/lib/clipboard";
import { cn } from "@/lib/utils";
import { claudePrompt, type SeriesAsk } from "./hooks";
@@ -273,11 +273,11 @@ export function PresetGrid({ value, onPick }: { value: string | null; onPick: (p
* account reads "Self-hosted only" for the open engine: a series doesn't run on their own GPU yet.
*/
export function SeriesPriceLine({ data, loading, engine, className }: { data: SeriesEstimate | undefined; loading?: boolean; engine: Engine; className?: string }) {
- const visitor = useIsVisitor();
+ const visitor = useLikelyVisitor();
if (!data) return <span className={cn("inline-flex items-center gap-1.5 font-mono text-[12px] text-muted-foreground", className)}>{loading && <Loader2 className="size-3 animate-spin" />}Estimating…</span>;
const p = data.price;
const each = p.episodes > 1 ? ` · ${p.episodes} × ${usd(p.perEpisode)}` : "";
- const price = data.demo ? "Demo · free" : engine === "open" ? (visitor ? "Self-hosted only" : "Free · your GPU") : `≈ ${usd(p.total)}${p.unknown ? "+" : ""}${each}`;
+ const price = visitor && (data.demo || engine === "open") ? "Self-hosted only" : data.demo ? "Demo · free" : engine === "open" ? "Free · your GPU" : `≈ ${usd(p.total)}${p.unknown ? "+" : ""}${each}`;
return (
<span className={cn("inline-flex min-w-0 flex-wrap items-center gap-x-2 gap-y-0.5", className)}>
<Popover>
diff --git a/src/components/dub/dub-studio.tsx b/src/components/dub/dub-studio.tsx
index 7a33e355..1a66d5c8 100644
--- a/src/components/dub/dub-studio.tsx
+++ b/src/components/dub/dub-studio.tsx
@@ -16,7 +16,7 @@ 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 { SelfHostNote } from "@/components/self-host-note";
-import { useEngine, useIsVisitor, useModelAccess } from "@/lib/api";
+import { useEngine, useLikelyVisitor, 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";
@@ -72,7 +72,7 @@ export function DubStudio({ tabs }: { tabs?: React.ReactNode }) {
// A dub removed elsewhere (another tab) just closes.
const open = sessions.data?.find((s) => s.id === openId);
return (
- <ToolShell title="Audio" tabs={tabs}>
+ <ToolShell title="Audio" tabs={tabs} selfHostedOnly>
{open ? (
<SessionView key={open.id} s={open} onBack={() => show(null)} />
) : openId && sessions.isLoading ? (
@@ -94,7 +94,7 @@ 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 visitor = useLikelyVisitor();
const { create } = useDubActions();
const [video, setVideo] = useState<SlotValue | null>(null);
const [duration, setDuration] = useState<number | undefined>(undefined);
@@ -237,14 +237,14 @@ function NewDub({ onStarted }: { onStarted: (id: string) => void }) {
* only" for a guest or an account: a dub doesn't run on their own GPU yet).
*/
function PriceNote({ price, loading, error, hint }: { price?: DubPrice; loading?: boolean; error?: Error | null; hint?: string }) {
- const visitor = useIsVisitor();
+ const visitor = useLikelyVisitor();
if (loading) return <Skeleton className="h-4 w-20" aria-label="Pricing" />;
if (error) return <span className="max-w-[16rem] text-right text-[12px] leading-snug text-muted-foreground">{error.message}</span>;
if (!price) return null;
const extra = price.unpriced.length ? `${price.unpriced.join(" and ")} bill${price.unpriced.length === 1 ? "s" : ""} by the provider's own rate (per character or token).` : undefined;
return (
<span className="text-right text-[12px] leading-snug" title={[extra, hint].filter(Boolean).join(" ") || undefined}>
- <span className="font-medium tabular-nums">{visitor && !price.demo && price.engine === "open" ? "Self-hosted only" : priceLine(price)}</span>
+ <span className="font-medium tabular-nums">{visitor && (price.demo || price.engine === "open") ? "Self-hosted only" : priceLine(price)}</span>
{price.steps > 1 && <span className="block text-muted-foreground">{price.steps} steps</span>}
</span>
);
diff --git a/src/components/evolution/evolution-tool.tsx b/src/components/evolution/evolution-tool.tsx
index 7da0228c..ddca4390 100644
--- a/src/components/evolution/evolution-tool.tsx
+++ b/src/components/evolution/evolution-tool.tsx
@@ -17,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, useIsVisitor } from "@/lib/api";
+import { useEngine, useGenerations, useLikelyVisitor } 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";
@@ -58,7 +58,7 @@ 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 visitor = useLikelyVisitor();
const source = useSourceClip(EVOLUTION.maxBytes);
const clip = source.clip;
const trimmer = useRef<VideoTrimmerHandle>(null);
@@ -159,7 +159,7 @@ export function EvolutionTool({ tabs }: { tabs?: React.ReactNode }) {
};
return (
- <ToolShell title="Video tools" tabs={tabs} wide>
+ <ToolShell title="Video tools" tabs={tabs} wide selfHostedOnly>
{!clip && (
<ToolHero
title="Take a clip further"
diff --git a/src/components/explainer/explainer-studio.tsx b/src/components/explainer/explainer-studio.tsx
index 22377013..505edc40 100644
--- a/src/components/explainer/explainer-studio.tsx
+++ b/src/components/explainer/explainer-studio.tsx
@@ -14,7 +14,7 @@ import { Switch } from "@/components/ui/switch";
import { EngineSwitch } from "@/components/studio/engine-switch";
import { fileToSlot } from "@/components/studio/media-slot";
import { SelfHostNote } from "@/components/self-host-note";
-import { useEngine, useIsVisitor } from "@/lib/api";
+import { useEngine, useLikelyVisitor } from "@/lib/api";
import {
ANIMATION_MODES,
AUTO_SECONDS,
@@ -148,7 +148,7 @@ export function ExplainerStudio({ picker }: { picker: PickerData }) {
const router = useRouter();
const [engine, setEngine] = useEngine();
// An explainer doesn't run on an account's own GPU yet (only the studios' generations do): said here, not after Generate.
- const visitor = useIsVisitor();
+ const visitor = useLikelyVisitor();
// The estimate's problem (no narrator voice yet…) is a hint until Generate is pressed.
const [tried, setTried] = useState(false);
const genre = genreInfo("education");
@@ -263,7 +263,7 @@ export function ExplainerStudio({ picker }: { picker: PickerData }) {
<SidebarTrigger className="md:hidden" />
<h1 className="truncate font-heading text-[22px] leading-none">Explainer</h1>
<div className="ml-auto">
- <EngineSwitch value={engine} onChange={setEngine} />
+ <EngineSwitch value={engine} onChange={setEngine} selfHostedOnly />
</div>
</header>
<div className="mx-auto grid w-full max-w-[1240px] min-w-0 flex-1 gap-8 px-3 pt-6 pb-16 sm:px-6 lg:grid-cols-[minmax(0,520px)_minmax(0,1fr)]">
@@ -462,7 +462,8 @@ export function ExplainerStudio({ picker }: { picker: PickerData }) {
</div>
<Sheet open={stylesOpen} onOpenChange={setStylesOpen}>
- <SheetContent className="w-full overflow-y-auto sm:max-w-[640px]">
+ {/* The Sheet's own width is set for its side (data-[side=right]:…): only the same variant overrides it. */}
+ <SheetContent className="overflow-y-auto data-[side=right]:w-full data-[side=right]:sm:max-w-[640px]">
<SheetHeader>
<SheetTitle>Styles</SheetTitle>
<SheetDescription>One visual style for the whole video.</SheetDescription>
diff --git a/src/components/faceless/controls.tsx b/src/components/faceless/controls.tsx
index 8c531278..24e6e54d 100644
--- a/src/components/faceless/controls.tsx
+++ b/src/components/faceless/controls.tsx
@@ -7,7 +7,7 @@ import { Switch } from "@/components/ui/switch";
import { radioKeys, radioTab } from "@/components/studio/radio-keys";
import { formatLength, PART_LABELS, type EstimateResult, type StepPart } from "@/lib/catalog/faceless";
import type { Engine } from "@/lib/catalog/types";
-import { useIsVisitor } from "@/lib/api";
+import { useLikelyVisitor } from "@/lib/api";
import { cn } from "@/lib/utils";
/** A segmented control (Liner style: muted track, white thumb), keyboard like a radio group. */
@@ -83,9 +83,9 @@ export const usd = (n: number) => (n >= 10 ? `$${n.toFixed(0)}` : `$${n.toFixed(
*/
export function EstimateLine({ data, loading, engine, className, quiet }: { data: EstimateResult | undefined; loading?: boolean; engine: Engine; className?: string; quiet?: boolean }) {
const [open, setOpen] = useState(false);
- const visitor = useIsVisitor();
+ const visitor = useLikelyVisitor();
if (!data) return <span className={cn("inline-flex items-center gap-1.5 font-mono text-[12px] text-muted-foreground", className)}>{loading && <Loader2 className="size-3 animate-spin" />}Estimating…</span>;
- const price = data.demo ? "Demo · free" : engine === "open" ? (visitor ? "Self-hosted only" : "Free · your GPU") : `≈ ${usd(data.estimate.total)}${data.estimate.unknown ? "+" : ""}`;
+ const price = visitor && (data.demo || engine === "open") ? "Self-hosted only" : data.demo ? "Demo · free" : engine === "open" ? "Free · your GPU" : `≈ ${usd(data.estimate.total)}${data.estimate.unknown ? "+" : ""}`;
const parts = Object.entries(data.estimate.parts).filter(([, v]) => (v ?? 0) > 0) as [StepPart, number][];
const notes = !data.error ? (data.notes ?? []) : [];
return (
diff --git a/src/components/faceless/faceless-home.tsx b/src/components/faceless/faceless-home.tsx
index d04f9bda..42afb962 100644
--- a/src/components/faceless/faceless-home.tsx
+++ b/src/components/faceless/faceless-home.tsx
@@ -11,7 +11,7 @@ import { EngineSwitch } from "@/components/studio/engine-switch";
import { radioKeys, radioTab } from "@/components/studio/radio-keys";
import { SelfHostNote } from "@/components/self-host-note";
import { useEdgeFade } from "@/components/studio/use-edge-fade";
-import { useEngine, useIsVisitor } from "@/lib/api";
+import { useEngine, useLikelyVisitor } from "@/lib/api";
import { GENRE_IDEAS, GENRES, MAX_IDEA, MAX_SCRIPT, wordCount, youtubeKind, YOUTUBE_ERROR, type FacelessGenre } from "@/lib/catalog/faceless";
import { cn } from "@/lib/utils";
import { toastError } from "@/lib/refusals";
@@ -44,7 +44,7 @@ export function FacelessHome() {
const [genreRow, genreFade] = useEdgeFade<HTMLDivElement>();
const [ideaRow, ideaFade] = useEdgeFade<HTMLDivElement>();
// A channel doesn't run on an account's own GPU yet (only the studios' generations do): said here, not after Next.
- const visitor = useIsVisitor();
+ const visitor = useLikelyVisitor();
const checkRef = (v: string) => {
const bad = v.trim() && !youtubeKind(v);
@@ -78,7 +78,7 @@ export function FacelessHome() {
<SidebarTrigger className="md:hidden" />
<h1 className="truncate font-heading text-[22px] leading-none">Faceless Studio</h1>
<div className="ml-auto">
- <EngineSwitch value={engine} onChange={setEngine} />
+ <EngineSwitch value={engine} onChange={setEngine} selfHostedOnly />
</div>
</header>
<div className="mx-auto w-full max-w-[1240px] min-w-0 flex-1 space-y-12 px-3 pb-16 sm:px-6">
diff --git a/src/components/fashion/character-sheet.tsx b/src/components/fashion/character-sheet.tsx
index 2c7d1a18..da66ae69 100644
--- a/src/components/fashion/character-sheet.tsx
+++ b/src/components/fashion/character-sheet.tsx
@@ -16,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, useIsVisitor, useSaveElement } from "@/lib/api";
+import { useElements, useEngine, useGenerations, useLikelyVisitor, 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";
@@ -156,7 +156,7 @@ export function CharacterSheetView({ fields, defaults }: { fields: CastFieldData
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 visitor = useLikelyVisitor();
const [mode, setMode] = useState<Mode>("reference");
const [photos, setPhotos] = useState<SlotValue[]>([]);
const [details, setDetails] = useState("");
@@ -203,7 +203,7 @@ export function CharacterSheetView({ fields, defaults }: { fields: CastFieldData
return (
<PageShell wide>
<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} />
+ <EngineSwitch value={engine} onChange={setEngine} selfHostedOnly />
</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)]">
diff --git a/src/components/fashion/fashion-view.tsx b/src/components/fashion/fashion-view.tsx
index 8080d7d8..f0e4c9c1 100644
--- a/src/components/fashion/fashion-view.tsx
+++ b/src/components/fashion/fashion-view.tsx
@@ -15,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, useIsVisitor, useModelAccess } from "@/lib/api";
+import { useEngine, useGenerations, useLikelyVisitor, 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";
@@ -75,7 +75,7 @@ export function FashionView() {
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 visitor = useLikelyVisitor();
const [garment, setGarment] = useState<SlotValue | null>(null);
const [pickedOutfit, setOutfitModel] = useState<string>();
const [pickedSet, setSetModel] = useState<string>();
@@ -148,7 +148,7 @@ export function FashionView() {
<RotateCcw /> Start over
</Button>
)}
- <EngineSwitch value={engine} onChange={setEngine} />
+ <EngineSwitch value={engine} onChange={setEngine} selfHostedOnly />
</div>
</PageHeader>
{visitor && <SelfHostNote className="-mt-3 mb-6 max-w-2xl">Fashion Factory runs on a self-hosted Fuobe for now.</SelfHostNote>}
diff --git a/src/components/genjutsu/genjutsu-studio.tsx b/src/components/genjutsu/genjutsu-studio.tsx
index aff303f6..d7c97604 100644
--- a/src/components/genjutsu/genjutsu-studio.tsx
+++ b/src/components/genjutsu/genjutsu-studio.tsx
@@ -26,7 +26,7 @@ import { VideoTrimmer, type TrimRange, type VideoTrimmerHandle } from "@/compone
import { openInStudio } from "@/components/swap-studio/hooks";
import { SelfHostNote } from "@/components/self-host-note";
import { useEdgeFade } from "@/components/studio/use-edge-fade";
-import { useEngine, useGenerations, useIsVisitor, useModelAccess } from "@/lib/api";
+import { useEngine, useGenerations, useLikelyVisitor, useModelAccess } from "@/lib/api";
import { CHARACTER_SWAP, cutsInPart, cutWarning, partWords, seedProblem, type CharacterOptions, type CharacterQuality } from "@/lib/catalog/character-swap";
import {
chooseMaker,
@@ -103,7 +103,7 @@ const seedOf = (s: string): number | undefined => (s.trim() === "" ? undefined :
export function GenjutsuStudio() {
const [engine, setEngine, engineMode] = useEngine();
// Genjutsu doesn't run on an account's own GPU yet (only the studios' generations do): said here, not after Generate.
- const visitor = useIsVisitor();
+ const visitor = useLikelyVisitor();
const access = useModelAccess();
const [mode, setModeState] = useState<GenjutsuMode>("motion");
const source = useSourceClip(GENJUTSU.maxBytes);
@@ -475,7 +475,7 @@ export function GenjutsuStudio() {
const tabs = <ModeTabsRow mode={mode} onMode={setMode} />;
return (
- <ToolShell title="Genjutsu" tabs={tabs} header={<SetupCode setup={setup} onPaste={apply} />} wide>
+ <ToolShell title="Genjutsu" tabs={tabs} header={<SetupCode setup={setup} onPaste={apply} />} wide selfHostedOnly>
{!clip && (
<ToolHero title={modeInfo.label} subtitle={`${modeInfo.hint} Priced before it runs${visitor ? "." : "; free on your own ComfyUI."}`}>
{isCharacter && (
@@ -936,7 +936,7 @@ function SourceBadge({ source }: { source: Maker["source"] }) {
/** The models for this mode and engine, one line each (where it comes from, what it's good at, its limits, its licence). */
function MakerList({ options, value, onChange }: { options: Maker[]; value: string; onChange: (id: string) => void }) {
// A guest or an account: open weights run on a self-hosted Fuobe only, not on their own GPU yet.
- const visitor = useIsVisitor();
+ const visitor = useLikelyVisitor();
return (
<div role="radiogroup" aria-label="Model" onKeyDown={radioKeys} className="space-y-1.5">
{options.map((m) => (
diff --git a/src/components/influencer/influencer-builder.tsx b/src/components/influencer/influencer-builder.tsx
index c26f444d..d69ef954 100644
--- a/src/components/influencer/influencer-builder.tsx
+++ b/src/components/influencer/influencer-builder.tsx
@@ -16,7 +16,7 @@ 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, useIsVisitor, useModelAccess } from "@/lib/api";
+import { useEngine, useGenerations, useLikelyVisitor, useModelAccess } from "@/lib/api";
import { keepOffered, offered } from "@/lib/model-access";
import {
categoriesFor,
@@ -98,7 +98,7 @@ function RunInfo({ preview, loading, blocker, visitor }: { preview?: RunPreview
if (blocker) return <p className="text-[12.5px] text-destructive">{blocker}</p>;
if (!preview) return <p className="h-5 text-[12.5px] text-muted-foreground">{loading ? "Pricing…" : ""}</p>;
if (preview.error) return <p className="text-[12.5px] text-destructive">{preview.error}</p>;
- const cost = preview.demo ? "Demo · free" : preview.costUsd === 0 ? (visitor ? "Self-hosted only" : "Free · your GPU") : preview.costUsd == null ? "price unknown" : `≈ $${preview.costUsd.toFixed(2)}`;
+ const cost = visitor && (preview.demo || preview.costUsd === 0) ? "Self-hosted only" : preview.demo ? "Demo · free" : preview.costUsd === 0 ? "Free · your GPU" : preview.costUsd == null ? "price unknown" : `≈ $${preview.costUsd.toFixed(2)}`;
return (
<div className="space-y-0.5 text-[12.5px] text-muted-foreground" aria-live="polite">
<p>
@@ -121,7 +121,7 @@ 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 visitor = useLikelyVisitor();
const wide = useWide();
const [state, setState] = useState<InfluencerState>(INFLUENCER_START);
const [active, setActive] = useState("tier");
@@ -203,7 +203,7 @@ export function InfluencerBuilder() {
return (
<PageShell wide>
<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} />
+ <EngineSwitch value={engine} onChange={setEngine} selfHostedOnly />
</PageHeader>
{visitor && <SelfHostNote className="-mt-3 mb-6 max-w-2xl">AI Influencer runs on a self-hosted Fuobe for now.</SelfHostNote>}
diff --git a/src/components/katana/katana-studio.tsx b/src/components/katana/katana-studio.tsx
index 0b6dcef2..1d49c358 100644
--- a/src/components/katana/katana-studio.tsx
+++ b/src/components/katana/katana-studio.tsx
@@ -19,7 +19,7 @@ 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 { SelfHostNote } from "@/components/self-host-note";
-import { useEngine, useIsVisitor, useModelAccess } from "@/lib/api";
+import { useEngine, useLikelyVisitor, 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";
@@ -57,14 +57,14 @@ async function findCuts(src: string, duration: number, onProgress: (p: number) =
/** visitor: a guest or an account, whose own GPU doesn't run Katana yet (the page says so). */
const money = (usd: number | null | undefined, demo?: boolean, open?: boolean, visitor?: boolean) =>
- demo ? "Demo · free" : open ? (visitor ? "Self-hosted only" : "Free · your GPU") : usd == null ? "Price unknown" : `≈ $${usd.toFixed(2)}`;
+ visitor && (demo || open) ? "Self-hosted only" : demo ? "Demo · free" : open ? "Free · your GPU" : usd == null ? "Price unknown" : `≈ $${usd.toFixed(2)}`;
/** 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 visitor = useLikelyVisitor();
const jobs = useKatanaJobs();
const { start } = useKatanaActions();
const [reference, setReference] = useState<SlotValue | null>(null);
@@ -110,7 +110,7 @@ export function KatanaStudio() {
: null;
const preview = useKatanaPreview(useDeferredValue(body));
const shown = segments ?? preview.data?.segments ?? null;
- const blocker = !reference
+ const setupBlocker = !reference
? "Add the reference edit"
: reference.uploading
? "Uploading…"
@@ -127,6 +127,8 @@ export function KatanaStudio() {
: preview.error
? (preview.error as Error).message
: null;
+ // A guest or an account reads why Recreate is off, not a step on an upload that is off too.
+ const blocker = visitor ? "Katana runs on a self-hosted Fuobe for now" : setupBlocker;
const scan = async () => {
if (!reference || !meta || scanning !== null) return;
@@ -155,7 +157,7 @@ export function KatanaStudio() {
};
return (
- <ToolShell title="Katana">
+ <ToolShell title="Katana" selfHostedOnly>
<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>
diff --git a/src/components/layers/projects-view.tsx b/src/components/layers/projects-view.tsx
index d113fcf9..fa105f53 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, useIsOwner, useIsVisitor, useViewer } from "@/lib/api";
+import { uploadFile, useHydrated, useIsOwner, useLikelyVisitor, 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. The empty list's Upload shows once the owner is known (useIsOwner).
- const visitor = useIsVisitor();
+ // nothing is uploaded only to be refused, and no list of projects they can't make is shown. The empty list's Upload
+ // shows once the owner is known (useIsOwner).
+ const visitor = useLikelyVisitor();
const isOwner = useIsOwner();
const viewer = useViewer().data;
const [picking, setPicking] = useState(false);
@@ -298,7 +299,7 @@ function ProjectsInner() {
</Popover>
</div>
{visitor ? (
- <SelfHostNote className="mx-auto mt-3 max-w-[560px]">Layers projects aren&apos;t on free accounts yet.</SelfHostNote>
+ <SelfHostNote className="mx-auto mt-3 max-w-[560px]">Layers runs on a self-hosted Fuobe for now.</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>
)}
@@ -307,7 +308,7 @@ function ProjectsInner() {
</p>
</section>
- <section className="mt-14" aria-labelledby="my-projects">
+ <section className={cn("mt-14", visitor && "hidden")} aria-labelledby="my-projects">
<h2 id="my-projects" className="font-heading text-[24px]">
My projects
</h2>
diff --git a/src/components/marketing/click-to-ad.tsx b/src/components/marketing/click-to-ad.tsx
index 0c1a5e84..287ce705 100644
--- a/src/components/marketing/click-to-ad.tsx
+++ b/src/components/marketing/click-to-ad.tsx
@@ -13,7 +13,7 @@ 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, useIsVisitor } from "@/lib/api";
+import { uploadFile, useLikelyVisitor } 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";
@@ -154,7 +154,7 @@ export function ClickToAd({ models }: { models: Record<string, ModelInfo> }) {
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 visitor = useLikelyVisitor();
const resultsRef = useRef<HTMLDivElement>(null);
const product = products.data?.find((p) => p.id === productId) ?? null;
const brand = useBrand(product?.brandId).data?.brand;
@@ -222,7 +222,7 @@ export function ClickToAd({ models }: { models: Record<string, ModelInfo> }) {
);
const est = useEstimate<RunEstimate>("/api/marketing/click-to-ad/estimate", body);
const blocker = !product ? "Select a product or enter a product URL" : !product.images.length ? `${product.name} has no images` : !desc.trim() ? "Add a description" : est.data?.blocker;
- const cost = est.data && !est.data.blocker ? (est.data.demo ? "Demo · free" : est.data.costUsd == null ? "" : `≈ ${formatCost(est.data.costUsd)}`) : "";
+ const cost = est.data && !est.data.blocker ? (visitor && (est.data.demo || est.data.costUsd === 0) ? "Self-hosted only" : est.data.demo ? "Demo · free" : est.data.costUsd == null ? "" : `≈ ${formatCost(est.data.costUsd)}`) : "";
const writeScript = async () => {
if (!productId) return;
@@ -257,7 +257,7 @@ export function ClickToAd({ models }: { models: Record<string, ModelInfo> }) {
return (
<div className="flex min-h-svh min-w-0 flex-col">
- <MarketingHeader title="Click to Ad" active="click" engine={engine} onEngine={setEngine} />
+ <MarketingHeader title="Click to Ad" active="click" engine={engine} onEngine={setEngine} selfHostedOnly />
<div className="mx-auto w-full min-w-0 max-w-[980px] flex-1 space-y-5 px-3 pt-6 pb-20 sm:px-6 sm:pt-10">
<div className="pb-2 text-center">
<h2 className="font-heading text-display text-balance">Make a video ad in one click</h2>
@@ -446,7 +446,8 @@ export function ClickToAd({ models }: { models: Record<string, ModelInfo> }) {
</Step>
)}
- <div ref={resultsRef} className="scroll-mt-28 pt-6">
+ {/* A guest or an account has no video ads here and can't make one (the note at the top says why). */}
+ <div ref={resultsRef} className={cn("scroll-mt-28 pt-6", visitor && "hidden")}>
<h2 className="mb-4 font-heading text-[24px]">Your video ads</h2>
<RunsList
feature="click-to-ad"
diff --git a/src/components/marketing/marketing-studio.tsx b/src/components/marketing/marketing-studio.tsx
index 2817eb8a..e99b7441 100644
--- a/src/components/marketing/marketing-studio.tsx
+++ b/src/components/marketing/marketing-studio.tsx
@@ -15,7 +15,7 @@ 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 { useIsOwner, useIsVisitor, useModelAccess } from "@/lib/api";
+import { useIsOwner, useLikelyVisitor, useModelAccess } from "@/lib/api";
import { keepOffered, offered } from "@/lib/model-access";
import { cn } from "@/lib/utils";
import { addRuns, send, useBrands, useEstimate } from "./hooks";
@@ -108,7 +108,7 @@ function SettingsPanel({ draft, set, models, engine }: { draft: Draft; set: (p:
// 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 visitor = useLikelyVisitor();
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(" · ");
@@ -293,7 +293,7 @@ export function MarketingStudio({ models }: { models: Record<string, ModelInfo>
// 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. The slots show once the owner is known
// (useIsOwner), so a visitor never sees them and then gone.
- const visitor = useIsVisitor();
+ const visitor = useLikelyVisitor();
const isOwner = useIsOwner();
const set = (p: Partial<Draft>) => setDraft((d) => ({ ...d, ...p }));
const f = FORMATS[draft.format];
@@ -344,7 +344,7 @@ export function MarketingStudio({ models }: { models: Record<string, ModelInfo>
: 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 ? (visitor ? "Self-hosted only" : "Free") : `≈ ${formatCost(est.data.costUsd)}`) : "";
+ const cost = est.data && !est.data.blocker ? (visitor && (est.data.demo || est.data.costUsd === 0) ? "Self-hosted only" : 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
// away), so the template gallery behind it stays in view.
@@ -386,7 +386,7 @@ export function MarketingStudio({ models }: { models: Record<string, ModelInfo>
return (
<div className="flex min-h-svh min-w-0 flex-col">
- <MarketingHeader title="Marketing Studio" active="studio" engine={engine} onEngine={setEngine} />
+ <MarketingHeader title="Marketing Studio" active="studio" engine={engine} onEngine={setEngine} selfHostedOnly />
<Suspense fallback={null}>
<UrlParams onTemplate={pickTemplate} onTab={setTab} />
</Suspense>
diff --git a/src/components/marketing/shell.tsx b/src/components/marketing/shell.tsx
index 09fdc967..9a25368a 100644
--- a/src/components/marketing/shell.tsx
+++ b/src/components/marketing/shell.tsx
@@ -18,8 +18,25 @@ const TABS: { id: SuiteTab; href: string; label: string; icon: typeof Target }[]
{ id: "multiplier", href: "/ads/multiplier", label: "Ad Multiplier", icon: Copy },
];
-/** The marketing suite's sticky header: title, the four tools as tabs, and the engine switch. */
-export function MarketingHeader({ title, active, engine, onEngine, right }: { title: string; active: SuiteTab; engine?: Engine; onEngine?: (e: Engine) => void; right?: React.ReactNode }) {
+/**
+ * The marketing suite's sticky header: title, the four tools as tabs, and the engine switch. selfHostedOnly: a tool that
+ * runs on a self-hosted Fuobe only (Marketing Studio, Click to Ad), see EngineSwitch.
+ */
+export function MarketingHeader({
+ title,
+ active,
+ engine,
+ onEngine,
+ right,
+ selfHostedOnly,
+}: {
+ title: string;
+ active: SuiteTab;
+ engine?: Engine;
+ onEngine?: (e: Engine) => void;
+ right?: React.ReactNode;
+ selfHostedOnly?: boolean;
+}) {
const nav = useRef<HTMLElement>(null);
// On a phone the tabs scroll sideways: bring the current one into view.
useEffect(() => {
@@ -35,7 +52,7 @@ export function MarketingHeader({ title, active, engine, onEngine, right }: { ti
<h1 className="min-w-0 truncate font-heading text-[22px] leading-none">{title}</h1>
<div className="ml-auto flex shrink-0 items-center gap-2">
{right}
- {engine && onEngine && <EngineSwitch value={engine} onChange={onEngine} />}
+ {engine && onEngine && <EngineSwitch value={engine} onChange={onEngine} selfHostedOnly={selfHostedOnly} />}
</div>
</div>
<nav ref={nav} aria-label="Marketing tools" className="scrollbar-none -mb-px flex gap-1 overflow-x-auto px-3 sm:px-6">
diff --git a/src/components/mixed-media/mixed-studio.tsx b/src/components/mixed-media/mixed-studio.tsx
index 208c9575..75aec366 100644
--- a/src/components/mixed-media/mixed-studio.tsx
+++ b/src/components/mixed-media/mixed-studio.tsx
@@ -13,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, useIsVisitor, useModelAccess } from "@/lib/api";
+import { uploadFile, useEngine, useLikelyVisitor, useModelAccess } from "@/lib/api";
import { keepOffered, offered } from "@/lib/model-access";
import {
clampFps,
@@ -76,7 +76,7 @@ export function MixedStudio({ models, frameModels }: { models: Record<Engine, Re
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();
+ const visitor = useLikelyVisitor();
useEffect(() => {
const t = new URLSearchParams(window.location.search).get("tab");
// eslint-disable-next-line react-hooks/set-state-in-effect -- read once after hydration
@@ -111,7 +111,7 @@ export function MixedStudio({ models, frameModels }: { models: Record<Engine, Re
</div>
<div className="ml-auto shrink-0">
{/* A phone's header has room for the tabs, not "Add key" too. */}
- <EngineSwitch value={engine} onChange={setEngine} wordless />
+ <EngineSwitch value={engine} onChange={setEngine} wordless selfHostedOnly />
</div>
</header>
<div className="mx-auto w-full max-w-[1240px] min-w-0 flex-1 px-3 pb-28 sm:px-6 lg:pb-16">
diff --git a/src/components/model3d/model3d-studio.tsx b/src/components/model3d/model3d-studio.tsx
index 287f8871..81adc8dc 100644
--- a/src/components/model3d/model3d-studio.tsx
+++ b/src/components/model3d/model3d-studio.tsx
@@ -16,7 +16,7 @@ import { MediaSlot, type SlotValue } from "@/components/studio/media-slot";
import { MediaDrop } from "@/components/av/media-drop";
import { Panel, ToolHero, ToolShell } from "@/components/av/tool-shell";
import { SelfHostNote } from "@/components/self-host-note";
-import { useCreateGeneration, useEngine, useGenerations, useHydrated, useIsVisitor, useModelAccess, useStatus } from "@/lib/api";
+import { useCreateGeneration, useEngine, useGenerations, useHydrated, useLikelyVisitor, useModelAccess, useStatus } from "@/lib/api";
import {
MAX_3D_PROMPT,
MODEL3D_FEATURE,
@@ -127,7 +127,7 @@ 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 visitor = useLikelyVisitor();
const access = useModelAccess();
const create = useCreateGeneration();
const results = useGenerations({ features: [MODEL3D_FEATURE, "app:app-image-to-3d"], limit: 24 });
@@ -164,7 +164,8 @@ export function Model3dStudio({ info }: { info: Record<string, Model3dInfo> }) {
const sides = Object.fromEntries(VIEW_SIDES.flatMap((s) => (views[s] ? [[s, views[s]!.ref]] : []))) as Partial<Record<ViewSide, string>>;
const input: Model3dInput = { engine, mode, modelId: modelId ?? undefined, photo: photo?.ref, views: sides, prompt: mode === "text" ? text : mode === "objects" ? object : undefined };
const uploading = !!photo?.uploading || VIEW_SIDES.some((s) => views[s]?.uploading);
- const blocker = model3dBlocker(input) ?? (uploading ? "Uploading…" : null);
+ // A guest or an account reads why the button is off, not a step on an upload that is off too.
+ const blocker = visitor ? "Image to 3D runs on a self-hosted Fuobe for now" : (model3dBlocker(input) ?? (uploading ? "Uploading…" : null));
// The price before anything is attached: placeholders stand in for the files and the words.
const priced: GenerationRequest | null = modelId
? model3dRequest({ ...input, photo: input.photo ?? PLACEHOLDER, views: { front: PLACEHOLDER, left: PLACEHOLDER, ...sides }, prompt: input.prompt?.trim() || "an object" })
@@ -186,7 +187,7 @@ export function Model3dStudio({ info }: { info: Record<string, Model3dInfo> }) {
const items = (results.data ?? []).filter((g) => g.feature !== "image-to-3d-step");
const setSide = (s: ViewSide) => (v: SlotValue | null) => setViews((cur) => ({ ...cur, [s]: v }));
return (
- <ToolShell title="Image to 3D">
+ <ToolShell title="Image to 3D" selfHostedOnly>
<Suspense fallback={null}>
<UrlModel onModel={fromUrl} onMode={setMode} onRig={showRigHint} />
</Suspense>
@@ -330,8 +331,7 @@ export function Model3dStudio({ info }: { info: Record<string, Model3dInfo> }) {
{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">
- {blocker ? `${blocker} · ` : ""}
- {preview.isError ? (preview.error as Error).message : (price ?? "Working out the price…")}
+ {visitor ? blocker : <>{blocker ? `${blocker} · ` : ""}{preview.isError ? (preview.error as Error).message : (price ?? "Working out the price…")}</>}
</p>
<p className="mt-1 text-[12px] text-muted-foreground">
{mode === "splat"
diff --git a/src/components/photodump/photodump-view.tsx b/src/components/photodump/photodump-view.tsx
index 8b5b9946..6cbd635b 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, useIsOwner, useIsVisitor, useModelAccess } from "@/lib/api";
+import { useElements, useEngine, useGenerations, useIsOwner, useLikelyVisitor, 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";
@@ -152,7 +152,7 @@ export function PhotodumpView() {
// 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 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 visitor = useLikelyVisitor();
const isOwner = useIsOwner();
const [step, setStep] = useState(0);
const [reached, setReached] = useState(0);
@@ -224,7 +224,7 @@ export function PhotodumpView() {
return (
<PageShell wide>
<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} />
+ <EngineSwitch value={engine} onChange={setEngine} selfHostedOnly />
</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">
@@ -289,7 +289,7 @@ export function PhotodumpView() {
);
})}
</div>
- {!shown.length && <p className="py-10 text-center text-[14px] text-muted-foreground">{tab === "mine" && !needle ? "No packs of your own yet — create one from your reference photos." : `No packs match “${q}”`}</p>}
+ {!shown.length && <p className="py-10 text-center text-[14px] text-muted-foreground">{tab === "mine" && !needle ? (visitor ? "Packs of your own are saved on a self-hosted Fuobe." : "No packs of your own yet — create one from your reference photos.") : `No packs match “${q}”`}</p>}
<div className="sticky bottom-3 z-10 flex items-center justify-between gap-3 rounded-2xl border bg-background/95 p-3 shadow-normal backdrop-blur">
<p className="min-w-0 truncate text-[13px]">{pack ? <><span className="font-medium">{pack.name}</span> · {pack.count} photos</> : <span className="text-muted-foreground">Pick a pack to continue</span>}</p>
<Button disabled={!pack} onClick={() => go(1)}>
diff --git a/src/components/photodump/steps.tsx b/src/components/photodump/steps.tsx
index 38b41a83..26516da2 100644
--- a/src/components/photodump/steps.tsx
+++ b/src/components/photodump/steps.tsx
@@ -1,7 +1,7 @@
"use client";
import { Check } from "lucide-react";
-import { useIsVisitor } from "@/lib/api";
+import { useLikelyVisitor } from "@/lib/api";
import { cn } from "@/lib/utils";
/** Numbered wizard steps; steps already reached can be revisited. */
@@ -40,13 +40,13 @@ export function Steps({ steps, current, reached, onGo }: { steps: string[]; curr
/**
* "Runs on Nano Banana Pro · 10 photos · ≈ $1.50" (or the reason it can't run). A guest or an account reads "Self-hosted
- * only" for a free run: these tools don't run on their own GPU yet.
+ * only" for a free run or a demo: these tools don't run on their own GPU yet, and their button is off.
*/
export function RunLine({ preview, loading }: { preview?: { modelName?: string; count?: number; costUsd?: number | null; demo?: boolean; notes: string[]; error?: string }; loading?: boolean }) {
- const visitor = useIsVisitor();
+ const visitor = useLikelyVisitor();
if (!preview) return <p className="h-5 text-[12.5px] text-muted-foreground">{loading ? "Pricing…" : ""}</p>;
if (preview.error) return <p className="text-[12.5px] text-destructive">{preview.error}</p>;
- const cost = preview.demo ? "Demo · free" : preview.costUsd === 0 ? (visitor ? "Self-hosted only" : "Free · your GPU") : preview.costUsd == null ? "price unknown" : `≈ $${preview.costUsd.toFixed(2)}`;
+ const cost = visitor && (preview.demo || preview.costUsd === 0) ? "Self-hosted only" : preview.demo ? "Demo · free" : preview.costUsd === 0 ? "Free · your GPU" : preview.costUsd == null ? "price unknown" : `≈ $${preview.costUsd.toFixed(2)}`;
return (
<div className="space-y-0.5 text-[12.5px] text-muted-foreground">
<p>
diff --git a/src/components/photodump/subject.tsx b/src/components/photodump/subject.tsx
index 293383d0..1f28827b 100644
--- a/src/components/photodump/subject.tsx
+++ b/src/components/photodump/subject.tsx
@@ -9,7 +9,7 @@ import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, D
import { Input } from "@/components/ui/input";
import { Skeleton } from "@/components/ui/skeleton";
import { fileToList, type SlotValue } from "@/components/studio/media-slot";
-import { useElements, useSaveElement } from "@/lib/api";
+import { useElements, useLikelyVisitor, useSaveElement } from "@/lib/api";
import type { StudioElement } from "@/lib/catalog/elements";
import { SOUL_ID_COPY, SOUL_ID_PHOTOS } from "@/lib/catalog/training";
import { cn } from "@/lib/utils";
@@ -128,17 +128,26 @@ export function QuickCharacter({ open, onOpenChange, onCreated }: { open: boolea
export function CharacterPicker({ value, onChange }: { value?: string; onChange: (id: string) => void }) {
const { data, isLoading } = useElements();
const [creating, setCreating] = useState(false);
+ // A character is saved to the studio's library, which is its owner's: a guest or an account reads where characters
+ // are made, in the same place, instead of a form whose photos and save would be refused.
+ const visitor = useLikelyVisitor();
const characters = (data ?? []).filter((e) => e.kind === "character");
return (
<>
<div className="grid grid-cols-3 gap-2 sm:grid-cols-4 lg:grid-cols-6">
- <button
- type="button"
- onClick={() => setCreating(true)}
- className="flex aspect-[3/4] flex-col items-center justify-center gap-1.5 rounded-xl border border-dashed text-[12.5px] font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-foreground"
- >
- <Plus className="size-5" /> New character
- </button>
+ {visitor ? (
+ <p className="flex aspect-[3/4] flex-col items-center justify-center gap-1.5 rounded-xl border border-dashed p-3 text-center text-[12px] leading-snug text-pretty text-muted-foreground">
+ <UserRound className="size-5" /> Characters are saved on a self-hosted Fuobe
+ </p>
+ ) : (
+ <button
+ type="button"
+ onClick={() => setCreating(true)}
+ className="flex aspect-[3/4] flex-col items-center justify-center gap-1.5 rounded-xl border border-dashed text-[12.5px] font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-foreground"
+ >
+ <Plus className="size-5" /> New character
+ </button>
+ )}
{isLoading
? Array.from({ length: 3 }, (_, i) => <Skeleton key={i} className="aspect-[3/4] rounded-xl" />)
: characters.map((el) => {
@@ -174,7 +183,7 @@ export function CharacterPicker({ value, onChange }: { value?: string; onChange:
);
})}
</div>
- <QuickCharacter open={creating} onOpenChange={setCreating} onCreated={(el) => onChange(el.id)} />
+ <QuickCharacter open={creating && !visitor} onOpenChange={setCreating} onCreated={(el) => onChange(el.id)} />
</>
);
}
diff --git a/src/components/remove-object/remove-object-tool.tsx b/src/components/remove-object/remove-object-tool.tsx
index 8e70610f..5e19e5eb 100644
--- a/src/components/remove-object/remove-object-tool.tsx
+++ b/src/components/remove-object/remove-object-tool.tsx
@@ -18,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, useIsVisitor, useModelAccess } from "@/lib/api";
+import { useEngine, useGenerations, useLikelyVisitor, useModelAccess } from "@/lib/api";
import {
CLICK_OPEN_PROBLEM,
chooseEraser,
@@ -74,7 +74,7 @@ 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 visitor = useLikelyVisitor();
const access = useModelAccess();
const source = useSourceClip(REMOVE.maxBytes);
const clip = source.clip;
@@ -239,7 +239,7 @@ export function RemoveObjectTool({ tabs }: { tabs?: React.ReactNode }) {
const preview = useGeneration(previewOf?.id ?? null).data;
return (
- <ToolShell title="Video tools" tabs={tabs} wide>
+ <ToolShell title="Video tools" tabs={tabs} wide selfHostedOnly>
{!clip && (
<ToolHero
title="Remove anything from a video"
diff --git a/src/components/self-host-note.tsx b/src/components/self-host-note.tsx
index eadc52ed..07de5447 100644
--- a/src/components/self-host-note.tsx
+++ b/src/components/self-host-note.tsx
@@ -4,10 +4,12 @@ import { FUOBE_REPO } from "@/lib/connections";
/**
* Where a studio saves to its owner's library (projects, canvases, brands, elements…), which guests and free accounts
* can't do yet: says so up front, with the way to use it now (Fuobe is open source), instead of a form the server refuses.
+ * Hidden in a browser the owner used last (`<html data-viewer="owner">`, src/components/app-sidebar.tsx), where a page
+ * that shows it until the viewer is known (useLikelyVisitor) would otherwise draw it and take it away.
*/
export function SelfHostNote({ children, className }: { children: React.ReactNode; className?: string }) {
return (
- <p role="note" className={cn("text-[13px] text-pretty text-muted-foreground", className)}>
+ <p role="note" className={cn("text-[13px] text-pretty text-muted-foreground [html[data-viewer='owner']_&]:hidden", className)}>
{children}{" "}
<a href={FUOBE_REPO} target="_blank" rel="noreferrer" className="font-medium text-foreground underline underline-offset-4">
Run Fuobe yourself
diff --git a/src/components/shorts/shorts-studio.tsx b/src/components/shorts/shorts-studio.tsx
index 504369ee..fa4126d9 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, useIsOwner, useIsVisitor, useModelAccess } from "@/lib/api";
+import { useEngine, useIsOwner, useLikelyVisitor, useModelAccess } from "@/lib/api";
import {
clipShapeProblem,
rangeProblem,
@@ -54,7 +54,7 @@ export function ShortsStudio({ models }: { models: Record<Engine, ModelChoice[]>
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();
+ const visitor = useLikelyVisitor();
// Hand-offs: /shorts?tab=history, ?preset=shorts-claymation, ?video=/api/files/….
useEffect(() => {
@@ -100,7 +100,7 @@ export function ShortsStudio({ models }: { models: Record<Engine, ModelChoice[]>
</div>
<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 />
+ <EngineSwitch value={engine} onChange={setEngine} wordless selfHostedOnly />
</div>
</header>
<div className="mx-auto w-full max-w-[1240px] min-w-0 flex-1 px-3 pb-28 sm:px-6 lg:pb-16">
diff --git a/src/components/shorts/ui.tsx b/src/components/shorts/ui.tsx
index 77f6b7a4..0fdd18e7 100644
--- a/src/components/shorts/ui.tsx
+++ b/src/components/shorts/ui.tsx
@@ -232,12 +232,13 @@ export function Steps({ steps, current, className }: { steps: string[]; current:
/**
* "≈ $0.42", "Demo · free", "Free · your GPU". visitor: a guest or an account, whose GPU these tools don't run on yet
- * (the page says why): "Self-hosted only".
+ * (the page says why): "Self-hosted only", a demo's price too, since its button is off.
*/
export function costText(e: { costUsd: number | null; demo: boolean } | undefined, engine: "cloud" | "open", visitor?: boolean): string {
if (!e) return "…";
+ if (visitor && (e.demo || engine === "open")) return "Self-hosted only";
if (e.demo) return "Demo · free";
- if (engine === "open") return visitor ? "Self-hosted only" : "Free · your GPU";
+ if (engine === "open") return "Free · your GPU";
if (e.costUsd === null) return "Price unknown";
if (e.costUsd === 0) return "Free";
return `≈ $${e.costUsd < 1 ? e.costUsd.toFixed(3).replace(/0$/, "") : e.costUsd.toFixed(2)}`;
diff --git a/src/components/studio/engine-switch.tsx b/src/components/studio/engine-switch.tsx
index d24f6efa..813c9ef6 100644
--- a/src/components/studio/engine-switch.tsx
+++ b/src/components/studio/engine-switch.tsx
@@ -20,6 +20,8 @@ const OPTIONS: { value: Engine; label: string; icon: typeof Cloud; tip: string }
* icon-only below the sm breakpoint so titles keep their line on phones (`compact` does the same
* for `sm`, e.g. in Assist's one-row footer); the tooltips and aria labels still name each engine.
* `wordless`: no "Add key" on a phone either, in a header that has no room for it (the lock and the label still say it).
+ * `selfHostedOnly`: a tool that runs on a self-hosted Fuobe only (its page says so to a guest or an account), where
+ * anyone but the owner gets a plain badge: no way to Your GPU or a key, which wouldn't run it.
*/
export function EngineSwitch({
value,
@@ -27,12 +29,14 @@ export function EngineSwitch({
size = "md",
compact = size === "md",
wordless,
+ selfHostedOnly,
}: {
value: Engine;
onChange: (e: Engine) => void;
size?: "sm" | "md";
compact?: boolean;
wordless?: boolean;
+ selfHostedOnly?: boolean;
}) {
const mode = useEngineMode();
// Until hydrated, the server's switch (as useEngineMode): a viewer or status that lands mid-hydration must not change it.
@@ -57,12 +61,12 @@ export function EngineSwitch({
<o.icon className="size-3.5" />
<span className={cn(compact && "hidden sm:inline")}>{text}</span>
{/* A phone has room for two words: what to do about the lock. */}
- {compact && !wordless && locked?.addKey && <span className="sm:hidden">Add key</span>}
+ {compact && !wordless && !selfHostedOnly && locked?.addKey && <span className="sm:hidden">Add key</span>}
</>
);
// An account opens "Add your key" right here (a plain click; Settings → Your keys in a new tab), or Your GPU when
// the studio runs open-source models only: the way to paid models is its own key.
- if (locked) {
+ if (locked && !selfHostedOnly) {
return (
<Tooltip>
<TooltipTrigger asChild>
@@ -101,7 +105,13 @@ export function EngineSwitch({
{body}
</span>
</TooltipTrigger>
- <TooltipContent>{mode === "open" ? "This studio runs open-source models, free on your own GPU" : "This studio runs paid cloud models"}</TooltipContent>
+ <TooltipContent>
+ {selfHostedOnly
+ ? `${o.value === "open" ? "Open-source models" : "Paid cloud models"} · runs on a self-hosted Fuobe`
+ : mode === "open"
+ ? "This studio runs open-source models, free on your own GPU"
+ : "This studio runs paid cloud models"}
+ </TooltipContent>
</Tooltip>
);
}
diff --git a/src/components/swap-studio/home.tsx b/src/components/swap-studio/home.tsx
index 743b87e0..fc7f0818 100644
--- a/src/components/swap-studio/home.tsx
+++ b/src/components/swap-studio/home.tsx
@@ -11,11 +11,12 @@ import { Skeleton } from "@/components/ui/skeleton";
import { Panel, ToolHero, ToolShell } from "@/components/av/tool-shell";
import { EngineSwitch } from "@/components/studio/engine-switch";
import { SelfHostNote } from "@/components/self-host-note";
-import { useEngine, useIsVisitor } from "@/lib/api";
+import { useEngine, useLikelyVisitor } from "@/lib/api";
import { characterLicenceLine } from "@/lib/catalog/character-swap";
import { SWAP_STUDIO, type SwapProjectCard } from "@/lib/catalog/swap-studio";
import { STUDIO_MODELS } from "@/lib/catalog/swap-studio-plan";
import { toastError } from "@/lib/refusals";
+import { cn } from "@/lib/utils";
import { useCreateSwapProject, useDeleteSwapProject, useSwapProjects } from "./hooks";
const STEPS = [
@@ -43,7 +44,7 @@ export function SwapStudioHome() {
const [confirm, setConfirm] = useState<SwapProjectCard | null>(null);
const nameId = useId();
// A project is saved to the studio's library, which is its owner's: a guest or an account is told so up front.
- const visitor = useIsVisitor();
+ const visitor = useLikelyVisitor();
const start = () =>
create.mutate(
@@ -55,7 +56,7 @@ export function SwapStudioHome() {
);
return (
- <ToolShell title="Character Swap Studio" engineSwitch={false} header={<EngineSwitch value={engine} onChange={setEngine} />} wide>
+ <ToolShell title="Character Swap Studio" engineSwitch={false} header={<EngineSwitch value={engine} onChange={setEngine} selfHostedOnly />} wide>
<ToolHero
title="Swap a character through whole clips"
subtitle="Put your character into whole clips, shot by shot: pick who to swap, check each shot, keep the best take."
@@ -84,7 +85,7 @@ export function SwapStudioHome() {
{visitor ? "New project" : `New project · ${engine === "open" ? "your GPU" : "cloud"}`}
</Button>
</form>
- {visitor && <SelfHostNote className="mt-3 max-w-lg">Free accounts can&apos;t save projects here yet.</SelfHostNote>}
+ {visitor && <SelfHostNote className="mt-3 max-w-lg">Character Swap runs on a self-hosted Fuobe for now.</SelfHostNote>}
</ToolHero>
<ol className="mx-auto mt-8 grid max-w-[1040px] gap-3 sm:grid-cols-2 lg:grid-cols-4" aria-label="How it works">
@@ -101,7 +102,8 @@ export function SwapStudioHome() {
))}
</ol>
- <section className="mt-8" aria-labelledby="swap-projects">
+ {/* A guest or an account has no projects here and can't make one (the note above says why). */}
+ <section className={cn("mt-8", visitor && "hidden")} aria-labelledby="swap-projects">
<h2 id="swap-projects" className="mb-3 text-[15px] font-semibold">
Projects
</h2>
diff --git a/src/lib/api.ts b/src/lib/api.ts
index dd5fa043..b3cbb754 100644
--- a/src/lib/api.ts
+++ b/src/lib/api.ts
@@ -1178,6 +1178,30 @@ export function useIsVisitor(): boolean {
return hydrated && !!v && !v.owner;
}
+/** Who used this browser last (VIEWER_KEY), or null. Read after hydration only: the server's HTML can't know it. */
+function lastViewer(): string | null {
+ try {
+ return localStorage.getItem(VIEWER_KEY);
+ } catch {
+ return null;
+ }
+}
+
+/**
+ * A guest or an account, as useIsVisitor, but from the first paint: true until the viewer is known to be the owner. For
+ * the tools that run on a self-hosted Fuobe only: a guest's first paint already has their words, the note and the
+ * buttons that are off, so nothing changes or moves when the viewer comes. The owner's page switches instead, at
+ * hydration in a browser the owner used last (VIEWER_KEY), where the note is hidden from the first paint too
+ * (src/components/self-host-note.tsx).
+ */
+export function useLikelyVisitor(): boolean {
+ const v = useViewer().data;
+ const hydrated = useHydrated();
+ if (!hydrated) return true;
+ if (v) return !v.owner;
+ return lastViewer() !== "owner";
+}
+
/**
* The studio's owner, once known (and after hydration, as useIsVisitor): what only the owner can do (Assist's Create
* and Schedule, the Library's folders, shares and Trash) shows from then on, so a visitor never sees it flash in and out.