Parcourir la source

修改sd的提示词非必输,放开控制请求comfy

wuyouzhi il y a 1 mois
Parent
commit
045e512482

+ 10 - 11
xyzc-start/src/main/java/com/xyzc/start/service/impl/ComfyUIServiceImpl.java

@@ -38,7 +38,7 @@ public class ComfyUIServiceImpl implements IComfyUIService {
 
     public String callbackGenPicUrl="http://47.121.123.230:18660/web/comfyui/updatePromtId";
 
-    public String comfyuiUrl = "http://121.15.198.153:43210/prompt";
+    public String comfyuiUrl = "http://10.168.1.190:43210/prompt";
 
     private final ComfyUIMapper baseMapper;
     // 图片系统配置类
@@ -112,6 +112,7 @@ public class ComfyUIServiceImpl implements IComfyUIService {
         else // SD类型
             baseUserPhotoFolder.setType(2l);
         baseUserPhotoFolder.setPhotoOssId(ossId);
+        baseUserPhotoFolder.setBaseUserId(SecurityUser.getUserId());
         photoFolderMapper.insertOrUpdate(baseUserPhotoFolder);
     }
 
@@ -231,8 +232,8 @@ public class ComfyUIServiceImpl implements IComfyUIService {
         baseUserPhotoFolder.setWorkflowId(comfyuiWorkflow.getId());
         baseUserPhotoFolder.setBaseUserId(SecurityUser.getUserId());
         if (Arrays.asList(1, 2, 4, 6, 7).contains(picType)) {
-            sendWorkFlow(picType, picUrl, baseUserPhotoFolder, comfyuiWorkflow);
             log.info("发送工作流1、2、4、6、7、9");
+            sendWorkFlow(picType, picUrl, baseUserPhotoFolder, comfyuiWorkflow);
         } else if (3 == picType) {
             log.info("发送工作流3");
 //            sendWorkFlow3(picType, picUrl, comfyuiWorkflow, jsonObject);//二维码制作
@@ -555,12 +556,12 @@ public class ComfyUIServiceImpl implements IComfyUIService {
         String primitive = promptJson.getString("primitive");
         // 反向提示词
         String oppositePrimitive = promptJson.getString("oppositePrimitive");
-        if (Strings.isBlank(primitive)) {
-            throw new ServerException(ErrorCode.COMFYUI_INPUT_PRIMITIVE);
-        }
-        if (Strings.isBlank(oppositePrimitive)) {
-            throw new ServerException(ErrorCode.COMFYUI_INPUT_OPPOSITEPRIMITIVE);
-        }
+//        if (Strings.isBlank(primitive)) {
+//            throw new ServerException(ErrorCode.COMFYUI_INPUT_PRIMITIVE);
+//        }
+//        if (Strings.isBlank(oppositePrimitive)) {
+//            throw new ServerException(ErrorCode.COMFYUI_INPUT_OPPOSITEPRIMITIVE);
+//        }
 
         if(width <512) {
             width = 512;
@@ -621,9 +622,9 @@ public class ComfyUIServiceImpl implements IComfyUIService {
             assert2ComfyUI2save(baseUserPhotoFolder, jsonObject, null);
         } catch (Exception e) {
             log.error(baseUserPhotoFolder.getBaseUserId()+" 证件照制作异常");
+            e.printStackTrace();
             throw new ServerException(ErrorCode.INTERNAL_SERVER_ERROR);
         }
-//        sendRestTemplate(jsonObject);
     }
 
     /**
@@ -703,8 +704,6 @@ public class ComfyUIServiceImpl implements IComfyUIService {
         opp2Array.remove(0);
         opp2Array.add(oppositePrimitive);
 
-        sendRestTemplate(jsonObject);
-
         try {
             assert2ComfyUI2save(baseUserPhotoFolder, jsonObject, null);
         } catch (Exception e) {