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.

Tool pages say "Free" for runs on this install's GPUs

Adarshed200bfa4ada
diff --git a/docs/public-signup.md b/docs/public-signup.md
index 8a4b16ab..a3e0025c 100644
--- a/docs/public-signup.md
+++ b/docs/public-signup.md
@@ -713,6 +713,10 @@ With it on:
- A run on this install's GPUs that failed on the person's own files ("A clip or sound in this run couldn't be read.",
"This run couldn't finish with these files or settings.") offers **Reuse** first (the draft comes back to change),
and Retry second.
+- Tool pages (Cinema, Turnaround, Fly-around, Character Swap Studio, Faceless, Content Factory, Genjutsu, Mixed
+ Media, Speech edit, Design a voice) say "Free" for an open run that goes to this install's GPUs, and show that
+ run's price and wait where their price check gives it (`toolPoolPrice`). "Free · your GPU" stays for runs that go
+ to the person's own GPU (`openFreeWords` in `src/lib/run-place.ts`).
- When a billing service names the models that may run on the studio's GPUs, that applies to every model a run uses,
not only its main one.
- An account can upload pictures for these runs. Clips and sound go to the workers only when the install allows them
diff --git a/src/components/audio-tools/design-voice-tool.tsx b/src/components/audio-tools/design-voice-tool.tsx
index ce09f8d9..3d5ad829 100644
--- a/src/components/audio-tools/design-voice-tool.tsx
+++ b/src/components/audio-tools/design-voice-tool.tsx
@@ -1,5 +1,6 @@
"use client";
+import { useOpenFree } from "@/components/studio/run-place-chip";
import { AudioLines, Check, Loader2, Mic, RotateCcw, Save, Sparkles } from "lucide-react";
import Link from "next/link";
import { useMemo, useState } from "react";
@@ -127,6 +128,7 @@ function Take({ g, index, description, line, canSave }: { g: Generation; index:
}
export function DesignVoiceTool() {
+ const openFree = useOpenFree();
const [engine, setEngine, mode] = useEngine();
const visitor = useIsVisitor();
const create = useCreateGeneration();
@@ -143,7 +145,7 @@ export function DesignVoiceTool() {
const model = modelId ? getModel(modelId) : undefined;
const blocker = designBlocker(key, engine) ?? (!description ? "Describe the voice, or pick a few chips" : !line.trim() ? "Write a line for it to say" : null);
const usd = model ? stepCostUsd(model, { feature: VOICE_FEATURE, modelId: model.id, prompt: line }) : null;
- const price = money(engine, usd === null ? null : usd * VOICE_TAKES);
+ const price = openFree(money(engine, usd === null ? null : usd * VOICE_TAKES));
const all = useGenerations({ features: [VOICE_FEATURE], limit: 24 });
const takes = useMemo(() => {
diff --git a/src/components/audio-tools/speech-edit-tool.tsx b/src/components/audio-tools/speech-edit-tool.tsx
index 8f784f26..1845f4a0 100644
--- a/src/components/audio-tools/speech-edit-tool.tsx
+++ b/src/components/audio-tools/speech-edit-tool.tsx
@@ -1,5 +1,6 @@
"use client";
+import { useOpenFree } from "@/components/studio/run-place-chip";
import { AudioLines, Clapperboard, Cpu, Download, FileVideo, Library, Loader2, Mic2, RotateCcw, Sparkles, Upload, X } from "lucide-react";
import Link from "next/link";
import { nanoid } from "nanoid";
@@ -270,6 +271,7 @@ function EffectOptions({ effect, onChange }: { effect: SpeechEffect; onChange: (
* GPU, when the label leaves; left out, the static entry.
*/
export function SpeechEditTool({ setup }: { setup?: OwnSetup | null } = {}) {
+ const openFree = useOpenFree();
const item = setup === undefined ? OWN_SETUP : setup;
const [engine, setEngine, mode] = useEngine();
// A guest or an account: its own setup's label beside the title (after hydration, so it matches the server HTML),
@@ -427,7 +429,7 @@ export function SpeechEditTool({ setup }: { setup?: OwnSetup | null } = {}) {
{source && engine === "open" && !cues && (
<Panel title="1 · Transcribe">
<div className="flex flex-wrap items-center gap-3">
- <p className="min-w-0 flex-1 text-[13px] text-muted-foreground">Fuobe writes down what was said, line by line, so you can change it like text. Free on your GPU.</p>
+ <p className="min-w-0 flex-1 text-[13px] text-muted-foreground">Fuobe writes down what was said, line by line, so you can change it like text. {openFree("Free on your GPU.")}</p>
<Button className="rounded-full" onClick={transcribe} disabled={!ready || transcribing}>
{transcribing ? <Loader2 className="size-4 animate-spin" /> : <Sparkles className="size-4" />} Transcribe
</Button>
diff --git a/src/components/cinema/blockout-panel.tsx b/src/components/cinema/blockout-panel.tsx
index bb45e6d1..98f93685 100644
--- a/src/components/cinema/blockout-panel.tsx
+++ b/src/components/cinema/blockout-panel.tsx
@@ -1,5 +1,6 @@
"use client";
+import { useOpenFree } from "@/components/studio/run-place-chip";
import { Box, Clapperboard, Layers, Loader2, Plus, RotateCcw, Trash2, Upload, Volume2, VolumeX } from "lucide-react";
import { nanoid } from "nanoid";
import Link from "next/link";
@@ -185,6 +186,7 @@ export interface BlockoutPanelProps {
export function BlockoutPanel(props: BlockoutPanelProps) {
const { open, onOpenChange, projectId, folderId, engine, settings, brief, context, draft, setDraft, onBuild } = props;
+ const openFree = useOpenFree();
const generate = useCinemaGenerate(projectId);
const status = useStatus().data;
const demo = placeholdersOn(status?.demoMode);
@@ -204,7 +206,7 @@ export function BlockoutPanel(props: BlockoutPanelProps) {
const seconds = s?.seconds ?? 0;
const set = (patch: Partial<BlockoutDraft>) => setDraft((d) => ({ ...d, ...patch }));
const cost = plan.costUsd;
- const price = demo ? "Placeholder · free" : cost === 0 ? (engine === "open" ? "Free · your GPU" : "Free") : cost != null ? `≈ ${formatCost(cost)}` : "Price unknown";
+ const price = demo ? "Placeholder · free" : cost === 0 ? (engine === "open" ? openFree("Free · your GPU") : "Free") : cost != null ? `≈ ${formatCost(cost)}` : "Price unknown";
const model = getModel(engine === "cloud" ? draft.modelId : BLOCKOUT_MODELS.open);
const resolutions = engine === "cloud" ? (getModel(draft.modelId)?.options.resolutions ?? []) : ["480p", "720p"];
const resolution = draft.resolution && resolutions.some((r) => r.toLowerCase() === draft.resolution!.toLowerCase()) ? draft.resolution : (engine === "cloud" ? getModel(draft.modelId)?.defaults?.resolution : "480p");
diff --git a/src/components/cinema/scene-actions.tsx b/src/components/cinema/scene-actions.tsx
index 6bb1c2fd..066fb4f4 100644
--- a/src/components/cinema/scene-actions.tsx
+++ b/src/components/cinema/scene-actions.tsx
@@ -1,5 +1,6 @@
"use client";
+import { useOpenFree } from "@/components/studio/run-place-chip";
import { Box } from "lucide-react";
import { useId, useMemo, useState } from "react";
import { Button } from "@/components/ui/button";
@@ -48,7 +49,8 @@ export function usePlanPrice(plan: CinemaPlan): { cost: number | null; label: st
const demo = placeholdersOn(status?.demoMode);
const cost = demo ? 0 : plan.costUsd;
// Free on the GPU says where it runs, like every other price on it.
- const free = plan.model.engine === "open" ? "Free · your GPU" : "Free";
+ const openFree = useOpenFree();
+ const free = plan.model.engine === "open" ? openFree("Free · your GPU") : "Free";
return { cost, demo, label: demo ? "Placeholder · free" : cost === 0 ? free : cost != null ? `≈ ${formatCost(cost)}` : "Price unknown" };
}
diff --git a/src/components/cinema/soul-builders.tsx b/src/components/cinema/soul-builders.tsx
index 3443bec0..f0178fbd 100644
--- a/src/components/cinema/soul-builders.tsx
+++ b/src/components/cinema/soul-builders.tsx
@@ -1,5 +1,6 @@
"use client";
+import { useOpenFree } from "@/components/studio/run-place-chip";
import { Check, Loader2, MapPin, RotateCcw, Shuffle, Sparkles, UserRoundPlus } from "lucide-react";
import { useRouter } from "next/navigation";
import { useMemo, useState } from "react";
@@ -204,9 +205,10 @@ function useBuilderRun(projectId: string) {
/** A builder's price: "Free · your GPU" on the GPU, like every other price on it. */
function CostLabel({ plan }: { plan: { costUsd: number | null; model: { engine: Engine } } }) {
+ const openFree = useOpenFree();
const status = useStatus().data;
const demo = placeholdersOn(status?.demoMode);
- return <span className="font-mono text-[12px] whitespace-nowrap text-muted-foreground">{demo ? "Placeholder · free" : plan.costUsd === 0 ? (plan.model.engine === "open" ? "Free · your GPU" : "Free") : plan.costUsd != null ? `≈ ${formatCost(plan.costUsd)}` : ""}</span>;
+ return <span className="font-mono text-[12px] whitespace-nowrap text-muted-foreground">{demo ? "Placeholder · free" : plan.costUsd === 0 ? (plan.model.engine === "open" ? openFree("Free · your GPU") : "Free") : plan.costUsd != null ? `≈ ${formatCost(plan.costUsd)}` : ""}</span>;
}
function SaveElement({ kind, defaultName, picked, description, onSaved }: { kind: "character" | "location"; defaultName: string; picked: string[]; description: string; onSaved: () => void }) {
diff --git a/src/components/content-factory/parts.tsx b/src/components/content-factory/parts.tsx
index 71e154f3..1c6516cc 100644
--- a/src/components/content-factory/parts.tsx
+++ b/src/components/content-factory/parts.tsx
@@ -1,5 +1,6 @@
"use client";
+import { useOpenFree } from "@/components/studio/run-place-chip";
import { AlertTriangle, Check, ChevronDown, Copy, Film, Info, Loader2, Pencil, RotateCcw, Sparkles, Terminal, X } from "lucide-react";
import Link from "next/link";
import { useQuery } from "@tanstack/react-query";
@@ -299,10 +300,11 @@ export function PresetTile({ p, on, tabStop, onPick }: { p: StylePreset; on: boo
* "≈ $4.20 · 3 episodes × $1.40" / "Placeholder · free" / "Free · your GPU", with the research's pricing note.
*/
export function SeriesPriceLine({ data, loading, engine, className }: { data: SeriesEstimate | undefined; loading?: boolean; engine: Engine; className?: string }) {
+ const openFree = useOpenFree();
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 ? "Placeholder · free" : engine === "open" ? "Free · your GPU" : `≈ ${usd(p.total)}${p.unknown ? "+" : ""}${each}`;
+ const price = data.demo ? "Placeholder · free" : engine === "open" ? openFree("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/faceless/controls.tsx b/src/components/faceless/controls.tsx
index 3e425dbc..6b073e97 100644
--- a/src/components/faceless/controls.tsx
+++ b/src/components/faceless/controls.tsx
@@ -1,5 +1,6 @@
"use client";
+import { useOpenFree } from "@/components/studio/run-place-chip";
import { AlertTriangle, Info, Loader2 } from "lucide-react";
import { useId, useState } from "react";
import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover";
@@ -81,9 +82,10 @@ export const usd = (n: number) => (n >= 10 ? `$${n.toFixed(0)}` : `$${n.toFixed(
* the viewer's own GPU (an account's own ComfyUI), free.
*/
export function EstimateLine({ data, loading, engine, className, quiet }: { data: EstimateResult | undefined; loading?: boolean; engine: Engine; className?: string; quiet?: boolean }) {
+ const openFree = useOpenFree();
const [open, setOpen] = useState(false);
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 ? "Placeholder · free" : engine === "open" ? "Free · your GPU" : `≈ ${usd(data.estimate.total)}${data.estimate.unknown ? "+" : ""}`;
+ const price = data.demo ? "Placeholder · free" : engine === "open" ? openFree("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/episode-view.tsx b/src/components/faceless/episode-view.tsx
index 3ba1381c..160afe4d 100644
--- a/src/components/faceless/episode-view.tsx
+++ b/src/components/faceless/episode-view.tsx
@@ -1,5 +1,6 @@
"use client";
+import { useOpenFree } from "@/components/studio/run-place-chip";
import {
AlertTriangle,
ArrowLeft,
@@ -223,6 +224,7 @@ const PART_OPTIONS: { value: ChangePart; label: string }[] = [
/** Change the selected scenes: describe the change, see what re-runs and the price, apply or discard. */
function SceneEditor({ view, scenes, onClose, onOpen }: { view: View; scenes: SceneRow[]; onClose: () => void; onOpen: (g: Generation) => void }) {
+ const openFree = useOpenFree();
const ep = view.episode;
const [part, setPart] = useState<ChangePart>("picture");
const [instruction, setInstruction] = useState("");
@@ -350,7 +352,7 @@ function SceneEditor({ view, scenes, onClose, onOpen }: { view: View; scenes: Sc
: preview.isError
? (preview.error as Error).message
: preview.data
- ? `Re-renders ${preview.data.labels.length} step${preview.data.labels.length === 1 ? "" : "s"} (${stepWords(preview.data.labels)})${preview.data.retime ? ", plus any scene whose timing moves" : ""} · ${preview.data.demo ? "Placeholder · free" : ep.settings.engine === "open" ? "Free · your GPU" : preview.data.costUsd === null ? "price unknown" : `≈ ${usd(preview.data.costUsd)}${preview.data.retime ? "+" : ""}`}`
+ ? `Re-renders ${preview.data.labels.length} step${preview.data.labels.length === 1 ? "" : "s"} (${stepWords(preview.data.labels)})${preview.data.retime ? ", plus any scene whose timing moves" : ""} · ${preview.data.demo ? "Placeholder · free" : ep.settings.engine === "open" ? openFree("Free · your GPU") : preview.data.costUsd === null ? "price unknown" : `≈ ${usd(preview.data.costUsd)}${preview.data.retime ? "+" : ""}`}`
: "Pricing…"}
</p>
<Button variant="ghost" onClick={discard} disabled={!draft}>
diff --git a/src/components/fly-around-run.ts b/src/components/fly-around-run.ts
index b85abb8f..e23e9010 100644
--- a/src/components/fly-around-run.ts
+++ b/src/components/fly-around-run.ts
@@ -1,5 +1,7 @@
"use client";
+import { useOpenFree } from "@/components/studio/run-place-chip";
+import { toolPoolPrice } from "@/lib/run-place";
import { keepPreviousData, useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
import { nanoid } from "nanoid";
import type { CameraKey } from "@/lib/camera-path";
@@ -56,6 +58,7 @@ export function flyPrice(p: FlyAroundPreview | undefined, compact = false): stri
/** A fly-around's live price (enabled while `body` is set) and its run, which puts the new cards in the feeds. */
export function useFlyAround(body: FlyAroundBody | null) {
const qc = useQueryClient();
+ const openFree = useOpenFree();
const preview = useQuery({
queryKey: ["fly-around-preview", body],
queryFn: () => post<FlyAroundPreview>("/api/fly-around?preview=1", body),
@@ -74,5 +77,6 @@ export function useFlyAround(body: FlyAroundBody | null) {
},
onError: (e) => toastError(e),
});
- return { preview, run, price: flyPrice(preview.data), compactPrice: flyPrice(preview.data, true) };
+ // On this studio's GPUs: the service's price and the place in line ("Free · your GPU" is for the person's own GPU).
+ return { preview, run, price: toolPoolPrice(preview.data)?.text ?? openFree(flyPrice(preview.data)), compactPrice: openFree(flyPrice(preview.data, true)) };
}
diff --git a/src/components/genjutsu/character-panel.tsx b/src/components/genjutsu/character-panel.tsx
index d268095c..f68c2f5e 100644
--- a/src/components/genjutsu/character-panel.tsx
+++ b/src/components/genjutsu/character-panel.tsx
@@ -1,5 +1,6 @@
"use client";
+import { useOpenFree } from "@/components/studio/run-place-chip";
import { VoiceFirstSwitch } from "@/components/audio-tools/voice-first-switch";
import { AudioLines, Cpu, Drama, Loader2, Sparkles, TriangleAlert } from "lucide-react";
import Link from "next/link";
@@ -101,6 +102,7 @@ export function CharacterControls({
/** "Clean the voice first" for that transcription (shown when given). */
voiceFirst?: { on: boolean; onChange: (on: boolean) => void; seconds?: number };
}) {
+ const openFree = useOpenFree();
const set = (patch: Partial<CharacterOptions>) => onChange({ ...value, ...patch });
const h3 = !!maker?.h3;
// Each engine's sizes (the cloud has no 1080p); a size the other engine offered shows as the swap's own.
@@ -163,7 +165,7 @@ export function CharacterControls({
)}
{h3 && (
- <Field label="Quality" hint={qualityShort(engine, shown)}>
+ <Field label="Quality" hint={openFree(qualityShort(engine, shown))}>
<Segmented
label="Quality"
value={shown}
@@ -173,7 +175,7 @@ export function CharacterControls({
/>
{/* Your GPU's 1080p / 2K / 4K regenerate with Open-H3 Regenerate: a 48 GB card, and the choice says so. */}
{engine === "open" && characterFinish(shown) && <OwnSetupChip setup="regenerate:swap-sharpen" />}
- {characterFinish(shown) && <p className="text-[12px] leading-snug text-pretty text-muted-foreground">{qualityHint(engine, shown)}</p>}
+ {characterFinish(shown) && <p className="text-[12px] leading-snug text-pretty text-muted-foreground">{openFree(qualityHint(engine, shown))}</p>}
{offReasons.length > 0 && (
<p id="character-quality-off" className="text-[12px] leading-snug text-pretty text-muted-foreground">
{offReasons.map((o) => `${o.q}: ${o.reason}.`).join(" ")}
diff --git a/src/components/mixed-media/mixed-studio.tsx b/src/components/mixed-media/mixed-studio.tsx
index 973159cb..ed30942f 100644
--- a/src/components/mixed-media/mixed-studio.tsx
+++ b/src/components/mixed-media/mixed-studio.tsx
@@ -1,5 +1,6 @@
"use client";
+import { useOpenFree } from "@/components/studio/run-place-chip";
import { OriginalSoundPicker } from "@/components/av/original-sound-picker";
import type { OriginalSound } from "@/lib/av/original-sound";
import { ArrowDown, Cloud, Cpu, Download, ImageIcon, Info, Loader2, Search, Sparkles, Wand2, X } from "lucide-react";
@@ -153,6 +154,7 @@ export function MixedStudio({
}
function How({ onStart, cloud, reveal }: { onStart: () => void; cloud: boolean; reveal?: StudioExampleRow }) {
+ const openFree = useOpenFree();
return (
<div className="mx-auto max-w-[920px] pt-10">
<h2 className="text-center font-heading text-[34px] leading-tight">How it works</h2>
@@ -173,7 +175,7 @@ function How({ onStart, cloud, reveal }: { onStart: () => void; cloud: boolean;
<p className="font-medium text-foreground">Cost</p>
<p className="mt-1">
A render is counted in frames: seconds × frame rate (10 s at 8 fps = 80 frames; at most 240). Fuobe Mixed Media draws every frame again in the
- look, free on your GPU
+ look, {openFree("free on your GPU")}
{cloud ? ", or in the cloud at about a cent a frame. Nano Banana 2.1 and Seedream 5.0 Flash redraw frames too, priced per frame." : "."} Smooth draws only the
first frame in the look, then every frame follows it{cloud ? ", priced per second. Fast restyles the clip in one pass, priced by the model" : ""}. You see
the estimate before you generate.
@@ -317,6 +319,7 @@ function Editor({
/** Whether a clip is loaded (the phone bar says what's next). */
onClip?: (has: boolean) => void;
}) {
+ const openFree = useOpenFree();
const source = useSourceClip(MIXED.maxBytes);
const { clip } = source;
const hasClip = !!clip;
@@ -551,7 +554,7 @@ function Editor({
<Field
label="Restyle"
- hint={frameMode ? `Every frame drawn again${cloud ? " · priced per frame" : " · free on your GPU"}` : smooth ? `First frame, then carried through${cloud ? " · priced per second" : " · free on your GPU"}` : "One video-to-video pass · priced by the model"}
+ hint={frameMode ? `Every frame drawn again${cloud ? " · priced per frame" : openFree(" · free on your GPU")}` : smooth ? `First frame, then carried through${cloud ? " · priced per second" : openFree(" · free on your GPU")}` : "One video-to-video pass · priced by the model"}
>
<Segmented<MixedMode> label="Restyle" value={mode} onChange={setMode} options={MODE_OPTIONS.filter((o) => MIXED_MODES[engine].includes(o.value))} />
</Field>
diff --git a/src/components/studio/run-place-chip.tsx b/src/components/studio/run-place-chip.tsx
index 674d2157..ff74279e 100644
--- a/src/components/studio/run-place-chip.tsx
+++ b/src/components/studio/run-place-chip.tsx
@@ -3,7 +3,7 @@
import { Cloud, Cpu, Lock, MonitorPlay, Server } from "lucide-react";
import Link from "next/link";
import { usePathname } from "next/navigation";
-import { useState } from "react";
+import { useCallback, useState } from "react";
import { openAddKey } from "@/components/keys/your-keys";
import { useOwnSetupPress } from "@/components/own-setup";
import { Button } from "@/components/ui/button";
@@ -13,7 +13,7 @@ import { CONNECT_GPU_EVENT, signInHref, useHydrated, useStatus, useViewer } from
import { formatCost } from "@/lib/format";
import { placeOf, type Place } from "@/lib/place-name";
import { quoteBody, useHostedQuote, useSettled } from "@/lib/hosted";
-import { checkedPool, openCheckPlace, placeRows, runPlace, type RunAudience, type RunOnPick, type RunPlace, type RunPlaceInput } from "@/lib/run-place";
+import { checkedPool, openCheckPlace, openFreeWords, placeRows, runPlace, type RunAudience, type RunOnPick, type RunPlace, type RunPlaceInput } from "@/lib/run-place";
import { useSetRunOn } from "@/lib/run-on";
import { cn } from "@/lib/utils";
import { chipBase, chipIdle } from "./chip";
@@ -48,6 +48,15 @@ export function useRunViewer(): { audience: RunAudience; gpu: boolean; hosted: b
};
}
+/**
+ * A tool page's own "free on your GPU" words as this viewer reads them (openFreeWords): just "Free" while its open runs
+ * go to this studio's GPUs; the page's words otherwise (hosted runs off, the owner, runs on the person's own GPU).
+ */
+export function useOpenFree(): (text: string) => string {
+ const site = openCheckPlace(useRunViewer()) !== null;
+ return useCallback((text: string) => openFreeWords(text, site), [site]);
+}
+
/** The place and price for this viewer (null until the viewer is known). */
export function useRunPlace(input: Omit<RunPlaceInput, "audience" | "format" | "gpu" | "hosted" | "preferPool" | "payer" | "place">): RunPlace | null {
const who = useRunViewer();
diff --git a/src/components/swap-studio/parts.tsx b/src/components/swap-studio/parts.tsx
index 7bf15282..a9b64b9b 100644
--- a/src/components/swap-studio/parts.tsx
+++ b/src/components/swap-studio/parts.tsx
@@ -1,14 +1,25 @@
"use client";
+import { useCallback } from "react";
import { AlertTriangle, CheckCircle2, CircleDashed, CircleSlash, Loader2, Pause } from "lucide-react";
import { openVideo, releaseVideo, sampleFrames } from "@/components/av/frame-sampler";
import { frameFromBlob, type Frame } from "@/components/remove-object/frame-stage";
import { jobState, type GenSummary, type JobStatus } from "@/lib/catalog/swap-studio";
import type { Engine } from "@/lib/catalog/types";
import { cn } from "@/lib/utils";
+import { useOpenFree } from "@/components/studio/run-place-chip";
/** Small pieces shared by Character Swap Studio's stages. */
+/**
+ * priceText as this viewer reads it: "Free" while its open runs go to this studio's GPUs ("Free · your GPU" is for the
+ * person's own GPU).
+ */
+export function usePriceText(): typeof priceText {
+ const openFree = useOpenFree();
+ return useCallback((costUsd: number | null | undefined, o: { demo?: boolean; engine: Engine }) => openFree(priceText(costUsd, o)), [openFree]);
+}
+
/** "≈ $0.38", "Free · your GPU", "Placeholder · free", "Price unknown". */
export function priceText(costUsd: number | null | undefined, o: { demo?: boolean; engine: Engine }): string {
if (o.demo) return "Placeholder · free";
diff --git a/src/components/swap-studio/stage-anchors.tsx b/src/components/swap-studio/stage-anchors.tsx
index a066e995..e92d5ee5 100644
--- a/src/components/swap-studio/stage-anchors.tsx
+++ b/src/components/swap-studio/stage-anchors.tsx
@@ -15,11 +15,12 @@ import type { Engine } from "@/lib/catalog/types";
import { cn } from "@/lib/utils";
import { toastError } from "@/lib/refusals";
import { useMakeAnchor, useStopJob, useSwapEdit } from "./hooks";
-import { GenChip, JobError, Note, priceText, SavedText } from "./parts";
+import { GenChip, JobError, Note, SavedText, usePriceText } from "./parts";
import type { StageProps } from "./workbench";
/** Make (with the engine's image edit) or import an anchor: the shot's scene anchor, or a segment's own reference. */
export function AnchorMaker({ id, project, clip, shotId, segment, estimate }: Pick<StageProps, "id" | "project" | "clip" | "estimate"> & { shotId: string; segment?: SwapSegment }) {
+ const priceText = usePriceText();
const make = useMakeAnchor(id);
const importer = useSwapEdit(id);
const engine = project.engine;
diff --git a/src/components/swap-studio/stage-review.tsx b/src/components/swap-studio/stage-review.tsx
index 371d3c10..dfd053f5 100644
--- a/src/components/swap-studio/stage-review.tsx
+++ b/src/components/swap-studio/stage-review.tsx
@@ -34,7 +34,8 @@ import { downloadHref } from "@/lib/library";
import { cn } from "@/lib/utils";
import { toastError } from "@/lib/refusals";
import { decisionsHref, useAssemble, useSharpen, useStopJob } from "./hooks";
-import { GenChip, JobError, Note, priceText, SavedText } from "./parts";
+import { GenChip, JobError, Note, SavedText, usePriceText } from "./parts";
+import { useOpenFree } from "@/components/studio/run-place-chip";
import type { StageProps } from "./workbench";
const DECISIONS = Object.keys(DECISION_LABELS) as Decision[];
@@ -149,6 +150,8 @@ function FinishVersion({ take, gens, onUse }: { take: SwapTake; gens: Record<str
/** Assemble → Finish: "Sharpen to 1080p / 2K / 4K" (runnable: the size, its price or GPU time, Run). */
function FinishPanel({ id, project, clip, gens, estimate }: Pick<StageProps, "id" | "project" | "clip" | "gens" | "estimate">) {
+ const priceText = usePriceText();
+ const openFree = useOpenFree();
const sharpen = useSharpen(id);
// Your GPU's sharpen regenerates with Open-H3 Regenerate: a 48 GB card (own-setup.ts), said beside the title.
const press = useOwnSetupPress();
@@ -174,7 +177,7 @@ function FinishPanel({ id, project, clip, gens, estimate }: Pick<StageProps, "id
const seconds = est?.seconds ?? chosen.reduce((n, p) => n + (p.end - p.start) / SWAP_STUDIO.fps, 0);
const cost = tier ? est?.costUsd[tier] : undefined;
const problem = "problem" in found ? SHARPEN_COPY.none : !tier ? (options.find((o) => o.reason)?.reason ?? SHARPEN_COPY.small) : null;
- const priceLine = engine === "open" ? (estimate?.demo ? priceText(0, { demo: true, engine }) : `Free on your GPU · ${gpuMinutes(seconds)}`) : priceText(cost, { demo: estimate?.demo, engine });
+ const priceLine = engine === "open" ? (estimate?.demo ? priceText(0, { demo: true, engine }) : openFree(`Free on your GPU · ${gpuMinutes(seconds)}`)) : priceText(cost, { demo: estimate?.demo, engine });
const join = joinNote(film);
const shownTier = tier ?? (engine === "cloud" ? "2K" : "1080p");
// Why a size can't be picked, said under the picker (a turned-off button can't take focus or show a tooltip on touch).
@@ -321,6 +324,7 @@ export function ReviewStage(props: StageProps) {
/** Assemble: the chosen takes over the original timeline with the clip's own sound, and Finish (Sharpen). */
export function AssembleStage({ id, project, clip, gens, estimate }: StageProps) {
+ const priceText = usePriceText();
const assemble = useAssemble(id);
const stop = useStopJob(id);
const found = assemblyPieces(project, clip);
diff --git a/src/components/swap-studio/stage-segments.tsx b/src/components/swap-studio/stage-segments.tsx
index b2b6c67a..a5f23572 100644
--- a/src/components/swap-studio/stage-segments.tsx
+++ b/src/components/swap-studio/stage-segments.tsx
@@ -28,7 +28,7 @@ import { cn } from "@/lib/utils";
import { toastError } from "@/lib/refusals";
import { useQueue, useStopJob, useStopTake } from "./hooks";
import { AnchorGrid, AnchorMaker } from "./stage-anchors";
-import { JobChip, Note, NumberField, priceText, SavedText } from "./parts";
+import { JobChip, Note, NumberField, SavedText, usePriceText } from "./parts";
import type { StageProps } from "./workbench";
const STATE_TEXT: Record<SegmentState["status"], string> = { ready: "Current", stale: "Out of date", empty: "No take yet" };
@@ -165,6 +165,7 @@ function TakeRow({
}
function SegmentCard(props: StageProps & { shot: SwapShot; seg: SwapSegment; index: number; state: SegmentState; count: number }) {
+ const priceText = usePriceText();
const { id, project, clip, shot, seg, index, state, gens, estimate, edit } = props;
const queue = useQueue(id);
const stopTake = useStopTake(id);
@@ -352,6 +353,7 @@ function SegmentCard(props: StageProps & { shot: SwapShot; seg: SwapSegment; ind
/** Segments: the shot's layout (5/10/15 s, split, merge, move), each segment's settings, queueing, and its takes. */
export function SegmentsStage(props: StageProps) {
+ const priceText = usePriceText();
const { id, project, clip, shot, estimate, edit } = props;
const queue = useQueue(id);
const [splitAt, setSplitAt] = useState<number | null>(null);
diff --git a/src/components/swap-studio/stage-who.tsx b/src/components/swap-studio/stage-who.tsx
index 6564d1a4..840fc03c 100644
--- a/src/components/swap-studio/stage-who.tsx
+++ b/src/components/swap-studio/stage-who.tsx
@@ -14,13 +14,14 @@ import type { PixelPoint } from "@/lib/catalog/types";
import { cn } from "@/lib/utils";
import { toastError } from "@/lib/refusals";
import { useMakeMask, useStopJob } from "./hooks";
-import { GenChip, grabFrame, JobError, Note, priceText } from "./parts";
+import { GenChip, grabFrame, JobError, Note, usePriceText } from "./parts";
import type { StageProps } from "./workbench";
const WORDS = { positive: "include", negative: "exclude", ask: "Click the person to swap", frame: "The shot's frame" };
/** Who to swap: SAM 3.1's words and pick, clicks on any frame of the shot, Track shot / Update frame, mask versions to approve. */
export function WhoStage({ id, project, clip, shot, gens, estimate, edit, src }: StageProps) {
+ const priceText = usePriceText();
const make = useMakeMask(id);
const stop = useStopJob(id);
const [at24, setAt24] = useState(0);
diff --git a/src/components/swap-studio/stage-words.tsx b/src/components/swap-studio/stage-words.tsx
index e30bef56..d6625bd9 100644
--- a/src/components/swap-studio/stage-words.tsx
+++ b/src/components/swap-studio/stage-words.tsx
@@ -10,7 +10,7 @@ import { Panel } from "@/components/av/tool-shell";
import { buildShotPrompt, ROLE_LABELS, secondsLabel, shotDialogue, shotSpeaker, SWAP_STUDIO, voiceLabel, voicesOf, type SwapRole } from "@/lib/catalog/swap-studio";
import { toastError } from "@/lib/refusals";
import { useTranscribe } from "./hooks";
-import { GenChip, JobError, Note, priceText, SavedText } from "./parts";
+import { GenChip, JobError, Note, SavedText, usePriceText } from "./parts";
import type { StageProps } from "./workbench";
const ROLES = Object.keys(ROLE_LABELS) as SwapRole[];
@@ -36,6 +36,7 @@ function RoleSelect({ value, onChange, label, auto }: { value: SwapRole | null;
/** Words: the clip's transcript (both engines' speech to text), who each voice is, and each shot's speaker, words and prompt. */
export function WordsStage({ id, project, clip, gens, estimate, edit }: StageProps) {
+ const priceText = usePriceText();
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(true);
diff --git a/src/components/swap-studio/workbench.tsx b/src/components/swap-studio/workbench.tsx
index 01e57ecc..8a18d4b9 100644
--- a/src/components/swap-studio/workbench.tsx
+++ b/src/components/swap-studio/workbench.tsx
@@ -18,7 +18,7 @@ import { cn } from "@/lib/utils";
import { onAttr, TAB_PILL, TabRow } from "@/components/ui/tab-row";
import { toastError } from "@/lib/refusals";
import { decisionsHref, useAddClip, usePrepareClip, useSwapEdit, useSwapEstimate, useSwapProject, type EditInput } from "./hooks";
-import { GenChip, JobError, Note, priceText, SavedText } from "./parts";
+import { GenChip, JobError, Note, SavedText, usePriceText } from "./parts";
import { AnchorsStage } from "./stage-anchors";
import { AssembleStage, ReviewStage } from "./stage-review";
import { SegmentsStage } from "./stage-segments";
@@ -202,6 +202,7 @@ export function SwapWorkbench({ id }: { id: string }) {
}
function ProjectPanel({ project, estimate, edit }: { project: SwapProject; estimate: StudioEstimate | undefined; edit: StageProps["edit"] }) {
+ const priceText = usePriceText();
const nameId = useId();
return (
<Panel title="Project">
diff --git a/src/components/turnaround/turnaround-dialog.tsx b/src/components/turnaround/turnaround-dialog.tsx
index 25360693..47a5683e 100644
--- a/src/components/turnaround/turnaround-dialog.tsx
+++ b/src/components/turnaround/turnaround-dialog.tsx
@@ -32,6 +32,8 @@ import {
} from "@/lib/catalog/turnaround";
import type { Engine, Generation } from "@/lib/catalog/types";
import { formatCost } from "@/lib/format";
+import { toolPoolPrice } from "@/lib/run-place";
+import { useOpenFree } from "@/components/studio/run-place-chip";
import { cn } from "@/lib/utils";
import { responseError, toastError } from "@/lib/refusals";
@@ -166,6 +168,7 @@ function Thumb({ url, className }: { url?: string; className?: string }) {
function TurnaroundForm({ pictures, name, realPerson: realDefault = false, elementId, engine: fixedEngine, onRun, title, flyAround, fictional, route: startRoute, onStarted }: Props & { onStarted: (run: Run) => void }) {
const [appEngine, setAppEngine, engineMode] = useEngine();
+ const openFree = useOpenFree();
const engine = fixedEngine ?? appEngine;
// The note about your GPU is for the studio's own install with both engines: guests and accounts run in the cloud.
const visitor = useLikelyVisitor();
@@ -234,7 +237,8 @@ function TurnaroundForm({ pictures, name, realPerson: realDefault = false, eleme
if (k === "sheet") setSheet(url);
else setViews((v) => ({ ...v, [k]: url }));
};
- const price = !p ? "" : p.demo ? "Placeholder · free" : engine === "open" ? `Free · on your GPU${p.gpuGb ? `, about ${p.gpuGb} GB` : ""}` : p.costUsd != null ? `≈ ${formatCost(p.costUsd)}` : "";
+ // On this studio's GPUs: the service's price and the place in line ("Free · your GPU" is for the person's own GPU).
+ const price = toolPoolPrice(p)?.text ?? openFree(!p ? "" : p.demo ? "Placeholder · free" : engine === "open" ? `Free · on your GPU${p.gpuGb ? `, about ${p.gpuGb} GB` : ""}` : p.costUsd != null ? `≈ ${formatCost(p.costUsd)}` : "");
const heading = headingOf({ title, flyAround, name });
return (
diff --git a/src/lib/run-place.ts b/src/lib/run-place.ts
index d11fceb9..024a0672 100644
--- a/src/lib/run-place.ts
+++ b/src/lib/run-place.ts
@@ -271,6 +271,20 @@ export function openCheckPlace(
return v.preferPool || v.runOn === "site" || v.runOn === "key" ? undefined : null;
}
+/**
+ * A tool page's own words for a free open-model run ("Free · your GPU", "Free on your GPU, about 20 GB", "free on your
+ * GPU"), as a viewer whose open runs go to this studio's GPUs reads them (`site`: hosted runs on and openCheckPlace
+ * names a place): "Free", with no place, since the page's place chip or price check says where. Runs that go to the
+ * person's own GPU, the owner's, and every install with hosted runs off keep the page's words.
+ */
+export function openFreeWords(text: string, site: boolean): string {
+ if (!site) return text;
+ return text
+ .replace(/\bFree(?: ·)?(?: on)? your GPU(?:, about \d+ GB)?/g, "Free")
+ .replace(/\bfree(?: ·)?(?: on)? your GPU\b/g, "free")
+ .replace(/\bFree · GPU\b/g, "Free");
+}
+
/**
* A run's request to send again (Retry): with hosted runs on, to the place it ran, named, so it never moves (a run on this
* studio's GPUs stays there, one on the person's own GPU or key stays there), whatever the account's pick says now.
diff --git a/tests/hosted-surface-labels.test.ts b/tests/hosted-surface-labels.test.ts
index 85781771..33bf1c6a 100644
--- a/tests/hosted-surface-labels.test.ts
+++ b/tests/hosted-surface-labels.test.ts
@@ -4,7 +4,7 @@ import { OWN_GPU_TOOL_HOSTED, OWN_GPU_TOOL_MESSAGE, ownGpuToolMessage } from "@/
import { KEPT_RUN_WORDS, setupCardWords } from "@/lib/own-setup-card";
import { answerPickModel, canPickModel, pickAnotherModel } from "@/lib/pick-model";
import { placeOf } from "@/lib/place-name";
-import { runPlace } from "@/lib/run-place";
+import { openCheckPlace, openFreeWords, runPlace } from "@/lib/run-place";
/*
* What the site's GPUs can't run is a label, never a refusal (hosted runs on): the card a press on a labelled item opens
@@ -87,3 +87,32 @@ describe("the surfaces that don't run here yet", () => {
expect(OWN_GPU_TOOL_HOSTED).not.toMatch(/isn't available here/);
});
});
+
+describe("a tool page's free words (4.7)", () => {
+ const site = (v: Parameters<typeof openCheckPlace>[0]) => openCheckPlace(v) !== null;
+ const account = { audience: "account" as const, gpu: false, hosted: true, preferPool: true };
+
+ it("an open run that goes to the site's GPUs is just Free: the page's place chip or price check says where", () => {
+ expect(openFreeWords("Free · your GPU", true)).toBe("Free");
+ expect(openFreeWords("Free on your GPU", true)).toBe("Free");
+ expect(openFreeWords("Free · on your GPU, about 20 GB", true)).toBe("Free");
+ expect(openFreeWords("Free · GPU", true)).toBe("Free");
+ expect(openFreeWords(" · free on your GPU", true)).toBe(" · free");
+ expect(openFreeWords("Free on your GPU · about 4 min", true)).toBe("Free · about 4 min");
+ // Prices and other words stay.
+ expect(openFreeWords("≈ $0.38", true)).toBe("≈ $0.38");
+ expect(openFreeWords("Placeholder · free", true)).toBe("Placeholder · free");
+ });
+
+ it("runs on the person's own GPU, the owner's, and every install with hosted runs off keep the page's words", () => {
+ expect(openFreeWords("Free · your GPU", false)).toBe("Free · your GPU");
+ expect(site(account)).toBe(true);
+ expect(site({ ...account, gpu: true })).toBe(true);
+ expect(site({ ...account, gpu: true, runOn: "gpu" })).toBe(false);
+ expect(site({ ...account, gpu: true, preferPool: false })).toBe(false);
+ expect(site({ ...account, gpu: true, preferPool: false, runOn: "site" })).toBe(true);
+ expect(site({ ...account, audience: "owner" })).toBe(false);
+ expect(site({ ...account, hosted: false })).toBe(false);
+ expect(site(null)).toBe(false);
+ });
+});