INNER CODE UNIT · TypeScript

createScene

fill3d/fill · lib/fill3d.ts:78

export async function createScene (image: string): Promise<Scene> {
  const response = await fetch("/api/scene", {
    method: "POST",
    body: JSON.stringify({ image }),
    headers: { "Content-Type": "application/json" }
  });
  const { error, ...payload } = await response.json();
  if (error)
    throw new Error(error);
  return payload;
}

/**
 * Generate a render.
 * This simply proxies to the `/api/render` API route which issues the request to Fill 3D.
 * @param sceneId Scene identifier.
 * @param prompt Generation prompt.
 * @returns Generated render.

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…