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.

953 B
Raw Blame
import { guestRun, toolViewer } from "@/server/account-tool-run";
import { DirectionSchema, writeDirection } from "@/server/evolution";
import { asAccount } from "@/server/generations";
import { body, handle } from "@/server/shorts-schemas";

/**
 * Write the creative direction from the references and your words: Claude, Ollama, or Fuobe's offline writer. Never
 * generates. A signed-in account's is always the offline writer's (never this studio's AI helper); a guest signs up first.
 */
export async function POST(request: Request) {
  const viewer = toolViewer(request);
  if (viewer.kind === "guest") return guestRun();
  return handle(async () => {
    const input = await body(request, DirectionSchema, "Pick how much should change, then add references or a few words");
    const write = () => writeDirection(input);
    return Response.json(await (viewer.kind === "account" ? asAccount(viewer.account.id, write) : write()));
  }, request);
}