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: Stable Diffusion User Directory (#2270)

bsu3338038063d4d105
diff --git a/api/app/clients/tools/structured/StableDiffusion.js b/api/app/clients/tools/structured/StableDiffusion.js
index 6e15db72b8..e891cbb398 100644
--- a/api/app/clients/tools/structured/StableDiffusion.js
+++ b/api/app/clients/tools/structured/StableDiffusion.js
@@ -103,8 +103,8 @@ class StableDiffusionAPI extends StructuredTool {
const filepath = path.join(imageOutputPath, this.userId, imageName);
this.relativePath = path.relative(clientPath, imageOutputPath);
- if (!fs.existsSync(imageOutputPath)) {
- fs.mkdirSync(imageOutputPath, { recursive: true });
+ if (!fs.existsSync(path.join(imageOutputPath, this.userId))) {
+ fs.mkdirSync(path.join(imageOutputPath, this.userId), { recursive: true });
}
try {