Commit ee1cdc60 authored by Administrator's avatar Administrator

增加局部重绘

parent f69ff7a9
......@@ -31,12 +31,12 @@ export default {
img_idx: string = "",
prompt: string = "",
negative_prompt: string = "",
width: string = "960",
height: string = "512",
sampler_index: string = "DPM++ 2M Karras",
seed: string = "-1",
steps: string = "25",
cfg_scale: string = "9",
width: string = "",
height: string = "",
sampler_index: string = "",
seed: string = "",
steps: string = "",
cfg_scale: string = "",
encrypt: string = "false",
model: string = ""
): Promise<{"domain_image_path": string, "local_image_path": string}> {
......@@ -73,6 +73,57 @@ export default {
});
},
submitSDInPaint(
task_id: string = "",
img_idx: string = "",
prompt: string = "",
negative_prompt: string = "",
width: string = "",
height: string = "",
sampler_index: string = "",
seed: string = "",
steps: string = "",
cfg_scale: string = "",
encrypt: string = "false",
model: string = "",
base_img: string = "",
mask: string = ""
): Promise<{"domain_image_path": string, "local_image_path": string}> {
if (!prompt || !base_img || !mask) {
return Promise.reject("SD提示词、基础图、mask均不能为空");
}
const post_data = {
task_id: task_id,
img_idx: img_idx,
prompt: prompt,
negative_prompt: negative_prompt,
sampler_index: sampler_index,
seed: seed,
steps: steps,
width: width,
height: height,
cfg_scale: cfg_scale,
encrypt: encrypt,
model: model,
base_img: base_img,
mask: mask
}
return request.post('/text2video/img2img_inpaint', post_data)
.then((res: any) => {
// console.log(res);
if (res && res.code === 0) {
return {"domain_image_path": res.data.result.domain_image_path, "local_image_path": res.data.result.local_image_path};
} else {
const errorMessage = res ? res.message : "未知错误";
return Promise.reject(errorMessage);
}
})
.catch((err: any) => {
console.log(`err = ${JSON.stringify(err)}`);
return Promise.reject(`与 stable-diffusion-webui Api 通讯失败`);
});
},
submitGenVideo(gen_video_param: any): Promise<string> {
if (!gen_video_param) {
return Promise.reject("输入不能为空");
......
This diff is collapsed.
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