1
2
3
4
5
6
7
8
9
10
11
12
13
import * as fal from "npm:@fal-ai/serverless-client";
fal.config({
// Can also be auto-configured using environment variables:
credentials: Deno.env.get("FAL_KEY"),
});
export default async function(req: Request): Promise<Response> {
const { prompt } = await req.json();
const result: any = await fal.run("fal-ai/fast-lightning-sdxl", { input: { prompt } });
return Response.json({ url: result.images[0].url });
}