更换Moodboard和Printboard提示词
This commit is contained in:
@@ -1203,6 +1203,9 @@ public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> i
|
|||||||
* @param modelName advanced high normal
|
* @param modelName advanced high normal
|
||||||
*/
|
*/
|
||||||
private HashMap<String, String> chooseModelAndPrompt(GenerateThroughImageTextDTO generateDTO, String modelName) {
|
private HashMap<String, String> chooseModelAndPrompt(GenerateThroughImageTextDTO generateDTO, String modelName) {
|
||||||
|
if (StringUtil.isNullOrEmpty(modelName)){
|
||||||
|
throw new BusinessException("system error");
|
||||||
|
}
|
||||||
HashMap<String, String> modelAndPromptMap = new HashMap<>();
|
HashMap<String, String> modelAndPromptMap = new HashMap<>();
|
||||||
boolean isUseImage;
|
boolean isUseImage;
|
||||||
if (Objects.isNull(generateDTO.getCollectionElementId())
|
if (Objects.isNull(generateDTO.getCollectionElementId())
|
||||||
@@ -1218,7 +1221,7 @@ public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> i
|
|||||||
String style = generateDTO.getText().substring(0, firstCommaIndex).trim();
|
String style = generateDTO.getText().substring(0, firstCommaIndex).trim();
|
||||||
|
|
||||||
String prompt = generateDTO.getText().substring(firstCommaIndex + 1).trim();
|
String prompt = generateDTO.getText().substring(firstCommaIndex + 1).trim();
|
||||||
prompt = getPrintboardPrompt(style, prompt);
|
prompt = getPrintboardPrompt(style, prompt,modelName);
|
||||||
modelAndPromptMap.put(ModelConstants.PROMPT, prompt);
|
modelAndPromptMap.put(ModelConstants.PROMPT, prompt);
|
||||||
|
|
||||||
|
|
||||||
@@ -1239,7 +1242,14 @@ public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> i
|
|||||||
}
|
}
|
||||||
|
|
||||||
} else if (ModelConstants.MOODBOARD.equals(generateDTO.getLevel1Type())) {
|
} else if (ModelConstants.MOODBOARD.equals(generateDTO.getLevel1Type())) {
|
||||||
String prompt = generateDTO.getText() + "high-resolution, ultra-detailed, realistic textures, perfect anatomy, cinematic lighting, 8k render, editorial photography style";
|
String userInput = generateDTO.getText();
|
||||||
|
String systemPrompt = "high-resolution, ultra-detailed, realistic textures, cinematic lighting, 8k render, editorial photography style";
|
||||||
|
String prompt;
|
||||||
|
if (userInput == null || userInput.trim().isEmpty()) {
|
||||||
|
throw new BusinessException("prompt null");
|
||||||
|
} else {
|
||||||
|
prompt = "Theme: " + userInput.trim() + "\nRequirement: " + systemPrompt;
|
||||||
|
}
|
||||||
modelAndPromptMap.put(ModelConstants.PROMPT, prompt);
|
modelAndPromptMap.put(ModelConstants.PROMPT, prompt);
|
||||||
|
|
||||||
if (ModelConstants.ADVANCED.equals(modelName)) {
|
if (ModelConstants.ADVANCED.equals(modelName)) {
|
||||||
@@ -1560,19 +1570,40 @@ public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> i
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private String getPrintboardPrompt(String style, String prompt) {
|
private String getPrintboardPrompt(String style, String userInput, String modelName) {
|
||||||
|
String systemPrompt = null;
|
||||||
|
String prompt;
|
||||||
|
|
||||||
if ("Painting Style".equals(style)) {
|
if ("Painting Style".equals(style)) {
|
||||||
prompt = "1.Requirements: Create a seamless, tiling fashion printboard pattern for apparel. The output must be stylish, contemporary, and suitable for real garment printing. Design pattern, seamless, highly detailed, elegant composition, visually balanced, professional textile print\n" +
|
if (ModelConstants.ADVANCED.equals(modelName)) {
|
||||||
"2.Core Theme: " + prompt + "\n" +
|
systemPrompt = "Tileable seamless pattern, elegant composition, visually balanced, Light watercolor, Giplie Studio (style) pattern with even color field background, high-quality digital print, zero perspective depth, harmonious visual balance, consistent color tone.";
|
||||||
"3.Style: painting_style-The painting style refers to the overall approach, techniques, and artistic philosophy used in the artwork. For fashion designs that will be applied to printboards, it is important to define the unique stylistic elements that would translate well into wearable patterns.";
|
} else if (ModelConstants.HIGH.equals(modelName)) {
|
||||||
|
systemPrompt = "Design pattern, seamless, highly detailed, elegant composition, visually balanced. \n" +
|
||||||
|
"Painting style: traditional painting, hand-painted, brush strokes.";
|
||||||
|
}
|
||||||
} else if ("Illustration Style".equals(style)) {
|
} else if ("Illustration Style".equals(style)) {
|
||||||
prompt = "1.Requirements: Create a seamless, tiling fashion printboard pattern for apparel. The output must be stylish, contemporary, and suitable for real garment printing. Design pattern, seamless, highly detailed, elegant composition, visually balanced, professional textile print\n" +
|
if (ModelConstants.ADVANCED.equals(modelName)) {
|
||||||
"2.Core Theme: " + prompt + "\n" +
|
systemPrompt = "Tileable seamless pattern, elegant composition, visually balanced, flat graphic, clean lines pattern with even color field background, high-quality digital print, zero perspective depth, harmonious visual balance, consistent color tone. ";
|
||||||
"3.Style: illustration_style-Illustration style focuses on the visual storytellingaspect, often used to depict narratives, characters, or thematic concepts. Forfashion, this style can introduce vivid and artistic interpretations, often aligned with specific themes.";
|
} else if (ModelConstants.HIGH.equals(modelName)) {
|
||||||
|
systemPrompt = "Design pattern, seamless, highly detailed, elegant composition, visually balanced. \n" +
|
||||||
|
"Illustration Style: flat graphic, clean lines.";
|
||||||
|
}
|
||||||
} else if ("Real Style".equals(style)) {
|
} else if ("Real Style".equals(style)) {
|
||||||
prompt = "1.Requirements: Create a seamless, tiling fashion printboard pattern for apparel. The output must be stylish, contemporary, and suitable for real garment printing. Design pattern, seamless, highly detailed, elegant composition, visually balanced, professional textile print\n" +
|
if (ModelConstants.ADVANCED.equals(modelName)) {
|
||||||
"2.Core Theme: " + prompt + "\n" +
|
systemPrompt = "Tileable seamless pattern, even color field background, photorealistic style pattern, high-quality digital print, zero perspective depth, harmonious visual balance, consistent color tone. ";
|
||||||
"3.Style: real_style-Real style in fashion is all about authenticity. It featuresnatural fabrics, simple cuts that mirror real life silhouettes, and colors inspired bythe everyday world, exuding a down-to-earth and genuine charm.";
|
} else if (ModelConstants.HIGH.equals(modelName)) {
|
||||||
|
systemPrompt = "Design pattern, seamless, highly detailed, elegant composition, visually balanced. \n" +
|
||||||
|
"Flat textile pattern printed directly on fabric surface, no three-dimensional objects, no items placed on cloth. \n" +
|
||||||
|
"Real style: fabric print, realistic woven/printed pattern, detailed surface pattern only";
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
throw new BusinessException("style error:"+ style);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (userInput == null || userInput.trim().isEmpty()) {
|
||||||
|
throw new BusinessException("prompt null");
|
||||||
|
} else {
|
||||||
|
prompt = "Theme: " + userInput.trim() + "\nRequirement: " + systemPrompt;
|
||||||
}
|
}
|
||||||
return prompt;
|
return prompt;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user