fixed comfyui

This commit is contained in:
2025-08-02 14:55:00 +02:00
parent 80873877c1
commit 83aba4c1a8
7 changed files with 18 additions and 19 deletions

View File

@@ -96,7 +96,10 @@ class ComfyUi implements ApiPluginInterface
$this->logInfo('Uploading image to ComfyUI.', ['image_path' => $imagePath]);
$response = Http::attach(
'image', file_get_contents($imagePath), basename($imagePath)
)->post($this->apiProvider->api_url . '/upload/image');
)->timeout(120)->post(rtrim($this->apiProvider->api_url, '/') . '/upload/image', [
'type' => 'input',
'overwrite' => 'false',
]);
if ($response->failed()) {
$this->logError('ComfyUI image upload failed.', ['response' => $response->body()]);
@@ -123,7 +126,7 @@ class ComfyUi implements ApiPluginInterface
private function queuePrompt(array $promptData): array
{
$this->logInfo('Queueing prompt in ComfyUI.');
$response = Http::post($this->apiProvider->api_url . '/prompt', ['prompt' => $promptData]);
$response = Http::timeout(120)->post(rtrim($this->apiProvider->api_url, '/') . '/prompt', ['prompt' => $promptData]);
if ($response->failed()) {
$this->logError('Failed to queue prompt in ComfyUI.', ['response' => $response->body()]);
@@ -137,7 +140,7 @@ class ComfyUi implements ApiPluginInterface
{
$this->logInfo('Waiting for ComfyUI result.', ['prompt_id' => $promptId]);
while (true) {
$response = Http::get($this->apiProvider->api_url . '/history/' . $promptId);
$response = Http::timeout(120)->get($this->apiProvider->api_url . '/history/' . $promptId);
$data = $response->json();
if (!empty($data[$promptId]['outputs'])) {