修改性别提取方式
This commit is contained in:
@@ -9,6 +9,7 @@ import com.aida.lanecarford.common.constant.MinioFileConstants;
|
||||
import com.aida.lanecarford.entity.*;
|
||||
import com.aida.lanecarford.exception.BusinessException;
|
||||
import com.aida.lanecarford.mapper.CustomerMapper;
|
||||
import com.aida.lanecarford.mapper.OutfitRequestMapper;
|
||||
import com.aida.lanecarford.mapper.TryOnEffectMapper;
|
||||
import com.aida.lanecarford.service.*;
|
||||
import com.aida.lanecarford.util.MinioUtil;
|
||||
@@ -54,6 +55,7 @@ public class TryOnEffectServiceImpl extends ServiceImpl<TryOnEffectMapper, TryOn
|
||||
private final MinioUtil minioUtil;
|
||||
private final MinioConfig minioConfig;
|
||||
private final FaceSwapConfig faceSwapConfig;
|
||||
private final OutfitRequestMapper outfitRequestMapper;
|
||||
|
||||
@Override
|
||||
public TryOnResultVo generateTryOnEffect(TryOnEffect tryOnEffectDto) {
|
||||
@@ -101,7 +103,7 @@ public class TryOnEffectServiceImpl extends ServiceImpl<TryOnEffectMapper, TryOn
|
||||
|
||||
String aiRreultlogicalUrl = null;
|
||||
if (tryOnEffectDto.getIsRegenerated() == 0 && imageUrls.size() == 1) {
|
||||
Customer customer = customerMapper.selectById(tryOnEffectDto.getCustomerId());
|
||||
OutfitRequest outfitRequest = outfitRequestMapper.selectById(style.getOutfitRequestId());
|
||||
List<Map<String, String>> maps = StringListConverter.jsonToList(style.getItems());
|
||||
StringBuffer sb = new StringBuffer();
|
||||
for (Map<String, String> map : maps) {
|
||||
@@ -111,7 +113,7 @@ public class TryOnEffectServiceImpl extends ServiceImpl<TryOnEffectMapper, TryOn
|
||||
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 " + outfitRequest.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("+sb.toString()+")** from the uploaded image. **ALL items MUST be visible and correctly worn in the final outfit.**" +
|
||||
@@ -290,7 +292,7 @@ public class TryOnEffectServiceImpl extends ServiceImpl<TryOnEffectMapper, TryOn
|
||||
return base64;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("下载图片或转换Base64失败: {}", e.getMessage(), e);
|
||||
log.error("下载图片或转换Base64失败: {}", e.getMessage());
|
||||
throw new BusinessException("Image download failed", "图片下载失败", ResultEnum.ERROR.getCode());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -206,7 +206,7 @@ public class MinioUtil {
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("验证桶存在性失败: {}", e.getMessage(), e);
|
||||
throw new MinioException("验证桶存在性失败", e);
|
||||
throw new MinioException("验证桶存在性失败bucketName:{}", bucketName);
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user