Nodes/Comfyui-TOO-Pack/πŸ—‚οΈ Collection Categorizer (LLM)
ComfyUI Node

πŸ—‚οΈ Collection Categorizer (LLM)

A local LLM files your films, mangas, and games into folders-by-JSON

By tetsuoo-onlineΒ·Created 9 months agoΒ·Updated about a month agoΒ· 5
πŸ—‚οΈ Collection Categorizer (LLM)
    • json_output
    • summary
    β—„ollama_modelqwen2.5:7bβ–Ί
    β—„custom_ollama_modelβ–Ί
    β—„folder_pathβ–Ί
    β—„scan_subfoldersfalseβ–Ί
    β—„save_jsontrueβ–Ί
    β—„collection_titleMa Collectionβ–Ί
    β—„content_typefilmsβ–Ί
    β—„custom_type_nameβ–Ί
    β—„custom_categoriesβ–Ί
    β—„seed0β–Ί

    Collection Categorizer is the odd one out in this pack - it doesn't touch images at all. Point it at a folder full of movies, manga archives, anime, series, books or games, and it asks a local LLM (via Ollama) to sort everything into genre/themed categories, then hands you a JSON file formatted for a tool called Collection Manager. It's a media-library organizer hiding inside a ComfyUI node, and once you stop being confused by that, it's honestly a neat use of the graph: you get the LLM call, a summary, and a reproducible seed, all as node outputs.

    The important thing first: this needs Ollama. The node talks to localhost:11434 over HTTP - no cloud, no API key, 100% local. But that means Ollama has to be installed, running, and holding at least one model:

    # one-time setup
    pip install requests --break-system-packages
    ollama pull qwen2.5:7b
    

    The README's recommended models are qwen2.5:7b (default, fast), gemma3:12b (best quality), llama3.1:8b (reliable), gemma3:4b (fastest). It's a chat LLM doing a JSON task, so smaller models are fine - this is exactly the "short structured rewriting" job where the KB's LLM-in-ComfyUI doc says small obedient models beat big reasoning ones.

    How it works. It scans the folder for videos (.mp4, .mkv, .avi, .mov, .wmv, .flv), archives (.cbz, .cbr, .zip, .rar) and documents (.epub, .pdf, .mobi); subfolders count as items unless you enable scan_subfolders. It builds a French-language prompt (this pack's author is francophone, and it shows) demanding strict JSON back, calls Ollama with format: json, parses the response, and validates that every item landed in exactly one category. Then it emits Collection Manager's JSON shape - title, icon, type, categories with id/name/subcategories/games (yes, "games" even for films - that's the target format's field name). If save_json is on, it writes <type>.json into the folder you scanned.

    Inputs and outputs. ollama_model (dropdown plus custom with custom_ollama_model), folder_path, scan_subfolders, save_json, collection_title, content_type (dropdown plus custom with custom_type_name), optional custom_categories (your own criteria, one per line; empty = LLM decides) and seed (0 = random, >0 = reproducible). Outputs: json_output (the whole JSON) and summary (item counts, category count, errors). It's an output node, so it always runs.

    Gotchas. This is a ComfyUI node running a 7B LLM on whatever hardware you have - big folders mean long waits, and Ollama competes with your sampler for VRAM. The prompt expects the model to obey exact-title reuse, and models slip: the summary will tell you if items went uncategorized. And the whole thing is aimed at a specific JSON consumer (Collection Manager); if you don't use that app, you're still left with a neat auto-categorization JSON you can repurpose. Worth keeping if you're already running Ollama; probably not worth installing Ollama for.

    CategoryπŸ”΅TOO-Pack/utils

    Inputs (10)

    NameTypeDefaultDescription
    ollama_modelCOMBOqwen2.5:7b6 options: qwen2.5:7b, gemma3:12b, llama3.1:8b, gemma3:4b, llama3:8b, custom
    custom_ollama_modelSTRINGβ€”
    folder_pathSTRINGβ€”
    scan_subfoldersBOOLEANfalseβ€”
    save_jsonBOOLEANtrueβ€”
    collection_titleSTRINGMa Collectionβ€”
    content_typeCOMBOfilms7 options: films, mangas, anime, series, books, games, +1
    custom_type_nameoptSTRINGβ€”
    custom_categoriesoptSTRINGβ€”
    seedoptINT00–18446744073709550000Seed pour rΓ©sultats reproductibles (0 = alΓ©atoire)

    Outputs (2)

    NameTypeDescription
    json_outputSTRINGβ€”
    summarySTRINGβ€”