From 042523a3c8b7d87b62e105b3457b1ec9c53feb14 Mon Sep 17 00:00:00 2001
From: Svornost <11434-svornost@users.noreply.gitgud.io>
Date: Fri, 22 Dec 2023 13:44:35 -0500
Subject: [PATCH] longer timeout to deal with slow responses while rendering

---
 src/art/genAI/stableDiffusion.js | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/art/genAI/stableDiffusion.js b/src/art/genAI/stableDiffusion.js
index 6e747e87d2f..e73f5f91b66 100644
--- a/src/art/genAI/stableDiffusion.js
+++ b/src/art/genAI/stableDiffusion.js
@@ -292,12 +292,13 @@ App.Art.GenAI.StableDiffusionClient = class {
 		return settings;
 	}
 
-	/**
+	/** Note the long timeout; if SD is actively rendering it'll sometimes stop responding to API queries.
+	 * Do not block on API calls.
 	 * @param {string} relativeUrl
 	 * @returns {Promise<Response>}
 	 */
 	async fetchAPIQuery(relativeUrl) {
-		return fetchWithTimeout(`${V.aiApiUrl}${relativeUrl}`, 1000, {method: "GET"});
+		return fetchWithTimeout(`${V.aiApiUrl}${relativeUrl}`, 30000, {method: "GET"});
 	}
 
 	/**
-- 
GitLab