|
@@ -520,64 +520,65 @@
|
|
|
}
|
|
|
let imgUrl = this.styleList[this.curStyleIndex].imgUrl;
|
|
|
// let base64Url = await this.image2Base64(imgUrl);
|
|
|
- let data = {
|
|
|
- "configType": "AI_Biography",
|
|
|
- "keyvalue": "ControlNet_IpAdapter",
|
|
|
- "model": "ip-adapter_xl [4209e9f7]",
|
|
|
- "cpu": "ip-adapter_clip_sdxl",
|
|
|
- "session_hash": Date.now(),
|
|
|
- "weight": 1.5,
|
|
|
- "number1": -1,
|
|
|
- "number2": -1,
|
|
|
- "number3": 0,
|
|
|
- "number4": 1,
|
|
|
- // "imageBase64": base64Url,
|
|
|
- "imageUrl":imgUrl,
|
|
|
- }
|
|
|
- let res1 = await requestConfig("AIuploadImgControlNet", data);
|
|
|
- if(!res1 || !res1.single){
|
|
|
- this.showToast("渲染失败,请重试");
|
|
|
- this.aiFlag = false;
|
|
|
- this.aiImage = "";
|
|
|
- this.myloading = false;
|
|
|
- return false;
|
|
|
- }
|
|
|
- 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 = 1;
|
|
|
- data.imageBase64 = this.inputBase64Url;
|
|
|
+ // let data = {
|
|
|
+ // "configType": "AI_Biography",
|
|
|
+ // "keyvalue": "ControlNet_IpAdapter",
|
|
|
+ // "model": "ip-adapter_xl [4209e9f7]",
|
|
|
+ // "cpu": "ip-adapter_clip_sdxl",
|
|
|
+ // "session_hash": Date.now(),
|
|
|
+ // "weight": 1.5,
|
|
|
+ // "number1": -1,
|
|
|
+ // "number2": -1,
|
|
|
+ // "number3": 0,
|
|
|
+ // "number4": 1,
|
|
|
+ // // "imageBase64": base64Url,
|
|
|
+ // "imageUrl":imgUrl,
|
|
|
+ // }
|
|
|
+ // let res1 = await requestConfig("AIuploadImgControlNet", data);
|
|
|
+ // if(!res1 || !res1.single){
|
|
|
+ // this.showToast("渲染失败,请重试");
|
|
|
+ // this.aiFlag = false;
|
|
|
+ // this.aiImage = "";
|
|
|
+ // this.myloading = false;
|
|
|
+ // return false;
|
|
|
+ // }
|
|
|
+ // 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 = 1;
|
|
|
+ // data.imageBase64 = this.inputBase64Url;
|
|
|
|
|
|
- let res2 = await requestConfig("AIuploadImgControlNet", data);
|
|
|
- if(!res2 || !res2.success){
|
|
|
- this.showToast("渲染失败,请重试");
|
|
|
- this.aiFlag = false;
|
|
|
- this.aiImage = "";
|
|
|
- this.myloading = false;
|
|
|
- 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 = "";
|
|
|
- this.myloading = false;
|
|
|
- return false;
|
|
|
- }
|
|
|
+ // let res2 = await requestConfig("AIuploadImgControlNet", data);
|
|
|
+ // if(!res2 || !res2.success){
|
|
|
+ // this.showToast("渲染失败,请重试");
|
|
|
+ // this.aiFlag = false;
|
|
|
+ // this.aiImage = "";
|
|
|
+ // this.myloading = false;
|
|
|
+ // 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 = "";
|
|
|
+ // this.myloading = false;
|
|
|
+ // return false;
|
|
|
+ // }
|
|
|
+ let session_hash = Date.now();
|
|
|
const prompt = this.styleList[this.curStyleIndex].prompt;
|
|
|
const noPromot = this.styleList[this.curStyleIndex].negativePrompt;
|
|
|
let unit = 768 / this.screenWidth;
|
|
@@ -596,7 +597,9 @@
|
|
|
"sampler":"DDIM",
|
|
|
"controlNetSessionHash":session_hash,
|
|
|
"cfgScale":12,
|
|
|
- "denoising":0.9
|
|
|
+ "denoising":0.9,
|
|
|
+ image:this.shottingImg,
|
|
|
+ styleImage:imgUrl,
|
|
|
};
|
|
|
let res = await requestConfig("generateTaskImgToImgForAliyun", parmas);
|
|
|
console.log("图生图结果:", res);
|