7Views the value of `basicAuthButton:last-pressed` in blob storage.
8
9
10
11### POST /press
8const prompt = "a cute and happy dog";
9const result: any = await fal.run("fal-ai/fast-lightning-sdxl", { input: { prompt } });
10console.log(result.images[0].url);
8const prompt = "a cute and happy dog";
9const result: any = await fal.run("fal-ai/fast-lightning-sdxl", { input: { prompt } });
10console.log(result.images[0].url);
8const prompt = "a cute and happy dog";
9const result: any = await fal.run("fal-ai/fast-lightning-sdxl", { input: { prompt } });
10console.log(result.images[0].url);
36 description: string;
37 utc_offset: number;
38 featured_image_url: string;
39 hours_text: string | null;
40 hours: {
38 ["bold", "italic", "underline", "strike"], // toggled buttons
39 ["blockquote", "code-block"],
40 ["link", "image", "video", "formula"],
41
42 [{ "header": 1 }, { "header": 2 }], // custom button values
117
118 case 4:
119 const url = `https://cdn-images-1.medium.com/max/${metadata.originalWidth * 2}/${metadata.id}`;
120
121 return ``;
10
11 const result: any = await fal.run("fal-ai/fast-lightning-sdxl", { input: { prompt } });
12 return Response.json({ url: result.images[0].url });
13}
1import { generateImage } from "https://esm.town/v/isidentical/falImageGen?v=11";
2import { blob } from "https://esm.town/v/std/blob?v=12";
3
4const genKey = (key: string): string => {
5 return "genImageCache-v1-" + key;
6};
7
10 let url = await blob.getJSON(genKey(key));
11 if (!url) {
12 let resp = await generateImage(`generate the image you would expect if the url path was: "${key}"`);
13 url = resp.url;
14 await blob.setJSON(genKey(key), url);
15 }
16 return new Response((await fetch(url)).body, { headers: { "content-type": "image/jpg" } });
17}
1/**
2 * Generates an image with Stable Diffusion XL through fal.ai
3 *
4 * @param {string} prompt - The input prompt to send to SDXL model.
5 * @returns {Promise<string>} A promise that resolves to the URL of the image.
6 */
7export async function generateImage(
8 input: string,
9): Promise<{ url: string }> {
10 let resp = await fetch("https://isidentical-falimagehandler.web.val.run/", {
11 method: "POST",
12 body: JSON.stringify({ prompt: input }),