This is a classic problem with ComfyUI that comfyui-api-wrapper merely doesn't solve, but it might be worth making an attempt to solve it.
Because of its aggressive caching, if you send the same workflow twice, ComfyUI returns nothing. If this process is being automated, it's quite easy to build the same workflow twice by accident, whether in testing or just by nature of the task. Ideally, comfyui-api-wrapper could do something about this and recall the previous response.
For instance, using the standard Flux.2 Klein 4B image generation workflow, and simply sending it twice, I get these two responses (from /generate/sync):
First time:
{"id":"3e2cb9bc-ac03-4ae4-b0b3-acd7fc1181e8","message":"Processing complete.","status":"completed","comfyui_response":{},"output":[{"filename":"Flux2-Klein_00018_.png","local_path":"../ComfyUI/output/3e2cb9bc-ac03-4ae4-b0b3-acd7fc1181e8/Flux2-Klein_00018_.png","type":"output","subfolder":"","node_id":"78","output_type":"images"}],"timings":{"queued_at_ms":1781875671360,"preprocess_ms":0,"generation_ms":5679,"postprocess_ms":4,"completed_at_ms":1781875677044,"total_ms":5684}}
Second time:
{"id":"76fe55f5-7b85-4185-ac99-9043e4f0035b","message":"Processing complete.","status":"completed","comfyui_response":{},"output":[],"timings":{"queued_at_ms":1781875718260,"preprocess_ms":0,"generation_ms":1505,"postprocess_ms":0,"completed_at_ms":1781875719767,"total_ms":1507}}
The second time being successful but blank is, at best, confusing, and certainly difficult to integrate into a larger API-driven system.
This is a classic problem with ComfyUI that comfyui-api-wrapper merely doesn't solve, but it might be worth making an attempt to solve it.
Because of its aggressive caching, if you send the same workflow twice, ComfyUI returns nothing. If this process is being automated, it's quite easy to build the same workflow twice by accident, whether in testing or just by nature of the task. Ideally, comfyui-api-wrapper could do something about this and recall the previous response.
For instance, using the standard Flux.2 Klein 4B image generation workflow, and simply sending it twice, I get these two responses (from
/generate/sync):First time:
{"id":"3e2cb9bc-ac03-4ae4-b0b3-acd7fc1181e8","message":"Processing complete.","status":"completed","comfyui_response":{},"output":[{"filename":"Flux2-Klein_00018_.png","local_path":"../ComfyUI/output/3e2cb9bc-ac03-4ae4-b0b3-acd7fc1181e8/Flux2-Klein_00018_.png","type":"output","subfolder":"","node_id":"78","output_type":"images"}],"timings":{"queued_at_ms":1781875671360,"preprocess_ms":0,"generation_ms":5679,"postprocess_ms":4,"completed_at_ms":1781875677044,"total_ms":5684}}Second time:
The second time being successful but blank is, at best, confusing, and certainly difficult to integrate into a larger API-driven system.