...
|
...
|
@@ -4,7 +4,7 @@ import styles from "./bg-removal-panel.module.scss"; |
|
|
import { useState } from "react";
|
|
|
import { message } from "antd";
|
|
|
import type { LocalData, PanelProps } from "@/app/types/zuotang";
|
|
|
import { ApiPath, Path } from "@/app/constant";
|
|
|
import { ApiPath, bgremovalModel, Path } from "@/app/constant";
|
|
|
import { useAccessStore } from "@/app/store";
|
|
|
import Locale from "@/app/locales";
|
|
|
import LoadingIcon from "@/app/icons/three-dots.svg";
|
...
|
...
|
@@ -13,7 +13,7 @@ import { useChatStore } from "@/app/store"; |
|
|
import { getBgPrompt } from "@/app/utils/prompt";
|
|
|
import { cosUploadImage } from "@/app/utils/tencentCos";
|
|
|
import { getFileByUrl } from "@/app/utils/fileUtil";
|
|
|
|
|
|
import { getServerSideConfig } from "@/app/config/server";
|
|
|
// 错误消息映射函数
|
|
|
const getErrorMessage = (state: number): string => {
|
|
|
const errorMap: { [key: number]: string } = {
|
...
|
...
|
@@ -440,7 +440,7 @@ export function BgPanel(props: PanelProps) { |
|
|
}
|
|
|
const input = getBgPrompt(prompt);
|
|
|
setLoading(true);
|
|
|
const response = await chatStore.directLlmInvoke(input, "gpt-4o-mini");
|
|
|
const response = await chatStore.directLlmInvoke(input, bgremovalModel);
|
|
|
const items = response.split("'").filter((item) => item.trim() !== "");
|
|
|
setPromptList(items);
|
|
|
} catch (error) {
|
...
|
...
|
@@ -519,6 +519,17 @@ export function BgPanel(props: PanelProps) { |
|
|
onClick={() => handleProcessImage("visual/r-background")}
|
|
|
disabled={isLoading}
|
|
|
/>
|
|
|
<IconButton
|
|
|
text="测试"
|
|
|
type="primary"
|
|
|
shadow
|
|
|
onClick={() => {
|
|
|
const config = getServerSideConfig();
|
|
|
|
|
|
console.log("**********************************", bgremovalModel);
|
|
|
}}
|
|
|
disabled={isLoading}
|
|
|
/>
|
|
|
</div>
|
|
|
</ControlParamItem>
|
|
|
</>
|
...
|
...
|
|