Commit bdb2929b authored by 周成波's avatar 周成波

v0.1

parent 2dfa1959
...@@ -30,9 +30,9 @@ export default { ...@@ -30,9 +30,9 @@ export default {
img_idx: string = "", img_idx: string = "",
prompt: string = "", prompt: string = "",
negative_prompt: string = "", negative_prompt: string = "",
sampler_index: string = "DPM++ SDE", sampler_index: string = "DPM++ 2M Karras",
seed: string = "-1", seed: string = "-1",
steps: string = "20", steps: string = "25",
width: string = "960", width: string = "960",
height: string = "512", height: string = "512",
cfg_scale: string = "9" cfg_scale: string = "9"
...@@ -64,7 +64,28 @@ export default { ...@@ -64,7 +64,28 @@ export default {
}) })
.catch((err: any) => { .catch((err: any) => {
console.log(err); console.log(err);
return Promise.reject("stable-diffusion-webui Api 通讯失败"); return Promise.reject("stable-diffusion-webui Api 通讯失败");
}); });
},
submitGenVideo(gen_video_param: Wm.GenVideoItem[]): Promise<string> {
if (!gen_video_param) {
return Promise.reject("输入不能为空");
}
const post_data = { task: gen_video_param }
return request.post('/text2video/gen_video', post_data)
.then((res: any) => {
// console.log(res);
if (res && res.code === 0) {
return res.data.result;
} else {
const errorMessage = res ? res.message : "未知错误";
return Promise.reject(errorMessage);
} }
})
.catch((err: any) => {
console.log(err);
return Promise.reject("gen_video接口通讯失败");
});
},
} }
This diff is collapsed.
...@@ -14,4 +14,11 @@ declare namespace Wm { ...@@ -14,4 +14,11 @@ declare namespace Wm {
本镜配图: string 本镜配图: string
task_id: string task_id: string
} }
interface GenVideoItem {
task_id: string
idx: string
text: string
img_path: string
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment