Merge pull request #4983 from OpenAI-Next/dev-sd

[Feature] Stable Diffusion
This commit is contained in:
Lloyd Zhou
2024-07-25 19:13:37 +08:00
committed by GitHub
35 changed files with 1714 additions and 140 deletions

View File

@@ -8,6 +8,8 @@ export const FETCH_COMMIT_URL = `https://api.github.com/repos/${OWNER}/${REPO}/c
export const FETCH_TAG_URL = `https://api.github.com/repos/${OWNER}/${REPO}/tags?per_page=1`;
export const RUNTIME_CONFIG_DOM = "danger-runtime-config";
export const STABILITY_BASE_URL = "https://api.stability.ai";
export const DEFAULT_API_HOST = "https://api.nextchat.dev";
export const OPENAI_BASE_URL = "https://api.openai.com";
export const ANTHROPIC_BASE_URL = "https://api.anthropic.com";
@@ -31,6 +33,8 @@ export enum Path {
NewChat = "/new-chat",
Masks = "/masks",
Auth = "/auth",
Sd = "/sd",
SdNew = "/sd-new",
}
export enum ApiPath {
@@ -42,6 +46,7 @@ export enum ApiPath {
Baidu = "/api/baidu",
ByteDance = "/api/bytedance",
Alibaba = "/api/alibaba",
Stability = "/api/stability",
}
export enum SlotID {
@@ -62,6 +67,7 @@ export enum StoreKey {
Prompt = "prompt-store",
Update = "chat-update",
Sync = "sync",
SdList = "sd-list",
}
export const DEFAULT_SIDEBAR_WIDTH = 300;
@@ -88,6 +94,7 @@ export enum ServiceProvider {
Baidu = "Baidu",
ByteDance = "ByteDance",
Alibaba = "Alibaba",
Stability = "Stability",
}
// Google API safety settings, see https://ai.google.dev/gemini-api/docs/safety-settings
@@ -100,6 +107,7 @@ export enum GoogleSafetySettingsThreshold {
}
export enum ModelProvider {
Stability = "Stability",
GPT = "GPT",
GeminiPro = "GeminiPro",
Claude = "Claude",
@@ -108,6 +116,11 @@ export enum ModelProvider {
Qwen = "Qwen",
}
export const Stability = {
GeneratePath: "v2beta/stable-image/generate",
ExampleEndpoint: "https://api.stability.ai",
};
export const Anthropic = {
ChatPath: "v1/messages",
ChatPath1: "v1/complete",
@@ -351,3 +364,5 @@ export const internalAllowedWebDavEndpoints = [
"https://webdav.yandex.com",
"https://app.koofr.net/dav/Koofr",
];
export const PLUGINS = [{ name: "Stable Diffusion", path: Path.Sd }];