Nodes/comfyui-kpu-utils/KPU Scene Generator
ComfyUI Node

KPU Scene Generator

A Scene Prompt Generator That's Mostly a Promise

By kpucha·Created 7 months ago·Updated 7 months ago· 0
KPU Scene Generator
    • positive_prompt
    • negative_prompt
    num_textos1

    I'm going to be straight with you: KPU Scene Generator is the weakest node in the comfyui-kpu-utils pack, and the honest reading of its source is that it doesn't actually do what its description says. That's still useful to know, because it's the difference between you spending ten minutes hunting for text fields that don't exist and you moving straight on to the pack's real prompt tools.

    Here's the design as intended by the source code: you set an integer num_textos (0 to 3), and the node is meant to spawn that many text fields (texto_1, texto_2, texto_3, built dynamically in get_input_types()) for you to type scene snippets into, which it then joins into a positive_prompt output, alongside a hardcoded negative of ugly, deformed, blurry, lowres, watermark, text, extra fingers.

    The mechanism is the problem. The dynamic fields are created in a method called get_input_types(), which checks the current value of num_textos and builds optional inputs on the fly. That method is never called by ComfyUI. ComfyUI's node loader only asks for INPUT_TYPES, and the shipped INPUT_TYPES declares a single required integer and nothing else. So in practice the texto_N fields never appear in the UI, execute() receives an empty keyword bag, and the node returns an empty positive prompt plus that fixed negative.

    What you actually get, then: a node with one input, num_textos (an integer, 0–3, default 1), and two outputs, positive_prompt and negative_prompt - where the positive is almost always just an empty string. It's a scaffold. A promising scaffold, but a scaffold.

    Why it's like this

    Making a widget's field count depend on another widget's value at runtime is a genuinely fiddly thing in ComfyUI. It normally requires a small JavaScript extension or one of the dynamic-input tricks that custom node authors keep reimplementing. The author of this pack wrote a plausible-looking Python-only version, but Python-only can't do it - ComfyUI has no protocol that re-runs INPUT_TYPES when a widget changes. So the idea is sound and the implementation is inert. The pack's own WailustriousPromptGenerator is the actually-working version of "assemble a scene prompt from parts."

    What to use instead

    If your goal is "join a few text snippets into a prompt," you don't need this pack at all - ComfyUI's built-in text nodes (Text Concatenate, or just multiple CLIP Text Encode inputs into the positive conditioning) do it without any custom node. If your goal is "generate a full scene prompt for an anime model," skip straight to the pack's WailustriousPromptGenerator, which does the whole job with real inputs.

    Installing

    Same as the rest of the pack: ComfyUI Manager → search "comfyui-kpu-utils" → install, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/kpucha/comfyui-kpu-utils
    

    Restart ComfyUI and it appears under KPU Utils. Ignore the phantom comfyui>=0.9.0 pip dependency - it isn't on PyPI, and nothing in this pack actually needs installing beyond what ComfyUI already ships. No models to download.

    Troubleshooting

    If you plug this node in expecting text inputs and see none, that's not a broken install - that's the node being a stub. The pack is young, unproven, and clearly a work in progress (one commit, zero community mentions anywhere I could find). Treat KPUSceneGenerator as a placeholder that the author will either finish or delete, and don't build a workflow on it. If you really want this exact dynamic-field behavior, check whether the pack has released a newer version since, then verify by reading nodes/kpu_scene_generator.py - the fix would be a JS extension or a rewritten input scheme.

    CategoryKPU Utils

    Inputs (1)

    NameTypeDefaultDescription
    num_textosINT10–3

    Outputs (2)

    NameTypeDescription
    positive_promptSTRING
    negative_promptSTRING