Initial commit

This commit is contained in:
2023-09-08 22:09:35 +03:00
commit 2a6488488e
20 changed files with 2581 additions and 0 deletions

View File

@ -0,0 +1,31 @@
import { StableDiffusionApi } from "stable-diffusion-api";
export const sdClient = new StableDiffusionApi({
host: "127.0.0.1",
port: 7860,
protocol: "http",
defaultSampler: "DPM++ 2M Karras",
defaultStepCount: 22,
});
await sdClient.setModel("deliberate_v3");
export async function predict(prompt: string) {
const result = await sdClient.txt2img({
prompt: prompt,
negative_prompt: '[deformed | disfigured], poorly drawn, [bad : wrong] anatomy, [extra | missing | floating | disconnected] limb, (mutated hands and fingers), blurry',
batch_size: 1,
cfg_scale: 7,
width: 640,
height: 640,
enable_hr: false,
hr_resize_x: 1280,
hr_resize_y: 1280,
hr_upscaler: "4x_NMKD-Siax_200k",
hr_second_pass_steps: 8,
denoising_strength: 0.36,
seed: -1
});
return result;
}