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 }; |