tsurumure 1 месяц назад
Родитель
Сommit
0e6cc5812c

+ 6 - 1
src/main/java/com/backendsys/modules/sdk/comfyui/service/impl/ComfyuiServiceImpl.java

@@ -1,5 +1,7 @@
 package com.backendsys.modules.sdk.comfyui.service.impl;
 
+import cn.hutool.core.convert.Convert;
+import cn.hutool.core.util.StrUtil;
 import cn.hutool.json.JSONArray;
 import cn.hutool.json.JSONObject;
 import com.backendsys.modules.common.Filter.WebClientFilter;
@@ -25,6 +27,8 @@ public class ComfyuiServiceImpl implements ComfyuiService {
     private String COMFYUI_HOST;
     @Value("${comfyui.token}")
     private String COMFYUI_TOKEN;
+    @Value("${comfyui.ports}")
+    private String COMFYUI_PORTS_STR;
 
     private WebClient webClient;
     public WebClient getWebClient() {
@@ -64,7 +68,8 @@ public class ComfyuiServiceImpl implements ComfyuiService {
     @Override
     public Integer getBestPort() {
 
-        List<Integer> PORTS = Arrays.asList(8000, 8001, 8002, 8003, 8004, 8005, 8006, 8007);
+//        List<Integer> PORTS = Arrays.asList(8000, 8001, 8002, 8003, 8004, 8005, 8006, 8007);
+        List<Integer> PORTS = Convert.toList(Integer.class, StrUtil.split(COMFYUI_PORTS_STR, ","));
 
         List<ComfyuiQueueItem> queueCountsList = new ArrayList<>();
 

+ 1 - 0
src/main/resources/application-dev.yml

@@ -211,6 +211,7 @@ klingai:
 
 comfyui:
   host: 127.0.0.1
+  ports: 8000, 8001, 8002, 8003, 8004, 8005, 8006, 8007
   token: $2b$12$.MR4qGaFetN1FPQzbfyIrehsyjnPJ12xAZhR/l7KZpLkUPQTCG4gy
   is-save: true
   # queue-key: comfyui:queue

+ 1 - 0
src/main/resources/application-local.yml

@@ -226,6 +226,7 @@ klingai:
 
 comfyui:
   host: 43.128.1.201
+  ports: 8000, 8001, 8002, 8003, 8004, 8005, 8006, 8007
   token: $2b$12$.MR4qGaFetN1FPQzbfyIrehsyjnPJ12xAZhR/l7KZpLkUPQTCG4gy
   is-save: true
   # queue-key: comfyui:queue

+ 1 - 0
src/main/resources/application-prod.yml

@@ -212,6 +212,7 @@ klingai:
 
 comfyui:
   host: 127.0.0.1
+  ports: 8000, 8001, 8002, 8003, 8004, 8005, 8006, 8007
   token: $2b$12$.MR4qGaFetN1FPQzbfyIrehsyjnPJ12xAZhR/l7KZpLkUPQTCG4gy
   is-save: true
   # queue-key: comfyui:queue