import { registerProvider } from "./store.js";
export const SEAART_MODELS = [
    'sdxl',
    'z_image',
    'z_image_turbo',
];
const SDXL_VER = 'c9090ffbe5649de2f34cfe5b865d50fe';
/** Default model_ver_no per model. Override with --model-ver-no. */
export const DEFAULT_MODEL_VER = {
    sdxl: SDXL_VER,
    z_image: SDXL_VER,
    z_image_turbo: SDXL_VER,
};
/** Models that require a `denoise` field (z_image family). */
const DENOISE_MODELS = new Set(['z_image', 'z_image_turbo']);
registerProvider({
    provider: 'seaart',
    category: 'image',
    models: SEAART_MODELS,
    buildBody(model, prompt, flags) {
        const action = flags.action ?? (flags.imageUrl ? 1 : 0);
        const params = {
            prompt,
            n_iter: flags.n ?? 1,
            action,
        };
        const modelVerNo = flags.modelVerNo ?? DEFAULT_MODEL_VER[model];
        if (modelVerNo)
            params.model_ver_no = modelVerNo;
        if (flags.width)
            params.width = flags.width;
        if (flags.height)
            params.height = flags.height;
        if (flags.steps)
            params.steps = flags.steps;
        if (flags.seed !== undefined)
            params.seed = flags.seed;
        if (flags.cfgScale !== undefined)
            params.cfg_scale = flags.cfgScale;
        if (flags.negativePrompt)
            params.negative_prompt = flags.negativePrompt;
        if (DENOISE_MODELS.has(model))
            params.denoise = flags.denoise ?? 0.7;
        const inputItem = { params };
        if (flags.imageUrl) {
            inputItem.content = [{ type: 'image', url: flags.imageUrl }];
        }
        return {
            model,
            dash_scope: true,
            moderation: true,
            input: [inputItem],
            metadata: {},
        };
    },
});
//# sourceMappingURL=seaart.js.map