Merge branch 'release/3.0' into dev/dev

This commit is contained in:
2024-12-19 15:32:10 +08:00
2 changed files with 13 additions and 5 deletions

View File

@@ -314,7 +314,14 @@ public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> i
private String modifyPrompt(String userInput, Generate generate, String level1Type) {
String text = "";
String translated = pythonService.promptTranslate(userInput);
String prefix = "";
if (userInput.startsWith("Painting Style")
|| userInput.startsWith("Illustration Style")
|| userInput.startsWith("Real Style") ){
prefix = userInput.substring(0, userInput.indexOf(",")) + ", ";
userInput = userInput.substring(userInput.indexOf(",") + 1);
}
String translated = prefix + pythonService.promptTranslate(userInput);
switch (level1Type) {
case "Moodboard":
text = translated + ",high quality";

View File

@@ -300,9 +300,9 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
sb.append("wearing ").append(collect);
}
if (StringUtils.isEmpty(prompt)) {
sb.append(",8K realistic,HDR");
sb.append(",high quality clothing details,8K realistic,HDR");
}else {
sb.append(",").append(prompt).append(",8K realistic,HDR");
sb.append(",high quality clothing details,").append(prompt).append(",8K realistic,HDR");
}
// 走模型
pythonService.toProductImage(tDesignPythonOutfit.getDesignUrl(), taskId, sb.toString(), toProductImageDTO.getImageStrength(), productType);
@@ -320,9 +320,9 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
result.add(toProductImageResult);
}else {
if (StringUtils.isEmpty(prompt)) {
sb.append(",8K realistic,HDR");
sb.append(",high quality clothing details,8K realistic,HDR");
}else {
sb.append(",").append(prompt).append(",8K realistic,HDR");
sb.append(",high quality clothing details,").append(prompt).append(",8K realistic,HDR");
}
taskId = UUID.randomUUID() + "-" + i + "-" + userHolder.getId();
@@ -342,6 +342,7 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
result.add(toProductImageResult);
}
i ++;
sb = new StringBuilder("The best quality, masterpiece, real image.");
// 添加需要扣除的积分到预扣除区
creditsService.addRecordToCreditsDeduction(userHolder.getId(), taskId, CreditsEventsEnum.TO_PRODUCT_IMAGE);
}