Skip to content

Commit 5c94ced

Browse files
committed
🔧 fix(StableDiffusion): Temporarily Remove sampler_index (#2815)
1 parent 221af46 commit 5c94ced

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

api/app/clients/tools/structured/StableDiffusion.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,18 @@ class StableDiffusionAPI extends StructuredTool {
8080
const payload = {
8181
prompt,
8282
negative_prompt,
83-
sampler_index: 'DPM++ 2M Karras',
8483
cfg_scale: 4.5,
8584
steps: 22,
8685
width: 1024,
8786
height: 1024,
8887
};
89-
const generationResponse = await axios.post(`${url}/sdapi/v1/txt2img`, payload);
88+
let generationResponse;
89+
try {
90+
generationResponse = await axios.post(`${url}/sdapi/v1/txt2img`, payload);
91+
} catch (error) {
92+
logger.error('[StableDiffusion] Error while generating image:', error);
93+
return 'Error making API request.';
94+
}
9095
const image = generationResponse.data.images[0];
9196

9297
/** @type {{ height: number, width: number, seed: number, infotexts: string[] }} */

0 commit comments

Comments
 (0)