ryu-js / lib /@randydev /flux-1-schnell.js
randydev's picture
Update lib/@randydev/flux-1-schnell.js
34a84a6 verified
raw
history blame
494 Bytes
import got from 'got';
async function FluxSchnell(message) {
const run = await got.post(`https://api.cloudflare.com/client/v4/accounts/${process.env['ACCOUNT_ID']}/ai/run/@cf/black-forest-labs/flux-1-schnell`, {
headers: {
'Authorization': `Bearer ${process.env['CLOUDFLARE_API_KEY']}`,
'Content-Type': 'application/json'
},
json: {
'prompt': message
}
}).json();
return run.result.image;
}
export { FluxSchnell };