import axios from 'axios';
axios.post('https://api.artificialstudio.ai/api/generate', {
model: 'product-ad',
input: {
prompt : "Create a minimalist and modern background to highlight a sneaker. Choose a neutral tone, like light grey or white, with soft shadows for added depth. Add a subtle floor reflection for an elegant effect. Incorporate pastel-toned abstract geometric elements for a contemporary touch, ensuring they don't distract from the main focus. Show only the sneaker floating in the air against a vibrant background. Do not alter the sneaker's image.",
reference_image : "https://files.artificialstudio.ai/21fdf3f7-291e-4e4c-9174-53e3633036b3.webp",
image_size : "1024x1536"
},
webhook: 'https://your-webhook-url.com/api/webhook',
}, {
headers: {
'Content-Type': 'application/json',
'Authorization': 'YOUR_API_KEY'
}
}).then(res => {
console.log('Success:', res.data);
}).catch(error => {
console.error('Error:', error);
});
app.post("/api/webhook", (req: any, res: any) => {
console.log(req.body) // id, output, status, model, payload, error...
res.send("Webhook received");
});