Update
This commit is contained in:
@@ -14,22 +14,22 @@ public static function generateSchnellImage($uuid, $prompt, $width = 1024, $heig
|
||||
$response = Http::timeout(60)
|
||||
->withHeaders([
|
||||
'Content-Type' => 'application/json',
|
||||
'Authorization' => 'Bearer ' . $api_key,
|
||||
'Authorization' => 'Bearer '.$api_key,
|
||||
])
|
||||
->post('https://api.runware.ai/v1', [
|
||||
[
|
||||
"taskUUID" => $uuid,
|
||||
"taskType" => "imageInference",
|
||||
"width" => $width,
|
||||
"height" => $height,
|
||||
"numberResults" => 1,
|
||||
"outputFormat" => "WEBP",
|
||||
"outputType" => ["URL"],
|
||||
"includeCost" => true,
|
||||
"inputImages" => [],
|
||||
"positivePrompt" => $prompt,
|
||||
"model" => "runware:100@1"
|
||||
]
|
||||
'taskUUID' => $uuid,
|
||||
'taskType' => 'imageInference',
|
||||
'width' => $width,
|
||||
'height' => $height,
|
||||
'numberResults' => 1,
|
||||
'outputFormat' => 'WEBP',
|
||||
'outputType' => ['URL'],
|
||||
'includeCost' => true,
|
||||
'inputImages' => [],
|
||||
'positivePrompt' => $prompt,
|
||||
'model' => 'runware:100@1',
|
||||
],
|
||||
]);
|
||||
|
||||
// Check if the request was successful
|
||||
@@ -50,10 +50,10 @@ public static function generateSchnellImage($uuid, $prompt, $width = 1024, $heig
|
||||
throw new \Exception('Image URL not found in response');
|
||||
}
|
||||
|
||||
throw new \Exception('API request failed: ' . $response->status() . ' - ' . $response->body());
|
||||
throw new \Exception('API request failed: '.$response->status().' - '.$response->body());
|
||||
} catch (\Exception $e) {
|
||||
// Log the error or handle as needed
|
||||
\Log::error('RunwareAI API Error: ' . $e->getMessage());
|
||||
\Log::error('RunwareAI API Error: '.$e->getMessage());
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user