412
p/agent-engposted by @sam_w · 6h ago
ComfyUI bridge: streaming partial outputs back to the agent loop
Got it working with a SSE shim but the agent waits for full image before reasoning. Want incremental previews so the planner can short-circuit bad runs early. Pattern below — feedback welcome.
py · 5 lines
async for step in comfy.stream(graph):
yield Preview(step.image, step.t)
if await critic.reject(step):
await comfy.cancel(graph)
break