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]); $this->logInfo('Uploading image to ComfyUI.', ['image_path' => $imagePath]);
$response = Http::attach( $response = Http::attach(
'image', file_get_contents($imagePath), basename($imagePath) '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()) { if ($response->failed()) {
$this->logError('ComfyUI image upload failed.', ['response' => $response->body()]); $this->logError('ComfyUI image upload failed.', ['response' => $response->body()]);
@@ -123,7 +126,7 @@ class ComfyUi implements ApiPluginInterface
private function queuePrompt(array $promptData): array private function queuePrompt(array $promptData): array
{ {
$this->logInfo('Queueing prompt in ComfyUI.'); $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()) { if ($response->failed()) {
$this->logError('Failed to queue prompt in ComfyUI.', ['response' => $response->body()]); $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]); $this->logInfo('Waiting for ComfyUI result.', ['prompt_id' => $promptId]);
while (true) { 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(); $data = $response->json();
if (!empty($data[$promptId]['outputs'])) { if (!empty($data[$promptId]['outputs'])) {

View File

@@ -126,7 +126,7 @@ const showStyleSelectorView = ref(false);
} }
.context-menu li:hover { .context-menu li:hover {
background: var(--color-text); /* Adjust hover background for dark mode */ @apply hover:bg-gray-100 dark:hover:bg-gray-700;
color: var(--color-background); /* Adjust hover text color for dark mode */ @apply dark:hover:text-gray-400;
} }
</style> </style>

View File

@@ -62,9 +62,10 @@ onMounted(() => {
<style scoped> <style scoped>
.style-selector { .style-selector {
background: white; @apply bg-white dark:bg-gray-800 !important;
border: 1px solid #ccc; @apply border border-gray-300 dark:border-gray-700;
box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.1); @apply shadow-lg dark:shadow-none;
@apply text-gray-900 dark:text-white !important;
z-index: 1000; z-index: 1000;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@@ -85,6 +86,7 @@ onMounted(() => {
.style-selector-header h3 { .style-selector-header h3 {
margin: 0; margin: 0;
@apply dark:text-white;
color: #333; color: #333;
} }
@@ -134,12 +136,12 @@ onMounted(() => {
.style-details h4 { .style-details h4 {
margin: 0; margin: 0;
color: #007bff; @apply text-blue-600 dark:text-white;
} }
.style-details p { .style-details p {
margin: 5px 0 0; margin: 5px 0 0;
font-size: 0.9em; font-size: 0.9em;
color: #666; @apply text-gray-600 dark:text-gray-400;
} }
</style> </style>

View File

@@ -14,4 +14,5 @@ return [
'navigation.previous' => 'Zurück', 'navigation.previous' => 'Zurück',
'navigation.next' => 'Weiter', 'navigation.next' => 'Weiter',
'navigation.page_of' => 'Seite :currentPage von :totalPages', 'navigation.page_of' => 'Seite :currentPage von :totalPages',
'loading_spinner.processing_image' => 'Bild wird verarbeitet...',
]; ];

View File

@@ -14,4 +14,5 @@ return [
'navigation.previous' => 'Previous', 'navigation.previous' => 'Previous',
'navigation.next' => 'Next', 'navigation.next' => 'Next',
'navigation.page_of' => 'Page :currentPage of :totalPages', 'navigation.page_of' => 'Page :currentPage of :totalPages',
'loading_spinner.processing_image' => 'Processing image...',
]; ];

View File

@@ -31,12 +31,3 @@ Route::middleware('auth')->group(function () {
require __DIR__.'/auth.php'; require __DIR__.'/auth.php';
Route::get('/test-translations-en', function () {
app()->setLocale('en');
return response()->json(trans('api'));
});
Route::get('/test-translations-de', function () {
app()->setLocale('de');
return response()->json(trans('api'));
});

View File

@@ -3,6 +3,7 @@ import forms from '@tailwindcss/forms';
/** @type {import('tailwindcss').Config} */ /** @type {import('tailwindcss').Config} */
export default { export default {
darkMode: 'class',
content: [ content: [
'./vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php', './vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php',
'./storage/framework/views/*.php', './storage/framework/views/*.php',