ComfyUI Node

Chunk Router

The node the author flags as not working yet

By Excidos·Created 2 years ago·Updated 2 years ago· 67
Chunk Router
    • selected_chunk
    chunks
    indices
    selected_index0

    Let's lead with the honest bit, because it's the single most important thing about this node: the pack's own README lists it as "(Currently Not Working) (WIP)." That's the author telling you, in their own documentation, not to rely on it yet. So before you spend time wiring it into a workflow, know that going in.

    What it's meant to do

    The idea is sound, even if the implementation isn't there yet. Text Chunker splits a document into a batch of chunks. Once you've got a batch, you usually want to grab one of them at a time - chunk 3 for this pass, chunk 7 for the next - rather than processing all of them simultaneously. Chunk Router is meant to be that selector: feed it the chunk list, tell it which index you want, and it hands back just that one chunk as a single string, ready to drop into a text-consuming node that doesn't know how to handle a batch.

    The inputs and outputs, on paper

    • chunks - the batch of text you're routing through, presumably Text Chunker's text_chunks output.
    • indices - an integer input tied to the chunk batch.
    • selected_index - the one you actually set, 0 to 1000, defaulting to 0. This is the field that picks which chunk comes out.

    The intended output is selected_chunk, a single STRING - the one chunk at selected_index, isolated from the rest of the batch.

    That's the design on paper, and it's a reasonable one. The problem is execution, not concept.

    Installing it

    If you want it anyway - maybe to test it yourself, maybe because a fix has landed since this was written - installation is the same as the rest of the pack. Through ComfyUI Manager: search ComfyUI-Documents, install, restart. Manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Excidos/ComfyUI-Documents.git
    pip install -r ComfyUI-Documents/requirements.txt
    

    No extra dependency specific to this node beyond what the rest of the pack already needs.

    Where people get burned

    This is about as clean an example as you'll find of "read the README before you build around a node." A few practical notes:

    • Don't build a workflow that depends on this being reliable. The author has already told you it doesn't currently work. Treat any output you get from it as unverified until you've checked it against the source chunk manually.
    • Check the GitHub repo before you invest time. This was flagged WIP in the README at the time of writing; it's a small, actively-maintained-by-one-person pack, so it's worth a quick look at the repo's recent commits and issues to see if it's been fixed since.
    • If you need chunk selection right now, don't wait on this node. The batch coming out of Text Chunker is a plain list of strings - you can index into it, loop over it, or route it with a general-purpose list/index utility from elsewhere in the ecosystem while this one catches up. It's a small gap in an otherwise straightforward little pack, not a dealbreaker for the pack as a whole.

    The honest takeaway: Document Loader, PDF to Image, PDF Page Splitter, and Text Chunker all do exactly what their README says. This one is the exception, and the author was upfront enough to say so directly in the docs rather than let you find out the hard way.

    Categorydocument_processing

    Inputs (3)

    NameTypeDefaultDescription
    chunksSTRING
    indicesINT
    selected_indexINT00–1000

    Outputs (1)

    NameTypeDescription
    selected_chunkSTRING