Hey guys, sorry if this is a stupid question, but i'm really struggling with it
I'm trying to make my bot answer with an image from an API request(that the bot should also make)
The thing is, I have no idea how to set the variables(the type should be an object?), how to make the code work, and anything
The code I'm trying to execute is above:
const form = new FormData()
form.append('image_file', photo)
form.append('mask_file', mask)
fetch('https://clipdrop-api.co/cleanup/v1', {
method: 'POST',
headers: {
'x-api-key': YOUR_API_KEY,
},
body: form,
})
.then(response => response.arrayBuffer())
.then(buffer => {
// buffer here is a binary representation of the returned image
})
If anyone could please help me understand how to make this work, I'd be eternally grateful ❤️
bonus: this api is a free text-to-image AI, it gives you 100 credits for free requests, and after that u have to pay