mirror of
https://github.com/Nezumi-2711/9router.git
synced 2026-09-22 20:00:47 +00:00
- image/embed/tts/search base URLs derive from media.*Config.baseUrl / searchViaChat.endpoint (single source); handlers read PROVIDER_MEDIA. - ~18 hardcoded endpoints moved: bfl/fal/stability/runway/hf/gemini/ cloudflare/recraft/sdwebui/comfyui/nanobanana image, voyage embed, gemini/openrouter tts, chatSearch endpoints. - Byte-identical: PROVIDERS 62 + alias 90 baselines, image buildUrl outputs. Co-authored-by: Cursor <cursoragent@cursor.com>
21 lines
784 B
JavaScript
21 lines
784 B
JavaScript
// SD WebUI (AUTOMATIC1111) — local, noAuth
|
|
import { nowSec } from "./_base.js";
|
|
import { PROVIDER_MEDIA } from "../../providers/index.js";
|
|
|
|
const BASE_URL = PROVIDER_MEDIA["sdwebui"]?.imageConfig?.baseUrl;
|
|
|
|
export default {
|
|
noAuth: true,
|
|
buildUrl: () => BASE_URL,
|
|
buildHeaders: () => ({ "Content-Type": "application/json" }),
|
|
buildBody: (_model, body) => {
|
|
const { prompt, n = 1, size = "1024x1024" } = body;
|
|
const [width, height] = size.split("x").map(Number);
|
|
return { prompt, width: width || 512, height: height || 512, steps: 20, batch_size: n };
|
|
},
|
|
normalize: (responseBody) => {
|
|
const images = Array.isArray(responseBody.images) ? responseBody.images.map((img) => ({ b64_json: img })) : [];
|
|
return { created: nowSec(), data: images };
|
|
},
|
|
};
|