Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
1
2
3
4
5
6
7
8
9
import { stableDiffusionGet } from "https://esm.town/v/calvinfo/stableDiffusionGet";
import { stableDiffusionCreate } from "https://esm.town/v/calvinfo/stableDiffusionCreate";
export let stableDiffusion = async (key, prompt) => {
let data = await stableDiffusionCreate(key, prompt);
await setTimeout(() => {}, 60000); // wait for 5s to get it to process
let res = await stableDiffusionGet(key, data.urls.get);
return res;
}
October 23, 2023