1
mirror of https://github.com/comfyanonymous/ComfyUI.git synced 2025-08-02 15:04:50 +08:00

Only show last 200 elements in the UI history tab.

This commit is contained in:
comfyanonymous
2023-11-20 16:51:41 -05:00
parent a03dde190e
commit 2dd5b4dd78
3 changed files with 17 additions and 4 deletions

View File

@@ -431,7 +431,10 @@ class PromptServer():
@routes.get("/history")
async def get_history(request):
return web.json_response(self.prompt_queue.get_history())
max_items = request.rel_url.query.get("max_items", None)
if max_items is not None:
max_items = int(max_items)
return web.json_response(self.prompt_queue.get_history(max_items=max_items))
@routes.get("/history/{prompt_id}")
async def get_history(request):