jbilcke-hf's picture
jbilcke-hf HF Staff
yep, it works
8101ed0
raw
history blame
271 Bytes
export async function generateImage(prompt: string): Promise<string> {
const requestUri = `/api/resolvers/image?p=${encodeURIComponent(prompt)}`
const res = await fetch(requestUri)
const blob = await res.blob()
const url = URL.createObjectURL(blob)
return url
}