diff --git a/privet/ailabs/controller/dalle.php b/privet/ailabs/controller/dalle.php index ffc1d81..73e7c86 100644 --- a/privet/ailabs/controller/dalle.php +++ b/privet/ailabs/controller/dalle.php @@ -66,22 +66,10 @@ class dalle extends GenericController protected function prepare($opts) { - if (filter_var($this->job['request'], FILTER_VALIDATE_URL)) { - // https://platform.openai.com/docs/api-reference/images/create-variation - // The image to use as the basis for the variation(s). Must be a valid PNG file, less than 4MB, and square. - $image = curl_file_create($this->job['request'], 'image/png'); - $opts += [ - 'image' => $image, - 'n' => $this->cfg->n, - 'response_format' => $this->cfg->response_format, - ]; - } else { - $opts += [ - 'prompt' => trim($this->job['request']), - 'n' => $this->cfg->n, - 'response_format' => $this->cfg->response_format, - ]; - } + + $opts += [ + 'prompt' => trim($this->job['request']), + ]; return $opts; } @@ -93,13 +81,7 @@ class dalle extends GenericController $result = new resultSubmit(); - if (empty($opts['image'])) { - // https://api.openai.com/v1/images/generations - $result->response = $api->sendRequest($this->cfg->url_generations, 'POST', $opts); - } else { - // https://api.openai.com/v1/images/variations - $result->response = $api->sendRequest($this->cfg->url_variations, 'POST', $opts); - } + $result->response = $api->sendRequest($this->cfg->url_generations, 'POST', $opts); $result->responseCodes = $api->responseCodes; @@ -173,4 +155,4 @@ class dalle extends GenericController return $result; } -} +} \ No newline at end of file