Skip to content

Instantly share code, notes, and snippets.

@cfjedimaster
Created April 25, 2024 15:50
Show Gist options
  • Save cfjedimaster/a5c5b45a9768c0e678d504e49ca85a40 to your computer and use it in GitHub Desktop.
Save cfjedimaster/a5c5b45a9768c0e678d504e49ca85a40 to your computer and use it in GitHub Desktop.
async function textToImage(prompt, id, token) {
let body = {
"n":4,
prompt
}
let req = await fetch('https://firefly-api.adobe.io/v2/images/generate', {
method:'POST',
headers: {
'X-Api-Key':id,
'Authorization':`Bearer ${token}`,
'Content-Type':'application/json'
},
body: JSON.stringify(body)
});
return await req.json();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment