1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/**
* Generates an image with Stable Diffusion XL through fal.ai
*
* @param {string} prompt - The input prompt to send to SDXL model.
* @returns {Promise<string>} A promise that resolves to the URL of the image.
*/
export async function generateImage(
input: string,
): Promise<{ url: string }> {
let resp = await fetch("https://isidentical-falimagehandler.web.val.run/", {
method: "POST",
body: JSON.stringify({ prompt: input }),
});
return await resp.json();
}
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
v11
May 23, 2024