提示词加入类别
This commit is contained in:
@@ -40,7 +40,7 @@ public class WebConfig implements WebMvcConfigurer {
|
|||||||
registry.addInterceptor(jwtInterceptor)
|
registry.addInterceptor(jwtInterceptor)
|
||||||
.addPathPatterns("/api/**/**") // 保护这些路径
|
.addPathPatterns("/api/**/**") // 保护这些路径
|
||||||
.excludePathPatterns(Arrays.asList("/api/auth/precheckEmail", "/api/auth/registerOrLogin",
|
.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/*")); // 排除登录接口
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import com.aida.lanecarford.mapper.CustomerMapper;
|
|||||||
import com.aida.lanecarford.mapper.TryOnEffectMapper;
|
import com.aida.lanecarford.mapper.TryOnEffectMapper;
|
||||||
import com.aida.lanecarford.service.*;
|
import com.aida.lanecarford.service.*;
|
||||||
import com.aida.lanecarford.util.MinioUtil;
|
import com.aida.lanecarford.util.MinioUtil;
|
||||||
|
import com.aida.lanecarford.util.StringListConverter;
|
||||||
import com.aida.lanecarford.vo.TryOnResultVo;
|
import com.aida.lanecarford.vo.TryOnResultVo;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
@@ -27,10 +28,7 @@ import org.springframework.stereotype.Service;
|
|||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -102,10 +100,19 @@ public class TryOnEffectServiceImpl extends ServiceImpl<TryOnEffectMapper, TryOn
|
|||||||
String aiRreultlogicalUrl = null;
|
String aiRreultlogicalUrl = null;
|
||||||
if (tryOnEffectDto.getIsRegenerated() == 0 && imageUrls.size() == 1) {
|
if (tryOnEffectDto.getIsRegenerated() == 0 && imageUrls.size() == 1) {
|
||||||
Customer customer = customerMapper.selectById(tryOnEffectDto.getCustomerId());
|
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" +
|
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" +
|
"\n" +
|
||||||
"**CRITICAL COMPOSITION INSTRUCTION:**\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" +
|
"\n" +
|
||||||
"**Placement Detail:** Outerwear must be worn on the outside, and if a bag is present, it must be visible.\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" +
|
"**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" +
|
||||||
|
|||||||
Reference in New Issue
Block a user