zjs_project 1 рік тому
батько
коміт
4964677c58

+ 0 - 9
src/App.vue

@@ -66,15 +66,6 @@
 					alert('监测到E1004错误' + error);
 				}
 			}, true)
-			window.addEventListener('beforeunload', function(event) {
-				// 检查内存使用情况
-				if (performance.memory.usedJSHeapSize >= performance.memory.jsHeapSizeLimit) {
-					// 内存不足,执行重新加载页面的逻辑
-					event.preventDefault();
-					// window.location.reload();
-					alert("**内存不足,页面重新载入**")
-				}
-			});
 			// 监听页面隐藏事件
 			window.addEventListener('pagehide', function(event) {
 			    // 判断页面是否因为内存不足而被卸载或隐藏

+ 61 - 58
src/components/newBottomCom/viewMask/viewMask.vue

@@ -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);

+ 1 - 1
src/main.js

@@ -39,7 +39,7 @@ window.echarts = echarts
 
 console.log('***process.env***', process.env);
 window.env = process.env.NODE_ENV;
-env = env == 'development' ? 'production' : env;
+env = env == 'development' ? 'test2' : env;
 window.$config = api(env);
 console.log("window.$config", window.$config);
 

+ 1 - 0
src/static/layoutModelData.js

@@ -162,6 +162,7 @@ var layoutModel = [
 	{url: 'https://dm.static.elab-plus.com/miniProgram/model/BP_L_CeilingLamp_01.glb', name: '吊灯01',modelName: 'BP_L_CeilingLamp_01', type:2},
 	{url: 'https://dm.static.elab-plus.com/miniProgram/model/BP_L_FloorLamp01.glb', name: '地灯05',modelName: 'BP_L_FloorLamp01', type:2},
 	{url: 'https://dm.static.elab-plus.com/miniProgram/model/BP_L_CeilingLamp_02.glb', name: '吊灯02',modelName: 'BP_L_CeilingLamp_02', type:2},
+	{url: 'https://dm.static.elab-plus.com/miniProgram/model/BP_G_grass01.glb', name: '草地',modelName: 'BP_G_grass01', type:1},
 ];
 
 module.exports = layoutModel;