Created
April 25, 2024 15:50
-
-
Save cfjedimaster/a5c5b45a9768c0e678d504e49ca85a40 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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