()
| 52 | })); |
| 53 | |
| 54 | async 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 |
no test coverage detected