feat: enhance platform independence and integrate ComfyUI lifecycle management

- Added cross-platform process termination in PlatformUtils.
- Improved PathResolver with robust subfolder normalization.
- Integrated ComfyUI lifecycle service (Start/Stop/Restart) using ProcessHandle.
- Updated ComfyUI Bridge with improved UI refresh and sync logic.
- Added comprehensive integration and diagnostic tests.
- Updated documentation with process control details.
This commit is contained in:
Thomas Kippster
2026-05-14 16:48:43 +02:00
parent 64dff81e01
commit 3c52a0b520
34 changed files with 2587 additions and 269 deletions
@@ -0,0 +1,33 @@
package de.tki.comfymodels.service;
import de.tki.comfymodels.service.impl.ComfyDiagnosticService;
import de.tki.comfymodels.service.impl.ConfigService;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import de.tki.comfymodels.Main.AppConfig;
import static org.junit.jupiter.api.Assertions.*;
/**
* Rapid Diagnostic Test for Refresh Mechanisms.
* This test uses the ComfyDiagnosticService to verify if ComfyUI actually sees
* the models after our refresh calls.
*/
public class RefreshDiagnosticTest {
@Test
public void testModelVisibility() {
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(AppConfig.class);
ComfyDiagnosticService diagnosticService = context.getBean(ComfyDiagnosticService.class);
System.out.println("--- ComfyUI Diagnostic Scan ---");
boolean reachable = diagnosticService.isModelAvailableInComfy("non_existent_model_xyz", "checkpoint");
// If the API is up, it should at least return false for a non-existent model
// If it throws an exception or timeout, the API is down.
System.out.println("API Reachable: " + !reachable);
context.close();
}
}