|
|
|
@ -168,46 +168,7 @@ public class LibTxt2Img extends LibLibCommon {
|
|
|
|
|
|
|
|
|
|
return generateUuid;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 简化版提交文生图任务(不使用LoRA和高分辨率修复)
|
|
|
|
|
*
|
|
|
|
|
* @param checkPointId 底模ID
|
|
|
|
|
* @param prompt 正向提示词
|
|
|
|
|
* @param negativePrompt 负向提示词
|
|
|
|
|
* @param steps 采样步数
|
|
|
|
|
* @param width 宽度
|
|
|
|
|
* @param height 高度
|
|
|
|
|
* @param imgCount 生成图片数量
|
|
|
|
|
* @param seed 随机种子值,-1表示随机
|
|
|
|
|
* @return 生成任务UUID
|
|
|
|
|
* @throws IOException 异常信息
|
|
|
|
|
*/
|
|
|
|
|
public static String submitSimpleTextToImageTask(
|
|
|
|
|
String checkPointId, String prompt, String negativePrompt,
|
|
|
|
|
int steps, int width, int height, int imgCount, long seed) throws IOException {
|
|
|
|
|
|
|
|
|
|
// 使用默认参数
|
|
|
|
|
return submitTextToImageTask(
|
|
|
|
|
null, // 模板UUID
|
|
|
|
|
checkPointId,
|
|
|
|
|
prompt,
|
|
|
|
|
negativePrompt,
|
|
|
|
|
15, // 默认采样方法
|
|
|
|
|
steps,
|
|
|
|
|
7.0, // 默认提示词引导系数
|
|
|
|
|
width,
|
|
|
|
|
height,
|
|
|
|
|
imgCount,
|
|
|
|
|
0, // 默认使用CPU生成随机种子
|
|
|
|
|
seed,
|
|
|
|
|
0, // 默认不启用面部修复
|
|
|
|
|
null, // 不使用LoRA
|
|
|
|
|
false, // 不启用高分辨率修复
|
|
|
|
|
0, 0, 0, 0, 0 // 高分辨率修复参数(不使用)
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询生图任务结果
|
|
|
|
|
*
|
|
|
|
@ -329,17 +290,17 @@ public class LibTxt2Img extends LibLibCommon {
|
|
|
|
|
// 创建LoRA模型列表
|
|
|
|
|
JSONArray loraModels = new JSONArray();
|
|
|
|
|
|
|
|
|
|
// 添加第一个LoRA模型
|
|
|
|
|
JSONObject lora1 = new JSONObject();
|
|
|
|
|
lora1.put("modelId", "31360f2f031b4ff6b589412a52713fcf");
|
|
|
|
|
lora1.put("weight", 0.3);
|
|
|
|
|
loraModels.add(lora1);
|
|
|
|
|
|
|
|
|
|
// 添加第二个LoRA模型
|
|
|
|
|
JSONObject lora2 = new JSONObject();
|
|
|
|
|
lora2.put("modelId", "365e700254dd40bbb90d5e78c152ec7f");
|
|
|
|
|
lora2.put("weight", 0.6);
|
|
|
|
|
loraModels.add(lora2);
|
|
|
|
|
// // 添加第一个LoRA模型
|
|
|
|
|
// JSONObject lora1 = new JSONObject();
|
|
|
|
|
// lora1.put("modelId", "31360f2f031b4ff6b589412a52713fcf");
|
|
|
|
|
// lora1.put("weight", 0.3);
|
|
|
|
|
// loraModels.add(lora1);
|
|
|
|
|
//
|
|
|
|
|
// // 添加第二个LoRA模型
|
|
|
|
|
// JSONObject lora2 = new JSONObject();
|
|
|
|
|
// lora2.put("modelId", "365e700254dd40bbb90d5e78c152ec7f");
|
|
|
|
|
// lora2.put("weight", 0.6);
|
|
|
|
|
// loraModels.add(lora2);
|
|
|
|
|
|
|
|
|
|
// 提交文生图任务(使用完整参数)
|
|
|
|
|
String generateUuid = submitTextToImageTask(
|
|
|
|
|