|
|
@@ -252,6 +252,8 @@ class AIImageGenerationService
|
|
|
if ($task->width && $task->height) {
|
|
|
$apiParams['size'] = $task->width . 'x' . $task->height;
|
|
|
}
|
|
|
+
|
|
|
+ $api_url = 'https://token.ithinkai.cn/v1/images/generations';
|
|
|
|
|
|
// 参考图片
|
|
|
if ($task->ref_img_url) {
|
|
|
@@ -259,13 +261,14 @@ class AIImageGenerationService
|
|
|
$apiParams['image_url'] = [
|
|
|
'url' => $imageUrl
|
|
|
];
|
|
|
+ $api_url = 'https://token.ithinkai.cn/v1/images/edits';
|
|
|
}
|
|
|
|
|
|
dLog('generate')->info('GPT-Image2 API参数: ', $apiParams);
|
|
|
- logDB('generate', 'info', 'GPT-Image2任务提交', ['task_id' => $task->task_id, 'params' => $apiParams]);
|
|
|
+ logDB('generate', 'info', 'GPT-Image2任务提交', ['task_id' => $task->task_id, 'api_url' => $api_url, 'params' => $apiParams]);
|
|
|
|
|
|
// 调用GPT-Image2 API
|
|
|
- $response = $this->httpClient->post('https://token.ithinkai.cn/v1/images/generations', [
|
|
|
+ $response = $this->httpClient->post($api_url, [
|
|
|
'headers' => [
|
|
|
'Authorization' => 'Bearer ' . $apiKey,
|
|
|
'Content-Type' => 'application/json',
|