File size: 494 Bytes
dcb1206
 
 
 
 
 
 
 
1b65bec
 
 
dcb1206
34a84a6
4c0098a
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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 };