/** * Backend Factory * * Provides access to ComfyUI backends. * * DEFAULT: Local ComfyUI (for most operations) * OPT-IN: RunPod (for heavy video operations) * * Usage: * // Get default (local) backend * const local = getBackend(); * await local.imagine({ ... }); * * // Explicitly get RunPod for heavy operations * const runpod = getRunPodBackend(); * await runpod.lipsync({ ... }); * * // Or use the smart getter that picks based on operation * const backend = getBackendFor("lipsync"); // Returns RunPod if configured * * Environment: * COMFYUI_URL - Local ComfyUI URL (default: http://localhost:8188) * COMFYUI_INPUT_DIR - Local input directory * COMFYUI_OUTPUT_DIR - Local output directory * RUNPOD_ENDPOINT_ID - RunPod endpoint (optional) * RUNPOD_API_KEY - RunPod API key (optional) */ export * from "./types.js"; export { LocalBackend } from "./local.js"; export { RunPodBackend } from "./runpod.js"; import { ComfyBackend } from "./types.js"; import { LocalBackend } from "./local.js"; import { RunPodBackend } from "./runpod.js"; /** * Get the LOCAL backend (default) * * Use this for most operations: imagine, portrait, controlnet, tts, etc. */ export declare function getBackend(): ComfyBackend; /** * Get the local ComfyUI backend */ export declare function getLocalBackend(): LocalBackend; /** * Get the RunPod backend (for GPU-heavy operations) * * Use this for: lipsync, img2video, animation, etc. * Throws if RunPod is not configured. */ export declare function getRunPodBackend(): RunPodBackend; /** * Smart backend selector based on operation type * * Returns RunPod for GPU-heavy operations (if configured), local otherwise. * * @param operation - The operation type (e.g., "lipsync", "imagine", "portrait") */ export declare function getBackendFor(operation: string): ComfyBackend; /** * Check if RunPod is configured */ export declare function isRunPodConfigured(): boolean; /** * Check if local ComfyUI is available */ export declare function isLocalAvailable(): Promise; /** * Clear cached backends (useful for testing) */ export declare function clearBackendCache(): void; /** * Get status of all backends */ export declare function getBackendStatus(): Promise<{ local: { configured: boolean; healthy: boolean; error?: string; }; runpod: { configured: boolean; healthy: boolean; error?: string; }; }>;