<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://modelslab.com/api/v6/image_editing/inpaint",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'key' => '<string>',
'prompt' => '<string>',
'init_image' => '<string>',
'mask_image' => '<string>',
'negative_prompt' => '<string>',
'width' => 512,
'height' => 512,
'samples' => 1,
'num_inference_steps' => 30,
'safety_checker' => 'no',
'guidance_scale' => 5,
'strength' => 0.7,
'instant_response' => 'false',
'base64' => 'false',
'seed' => 123,
'webhook' => '<string>',
'track_id' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}