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.

Genjutsu: every mode and option shows to everyone and runs on a visitor's own GPU

Adarsh4a82710ecbcd
diff --git a/src/app/api/genjutsu/estimate/route.ts b/src/app/api/genjutsu/estimate/route.ts
index 6141f083..75abc987 100644
--- a/src/app/api/genjutsu/estimate/route.ts
+++ b/src/app/api/genjutsu/estimate/route.ts
@@ -12,8 +12,8 @@ export async function POST(request: Request) {
return priceAsRun(request, () =>
handle(async () => {
const input = await body(request, GenjutsuEstimateSchema, "Add a clip and pick a mode");
- // A feature that hasn't opened is refused to everyone but the owner (src/server/genjutsu-live.ts).
- return Response.json(await estimateGenjutsu(input, { owner: requestViewer(request).kind === "owner" }));
+ // A feature that hasn't opened on this studio's GPU is priced as a visitor's own-setup run (src/lib/own-setup.ts).
+ return Response.json(await estimateGenjutsu(input, { owner: requestViewer(request).kind === "owner", ownSetup: true }));
}),
);
}
diff --git a/src/app/api/genjutsu/route.ts b/src/app/api/genjutsu/route.ts
index 5c8bbb3b..106782a5 100644
--- a/src/app/api/genjutsu/route.ts
+++ b/src/app/api/genjutsu/route.ts
@@ -28,7 +28,7 @@ export async function POST(request: Request) {
runAccountTool(request, viewer.account, {
tool: "genjutsu",
files: [input.source.url, input.mask, input.picture?.frame, ...(input.references ?? []), ...look],
- plan: async () => genjutsuSteps((run = await planGenjutsuRun(input, { owner: false }))),
+ plan: async () => genjutsuSteps((run = await planGenjutsuRun(input, { owner: false, ownSetup: true }))),
start: () => startGenjutsu(run!),
}),
({ value, gpuWarning }) => Response.json({ final: value.final, items: value.items, ...(gpuWarning && { gpuWarning }) }, { status: 201 }),
diff --git a/src/app/api/genjutsu/scene/route.ts b/src/app/api/genjutsu/scene/route.ts
index 00bcbca1..a097700c 100644
--- a/src/app/api/genjutsu/scene/route.ts
+++ b/src/app/api/genjutsu/scene/route.ts
@@ -4,7 +4,7 @@ import { body, handle } from "@/server/shorts-schemas";
/**
* From picture's "What happens": starts the describer on the part; the page waits for its text (a generation). The
- * owner's, or an account's on its own GPU (src/server/account-tool-run.ts) once From picture is open to everyone.
+ * owner's, or an account's on its own GPU (src/server/account-tool-run.ts).
*/
export async function POST(request: Request) {
const viewer = toolViewer(request);
@@ -19,8 +19,8 @@ export async function POST(request: Request) {
const r = await runAccountTool(request, viewer.account, {
tool: "genjutsu",
files: [input.source.url, input.ownPerson ? undefined : input.frame],
- plan: () => [{ request: sceneRequest(input, { owner: false }) }],
- start: () => startStep(sceneRequest(input, { owner: false })),
+ plan: () => [{ request: sceneRequest(input, { owner: false, ownSetup: true }) }],
+ start: () => startStep(sceneRequest(input, { owner: false, ownSetup: true })),
});
return r.ok ? Response.json(r.value, { status: 201 }) : r.response;
}, request);
diff --git a/src/app/api/genjutsu/transcribe/route.ts b/src/app/api/genjutsu/transcribe/route.ts
index e4b72834..18d191e4 100644
--- a/src/app/api/genjutsu/transcribe/route.ts
+++ b/src/app/api/genjutsu/transcribe/route.ts
@@ -1,11 +1,11 @@
-import { bodyTooBig, guestRun, ownGpuTool, runAccountTool, toolViewer } from "@/server/account-tool-run";
+import { bodyTooBig, guestRun, runAccountTool, toolViewer } from "@/server/account-tool-run";
import { startStep, transcribeClip, TranscribeSchema, transcribeRequest } from "@/server/genjutsu";
-import { soundLive } from "@/server/sound-live";
import { body, handle } from "@/server/shorts-schemas";
/**
* The clip's words for Character swap's "What's said": one transcription the page picks the part's lines from. The
- * owner's, or an account's on its own GPU or key (src/server/account-tool-run.ts).
+ * owner's, or an account's on its own GPU or key (src/server/account-tool-run.ts), "Clean the voice first" included: it
+ * runs there before it has passed on this studio's GPU (src/lib/own-setup.ts).
*/
export async function POST(request: Request) {
const viewer = toolViewer(request);
@@ -17,8 +17,6 @@ export async function POST(request: Request) {
return handle(async () => {
const input = await body(request, TranscribeSchema, "Add a clip first");
if (viewer.kind === "owner") return Response.json(transcribeClip(input), { status: 201 });
- // "Clean the voice first" opens to visitors once it has passed a real run (src/server/sound-live.ts).
- if (input.cleanVoiceFirst && !soundLive()["clean-voice-first"]) return ownGpuTool();
const r = await runAccountTool(request, viewer.account, {
tool: "genjutsu",
files: [input.source.url],
diff --git a/src/app/api/swap-studio/projects/[id]/transcribe/route.ts b/src/app/api/swap-studio/projects/[id]/transcribe/route.ts
index 15e37e66..4868b24b 100644
--- a/src/app/api/swap-studio/projects/[id]/transcribe/route.ts
+++ b/src/app/api/swap-studio/projects/[id]/transcribe/route.ts
@@ -1,17 +1,13 @@
import { z } from "zod";
-import { ownGpuTool } from "@/server/account-tool-run";
-import { soundLive } from "@/server/sound-live";
import { transcribe } from "@/server/swap-studio";
import { jobRoute } from "@/server/swap-studio-account";
/** cleanVoiceFirst: the speech apart from the music and effects before it's read (src/lib/av/voice-first.ts). */
const Transcribe = z.object({ clipId: z.string().min(1).max(80), cleanVoiceFirst: z.boolean().optional() });
-const run = jobRoute(Transcribe, "Pick a clip", (id, b) => transcribe(id, b.clipId, { cleanVoiceFirst: b.cleanVoiceFirst }), {
- status: 200,
- // "Clean the voice first" opens to accounts once it has passed a real run (src/server/sound-live.ts), as in Genjutsu.
- refuse: (b) => (b.cleanVoiceFirst && !soundLive()["clean-voice-first"] ? ownGpuTool() : null),
-});
+// "Clean the voice first" runs on an account's own GPU or key, as in Genjutsu, before it has passed on this studio's GPU
+// (src/lib/own-setup.ts).
+const run = jobRoute(Transcribe, "Pick a clip", (id, b) => transcribe(id, b.clipId, { cleanVoiceFirst: b.cleanVoiceFirst }), { status: 200 });
/**
* The clip's words, with who speaks when (Scribe v2 on the cloud, Qwen3-ASR on your GPU). An account's on its own GPU or
diff --git a/src/components/audio-tools/voice-first-switch.tsx b/src/components/audio-tools/voice-first-switch.tsx
index 07a2f8b1..a720195d 100644
--- a/src/components/audio-tools/voice-first-switch.tsx
+++ b/src/components/audio-tools/voice-first-switch.tsx
@@ -1,31 +1,39 @@
"use client";
import { useId } from "react";
+import { OwnSetupChip } from "@/components/own-setup";
import { Switch } from "@/components/ui/switch";
import { useIsAccount, useIsGuest, useSoundLive } from "@/lib/api";
import { VOICE_FIRST_BED, VOICE_FIRST_FEATURE, VOICE_FIRST_HINT, VOICE_FIRST_LABEL, voiceFirstCost } from "@/lib/av/voice-first";
import type { Engine } from "@/lib/catalog/types";
+import { ownSetupItem } from "@/lib/own-setup";
import { cn } from "@/lib/utils";
/**
* "Clean the voice first" beside a transcript or a lip sync (src/lib/av/voice-first.ts): the switch, what it does on
- * this engine and what it adds (time on your GPU, a price in the cloud). Until it has passed a real run it shows for the
- * studio's owner only and starts off (the server refuses it to visitors); once it has, it shows for everyone.
+ * this engine and what it adds (time on your GPU, a price in the cloud). Until it has passed a real run on this studio's
+ * GPU it starts off, and shows for the owner and, where its run goes to the visitor's own GPU or key (`ownSetup`: Genjutsu,
+ * Character Swap Studio), for everyone, marked with what it runs on (src/lib/own-setup.ts); once it has, it shows for
+ * everyone, unmarked.
*/
export function useVoiceFirstLive(): boolean {
return useSoundLive(VOICE_FIRST_FEATURE);
}
-export function useVoiceFirstShown(): boolean {
+export function useVoiceFirstShown(ownSetup = false): boolean {
const guest = useIsGuest();
const account = useIsAccount();
const live = useVoiceFirstLive();
- return live || (!guest && !account);
+ return live || ownSetup || (!guest && !account);
}
export function VoiceFirstSwitch({ engine, on, onChange, seconds, lip, className }: { engine: Engine; on: boolean; onChange: (on: boolean) => void; seconds?: number; lip?: boolean; className?: string }) {
const id = useId();
const cost = voiceFirstCost(engine, seconds);
+ const guest = useIsGuest();
+ const account = useIsAccount();
+ const visitor = guest || account;
+ const live = useVoiceFirstLive();
return (
<div className={cn("flex min-w-0 items-start gap-2", className)}>
<Switch id={id} checked={on} onCheckedChange={onChange} className="mt-0.5 shrink-0" />
@@ -34,6 +42,7 @@ export function VoiceFirstSwitch({ engine, on, onChange, seconds, lip, className
{VOICE_FIRST_LABEL}
{on && cost ? <span className="font-normal text-muted-foreground"> · {cost}</span> : null}
</label>
+ {visitor && !live && <OwnSetupChip setup={ownSetupItem("sound:clean-voice-first")} className="ml-1.5 align-[1px]" />}
<p className="text-[12px] text-pretty text-muted-foreground">
{VOICE_FIRST_HINT[engine]}
{lip ? ` ${VOICE_FIRST_BED[engine]}` : ""}
diff --git a/src/components/genjutsu/genjutsu-studio.tsx b/src/components/genjutsu/genjutsu-studio.tsx
index 929e0f97..e2b210dd 100644
--- a/src/components/genjutsu/genjutsu-studio.tsx
+++ b/src/components/genjutsu/genjutsu-studio.tsx
@@ -34,8 +34,11 @@ import {
chooseMaker,
decodeSetup,
GENJUTSU,
+ GENJUTSU_FEATURE_KEYS,
+ GENJUTSU_FEATURES,
GENJUTSU_MODES,
modeOpen,
+ requestFeatures,
type FeatureCheck,
type FinishOptions,
type GenjutsuFeature,
@@ -78,6 +81,8 @@ import { ORIGINAL_SOUND_FEATURE, originalSoundDefault, originalSoundOn, type Ori
import { OriginalSoundPicker } from "@/components/av/original-sound-picker";
import { useDescribeCharacter, useDescribeScene, useGenjutsuEstimate, useGenjutsuRun, useTranscribeClip, waitForGeneration, type GenjutsuBody } from "./hooks";
import { FinishFields, FrameCompare, LightPicker, More, OnlyYou, PERSON_COLOURS, PictureSteps, roleForTap, SceneEditFields, WhoBecomesWho } from "./openjutsu-panels";
+import { OwnSetupChip, OwnSetupMark, useOwnSetupPress } from "@/components/own-setup";
+import { ownSetupItem } from "@/lib/own-setup";
import { LookPicker, type LookSource } from "./look-picker";
import { SetupCode } from "./setup-code";
import { useClipCuts } from "./use-cuts";
@@ -124,10 +129,19 @@ const seedOf = (s: string): number | undefined => (s.trim() === "" ? undefined :
*/
export function GenjutsuStudio({ examples, modeExamples, live }: { examples?: ExampleRowData | null; modeExamples?: ModeExamples; live?: Partial<Record<GenjutsuFeature, boolean>> }) {
const [engine, setEngine, engineMode] = useEngine();
- // The Openjutsu modes open one by one, each after its GPU test (src/server/genjutsu-live.ts); the owner sees them all.
+ // The Openjutsu modes open one by one on this studio's GPU, each after its GPU test (src/server/genjutsu-live.ts).
+ // Until then everyone sees them: the owner with an "Only you" mark, a visitor with what it runs on (its own GPU,
+ // src/lib/own-setup.ts). The mark leaves by itself once the feature's test passes.
const owner = useIsOwner();
- const open: FeatureCheck = useCallback((f) => owner || !!live?.[f], [owner, live]);
- const ownerOnly: FeatureCheck = (f) => owner && !live?.[f];
+ const open: FeatureCheck = useCallback((f) => owner || !!live?.[f] || !!ownSetupItem(`genjutsu:${f}`), [owner, live]);
+ const liveOpen: FeatureCheck = useCallback((f) => owner || !!live?.[f], [owner, live]);
+ const mark = (f: GenjutsuFeature): React.ReactNode => (live?.[f] ? undefined : owner ? <OnlyYou /> : <OwnSetupChip setup={ownSetupItem(`genjutsu:${f}`)} />);
+ const press = useOwnSetupPress();
+ // A mode that hasn't opened (From picture; Finish until one of its tools has): the setup of its first such feature.
+ const modeSetup = (m: GenjutsuMode) => {
+ const f = GENJUTSU_FEATURE_KEYS.find((k) => GENJUTSU_FEATURES[k].mode === m && !live?.[k] && ownSetupItem(`genjutsu:${k}`));
+ return f ? ownSetupItem(`genjutsu:${f}`) : null;
+ };
// The page sends only the mode examples open to everyone; the owner's are fetched (never in a visitor's page).
const ownerExamples = useQuery({
queryKey: ["genjutsu-examples"],
@@ -245,19 +259,20 @@ export function GenjutsuStudio({ examples, modeExamples, live }: { examples?: Ex
// Models switched off in Settings → Models & licences leave the list, and the pick falls back to one that is on.
const isOn = (id: string) => offered(access, id, engine);
const readyRefs = ready(refs).length;
- const choice = chooseMaker({
+ const ask = {
engine,
mode,
target,
tier,
look: effLook ?? (mode === "restyle" ? lookPlaceholder(lookSource) : undefined),
- modelId: picked[choiceKey],
offered: isOn,
- open,
refs: readyRefs,
action: mode === "swap" ? action : undefined,
tool: mode === "finish" ? finish.tool : undefined,
- });
+ };
+ // Nothing picked yet: start on a model open on this studio's GPU where there is one; the own-setup ones are a pick away.
+ const livePick = chooseMaker({ ...ask, open: liveOpen });
+ const choice = chooseMaker({ ...ask, modelId: picked[choiceKey] ?? ("maker" in livePick ? livePick.maker.id : undefined), open });
const maker: Maker | null = "maker" in choice ? choice.maker : null;
const options = keepOffered(makersFor(engine, mode, target, open), (m) => makerOffered(m, isOn)).filter((m) => mode !== "finish" || m.tool === finish.tool);
const group = isCharacter && !!maker?.group;
@@ -313,7 +328,7 @@ export function GenjutsuStudio({ examples, modeExamples, live }: { examples?: Ex
const [clipWords, setClipWords] = useState<{ url: string; clean: boolean; g: Generation } | null>(null);
// "Clean the voice first" for the clip's words: off until the chain has passed a real run, then on (the switch is under
// "Use the clip's words").
- const voiceFirstShown = useVoiceFirstShown();
+ const voiceFirstShown = useVoiceFirstShown(true);
const voiceFirstLive = useVoiceFirstLive();
const [voiceFirst, setVoiceFirst] = useState<boolean | null>(null);
const cleanFirst = voiceFirstShown && (voiceFirst ?? (engine === "open" && voiceFirstDefault("video", voiceFirstLive)));
@@ -650,6 +665,9 @@ export function GenjutsuStudio({ examples, modeExamples, live }: { examples?: Ex
: null;
const estimate = useGenjutsuEstimate(body);
const est = estimate.data && !estimate.isError ? estimate.data : undefined;
+ // What Generate needs of a visitor's own setup: the first feature of this run that hasn't opened on this studio's GPU.
+ const needFeature = body && maker && !owner ? requestFeatures({ mode: body.mode, maker, character: body.character, object: body.object, picture: body.picture, finish: body.finish }).find((f) => !live?.[f]) : undefined;
+ const setupNeed = needFeature ? ownSetupItem(`genjutsu:${needFeature}`) : null;
const blocker = !clip
? "Add a clip"
@@ -819,7 +837,7 @@ export function GenjutsuStudio({ examples, modeExamples, live }: { examples?: Ex
const modeInfo = getMode(mode);
const hint = modeHint(mode, open);
- const tabs = <ModeTabsRow modes={GENJUTSU_MODES.filter((m) => modeOpen(m.id, open))} mode={mode} onMode={setMode} onlyYou={(m) => owner && !modeOpen(m, (f) => !!live?.[f])} />;
+ const tabs = <ModeTabsRow modes={GENJUTSU_MODES.filter((m) => modeOpen(m.id, open))} mode={mode} onMode={setMode} mark={(m) => (modeOpen(m, (f) => !!live?.[f]) ? undefined : owner ? <OnlyYou /> : <OwnSetupMark setup={modeSetup(m)} />)} />;
return (
<ToolShell title="Genjutsu" tabs={tabs} fadeKey={mode} header={<SetupCode setup={fullSetup} onPaste={(s) => apply(s)} />} wide>
@@ -1017,11 +1035,11 @@ export function GenjutsuStudio({ examples, modeExamples, live }: { examples?: Ex
{example && <ModeExampleRow key={example.id} card={example} owner={owner} canUse inUse={exampleInUse} onlyYou={exampleOnlyYou} onUse={() => pickExample(example)} />}
<p className="text-[13px] text-pretty text-muted-foreground">{hint}</p>
- {mode === "finish" && <FinishFields value={finish} onChange={setFinish} open={open} ownerOnly={ownerOnly} seed={seed} onSeed={setSeed} />}
+ {mode === "finish" && <FinishFields value={finish} onChange={setFinish} open={open} mark={mark} seed={seed} onSeed={setSeed} />}
{mode === "picture" && pictureStage === "frame" && (
<>
- <LightPicker value={picture} onChange={setPicture} open={open} ownerOnlyLight={ownerOnly("picture-light")} ownerOnlyOwn={ownerOnly("picture-own-person")} />
+ <LightPicker value={picture} onChange={setPicture} open={open} lightMark={mark("picture-light")} ownMark={mark("picture-own-person")} />
<Field label="Adjust (optional)" htmlFor="gj-adjust">
<Input id="gj-adjust" value={picture.adjust ?? ""} onChange={(e) => setPicture({ ...picture, adjust: e.target.value.slice(0, 300) || undefined })} maxLength={300} placeholder="e.g. “arms crossed, chin up”" className="h-11 text-[13px]" />
</Field>
@@ -1054,19 +1072,17 @@ export function GenjutsuStudio({ examples, modeExamples, live }: { examples?: Ex
]}
/>
</Field>
- {owner && (
- <Field label="Renderer" hint={<OnlyYou />}>
- <Segmented
- label="Renderer"
- value={picture.renderer ?? "solar"}
- onChange={(renderer) => setPicture({ ...picture, renderer: renderer === "solar" ? undefined : renderer })}
- options={[
- { value: "solar", label: "Standard" },
- { value: "h3", label: "H3" },
- ]}
- />
- </Field>
- )}
+ <Field label="Renderer" hint={mark("picture-h3-renderer")}>
+ <Segmented
+ label="Renderer"
+ value={picture.renderer ?? "solar"}
+ onChange={(renderer) => setPicture({ ...picture, renderer: renderer === "solar" ? undefined : renderer })}
+ options={[
+ { value: "solar", label: "Standard" },
+ { value: "h3", label: "H3" },
+ ]}
+ />
+ </Field>
<Field label="Seed" htmlFor="gj-pic-seed" hint="Blank: a new one each time">
<Input id="gj-pic-seed" inputMode="numeric" value={seed} onChange={(e) => setSeed(e.target.value.replace(/[^0-9]/g, "").slice(0, 10))} className="h-11 text-[13px]" />
</Field>
@@ -1103,7 +1119,7 @@ export function GenjutsuStudio({ examples, modeExamples, live }: { examples?: Ex
setObjectEdit((o) => ({ ...o, action: a }));
}}
open={open}
- ownerOnly={ownerOnly}
+ mark={mark}
painted={!!paint}
target={target}
seed={seed}
@@ -1118,7 +1134,7 @@ export function GenjutsuStudio({ examples, modeExamples, live }: { examples?: Ex
value={character}
onChange={setCharacter}
onTap={frame ? (i) => setTapFor(i) : null}
- oneByOne={{ show: refs.length === 2 && open("group-swap-one-by-one"), ownerOnly: ownerOnly("group-swap-one-by-one") }}
+ oneByOne={{ show: refs.length === 2 && open("group-swap-one-by-one"), mark: mark("group-swap-one-by-one") }}
seed={seed}
onSeed={setSeed}
/>
@@ -1185,7 +1201,7 @@ export function GenjutsuStudio({ examples, modeExamples, live }: { examples?: Ex
const most = mode === "motion" ? options.find((m) => m.id === id)?.part?.max : undefined;
if (most && range && range.endTime - range.startTime > most + 0.05) setRange({ ...range, endTime: Math.round((range.startTime + most) * 100) / 100 });
}}
- onlyYou={(m) => !!m.features && !m.features.some((f) => !!live?.[f]) && owner}
+ mark={(m) => (m.features && !m.features.some((f) => !!live?.[f]) ? mark(m.features[0]) : undefined)}
/>
</Field>
)}
@@ -1248,7 +1264,7 @@ export function GenjutsuStudio({ examples, modeExamples, live }: { examples?: Ex
</>
)}
</div>
- <Button id="gj-generate" className="rounded-full" onClick={() => start()} disabled={!!blocker || runMutation.isPending || describing}>
+ <Button id="gj-generate" className="rounded-full" onClick={() => press(setupNeed, () => start())} disabled={!!blocker || runMutation.isPending || describing}>
{runMutation.isPending ? <Loader2 className="size-4 animate-spin" /> : <Wand2 className="size-4" />} {mode === "picture" ? (pictureStage === "frame" ? "Make the first frame" : "Make the video") : "Generate"}
</Button>
</div>
@@ -1419,7 +1435,7 @@ function frameHint(mode: GenjutsuMode, target: GenjutsuTarget | undefined, point
}
/** The modes as tabs under the header (the selected one is in the URL as ?mode=); only the ones open to this viewer. */
-function ModeTabsRow({ modes, mode, onMode, onlyYou }: { modes: typeof GENJUTSU_MODES; mode: GenjutsuMode; onMode: (m: GenjutsuMode) => void; onlyYou: (m: GenjutsuMode) => boolean }) {
+function ModeTabsRow({ modes, mode, onMode, mark }: { modes: typeof GENJUTSU_MODES; mode: GenjutsuMode; onMode: (m: GenjutsuMode) => void; mark: (m: GenjutsuMode) => React.ReactNode }) {
// The selected tab stays in view on a phone, where the row scrolls (only the row: the page stays put).
return (
<div className="border-b">
@@ -1429,7 +1445,7 @@ function ModeTabsRow({ modes, mode, onMode, onlyYou }: { modes: typeof GENJUTSU_
return (
<button key={m.id} type="button" role="tab" aria-selected={on} tabIndex={on ? 0 : -1} onClick={() => onMode(m.id)} className={TAB_PILL} {...onAttr(on)}>
{m.label}
- {onlyYou(m.id) && <OnlyYou />}
+ {mark(m.id)}
</button>
);
})}
@@ -1453,7 +1469,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). */
-function MakerList({ options, value, onChange, onlyYou }: { options: Maker[]; value: string; onChange: (id: string) => void; onlyYou?: (m: Maker) => boolean }) {
+function MakerList({ options, value, onChange, mark }: { options: Maker[]; value: string; onChange: (id: string) => void; mark?: (m: Maker) => React.ReactNode }) {
return (
<div role="radiogroup" aria-label="Model" onKeyDown={radioKeys} className="space-y-1.5">
{options.map((m) => (
@@ -1473,7 +1489,7 @@ function MakerList({ options, value, onChange, onlyYou }: { options: Maker[]; va
<span className="min-w-0">
<span className="flex flex-wrap items-center gap-1.5 text-[13px] font-medium">
{m.label} <SourceBadge source={m.source} />
- {onlyYou?.(m) && <OnlyYou />}
+ {mark?.(m)}
</span>
<span className="block text-[12px] leading-snug text-muted-foreground">{m.note}</span>
</span>
diff --git a/src/components/genjutsu/openjutsu-panels.tsx b/src/components/genjutsu/openjutsu-panels.tsx
index 837c4487..66c57d30 100644
--- a/src/components/genjutsu/openjutsu-panels.tsx
+++ b/src/components/genjutsu/openjutsu-panels.tsx
@@ -9,13 +9,13 @@ import { Textarea } from "@/components/ui/textarea";
import { Field, Segmented } from "@/components/shorts/ui";
import type { SlotValue } from "@/components/studio/media-slot";
import { roleFromPin, type CharacterOptions } from "@/lib/catalog/character-swap";
-import { OPENJUTSU_LIMITS, SCENE_ACTIONS, type FeatureCheck, type FinishOptions, type ObjectEdit, type PictureOptions, type SceneAction } from "@/lib/catalog/genjutsu";
+import { OPENJUTSU_LIMITS, SCENE_ACTIONS, type FeatureCheck, type FinishOptions, type GenjutsuFeature, type ObjectEdit, type PictureOptions, type SceneAction } from "@/lib/catalog/genjutsu";
import { LIGHT_LOOKS, type LookId } from "@/lib/openjutsu-graphs";
import { cn } from "@/lib/utils";
/**
* Genjutsu's Openjutsu panels (Group swap's Who becomes who, Scene edit, From picture's light and steps, Finish): phone
- * first (44 px taps, wraps, no sideways scroll). What hasn't opened yet shows to the owner only, with an "Only you" badge.
+ * first (44 px taps, wraps, no sideways scroll). What hasn't opened on this studio's GPU yet carries a mark: "Only you" for the owner, what it runs on for a visitor.
*/
/** The owner's mark on a tab, an action or a card nobody else sees yet. */
@@ -23,6 +23,9 @@ export function OnlyYou({ className }: { className?: string }) {
return <span className={cn("inline-flex h-4 shrink-0 items-center rounded-[4px] bg-muted px-1 align-[1px] text-[10px] font-medium text-muted-foreground", className)}>Only you</span>;
}
+/** A feature's mark while it hasn't opened on this studio's GPU (OnlyYou for the owner, OwnSetupChip for a visitor). */
+export type FeatureMark = (f: GenjutsuFeature) => React.ReactNode;
+
/** Each character's colour: the number badge and the pin on the frame. */
export const PERSON_COLOURS = ["#e11d48", "#2563eb", "#16a34a", "#d97706"] as const;
@@ -76,7 +79,7 @@ export function WhoBecomesWho({
/** Opens the part's first frame for this character's tap (null while the frame can't be shown). */
onTap: ((i: number) => void) | null;
/** The Render choice shows (exactly 2 characters, and it is open to this viewer). */
- oneByOne: { show: boolean; ownerOnly: boolean };
+ oneByOne: { show: boolean; mark?: React.ReactNode };
seed: string;
onSeed: (s: string) => void;
}) {
@@ -116,7 +119,7 @@ export function WhoBecomesWho({
<p className="text-[12px] text-muted-foreground">Say where they stand or what they do. Clothes and hair words can carry over.</p>
</Field>
{oneByOne.show && (
- <Field label="Render" hint={oneByOne.ownerOnly ? <OnlyYou /> : undefined}>
+ <Field label="Render" hint={oneByOne.mark}>
<Segmented
label="Render"
value={value.onePerPerson ? "one" : "both"}
@@ -179,7 +182,7 @@ export function SceneEditFields({
action,
onAction,
open,
- ownerOnly,
+ mark,
painted,
target,
seed,
@@ -191,8 +194,8 @@ export function SceneEditFields({
action: SceneAction;
onAction: (a: SceneAction) => void;
open: FeatureCheck;
- /** Not open to everyone yet: the owner sees it with a badge. */
- ownerOnly: FeatureCheck;
+ /** A feature that hasn't opened on this studio's GPU: its mark (OnlyYou for the owner, OwnSetupChip for a visitor). */
+ mark: FeatureMark;
painted: boolean;
target: "type" | "paint" | "click" | undefined;
seed: string;
@@ -206,7 +209,7 @@ export function SceneEditFields({
return (
<div className="space-y-3">
{actions.length > 1 && (
- <Field label="Action" hint={ownerOnly(info.feature) ? <OnlyYou /> : undefined}>
+ <Field label="Action" hint={mark(info.feature)}>
<Segmented label="Action" value={action} onChange={onAction} options={actions.map((a) => ({ value: a.id, label: a.label }))} />
</Field>
)}
@@ -307,14 +310,14 @@ export function LightPicker({
value,
onChange,
open,
- ownerOnlyLight,
- ownerOnlyOwn,
+ lightMark,
+ ownMark,
}: {
value: PictureOptions;
onChange: (p: PictureOptions) => void;
open: FeatureCheck;
- ownerOnlyLight: boolean;
- ownerOnlyOwn: boolean;
+ lightMark?: React.ReactNode;
+ ownMark?: React.ReactNode;
}) {
const light = value.light;
const pick = (l: PictureOptions["light"]) => onChange({ ...value, light: l });
@@ -340,7 +343,7 @@ export function LightPicker({
return (
<div className="space-y-3">
{open("picture-light") && (
- <Field label="Light" hint={ownerOnlyLight ? <OnlyYou /> : undefined}>
+ <Field label="Light" hint={lightMark}>
<div role="radiogroup" aria-label="Light" className="grid grid-cols-3 gap-1.5 sm:grid-cols-4">
{!value.ownPerson && card("none", "As in your picture", !light, () => pick(undefined))}
{LIGHT_LOOKS.map((l) => card(l.id, l.name, !!light && "look" in light && light.look === l.id, () => pick({ look: l.id }), LOOK_SWATCH[l.id]))}
@@ -369,7 +372,7 @@ export function LightPicker({
checked={!!value.ownPerson}
onChange={(on) => onChange({ ...value, ownPerson: on || undefined, ...(on ? {} : { keepCrop: undefined }) })}
/>
- {ownerOnlyOwn && <OnlyYou className="ml-14" />}
+ {ownMark && <div className="ml-14">{ownMark}</div>}
{value.ownPerson && <SwitchRow label="Keep the frame's crop" checked={!!value.keepCrop} onChange={(on) => onChange({ ...value, keepCrop: on || undefined })} />}
</div>
)}
@@ -430,14 +433,14 @@ export function FinishFields({
value,
onChange,
open,
- ownerOnly,
+ mark,
seed,
onSeed,
}: {
value: FinishOptions;
onChange: (f: FinishOptions) => void;
open: FeatureCheck;
- ownerOnly: FeatureCheck;
+ mark: FeatureMark;
seed: string;
onSeed: (s: string) => void;
}) {
@@ -449,7 +452,7 @@ export function FinishFields({
return (
<div className="space-y-3">
{tools.length > 1 && (
- <Field label="Tool" hint={ownerOnly(value.tool === "faces" ? "finish-faces" : "finish-colours") ? <OnlyYou /> : undefined}>
+ <Field label="Tool" hint={mark(value.tool === "faces" ? "finish-faces" : "finish-colours")}>
<Segmented label="Tool" value={value.tool} onChange={(tool) => onChange({ tool })} options={tools.map(({ value: v, label }) => ({ value: v, label }))} />
</Field>
)}
diff --git a/src/components/swap-studio/stage-words.tsx b/src/components/swap-studio/stage-words.tsx
index a95c320a..e30bef56 100644
--- a/src/components/swap-studio/stage-words.tsx
+++ b/src/components/swap-studio/stage-words.tsx
@@ -38,7 +38,7 @@ function RoleSelect({ value, onChange, label, auto }: { value: SwapRole | null;
export function WordsStage({ id, project, clip, gens, estimate, edit }: StageProps) {
const transcribe = useTranscribe(id);
// "Clean the voice first": on for the clip's speech on your GPU, off in the cloud (a paid step there).
- const voiceFirstShown = useVoiceFirstShown();
+ const voiceFirstShown = useVoiceFirstShown(true);
const voiceFirstLive = useVoiceFirstLive();
const [voiceFirst, setVoiceFirst] = useState<boolean | null>(null);
const cleanFirst = voiceFirstShown && (voiceFirst ?? (project.engine === "open" && voiceFirstDefault("video", voiceFirstLive)));
diff --git a/src/lib/nav-model.ts b/src/lib/nav-model.ts
index 25189743..8d613762 100644
--- a/src/lib/nav-model.ts
+++ b/src/lib/nav-model.ts
@@ -351,7 +351,7 @@ const STUDIO_FEATURES: NavEntry[] = [
["insert", "Insert", "Add something to the shot", "insert add object put into clip place"],
] as const
).map(([id, label, what, kw]) => feature("genjutsu", "WandSparkles", id, `/genjutsu?mode=${id}`, label, what, kw)),
- feature("genjutsu", "WandSparkles", "picture", "/genjutsu?mode=picture", "From picture", "Your picture's setting, moving", "from picture photo setting animate motion", OWNER),
+ feature("genjutsu", "WandSparkles", "picture", "/genjutsu?mode=picture", "From picture", "Your picture's setting, moving", "from picture photo setting animate motion"),
feature("genjutsu", "WandSparkles", "finish", "/genjutsu?mode=finish", "Finish", "Fix faces and colours", "finish fix faces colours colors", FINISH_OPEN ? undefined : OWNER),
...(
[
diff --git a/src/lib/own-setup.ts b/src/lib/own-setup.ts
index bb13e23e..40830903 100644
--- a/src/lib/own-setup.ts
+++ b/src/lib/own-setup.ts
@@ -126,6 +126,15 @@ export function ownSetupOnly(modelOrAppId: string, engine?: Engine): OwnSetup |
return m ? ownSetupFor(m, engine) : null;
}
+/**
+ * An item's setup whatever its test says: for a surface that already knows, from the same flags, whether the item has
+ * opened on this studio's GPU (Genjutsu's live features, genjutsu-live.ts) and shows the label only until then. Null for
+ * an id this table doesn't hold.
+ */
+export function ownSetupItem(id: string): OwnSetup | null {
+ return ITEMS[id]?.setup ?? null;
+}
+
/** Every id this table holds (tests, and the hosted runs' checks). */
export const OWN_SETUP_IDS: readonly string[] = Object.keys(ITEMS);
diff --git a/src/server/genjutsu.ts b/src/server/genjutsu.ts
index 2341e7dc..688cd629 100644
--- a/src/server/genjutsu.ts
+++ b/src/server/genjutsu.ts
@@ -64,6 +64,7 @@ import { llmText, llmTextBackend } from "./enhance";
import { AccountRunError, ConnectComfyError, createGenerations, previewChained, previewGeneration } from "./generations";
import { db } from "./db";
import { genjutsuLive } from "./genjutsu-live";
+import { ownSetupItem } from "@/lib/own-setup";
import { decodePng } from "./png";
import { LOOK_IDS, paintKeyframe, type LookId, type PaintKeyframe } from "@/lib/openjutsu-graphs";
import { localLabel } from "./llm";
@@ -121,9 +122,14 @@ export interface GenjutsuBody {
finish?: FinishOptions;
}
-/** Who is asking: the owner sees and runs every feature; others only what has opened (src/server/genjutsu-live.ts). */
+/**
+ * Who is asking: the owner sees and runs every feature; others what has opened (src/server/genjutsu-live.ts), and with
+ * `ownSetup` (an account's run on its own GPU, account-tool-run.ts, or a price check) also what runs on a visitor's own
+ * setup until it opens (src/lib/own-setup.ts).
+ */
export interface GenjutsuViewer {
owner: boolean;
+ ownSetup?: boolean;
}
const OWNER: GenjutsuViewer = { owner: true };
@@ -252,11 +258,14 @@ interface Planned {
notes: string[];
}
-/** What this viewer may use: everything for the owner; for a guest or an account, what has opened. */
+/**
+ * What this viewer may use: everything for the owner; for a guest or an account, what has opened, and on its own setup
+ * the features that run there until they open (never on this studio's GPU: an account's steps go to its own GPU).
+ */
function openFor(viewer: GenjutsuViewer): FeatureCheck {
if (viewer.owner) return ALL_FEATURES;
const live = genjutsuLive();
- return (f) => live[f];
+ return (f) => live[f] || (!!viewer.ownSetup && !!ownSetupItem(`genjutsu:${f}`));
}
async function planInput(body: GenjutsuBody, opts: { probe: boolean; viewer?: GenjutsuViewer }): Promise<Planned> {
diff --git a/tests/account-genjutsu.test.ts b/tests/account-genjutsu.test.ts
index 63aecf33..093a5791 100644
--- a/tests/account-genjutsu.test.ts
+++ b/tests/account-genjutsu.test.ts
@@ -316,9 +316,11 @@ describe("an account runs Genjutsu on its own ComfyUI", () => {
expect((await other.json()).code).toBe("input-not-yours");
});
- it("From picture's describer stays closed to visitors until From picture opens; a first frame counts only for whoever made it", async () => {
+ it("From picture's describer runs on an account's own GPU before From picture opens here; a first frame counts only for whoever made it", async () => {
const r = await sceneRoute.POST(json("/api/genjutsu/scene", "POST", { engine: "open", source: { url: clip }, range: { start: 0, end: 6 }, ownPerson: true }, "a"));
- expect(r.status).toBe(422);
+ expect(r.status, await r.clone().text()).toBe(201);
+ // On its own ComfyUI, never the install's.
+ expect(fetched.filter((u) => !u.endsWith("/system_stats"))).toEqual([]);
// A first frame the owner made is no account's; the account's own is its own.
const frame = (account: string | null, url: string) => {
const t = Date.now();
diff --git a/tests/genjutsu-live.test.ts b/tests/genjutsu-live.test.ts
index 543eecf9..05ce4c14 100644
--- a/tests/genjutsu-live.test.ts
+++ b/tests/genjutsu-live.test.ts
@@ -52,8 +52,10 @@ describe("Genjutsu's live gate", () => {
expect(page).toContain("const live = genjutsuLive();");
// The page's mode examples are only the ones open to everyone (the owner's come from an owner-only route).
expect(page).toMatch(/<GenjutsuStudio examples=\{exampleRow\("tool:genjutsu"\)\} modeExamples=\{genjutsuExamples\(\(f\) => live\[f\]\)\} live=\{live\} \/>/);
- // The studio shows a feature when it is live or the viewer is the owner.
+ // The studio shows a feature when it is live, the viewer is the owner, or it runs on a visitor's own GPU until then
+ // (src/lib/own-setup.ts); its mark ("Only you", or what it runs on) shows until it is live.
const studio = fs.readFileSync(path.join(ROOT, "src/components/genjutsu/genjutsu-studio.tsx"), "utf8");
- expect(studio).toContain("const open: FeatureCheck = useCallback((f) => owner || !!live?.[f], [owner, live]);");
+ expect(studio).toContain("const open: FeatureCheck = useCallback((f) => owner || !!live?.[f] || !!ownSetupItem(`genjutsu:${f}`), [owner, live]);");
+ expect(studio).toContain("const mark = (f: GenjutsuFeature): React.ReactNode => (live?.[f] ? undefined : owner ? <OnlyYou /> : <OwnSetupChip setup={ownSetupItem(`genjutsu:${f}`)} />);");
});
});
diff --git a/tests/genjutsu-openjutsu-access.test.ts b/tests/genjutsu-openjutsu-access.test.ts
index 7926d37a..36657fc3 100644
--- a/tests/genjutsu-openjutsu-access.test.ts
+++ b/tests/genjutsu-openjutsu-access.test.ts
@@ -7,9 +7,9 @@ import { tempDir } from "./helpers/temp-dir";
vi.setConfig({ testTimeout: 60_000 });
/**
- * Genjutsu's Openjutsu modes under the owner's public sign-up rules: until a feature has passed its GPU test, a guest's or
- * an account's price check for it is refused in words (the tab isn't shown to them either); runs and From picture's
- * describer stay the owner's on this server, as every Genjutsu run.
+ * Genjutsu's Openjutsu modes under the owner's public sign-up rules: until a feature has passed its GPU test it runs for
+ * a visitor on its own GPU only (src/lib/own-setup.ts): a guest signs up first, an account without a GPU is asked to
+ * connect one, and this studio's own GPU never runs it for them.
*/
const dir = tempDir("fuobe-genjutsu-oj-access-");
process.env.FUOBE_DATA_DIR = dir;
@@ -68,16 +68,18 @@ const opened = () => [
];
describe("Genjutsu's Openjutsu features before and after they open", () => {
- it("a guest's and an account's price check is refused in words; the owner's goes through", async () => {
+ it("a guest's and an account's price check prices the run on their own setup; this studio's own runs still wait for the test", async () => {
process.env.FUOBE_PUBLIC_SIGNUP = "1";
const cookie = auth.createSession(auth.createAccount(`oj${++n}@example.com`, "long enough").id).value;
for (const b of bodies()) {
expect(passed(proxy(req("/api/genjutsu/estimate", { method: "POST" }))), b.mode).toBe(true);
for (const who of [undefined, cookie]) {
const r = await estimateRoute.POST(call("/api/genjutsu/estimate", b, who));
- expect(r.status, `${b.mode} ${who ? "account" : "guest"}`).toBe(422);
- expect((await r.json()).error).toBe(NOT_HERE);
+ const error = ((await r.json()) as { error?: string }).error ?? "";
+ expect(error, `${b.mode} ${who ? "account" : "guest"}`).not.toBe(NOT_HERE);
+ expect(error).not.toMatch(/isn['’]t available|not available/i);
}
+ // Without a visitor's own setup (this studio's GPU) a feature waits for its test, as before.
await expect(estimateGenjutsu(b as never, { owner: false })).rejects.toThrow(NOT_HERE);
// The owner sees and prices every feature.
const owner = await estimateGenjutsu(b as never, { owner: true }).catch((e: Error) => e);
@@ -175,7 +177,7 @@ describe("Genjutsu's Openjutsu features before and after they open", () => {
expect(say("/api/files/never-made.png")).toBe("Make and pick the first frame first");
});
- it("From picture's describer runs for an account (on its own GPU) only once From picture opens; a guest signs up first", async () => {
+ it("From picture's describer runs for an account on its own GPU before From picture opens here; a guest signs up first", async () => {
process.env.FUOBE_PUBLIC_SIGNUP = "1";
const id = auth.createAccount(`oj${++n}@example.com`, "long enough").id;
const cookie = auth.createSession(id).value;
@@ -189,18 +191,57 @@ describe("Genjutsu's Openjutsu features before and after they open", () => {
expect((await r.json()).code).toBe("connect-gpu");
}
expect(access.isPriceCheck("POST", "/api/genjutsu/scene", "")).toBe(false);
- // Behind the proxy the route refuses a guest, and an account's describer while From picture hasn't opened.
+ // Behind the proxy the route asks a guest to sign up.
const body = { engine: "open", source: { url: clip }, range: { start: 0, end: 6 }, ownPerson: true };
expect((await sceneRoute.POST(call("/api/genjutsu/scene", body))).status).toBe(401);
const { runAsTenant } = await import("@/server/tenant");
const own = runAsTenant({ kind: "account", id }, () => saveFile({ data: fs.readFileSync(path.join(__dirname, "fixtures/shorts-12s.mp4")), contentType: "video/mp4", source: "upload", name: "mine.mp4" }).url);
globalThis.__fuobeTestDiskFree = 1e13;
try {
+ // Before From picture opens here too, an account without a GPU gets "Connect your GPU", never a refusal.
const r = await sceneRoute.POST(call("/api/genjutsu/scene", { ...body, source: { url: own } }, cookie));
- if (!genjutsuLive().picture) {
- expect(r.status).toBe(422);
- expect((await r.json()).error).toBe(NOT_HERE);
+ expect(r.status).toBe(403);
+ expect(r.headers.get(access.CONNECT_GPU_HEADER)).toBe("1");
+ const j = (await r.json()) as { code?: string; error?: string };
+ expect(j.code).toBe("connect-gpu");
+ expect(j.error).not.toBe(NOT_HERE);
+ } finally {
+ globalThis.__fuobeTestDiskFree = undefined;
+ }
+ });
+});
+
+describe("Genjutsu's features that run on a visitor's own setup until they open here", () => {
+ it("asks an account without a GPU to connect one (never a refusal), for a run and for Clean the voice first", async () => {
+ process.env.FUOBE_PUBLIC_SIGNUP = "1";
+ const genjutsuRoute = await import("@/app/api/genjutsu/route");
+ const transcribeRoute = await import("@/app/api/genjutsu/transcribe/route");
+ const { ownSetupOnly } = await import("@/lib/own-setup");
+ const id = auth.createAccount(`oj${++n}@example.com`, "long enough").id;
+ const cookie = auth.createSession(id).value;
+ const { runAsTenant } = await import("@/server/tenant");
+ const own = runAsTenant({ kind: "account", id }, () => saveFile({ data: fs.readFileSync(path.join(__dirname, "fixtures/shorts-12s.mp4")), contentType: "video/mp4", source: "upload", name: "mine.mp4" }).url);
+ const mine = (b: ReturnType<typeof bodies>[number]) => JSON.parse(JSON.stringify(b).split(clip).join(own)) as typeof b;
+ const connect = async (r: Response, what: string) => {
+ const j = (await r.json()) as { code?: string; error?: string };
+ expect(r.status, `${what}: ${j.error}`).toBe(403);
+ expect(j.code, what).toBe("connect-gpu");
+ expect(r.headers.get(access.CONNECT_GPU_HEADER), what).toBe("1");
+ expect(j.error ?? "", what).not.toMatch(/isn['’]t available|not available|untested|validat/i);
+ };
+ globalThis.__fuobeTestDiskFree = 1e13;
+ try {
+ const live = genjutsuLive();
+ for (const b of bodies()) {
+ await connect(await genjutsuRoute.POST(call("/api/genjutsu", mine(b), cookie)), b.mode);
+ }
+ // Every feature these runs need is marked for visitors until it opens here.
+ for (const f of ["finish-faces", "picture", "object-remove", "object-background", "group-swap-one-by-one"] as const) {
+ if (!live[f]) expect(ownSetupOnly(`genjutsu:${f}`), f).not.toBeNull();
}
+ await connect(await transcribeRoute.POST(call("/api/genjutsu/transcribe", { engine: "open", source: { url: own }, cleanVoiceFirst: true }, cookie)), "clean the voice first");
+ // A guest signs up first.
+ expect((await transcribeRoute.POST(call("/api/genjutsu/transcribe", { engine: "open", source: { url: own }, cleanVoiceFirst: true }))).status).toBe(401);
} finally {
globalThis.__fuobeTestDiskFree = undefined;
}
diff --git a/tests/nav-areas.test.ts b/tests/nav-areas.test.ts
index 62f6c7d4..e6b0dfd6 100644
--- a/tests/nav-areas.test.ts
+++ b/tests/nav-areas.test.ts
@@ -127,7 +127,7 @@ describe("/studios", () => {
expect(subsOf("film", "video-tools")).not.toContain("video-tools-matte"); // Video tools' first mode is the studio's own page
// Ads Studio is a studio with a card or pill of its own here: Marketing Studio's row has the other two.
expect(subsOf("sell", "marketing")).toEqual(["marketing-click-to-ad", "ads-multiplier"]);
- expect(subsOf("people", "genjutsu")).toEqual(["genjutsu-motion", "genjutsu-character", "genjutsu-swap", "genjutsu-restyle", "genjutsu-insert", "genjutsu-finish"]);
+ expect(subsOf("people", "genjutsu")).toEqual(["genjutsu-motion", "genjutsu-character", "genjutsu-swap", "genjutsu-restyle", "genjutsu-insert", "genjutsu-picture", "genjutsu-finish"]);
expect(subsOf("people", "character-sheet")).toEqual(["character-sheet-reference", "character-sheet-cast", "character-sheet-describe"]);
expect(subsOf("sound", "audio")).not.toContain("audio-music"); // a card of its own
for (const s of sections) {
@@ -137,7 +137,7 @@ describe("/studios", () => {
for (const c of s.chips) expect(s.cards.map((x) => entry(x)!.href), `${s.id}: ${c}`).not.toContain(entry(c)!.href);
for (const x of s.subs ?? []) for (const c of x.ids) expect(hrefs.has(entry(c)!.href), `${s.id}: ${c}`).toBe(false);
}
- // The owner's own (Genjutsu's From picture) are theirs alone; Cinema Studio's Blockout is everyone's.
+ // Genjutsu's From picture (it runs on a visitor's own GPU) and Cinema Studio's Blockout are linked for everyone.
const owner = areaSections("studios", "owner");
expect(owner.find((s) => s.id === "people")!.subs!.find((x) => x.parent === "genjutsu")!.ids).toContain("genjutsu-picture");
expect(owner.find((s) => s.id === "film")!.subs!.find((x) => x.parent === "cinema")!.ids).toEqual(["cinema-blockout"]);
diff --git a/tests/nav-bar.test.ts b/tests/nav-bar.test.ts
index a2f056a9..efd80a64 100644
--- a/tests/nav-bar.test.ts
+++ b/tests/nav-bar.test.ts
@@ -172,7 +172,7 @@ describe("the launcher's columns", () => {
.find((e) => e.id === id)
?.subs?.map((s) => s.label);
expect(subs("marketing")).toEqual(["Click to Ad", "Ads Studio", "Ad Multiplier"]);
- expect(subs("genjutsu")).toEqual(["Motion transfer", "Character swap", "Object swap", "Restyle", "Insert", "Finish"]);
+ expect(subs("genjutsu")).toEqual(["Motion transfer", "Character swap", "Object swap", "Restyle", "Insert", "From picture", "Finish"]);
expect(subs("upscale")).toEqual(["Image", "Video", "FPS Boost", "SDR to HDR", "Export"]);
expect(subs("audio")).toEqual(["Speech", "Dialogue", "Voice change", "See all 15"]);
expect(subs("video-tools")).toEqual(["Relight", "Captions", "Remove object", "See all 11"]);
diff --git a/tests/nav-subfeatures.test.ts b/tests/nav-subfeatures.test.ts
index 0f53547b..a557a84e 100644
--- a/tests/nav-subfeatures.test.ts
+++ b/tests/nav-subfeatures.test.ts
@@ -116,7 +116,7 @@ describe("the catalogue of studio features", () => {
describe("who sees a studio's features", () => {
it("keeps the owner's own modes the owner's, in every place", () => {
- for (const id of ["genjutsu-picture", "canvas-skills", "assist-memory", "assist-scheduled", "video-tools-restore"]) {
+ for (const id of ["canvas-skills", "assist-memory", "assist-scheduled", "video-tools-restore"]) {
expect(entry(id)!.visibility, id).toEqual(["owner"]);
for (const kind of VISITORS) expect(entriesFor(kind).some((e) => e.id === id), `${kind}: ${id}`).toBe(false);
}
@@ -160,6 +160,15 @@ describe("who sees a studio's features", () => {
}
});
+ it("links Genjutsu's From picture for everyone: it runs on a visitor's own GPU until it opens here", () => {
+ const picture = entry("genjutsu-picture")!;
+ expect(picture.visibility).toBeUndefined();
+ for (const kind of VISITORS) {
+ expect(visibleTo(picture, kind), kind).toBe(true);
+ expect(studioSubs("genjutsu", kind, "sheet").some((e) => e.id === picture.id), kind).toBe(true);
+ }
+ });
+
it("links a feature a visitor may open but not run here (its page says so) in the menus and sheets for the owner only", () => {
for (const id of OWNER_RUNS) {
for (const kind of VISITORS) {
@@ -218,7 +227,7 @@ describe("finding a studio's features", () => {
const inside = (kind: ViewerKind | undefined, q: string) => find(kind, q).groups[0];
expect(find("guest", "genjutsu").best[0]).toMatchObject({ id: "genjutsu" });
expect(inside("guest", "genjutsu")).toMatchObject({ label: "In Genjutsu" });
- expect(inside("guest", "genjutsu").hits.map((h) => h.label)).toEqual(["Motion transfer", "Character swap", "Object swap", "Restyle", "Insert", "Finish"]);
+ expect(inside("guest", "genjutsu").hits.map((h) => h.label)).toEqual(["Motion transfer", "Character swap", "Object swap", "Restyle", "Insert", "From picture", "Finish"]);
expect(inside("owner", "genjutsu").hits.map((h) => h.label)).toEqual(["Motion transfer", "Character swap", "Object swap", "Restyle", "Insert", "From picture", "Finish"]);
expect(inside("guest", "character sheet").hits.map((h) => h.label)).toEqual(["From Reference", "Build from scratch", "From a description"]);
// Not a tab that is the studio's own page (Upscale's Image), nor one already among the best matches.
diff --git a/tests/phone-nav.test.ts b/tests/phone-nav.test.ts
index c019844e..e117fe07 100644
--- a/tests/phone-nav.test.ts
+++ b/tests/phone-nav.test.ts
@@ -250,9 +250,9 @@ describe("the Studios sheet", () => {
expect(pills(sell)).toEqual(["Click to Ad", "Ad Multiplier"]);
expect(words(sell)).toContain("Marketing Studio");
const people = at("/", () => sheet({ group: "people" }));
- expect(pills(people)).toEqual(["Motion transfer", "Character swap", "Object swap", "Restyle", "Insert", "Finish"]);
+ expect(pills(people)).toEqual(["Motion transfer", "Character swap", "Object swap", "Restyle", "Insert", "From picture", "Finish"]);
// Pages that say "isn't available here" to a visitor, and the owner's own modes, aren't linked for them.
- for (const w of ["From a selfie", "From Reference", "From picture", "Split soundtrack", "Remove dialogue"]) {
+ for (const w of ["From a selfie", "From Reference", "Split soundtrack", "Remove dialogue"]) {
for (const g of LAUNCHER_GROUPS) expect(pills(at("/", () => sheet({ group: g.id }))), `${g.id}: ${w}`).not.toContain(w);
}
// Cinema Studio's Blockout is linked for everyone (a guest is offered a free account on a run).