feat: add Bailian image generation support
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import type { EnabledImageCapability, GenerationStatus } from "@/lib/types";
|
||||
|
||||
export type ImageCreationEngine = "jimeng" | "evolink";
|
||||
export type ImageCreationEngine = "jimeng" | "evolink" | "bailian";
|
||||
|
||||
export type EvolinkImageSettings = {
|
||||
apiKey?: string;
|
||||
@@ -29,7 +29,7 @@ export type EvolinkTaskResponse = {
|
||||
|
||||
export function getSelectedImageEngine(): ImageCreationEngine {
|
||||
const value = (process.env.IMAGE_CREATION_ENGINE || process.env.IMAGE_PROVIDER || "jimeng").trim().toLowerCase();
|
||||
return value === "evolink" ? "evolink" : "jimeng";
|
||||
return value === "evolink" || value === "bailian" ? value : "jimeng";
|
||||
}
|
||||
|
||||
export function getEffectiveImageEngine(capability: EnabledImageCapability, override?: unknown): ImageCreationEngine {
|
||||
@@ -44,6 +44,7 @@ export function getEffectiveImageEngine(capability: EnabledImageCapability, over
|
||||
export function normalizeImageEngine(value: unknown): ImageCreationEngine | undefined {
|
||||
const normalized = typeof value === "string" ? value.trim().toLowerCase() : "";
|
||||
if (normalized === "evolink") return "evolink";
|
||||
if (normalized === "bailian") return "bailian";
|
||||
if (normalized === "jimeng") return "jimeng";
|
||||
return undefined;
|
||||
}
|
||||
@@ -51,6 +52,7 @@ export function normalizeImageEngine(value: unknown): ImageCreationEngine | unde
|
||||
function selectedEngineFrom(value: string | undefined): ImageCreationEngine {
|
||||
const normalized = (value || "").trim().toLowerCase();
|
||||
if (normalized === "evolink") return "evolink";
|
||||
if (normalized === "bailian") return "bailian";
|
||||
if (normalized === "jimeng") return "jimeng";
|
||||
return getSelectedImageEngine();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user