'https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image', CURLOPT_POST => true, CURLOPT_POSTFIELDS => json_encode(['prompt'=>'a bamboo basket full of fresh tomatoes','image_size'=>'square_hd']), CURLOPT_HTTPHEADER => ['Content-Type: application/json'], CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 60, ]); $tmp = 'D:/Softwares/phpstudy_pro/WWW/fenleixinxi/tmp_img/test_ai_'.$i.'.jpg'; $data = curl_exec($ch); file_put_contents($tmp, $data); echo "test_$i md5=" . md5_file($tmp) . ' size=' . strlen($data) . PHP_EOL; }