New-Riffusion / lib /config.ts
Gertie2013's picture
Create lib/config.ts
06ffb02 verified
Raw
History Blame Contribute Delete
917 Bytes
export const VALID_MODELS = {
ACE_STEP: "ACE-Step/ACE-Step-v1-3.5B",
DREAM_VAE: "daydreamlive/DreamVAE",
};
export function validateModel(model: string) {
return Object.values(VALID_MODELS).includes(model);
}
export function validateApiKey(key?: string) {
return typeof key === "string" && key.trim().length > 0;
}
// lib/types.ts
export type VoiceType = "Random" | "Male" | "Female";
export interface GenerateRequestBody {
stylePrompt: string;
lyricPrompt?: string;
voice: VoiceType;
durationSeconds?: number;
}
export interface EditRequestBody {
operation: "cover" | "extend" | "swap_vocal" | "crop";
trackId: string;
params?: Record<string, unknown>;
}
// lib/cache.ts
const genCache = new Map<string, any>();
export function getCachedGeneration(key: string) {
return genCache.get(key);
}
export function setCachedGeneration(key: string, value: any) {
genCache.set(key, value);
}