Nodes/YG Custom Nodes/YG Prompt List By Category
ComfyUI Node

YG Prompt List By Category

Categorized prompts that loop themselves

By mallikarjunaraokoliparthi·Created 2 months ago·Updated about a month ago· 0
YG Prompt List By Category
    • prompt
    • category
    • index
    • total
    text[animals] apple banana [food] mango grapes

    Most batch-prompt tools make you juggle CSV files, index nodes, and counter math. YG Prompt List By Category skips all of it: you type a list of prompts into one text box, tag sections with category headers, and the node hands the whole list to ComfyUI in a single execution. Because every output is a list, the engine itself loops your downstream nodes - text encoder, sampler, VAE decode, save - once per item, without you wiring a single loop construct.

    How it works

    The format is one multiline string, and it's self-documenting:

    [animals]
    a red fox in snow
    a sleeping cat
    
    [food]
    a mango still life
    a bowl of grapes
    

    Lines that start with [name] switch the current category; everything after is a prompt item. The node parses that into a flat list and returns four outputs - prompt, category, index, total - each as a list. That's the important part: the node sets OUTPUT_IS_LIST = (True, True, True, True), which tells ComfyUI to unroll downstream nodes once per list element. This is the engine-native batch mechanism, and it means the diffusion model and text encoder stay loaded across iterations instead of being reloaded between items - the whole reason to use it rather than looping at the graph level.

    Items before any header go in an implicit uncategorized category, and an empty list returns a single empty string so downstream nodes don't just die.

    The inputs that matter

    Just one: text, the multiline box above. That's the whole API surface. It also means this node is a genuinely beginner-friendly way to try batching - there's nothing else to configure.

    The category and index/total outputs are there so downstream things can branch on them - e.g. save each category's images to its own subfolder, or name files with the item index. A natural companion in this same pack is YG Download Images By Category (YGSaveAllImages), which can take the category as its subfolder input and group files by section.

    Installing it

    It's one of twelve nodes in comfyui_yg_nodes (MIT, "YG Custom Nodes" v1.0.4 by Mallikarjuna Rao Koliparthi), no extra Python dependencies. Install via ComfyUI Manager (search comfyui_yg_nodes) or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/mallikarjunaraokoliparthi/comfyui_yg_nodes.git
    

    Restart ComfyUI; it's in the YG/IO category.

    Where people get tripped up

    Because the node re-emits on every run (it always reports as changed), a single queue press regenerates the entire list - if you're mid-way through a 200-item list and hit run, you start the whole thing over, not "continue." There's no built-in resume. Also, the list mechanism makes everything downstream iterate, including preview nodes - 200 items means 200 previews queued, which is fine on disk but can surprise you with the volume of saved files. And the syntax is strictly [header] on its own line: inline tags like [animals] fox are treated as a prompt, not a category. Get past those and this is one of the more pleasant ways to blast through a prompt list without installing a dedicated batch suite.

    CategoryYG/IO

    Inputs (1)

    NameTypeDefaultDescription
    textSTRING[animals] apple banana [food] mango grapes

    Outputs (4)

    NameTypeDescription
    promptSTRING
    categorySTRING
    indexINT
    totalINT