Commit f69ff7a9 authored by Administrator's avatar Administrator

SD接口增加模型名称,可更换模型

parent e42888b1
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* 相关接口 * 相关接口
*/ */
import request from '@/api/request' import request from '@/api/request'
import { enc } from 'crypto-js';
export default { export default {
submitLLM(prompt: string, llm: string = "gpt", history: Wm.PromptHistory[] = [], task_id: string = "-", encrypt: string = "false"): Promise<string> { submitLLM(prompt: string, llm: string = "gpt", history: Wm.PromptHistory[] = [], task_id: string = "-", encrypt: string = "false"): Promise<string> {
...@@ -22,7 +22,7 @@ export default { ...@@ -22,7 +22,7 @@ export default {
}) })
.catch((err: any) => { .catch((err: any) => {
console.log(`err = ${JSON.stringify(err)}`); console.log(`err = ${JSON.stringify(err)}`);
return Promise.reject(`与LLM通讯失败${JSON.stringify(err.message)}`); return Promise.reject(`与LLM通讯失败`);
}); });
}, },
...@@ -37,7 +37,8 @@ export default { ...@@ -37,7 +37,8 @@ export default {
seed: string = "-1", seed: string = "-1",
steps: string = "25", steps: string = "25",
cfg_scale: string = "9", cfg_scale: string = "9",
encrypt: string = "false" encrypt: string = "false",
model: string = ""
): Promise<{"domain_image_path": string, "local_image_path": string}> { ): Promise<{"domain_image_path": string, "local_image_path": string}> {
if (!prompt) { if (!prompt) {
return Promise.reject("SD提示词不能为空"); return Promise.reject("SD提示词不能为空");
...@@ -54,6 +55,7 @@ export default { ...@@ -54,6 +55,7 @@ export default {
height: height, height: height,
cfg_scale: cfg_scale, cfg_scale: cfg_scale,
encrypt: encrypt, encrypt: encrypt,
model: model,
} }
return request.post('/text2video/text2img', post_data) return request.post('/text2video/text2img', post_data)
.then((res: any) => { .then((res: any) => {
...@@ -67,7 +69,7 @@ export default { ...@@ -67,7 +69,7 @@ export default {
}) })
.catch((err: any) => { .catch((err: any) => {
console.log(`err = ${JSON.stringify(err)}`); console.log(`err = ${JSON.stringify(err)}`);
return Promise.reject(`与 stable-diffusion-webui Api 通讯失败${JSON.stringify(err.message)}`); return Promise.reject(`与 stable-diffusion-webui Api 通讯失败`);
}); });
}, },
...@@ -88,7 +90,7 @@ export default { ...@@ -88,7 +90,7 @@ export default {
}) })
.catch((err: any) => { .catch((err: any) => {
console.log(`err = ${JSON.stringify(err)}`); console.log(`err = ${JSON.stringify(err)}`);
return Promise.reject(`gen_video接口通讯失败${JSON.stringify(err.message)}`); return Promise.reject(`gen_video接口通讯失败`);
}); });
}, },
...@@ -109,7 +111,7 @@ export default { ...@@ -109,7 +111,7 @@ export default {
}) })
.catch((err: any) => { .catch((err: any) => {
console.log(`err = ${JSON.stringify(err)}`); console.log(`err = ${JSON.stringify(err)}`);
return Promise.reject(`与pwd_check接口通讯失败${JSON.stringify(err.message)}`); return Promise.reject(`与pwd_check接口通讯失败`);
}); });
}, },
...@@ -130,7 +132,7 @@ export default { ...@@ -130,7 +132,7 @@ export default {
}) })
.catch((err: any) => { .catch((err: any) => {
console.log(`err = ${JSON.stringify(err)}`); console.log(`err = ${JSON.stringify(err)}`);
return Promise.reject(`与翻译接口通讯失败${JSON.stringify(err.message)}`); return Promise.reject(`与翻译接口通讯失败`);
}); });
}, },
...@@ -148,7 +150,7 @@ export default { ...@@ -148,7 +150,7 @@ export default {
}) })
.catch((err: any) => { .catch((err: any) => {
console.log(`err = ${JSON.stringify(err)}`); console.log(`err = ${JSON.stringify(err)}`);
return Promise.reject(`add_text_to_img接口通讯失败${JSON.stringify(err.message)}`); return Promise.reject(`add_text_to_img接口通讯失败`);
}); });
}, },
...@@ -166,7 +168,7 @@ export default { ...@@ -166,7 +168,7 @@ export default {
}) })
.catch((err: any) => { .catch((err: any) => {
console.log(`err = ${JSON.stringify(err)}`); console.log(`err = ${JSON.stringify(err)}`);
return Promise.reject(`与Test Api通讯失败${JSON.stringify(err.message)}`); return Promise.reject(`与Test Api通讯失败`);
}); });
}, },
} }
...@@ -314,6 +314,7 @@ export const useManyValues = () => { ...@@ -314,6 +314,7 @@ export const useManyValues = () => {
const sd_paras = { const sd_paras = {
dreamshaperXL_v21TurboDPMSDE: { dreamshaperXL_v21TurboDPMSDE: {
model: "dreamshaperXL_v21TurboDPMSDE.safetensors",
sampler_index: "DPM++ SDE Karras", sampler_index: "DPM++ SDE Karras",
seed: "-1", seed: "-1",
steps: "6", steps: "6",
...@@ -321,6 +322,7 @@ export const useManyValues = () => { ...@@ -321,6 +322,7 @@ export const useManyValues = () => {
sd_prompt_prefix: sd_prompt_prefix sd_prompt_prefix: sd_prompt_prefix
}, },
juggernautXL_v9Rdphoto2Lightning: { juggernautXL_v9Rdphoto2Lightning: {
model: "juggernautXL_v9Rdphoto2Lightning.safetensors",
sampler_index: "Euler", sampler_index: "Euler",
seed: "-1", seed: "-1",
steps: "8", steps: "8",
......
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