Skip to content

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.

Remove hard coded max_items in history API

Jack Bauer6aa1bcd601df
diff --git a/web/scripts/api.js b/web/scripts/api.js
index de56b2310..9aa7528af 100644
--- a/web/scripts/api.js
+++ b/web/scripts/api.js
@@ -254,9 +254,9 @@ class ComfyApi extends EventTarget {
* Gets the prompt execution history
* @returns Prompt history including node outputs
*/
- async getHistory() {
+ async getHistory(max_items=200) {
try {
- const res = await this.fetchApi("/history?max_items=200");
+ const res = await this.fetchApi(`/history?max_items=${max_items}`);
return { History: Object.values(await res.json()) };
} catch (error) {
console.error(error);