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.

Your GPU: a connect from the card closes it, and the next upload sees it

Adarsh3340caf722c7
diff --git a/src/components/gpu/connect-choice.tsx b/src/components/gpu/connect-choice.tsx
index a9ec7c68..9b0a389e 100644
--- a/src/components/gpu/connect-choice.tsx
+++ b/src/components/gpu/connect-choice.tsx
@@ -152,6 +152,7 @@ function ComputerStatus({ gpu, onLink }: { gpu: Extract<AccountGpuView, { mode:
try {
qc.setQueryData(["account-gpu"], await gpuCall("DELETE"));
void qc.invalidateQueries({ queryKey: ["viewer"] });
+ void qc.invalidateQueries({ queryKey: ["status"] });
} catch (e) {
toast.error((e as Error).message);
} finally {
@@ -204,6 +205,7 @@ export interface ConnectChoiceProps {
* once), or this browser hasn't been allowed to reach it yet (the browser's question is explained first).
*/
reason?: FindReason;
+ /** Connected, from this computer or with a link: the card that asked can close (and a refused run start again). */
onStart?: () => void;
onNotNow?: () => void;
/** The two options' box (and the link's form): 36rem at most from sm up, unless a wider page lifts that (sm:max-w-none). */
@@ -230,7 +232,7 @@ export function ConnectChoice({ fromRun, kind, reason, onStart, onNotNow, classN
return (
<div className="space-y-4">
<p className="rounded-xl bg-muted px-3 py-2.5 text-[13px] text-muted-foreground">{unsupportedWords(support)}</p>
- <YourGpu className={className} />
+ <YourGpu className={className} onLinked={onStart} />
</div>
);
}
@@ -274,7 +276,7 @@ export function ConnectChoice({ fromRun, kind, reason, onStart, onNotNow, classN
</button>
{(link || linked) && (
<div className="mt-3">
- <YourGpu className={className} />
+ <YourGpu className={className} onLinked={onStart} />
</div>
)}
</div>
diff --git a/src/components/gpu/this-computer.tsx b/src/components/gpu/this-computer.tsx
index 1297fd52..131a4984 100644
--- a/src/components/gpu/this-computer.tsx
+++ b/src/components/gpu/this-computer.tsx
@@ -422,6 +422,8 @@ export function ThisComputer({ connect, fromRun, kind, onStart, onNotNow, autoLo
setDone({ port, stats, guard });
void qc.invalidateQueries({ queryKey: ["viewer"] });
void qc.invalidateQueries({ queryKey: ["account-gpu"] });
+ // What the account may do now (its own files are taken, useAskBeforeUpload): the status says so.
+ void qc.invalidateQueries({ queryKey: ["status"] });
try {
const board = await sendCheck<ReadinessView>(await checkThisComputer(port, { host }));
qc.setQueryData(["gpu", "readiness"], board);
diff --git a/src/components/gpu/your-gpu.tsx b/src/components/gpu/your-gpu.tsx
index 5b050ee2..fc6ce5d8 100644
--- a/src/components/gpu/your-gpu.tsx
+++ b/src/components/gpu/your-gpu.tsx
@@ -38,7 +38,7 @@ async function call<T>(method: string, body?: unknown, test = false): Promise<T>
* of a local ComfyUI. Nothing here looks for a ComfyUI on this device: it shows the tunnel command. 36rem wide at most
* from sm up, unless a wider page lifts that (className, as ConnectChoice's).
*/
-export function YourGpu({ className }: { className?: string } = {}) {
+export function YourGpu({ className, onLinked }: { className?: string; onLinked?: () => void } = {}) {
const qc = useQueryClient();
const id = useId();
const q = useQuery({ queryKey: ["account-gpu"], queryFn: () => call<GpuState>("GET") });
@@ -57,11 +57,13 @@ export function YourGpu({ className }: { className?: string } = {}) {
setInfo(r.info);
if (!test) {
qc.setQueryData(["account-gpu"], { gpu: r.gpu });
- // Runs go to the link now, not to a Fuobe tab on this computer.
+ // Runs go to the link now, not to a Fuobe tab on this computer, and its own files are taken (the status says so).
void qc.invalidateQueries({ queryKey: ["viewer"] });
+ void qc.invalidateQueries({ queryKey: ["status"] });
toast.success("Your GPU is connected. Runs go to your ComfyUI now.");
setUrl("");
setToken("");
+ onLinked?.();
}
} catch (e) {
setInfo(null);
@@ -74,6 +76,7 @@ export function YourGpu({ className }: { className?: string } = {}) {
setBusy("remove");
try {
qc.setQueryData(["account-gpu"], await call<GpuState>("DELETE"));
+ void qc.invalidateQueries({ queryKey: ["status"] });
setInfo(null);
} catch (e) {
toastError(e);