Nodes/ComfyUI-Unblend/Unblend Scene Book (JSON prompts)
ComfyUI Node

Unblend Scene Book (JSON prompts)

Your whole prompt collection, one JSON file away

By LatentDesireAI·Created 3 months ago·Updated 3 months ago· 0
Unblend Scene Book (JSON prompts)
    • prefix
    • prompt
    • full_prompt
    • char_points
    • name
    • count
    • horizontal
    • info
    json_pathscenes.json
    index1
    wraptrue
    default_horizontalfalse
    inline_json

    Once you've got the Unblend two-character pipeline working, the next thought is always "now I want forty of these." Copy-pasting tagged prompts into the Dynamic Sampler and re-clicking char_points by hand for every scene is a great way to spend a day. UnblendSceneBook is the node that makes that a data problem instead of a clicking problem: your whole prompt collection lives in one JSON file, and the node hands you a scene by index.

    How it works

    The file is a scene book: one shared prefix (your [QUALITY]/[STYLE] block, the constant you don't want to retype) plus a list of scenes. Each scene is a body prompt, its own char_points, and an orientation hint:

    {
      "prefix": "[QUALITY] masterpiece, best quality, very aesthetic\n[STYLE] detailed hair, very aesthetic",
      "prompts": [
        { "name": "beach midday",
          "prompt": "[SCENE] beach under a parasol\n[CHAR1] ningguang...\n[CHAR2] shenhe...\n[INTERACT] resting head on shoulder",
          "char_points": "0.3,0.45; 0.7,0.45",
          "horizontal": true }
      ]
    }
    

    The node reads it, pulls out the scene at index, and returns the pieces separately: prefix, prompt (scene body only), full_prompt (ready to feed a sampler), char_points, name, count, and horizontal - a boolean for whether the scene is meant to be landscape (true) or portrait (false). That last one is the nice touch: wire it into a latent-size switch and the composition node changes aspect ratio per scene automatically.

    You don't have to keep everything in a file, either. The inline_json input lets you paste the JSON straight into the node, which is great for testing a scene before committing it to disk. And the file parser is forgiving about naming - prompts/scenes, prompt/body, horizontal/landscape, or a "16:9"/"9:16" ratio string all work, so you can generate the book with a script without fighting the schema.

    The inputs that matter

    • json_path - the file path (or leave it and paste into inline_json).
    • index - which scene, 1-based. This is where the Line Counter plugs in: put its line_number here with wrap on and every run advances to the next scene, wrapping around when the book ends.
    • wrap - true wraps the index by the book's length (for an incrementing counter); false clamps to the first/last scene.
    • default_horizontal - the fallback orientation for scenes that don't set one.

    Install

    Same pack, same two options:

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

    Or ComfyUI Manager, search "Unblend", Install, restart.

    When things go wrong

    The info output is a tidy i/N: scene name [horiz|vert] line - if it doesn't say what you expected, your index is wrong, not the book. An empty book throws "no prompts in the JSON", which usually means a typo in the key or a missing prompts array. And remember index is 1-based while the Line Counter starts at 0 by default - misalign those and you'll perpetually be one scene off. If a scene comes back with no char_points, that scene's entry is a plain string (allowed, but it leaves the anchors empty) or you forgot to set them on that dict.

    CategoryUnblend

    Inputs (5)

    NameTypeDefaultDescription
    json_pathSTRINGscenes.json
    indexINT11–99999
    wrapBOOLEANtrue
    default_horizontalBOOLEANfalse
    inline_jsonoptSTRING

    Outputs (8)

    NameTypeDescription
    prefixSTRINGprefix only [QUALITY]/[STYLE]
    promptSTRINGscene body only (no prefix)
    full_promptSTRINGprefix + body (ready prompt)
    char_pointsSTRINGthis scene's char_points
    nameSTRINGscene name
    countINTtotal scenes
    horizontalBOOLEANrecommended format: True = horizontal, False = vertical
    infoSTRINGlog: i/N: name