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.
TypeScript ai-videocomfyuicreative-toolsgenerative-aiideogramimage-generationimage-to-3dimage-to-videoltx-videominimax-h3nextjsopen-sourceopen-weightsqwen-imagetext-to-imagevideo-generationwan
Runs: a clip too long for the GPUs here reads as the longest clip in whole seconds
Adarsh9e089544d5a3
diff --git a/src/server/hosted-run.ts b/src/server/hosted-run.tsindex ab90f3d5..df318e9f 100644--- a/src/server/hosted-run.ts+++ b/src/server/hosted-run.ts@@ -388,8 +388,12 @@ export function gateWords(reason: Exclude<GateReason, "ownSetup" | "outputs">, greturn (guest ? hostedGuestWords() : hostedWords(place))[reason];}+/** A size refusal for a clip's length (poolMostWords: "15 s clips"): its plain label and line. */+const clipLimit = (gate: GateRefusal): string | null => (gate.reason === "size" && gate.most?.endsWith(" s clips") ? gate.most : null);+/** A gate's refusal in words: the own setup's label (the same for a guest and an account), or the reason's label. */export const gateText = (gate: GateRefusal, guest: boolean, place: Place): string =>+ clipLimit(gate) ? `Up to ${clipLimit(gate)}` :gate.reason === "ownSetup" || gate.reason === "model3d"? ownSetupLabel(gate.setup ?? (gate.reason === "model3d" ? model3dSetup() : needsGpu())): gate.reason === "outputs"@@ -400,6 +404,7 @@ export const gateText = (gate: GateRefusal, guest: boolean, place: Place): strinexport function gateDetail(gate: GateRefusal, place: Place): string | undefined {if (gate.reason === "ownSetup" || gate.reason === "model3d") return ownSetupDetail(gate.setup ?? model3dSetup());if (gate.reason === "outputs") return undefined;+ if (clipLimit(gate)) return "Pick a shorter clip, or run it on your own GPU.";return hostedDetails(place, gate.most)[gate.reason];}diff --git a/src/server/hosted.ts b/src/server/hosted.tsindex 8faca015..d08952f9 100644--- a/src/server/hosted.ts+++ b/src/server/hosted.ts@@ -133,7 +133,8 @@ export function poolMostWords(endpoint: string | undefined, size: JobSize): striif (!endpoint || endpoint.includes("{")) return null;const most = workersMost(endpoint, size);if (most.maxMegapixels !== undefined && size.megapixels > most.maxMegapixels) return `${tenth(most.maxMegapixels)} megapixels`;- if (most.maxSeconds !== undefined && size.seconds > most.maxSeconds) return `${tenth(most.maxSeconds)} s clips`;+ // Whole seconds, as people pick lengths: a frame grid's few tenths over (5.2 s) read as the length below.+ if (most.maxSeconds !== undefined && size.seconds > most.maxSeconds) return `${Math.max(1, Math.floor(most.maxSeconds))} s clips`;if (most.maxOutputs !== undefined && size.outputs > most.maxOutputs) return `${most.maxOutputs} results at a time`;return null;}diff --git a/tests/hosted-words.test.ts b/tests/hosted-words.test.tsindex c615a00c..1e91e5f1 100644--- a/tests/hosted-words.test.ts+++ b/tests/hosted-words.test.ts@@ -280,3 +280,16 @@ describe("where runs go: the Run on list, Settings and the one-time note", () =>}});});++describe("a clip too long for the GPUs here", () => {+ it("reads as the longest clip in whole seconds, with a plain line under it", async () => {+ const { gateText, gateDetail } = await import("@/server/hosted-run");+ const place = { label: "Our GPUs", text: "our GPUs" } as Parameters<typeof gateText>[2];+ const gate = { ok: false as const, reason: "size" as const, most: "15 s clips" };+ expect(gateText(gate, false, place)).toBe("Up to 15 s clips");+ expect(gateText(gate, true, place)).toBe("Up to 15 s clips");+ expect(gateDetail(gate, place)).toBe("Pick a shorter clip, or run it on your own GPU.");+ // A picture's size keeps its own words.+ expect(gateText({ ok: false, reason: "size", most: "8 megapixels" }, false, place)).toBe("This size runs self-hosted");+ });+});