1
mirror of https://github.com/comfyanonymous/ComfyUI.git synced 2025-08-02 23:14:49 +08:00

Add a /history/{prompt_id} endpoint.

This commit is contained in:
comfyanonymous
2023-06-12 14:34:30 -04:00
parent 67833c83d8
commit af91df85c2
2 changed files with 12 additions and 2 deletions

View File

@@ -728,9 +728,14 @@ class PromptQueue:
return True
return False
def get_history(self):
def get_history(self, prompt_id=None):
with self.mutex:
return copy.deepcopy(self.history)
if prompt_id is None:
return copy.deepcopy(self.history)
elif prompt_id in self.history:
return {prompt_id: copy.deepcopy(self.history[prompt_id])}
else:
return {}
def wipe_history(self):
with self.mutex: