Nodes/comfyui-prompt-library-nodes/Unified T2I Prompt Source v2
ComfyUI Node

Unified T2I Prompt Source v2

Unified T2I Prompt Source v2

By 2223290690z-hue·Created 3 months ago·Updated 2 months ago· 1
Unified T2I Prompt Source v2
    • positive
    • library_path
    prefix
    role_1
    outfit_1(first outfit)
    role_2
    outfit_2(first outfit)
    role_3
    outfit_3(first outfit)
    picker_appearance
    picker_pose
    picker_scene
    picker_camera
    picker_prop
    picker_clothing
    picker_lighting
    additions
    manual_prompt
    selected_terms_preview
    prompt_preview
    seed0

    If this pack has a flagship, it's Unified T2I Prompt Source v2 - the README's example workflow is built around it, and it's the version the author actually maintained forward. It builds a positive prompt from a structured JSON prompt library: a quality prefix, up to three roles with outfits, then appearance, pose, scene, camera, prop, clothing, and lighting snippets, all funneled through one node into a sanitized prompt string that goes straight into your positive CLIPTextEncode.

    The pitch, in one line: prompts, character sheets, and scene fragments live in a portable JSON library instead of being hardcoded into every workflow graph. You back up the JSON, you swap whole character sets by swapping files, and the graph itself stays small and shareable - which is exactly the workflow-clutter problem this pack exists to solve.

    What v2 adds over the older nodes

    If you've seen the original Unified T2I Prompt Source (or its Picker/Smart twins), the differences are: a third role slot (role_3/outfit_3) for group scenes, a picker_lighting dropdown that the old trio lacks, and - tellingly - the removal of the negative_preset/negative_terms widgets that the old nodes carried but never actually used. v2 is the honest version: it only emits a positive prompt and a library path, and points you at the separate Negative Prompt Source for the negative side.

    How it works

    The composition pipeline: prefix selects a quality block (illustration quality, photo quality, concept art quality, quality only, or none), and the role count stamps a character tag - 1girl, solo for one subject, 2girls, lesbian for two (that "lesbian" is hardcoded; a -lesbian line in additions removes it if your two-person scene isn't romantic), 3girls for three. Role blocks are numbered (no.1girl,, no.2girl,, no.3girl,) and joined with BREAK, - the classic CLIP-chunk tool, meaningful on tag-based 77-token checkpoints, mostly inert on LLM-encoder models.

    Library lookups score entries by id > title > tag > content, and (random) picks a seeded random entry so seed gives you reproducible rolls. The output is deduplicated, whitespace-normalized, and stripped of all Chinese characters - the author's workflow was originally Chinese-first, so if your library content is in Chinese it won't survive. Keep content in English tags.

    Inputs and outputs

    The widgets that matter: prefix, role_1..3 + outfit_1..3, the seven picker_* dropdowns, additions, manual_prompt, and seed. The picker_* menus append alias: Title lines into additions and reset so you can stack several picks. additions is the power spot: @1.2 weights a term, -term excludes it, no.1girl ... scopes an addition to one subject. selected_terms_preview and prompt_preview are read-only, live-refreshed by the frontend so you can eyeball the composition before queueing.

    Outputs: positive (STRING) → positive CLIPTextEncode; library_path (STRING) → image metadata or a debug note showing which JSON library the run used.

    Installing it

    Zero dependencies beyond ComfyUI core - no requirements.txt, no model downloads. ComfyUI Manager → search "comfyui-prompt-library-nodes" → install → restart, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/2223290690z-hue/comfyui-prompt-library-nodes.git
    

    It loads examples/sample-library.json out of the box so the dropdowns aren't empty, and any exports/prompts-backup-*.json you drop in gets picked up automatically, newest first - that's how you switch to your own library.

    The traps worth knowing

    • Random is seeded, not live. (random) rolls from seed; if you never change the seed, the same "random" choice returns every run. Change the seed to actually shuffle.
    • The library decides your options. If a role doesn't appear in a dropdown, it's not in the roles folder (角色) of the currently loaded library. The newest prompts-backup-*.json in exports/ wins over the sample - a stale export that shadows the demo library is the #1 "where did my roles go" cause.
    • Preview boxes can look stale. They refresh via the frontend when widgets change; nudge a dropdown if they lag.

    If you're building a prompt-library workflow and don't already have a stake in the old names, start here. It's the version the author keeps shipping, and it's the best on-ramp to the pack's ideas.

    CategoryPrompt Manager

    Inputs (19)

    NameTypeDefaultDescription
    prefixCOMBO5 options: illustration quality, photo quality, concept art quality, quality only, none
    role_1COMBO4 options: (none), (random), Explorer, Researcher
    outfit_1COMBO(first outfit)5 options: (none), (first outfit), Explorer / Field Gear, Researcher / Lab Coat, Explorer / City Casual
    role_2COMBO4 options: (none), (random), Explorer, Researcher
    outfit_2COMBO(first outfit)5 options: (none), (first outfit), Explorer / Field Gear, Researcher / Lab Coat, Explorer / City Casual
    role_3COMBO4 options: (none), (random), Explorer, Researcher
    outfit_3COMBO(first outfit)5 options: (none), (first outfit), Explorer / Field Gear, Researcher / Lab Coat, Explorer / City Casual
    picker_appearanceCOMBO2 options: (add appearance), appearance: Soft Backlight
    picker_poseCOMBO2 options: (add pose), pose: Looking Over Map
    picker_sceneCOMBO2 options: (add scene), scene: Old Observatory
    picker_cameraCOMBO2 options: (add camera), camera: Medium Shot
    picker_propCOMBO2 options: (add prop), prop: Weathered Map
    picker_clothingCOMBO1 options: (add clothing)
    picker_lightingCOMBO2 options: (add lighting), lighting: Window Light
    additionsSTRING
    manual_promptSTRING
    selected_terms_previewSTRING
    prompt_previewSTRING
    seedINT00–18446744073709550000

    Outputs (2)

    NameTypeDescription
    positiveSTRING
    library_pathSTRING