<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://modelslab.com/api/v6/images/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>',
'model_id' => '<string>',
'init_image' => '<string>',
'mask_image' => '<string>',
'prompt' => '<string>',
'negative_prompt' => '<string>',
'width' => 512,
'height' => 512,
'samples' => 1,
'steps' => 21,
'guidance_scale' => 7.5,
'strength' => 0.7,
'scheduler' => 'DPMSolverMultistepScheduler',
'use_karras_sigmas' => 'yes',
'algorithm_type' => 'sde-dpmsolver++',
'clip_skip' => 2,
'safety_checker' => 'yes',
'seed' => 123,
'webhook' => '<string>',
'track_id' => '<string>'
]),
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;
}