Skip to content

Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active

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

Danny Avilaf00a8f87f760
diff --git a/api/app/clients/tools/structured/StableDiffusion.js b/api/app/clients/tools/structured/StableDiffusion.js
index e891cbb398..cfcbf73ac4 100644
--- a/api/app/clients/tools/structured/StableDiffusion.js
+++ b/api/app/clients/tools/structured/StableDiffusion.js
@@ -80,13 +80,18 @@ class StableDiffusionAPI extends StructuredTool {
const payload = {
prompt,
negative_prompt,
- sampler_index: 'DPM++ 2M Karras',
cfg_scale: 4.5,
steps: 22,
width: 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];
/** @type {{ height: number, width: number, seed: number, infotexts: string[] }} */