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.

868 B
Raw Blame
import { connection } from "next/server";
import { preflightOn } from "@/server/gpu/index-file";
import { readinessView } from "@/server/gpu/readiness-service";
import { gpuTargetFor } from "@/server/gpu/target";

/**
 * GPU pre-flight: the readiness board from the viewer's last check (the owner: the studio's own ComfyUI; an
 * account: the ComfyUI it connected). It never probes; POST /api/gpu/check does. Guests get { connected: false }.
 */
export async function GET(request: Request) {
  await connection();
  const headers = { "Cache-Control": "private, no-store" };
  if (!preflightOn()) return Response.json({ connected: false, reason: "off" }, { headers });
  const t = gpuTargetFor(request, "read");
  if (t.kind === "none") return Response.json({ connected: false, reason: t.reason }, { headers });
  return Response.json(readinessView(t), { headers });
}