提示词加入类别

This commit is contained in:
litianxiang
2025-10-28 17:37:03 +08:00
parent 43ce7a8933
commit f75d8db77c
2 changed files with 13 additions and 6 deletions

View File

@@ -40,7 +40,7 @@ public class WebConfig implements WebMvcConfigurer {
registry.addInterceptor(jwtInterceptor)
.addPathPatterns("/api/**/**") // 保护这些路径
.excludePathPatterns(Arrays.asList("/api/auth/precheckEmail", "/api/auth/registerOrLogin",
"/api/auth/forgotPwd", "/api/style/callback")); // 排除登录接口
"/api/auth/forgotPwd", "/api/style/callback","/api/try-on-effects/*","/api/customer-photos/*","/api/visit-records/*")); // 排除登录接口
}
/**

View File

@@ -11,6 +11,7 @@ import com.aida.lanecarford.mapper.CustomerMapper;
import com.aida.lanecarford.mapper.TryOnEffectMapper;
import com.aida.lanecarford.service.*;
import com.aida.lanecarford.util.MinioUtil;
import com.aida.lanecarford.util.StringListConverter;
import com.aida.lanecarford.vo.TryOnResultVo;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
@@ -27,10 +28,7 @@ import org.springframework.stereotype.Service;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.*;
import java.util.concurrent.TimeUnit;
/**
@@ -102,10 +100,19 @@ public class TryOnEffectServiceImpl extends ServiceImpl<TryOnEffectMapper, TryOn
String aiRreultlogicalUrl = null;
if (tryOnEffectDto.getIsRegenerated() == 0 && imageUrls.size() == 1) {
Customer customer = customerMapper.selectById(tryOnEffectDto.getCustomerId());
List<Map<String, String>> maps = StringListConverter.jsonToList(style.getItems());
StringBuffer sb = new StringBuffer();
for (Map<String, String> map : maps) {
String category = map.get("category");
sb.append("a ");
sb.append( category);
sb.append(",");
}
prompt = "A full-body, photorealistic professional studio shot of a **young " + customer.getGender() + "**, mid-20s, with **clear facial features and a confident expression**. The model is centered in the frame.They are **standing in a direct, static, full-view pose** on a **clean, light white backdrop** **The entire figure, from head to toe, should be in frame and occupy approximately 80% of the vertical space.**.\n" +
"\n" +
"**CRITICAL COMPOSITION INSTRUCTION:**\n" +
"Generate a single, seamless image of the model with a complete and fully visible head,**wearing ALL distinct items** from the uploaded image. **ALL items MUST be visible and correctly worn in the final outfit.**" +
"Generate a single, seamless image of the model with a complete and fully visible head,**wearing ALL distinct items("+sb.toString()+")** from the uploaded image. **ALL items MUST be visible and correctly worn in the final outfit.**" +
"\n" +
"**Placement Detail:** Outerwear must be worn on the outside, and if a bag is present, it must be visible.\n" +
"**Quality:** Ultra-high resolution, The figure should fill the frame as much as possible,studio photography quality. Emphasize **realistic fabric textures and sharp print fidelity**.\n" +