MCPcopy Create free account
hub / github.com/6174/comflowyspace / getQueue

Function getQueue

packages/common/store/comfyui-queue-state.ts:54–72  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

52}));
53
54async function getQueue(): Promise<Queue> {
55 const history = await getQueueApi();
56 // hacky way of getting the queue
57 const [queue_running, queue_pending] = [history.queue_running, history.queue_pending].map((queue) => {
58 return queue.map(([i, id, graph, clientId]) => {
59 const prompts = Object.values(graph).flatMap((node) =>
60 node.class_type === 'CLIPTextEncode' && node.inputs.text !== undefined ? [node.inputs.text] : []
61 )
62 const checkpoint = Object.values(graph).find((node) => node.class_type.startsWith('CheckpointLoader'))
63 const model = checkpoint?.inputs?.ckpt_name
64 return { id, prompts, model, clientId } as QueueItem
65 });
66 });
67
68 return {
69 queue_running,
70 queue_pending
71 }
72}
73
74

Callers 1

Calls 1

getQueueApiFunction · 0.90

Tested by

no test coverage detected