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.

Keep Remove a person and Clean up dialogue out of visitors' menus

Adarshe810bc82b5d6
diff --git a/docs/public-signup.md b/docs/public-signup.md
index ce41e779..3b2dfb00 100644
--- a/docs/public-signup.md
+++ b/docs/public-signup.md
@@ -204,8 +204,9 @@ cloudflared tunnel --url http://localhost:8188 # or: ngrok http 8188
video (`POST /api/turnaround`), though their price checks work, priced for the account's own
GPU. Split soundtrack's and Remove dialogue's pages say so up front ("Split soundtrack isn't
available here", "Remove dialogue isn't available here"), with their upload and run off. Result
- menus don't offer Remove dialogue to a guest or an account. Restore & colourise is left out of the
- Video tools tabs and the result menus for them.
+ menus don't offer Remove dialogue or Clean up dialogue to a guest or an account. Restore & colourise
+ and Remove a person (its mask preview and "Redo from here", `POST /api/remove-object/preview` and
+ `/reroll`, answer `own-gpu-tool` too) are left out of the Video tools tabs and the result menus for them.
- **Files a run takes.** A run on your GPU takes only files you uploaded here, or your own results.
A link or a `data:` URI answers 400 with `code: "input-not-allowed"`, someone else's file 403
(`input-not-yours`), and a file that has expired 404 (`input-gone`, "That file has expired.
diff --git a/src/components/cinema/cinema-feed.tsx b/src/components/cinema/cinema-feed.tsx
index ac21c231..1b7ec07b 100644
--- a/src/components/cinema/cinema-feed.tsx
+++ b/src/components/cinema/cinema-feed.tsx
@@ -28,6 +28,7 @@ import {
} from "lucide-react";
import { useQueryClient } from "@tanstack/react-query";
import Link from "next/link";
+import { useLikelyVisitor } from "@/lib/api";
import { useCallback, useEffect, useMemo, useState, useSyncExternalStore } from "react";
import { toast } from "sonner";
import { Checkbox } from "@/components/ui/checkbox";
@@ -189,6 +190,8 @@ export function deleteLabel(g: CinemaGeneration): string {
function TileMenu({ u, folders, projectId, handlers, onDelete }: { u: Unit; folders: CinemaFolder[]; projectId: string; handlers: FeedHandlers; onDelete: (ids: string[]) => void }) {
const actions = useItemActions(projectId);
+ // Remove a person runs on a self-hosted Fuobe only: a guest or an account isn't sent there.
+ const visitor = useLikelyVisitor();
const o = u.output;
const elsewhere = foreign(u.g, projectId);
return (
@@ -241,11 +244,13 @@ function TileMenu({ u, folders, projectId, handlers, onDelete }: { u: Unit; fold
<DropdownMenuItem onClick={() => handlers.onReference(o.url, "video")}>
<ImagePlus /> Use as reference clip
</DropdownMenuItem>
- <DropdownMenuItem asChild>
- <Link href={`/video-tools/remove-person?video=${encodeURIComponent(o.url)}`}>
- <UserX /> Remove a person
- </Link>
- </DropdownMenuItem>
+ {!visitor && (
+ <DropdownMenuItem asChild>
+ <Link href={`/video-tools/remove-person?video=${encodeURIComponent(o.url)}`}>
+ <UserX /> Remove a person
+ </Link>
+ </DropdownMenuItem>
+ )}
</>
)}
{u.scene
diff --git a/src/components/studio/composer.tsx b/src/components/studio/composer.tsx
index a1707ced..152a3569 100644
--- a/src/components/studio/composer.tsx
+++ b/src/components/studio/composer.tsx
@@ -23,7 +23,7 @@ import { quoteBody, useHostedQuote, useSettled, type RunOn } from "@/lib/hosted"
import { ExactOrbitControls } from "@/components/exact-orbit-controls";
import { useFlyAround } from "@/components/fly-around-run";
import { exactDefaults, takesExact, type ExactOrbit } from "@/lib/exact-orbit";
-import { CONNECT_GPU_EVENT, enhance, useClipFacts, useCreateGeneration, useElements, useEngine, useHydrated, useIsOwner, useStatus } from "@/lib/api";
+import { CONNECT_GPU_EVENT, enhance, useClipFacts, useCreateGeneration, useElements, useEngine, useHydrated, useIsOwner, useLikelyVisitor, useStatus } from "@/lib/api";
import { usePagePlace } from "@/components/gpu/use-page-place";
import { applyMentions, elementsNote, type StudioElement } from "@/lib/catalog/elements";
import { applySketch, stripMotionPaths } from "@/lib/catalog/sketch";
@@ -229,6 +229,7 @@ export function Composer({ docked }: { docked: boolean }) {
const catalog = useCatalog();
const presetUrl = usePresetUrl();
const [engine, setEngine, engineMode] = useEngine();
+ const visitor = useLikelyVisitor();
const create = useCreateGeneration();
const [enhancing, setEnhancing] = useState(false);
const [focused, setFocused] = useState(false);
@@ -1036,7 +1037,10 @@ export function Composer({ docked }: { docked: boolean }) {
else if (framesGap) framesNotice = { text: `${framesGap}.`, tone: "warn" };
else if (note) framesNotice = { text: note, tone: "info", action };
else if (animationTiming && model.engine === "cloud")
- framesNotice = { text: "In the cloud each gap is one clip with every frame kept, played at 16 fps. Faster speeds and 24 fps playback are on your GPU, free.", tone: "info" };
+ framesNotice = {
+ text: `In the cloud each gap is one clip with every frame kept, played at 16 fps.${!visitor && engineMode === "both" ? " Faster speeds and 24 fps playback are on your GPU, free." : ""}`,
+ tone: "info",
+ };
}
// Style: Animation, in Frames mode: Fuobe Animation (when it's on in this install), and back to the engine's frames model.
const animationModel = config.frames && catalog.offered("fuobe-animation", engine) ? catalog.getModel("fuobe-animation") : undefined;
diff --git a/src/components/studio/frames-strip.tsx b/src/components/studio/frames-strip.tsx
index c9ad47d0..82b8ac0b 100644
--- a/src/components/studio/frames-strip.tsx
+++ b/src/components/studio/frames-strip.tsx
@@ -25,7 +25,7 @@ import {
type PlaybackFps,
} from "@/lib/inbetween";
import type { Engine } from "@/lib/catalog/types";
-import { useAskBeforeUpload } from "@/lib/api";
+import { useAskBeforeUpload, useEngine, useLikelyVisitor } from "@/lib/api";
import { FRAMES_HINT, frameRange, frameRole, frameTimes, KEYFRAME_SNAP, MAX_KEYFRAMES, secondsLabel } from "@/lib/catalog/keyframes";
import type { FrameAttachment } from "@/lib/composer";
import { cn } from "@/lib/utils";
@@ -437,6 +437,10 @@ function Ruler({
function GapChip({ index, gap, fps, engine, onChange }: { index: number; gap: GapTiming; fps: PlaybackFps; engine: Engine; onChange: (g: GapTiming) => void }) {
const can = ENGINE_TIMING[engine];
const name = `keyframes ${index + 1} and ${index + 2}`;
+ // The GPU-only speeds are pointed out only where the GPU is there to switch to (the owner, both engines on).
+ const visitor = useLikelyVisitor();
+ const engineMode = useEngine()[2];
+ const gpuHint = !visitor && engineMode === "both";
return (
<Popover>
<PopoverTrigger asChild>
@@ -479,7 +483,7 @@ function GapChip({ index, gap, fps, engine, onChange }: { index: number; gap: Ga
role="radio"
aria-checked={gap.speed === sp}
disabled={!allowed}
- title={allowed ? undefined : "On your GPU"}
+ title={allowed || !gpuHint ? undefined : "On your GPU"}
onClick={() => onChange({ ...gap, speed: sp })}
className={cn("h-6 min-w-8 rounded-full px-1.5 text-[12px] font-medium tabular-nums disabled:opacity-40", gap.speed === sp ? "bg-background shadow-soft" : "hover:bg-background/60")}
>
@@ -490,7 +494,7 @@ function GapChip({ index, gap, fps, engine, onChange }: { index: number; gap: Ga
</div>
</div>
<p className="text-[11px] leading-snug text-muted-foreground">
- {engine === "open" ? "Faster keeps every 2nd, 3rd or 4th frame, for a snappier move." : "In the cloud every frame is kept. ×2–×4 are on your GPU."} This gap plays for {lengthLabel(gapSeconds(gap, fps))}.
+ {engine === "open" ? "Faster keeps every 2nd, 3rd or 4th frame, for a snappier move." : `In the cloud every frame is kept.${gpuHint ? " ×2–×4 are on your GPU." : ""}`} This gap plays for {lengthLabel(gapSeconds(gap, fps))}.
</p>
</div>
<label className="block space-y-1">
diff --git a/src/lib/output-actions.ts b/src/lib/output-actions.ts
index dd2ef06e..db5d9fe5 100644
--- a/src/lib/output-actions.ts
+++ b/src/lib/output-actions.ts
@@ -98,7 +98,7 @@ export interface ActionContext {
}
/** Hand-offs to tools a guest or an account can't open (they run on a self-hosted Fuobe only). */
-const OWNER_ONLY_ACTIONS: ReadonlySet<OutputActionId> = new Set<OutputActionId>(["restore-video", "remove-dialogue"]);
+const OWNER_ONLY_ACTIONS: ReadonlySet<OutputActionId> = new Set<OutputActionId>(["restore-video", "remove-dialogue", "remove-person", "clean-dialogue"]);
const q = (url: string) => encodeURIComponent(url);
diff --git a/tests/regenerate-offered.test.ts b/tests/regenerate-offered.test.ts
index a94a9ec9..aee18c1a 100644
--- a/tests/regenerate-offered.test.ts
+++ b/tests/regenerate-offered.test.ts
@@ -87,8 +87,17 @@ describe("tools a guest or an account can't open", () => {
expect(ids(upload(), { visitor: true })).not.toContain("restore-video");
});
- it("leaves only Restore & colourise's Video tools tab out for a visitor: Remove dialogue's page says it isn't available here", () => {
+ it("leaves Remove a person and Clean up dialogue out of a visitor's result menus, and keeps them for the owner", () => {
+ // An uploaded clip gets both (a clip with sound).
+ expect(ids(upload())).toEqual(expect.arrayContaining(["remove-person", "clean-dialogue"]));
+ const visitor = ids(upload(), { visitor: true });
+ expect(visitor).not.toContain("remove-person");
+ expect(visitor).not.toContain("clean-dialogue");
+ expect(ids(gen(), { visitor: true })).not.toContain("remove-person");
+ });
+
+ it("leaves Restore & colourise's and Remove a person's Video tools tabs out for a visitor: Remove dialogue's page says it isn't available here", () => {
const tabs = Object.fromEntries(HUB_MODES["video-tools"].map((m) => [m.id, m.ownerOnly ?? false]));
- expect(tabs).toMatchObject({ restore: true, "remove-dialogue": false, matte: false, evolution: false });
+ expect(tabs).toMatchObject({ restore: true, "remove-person": true, "remove-dialogue": false, matte: false, evolution: false });
});
});