|
@@ -338,42 +338,6 @@
|
|
|
this.styleList = [];
|
|
|
if (res.success) {
|
|
|
let list = res.list;
|
|
|
- // list.push({
|
|
|
- // id:1,
|
|
|
- // imgUrl:"https://dm.static.elab-plus.com/aiBeauty/AI3/exPic/livingroom02.png",
|
|
|
- // spaceName: "客厅",
|
|
|
- // styleName: "现代轻奢",
|
|
|
- // });
|
|
|
- // list.push({
|
|
|
- // id:2,
|
|
|
- // imgUrl:"https://dm.static.elab-plus.com/aiBeauty/AI3/exPic/livingroom02.png",
|
|
|
- // spaceName: "客厅",
|
|
|
- // styleName: "现代轻奢",
|
|
|
- // });
|
|
|
- // list.push({
|
|
|
- // id:3,
|
|
|
- // imgUrl:"https://dm.static.elab-plus.com/aiBeauty/AI3/exPic/livingroom02.png",
|
|
|
- // spaceName: "客厅",
|
|
|
- // styleName: "现代轻奢",
|
|
|
- // });
|
|
|
- // list.push({
|
|
|
- // id:4,
|
|
|
- // imgUrl:"https://dm.static.elab-plus.com/aiBeauty/AI3/exPic/livingroom02.png",
|
|
|
- // spaceName: "客厅",
|
|
|
- // styleName: "现代轻奢",
|
|
|
- // });
|
|
|
- // list.push({
|
|
|
- // id:5,
|
|
|
- // imgUrl:"https://dm.static.elab-plus.com/aiBeauty/AI3/exPic/livingroom02.png",
|
|
|
- // spaceName: "客厅",
|
|
|
- // styleName: "现代轻奢",
|
|
|
- // });
|
|
|
- // list.push({
|
|
|
- // id:6,
|
|
|
- // imgUrl:"https://dm.static.elab-plus.com/aiBeauty/AI3/exPic/livingroom02.png",
|
|
|
- // spaceName: "客厅",
|
|
|
- // styleName: "现代轻奢",
|
|
|
- // });
|
|
|
this.styleList = list;
|
|
|
}
|
|
|
if(!this.styleList || this.styleList.length==0){
|
|
@@ -535,19 +499,23 @@
|
|
|
},
|
|
|
//开始图生图流程
|
|
|
async startServer() {
|
|
|
+ if(!this.styleList || this.curStyleIndex < 0 || !this.styleList[this.curStyleIndex].imgUrl){
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ let imgUrl = this.styleList[this.curStyleIndex].imgUrl+"?imageMogr2/auto-orient/format/webp/blur/1x0/quality/75";
|
|
|
+ let base64Url = await this.image2Base64(imgUrl);
|
|
|
let data = {
|
|
|
- "configType": "ControlNet_Config",
|
|
|
- "keyvalue": "mix混合风_controlnet_upload",
|
|
|
- "server": "simple_and_quiet",
|
|
|
- "model": "control_v11p_sd15_mlsd_fp16 [77b5ad24]",
|
|
|
- "cpu": "mlsd",
|
|
|
+ "configType": "AI_Biography",
|
|
|
+ "keyvalue": "ControlNet_IpAdapter",
|
|
|
+ "model": "ip-adapter_xl [4209e9f7]",
|
|
|
+ "cpu": "ip-adapter_clip_sdxl",
|
|
|
"session_hash": Date.now(),
|
|
|
- "weight": 0.8,
|
|
|
- "number1": 0.2,
|
|
|
- "number2": 1,
|
|
|
- "number3": 0.1,
|
|
|
+ "weight": 1.5,
|
|
|
+ "number1": -1,
|
|
|
+ "number2": -1,
|
|
|
+ "number3": 0,
|
|
|
"number4": 1,
|
|
|
- "imageBase64": this.inputBase64Url
|
|
|
+ "imageBase64": base64Url
|
|
|
}
|
|
|
let res1 = await requestConfig("AIuploadImgControlNet", data);
|
|
|
if(!res1 || !res1.single){
|
|
@@ -556,15 +524,16 @@
|
|
|
this.aiImage = "";
|
|
|
return false;
|
|
|
}
|
|
|
- let session_hash = res1.single;
|
|
|
- data.model = "control_v11p_sd15_seg_fp16 [ab613144]";
|
|
|
- data.cpu = "seg_ofade20k";
|
|
|
- data.weight = 0.5;
|
|
|
- data.number1 = 0.1;
|
|
|
- data.number2 = 0.2;
|
|
|
+ let session_hash = data.session_hash;
|
|
|
+ data.model = "sai_xl_canny_256lora [566f20af]";
|
|
|
+ data.keyvalue = "ControlNet_Canny";
|
|
|
+ data.cpu = "canny";
|
|
|
+ data.weight = 0.8;
|
|
|
+ data.number1 = 100;
|
|
|
+ data.number2 = 200;
|
|
|
data.number3 = 0;
|
|
|
- data.number4 = 0.1;
|
|
|
- data.session_hash = session_hash;
|
|
|
+ data.number4 = 1;
|
|
|
+ data.imageBase64 = this.inputBase64Url;
|
|
|
|
|
|
let res2 = await requestConfig("AIuploadImgControlNet", data);
|
|
|
if(!res2 || !res2.success){
|
|
@@ -573,6 +542,22 @@
|
|
|
this.aiImage = "";
|
|
|
return false;
|
|
|
}
|
|
|
+ data.model = "t2iadapter_seg_sd14v1 [6387afb5]";
|
|
|
+ data.keyvalue = "ControlNet_Seg";
|
|
|
+ data.cpu = "seg_ofade20k";
|
|
|
+ data.weight = 0.8;
|
|
|
+ data.number1 = -1;
|
|
|
+ data.number2 = -1;
|
|
|
+ data.number3 = 0;
|
|
|
+ data.number4 = 1;
|
|
|
+ data.imageBase64 = this.inputBase64Url;
|
|
|
+ let res3 = await requestConfig("AIuploadImgControlNet", data);
|
|
|
+ if(!res3 || !res3.success){
|
|
|
+ this.showToast("渲染失败,请重试");
|
|
|
+ this.aiFlag = false;
|
|
|
+ this.aiImage = "";
|
|
|
+ return false;
|
|
|
+ }
|
|
|
|
|
|
const prompt = this.styleList[this.curStyleIndex].prompt;
|
|
|
const noPromot = this.styleList[this.curStyleIndex].negativePrompt;
|
|
@@ -584,9 +569,9 @@
|
|
|
brandId: $config.brandId,
|
|
|
height: this.imageHeight,
|
|
|
width: this.imageWidth,
|
|
|
- "moduleType": "simple_and_quiet",
|
|
|
+ "moduleType": "AI_Biography",
|
|
|
"keyword":"img_2_img",
|
|
|
- "steps":50,
|
|
|
+ "steps":20,
|
|
|
"sampler":"DDIM",
|
|
|
"controlNetSessionHash":session_hash,
|
|
|
"cfgScale":12,
|