🔧 fix(StableDiffusion): Temporarily Remove sampler_index (#2815)

This commit is contained in:
Danny Avila 2024-05-21 09:51:29 -04:00 committed by GitHub
parent 79840763e7
commit f00a8f87f7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -80,13 +80,18 @@ class StableDiffusionAPI extends StructuredTool {
const payload = { const payload = {
prompt, prompt,
negative_prompt, negative_prompt,
sampler_index: 'DPM++ 2M Karras',
cfg_scale: 4.5, cfg_scale: 4.5,
steps: 22, steps: 22,
width: 1024, width: 1024,
height: 1024, height: 1024,
}; };
const generationResponse = await axios.post(`${url}/sdapi/v1/txt2img`, payload); let generationResponse;
try {
generationResponse = await axios.post(`${url}/sdapi/v1/txt2img`, payload);
} catch (error) {
logger.error('[StableDiffusion] Error while generating image:', error);
return 'Error making API request.';
}
const image = generationResponse.data.images[0]; const image = generationResponse.data.images[0];
/** @type {{ height: number, width: number, seed: number, infotexts: string[] }} */ /** @type {{ height: number, width: number, seed: number, infotexts: string[] }} */