12 lines
378 B
TypeScript
12 lines
378 B
TypeScript
import type { Preset } from "../presets";
|
|
import { SwarmBackend } from "./swarm";
|
|
import { A1111Backend } from "./a1111";
|
|
import { ComfyBackend } from "./comfy";
|
|
export function backend(p: Preset) {
|
|
switch (p.backend) {
|
|
case "swarm": return new SwarmBackend(p.url);
|
|
case "a1111": return new A1111Backend(p.url);
|
|
case "comfy": return new ComfyBackend(p.url);
|
|
}
|
|
}
|