Nodes/ComfyUI-Zero2JSON/πŸ–ΌοΈ Z2J Background
ComfyUI Node

πŸ–ΌοΈ Z2J Background

The cheap win in the pack β€” Z2J Background quietly fixes dead compositions

By MushroomFleetΒ·Created 7 months agoΒ·Updated 5 months agoΒ· 1
πŸ–ΌοΈ Z2J Background
    • text
    β—„seed0β–Ί
    β—„prompt_index0β–Ί
    β—„profilebackground_default.jsonβ–Ί
    β—„prefixβ–Ί
    β—„suffixβ–Ί

    Backgrounds are the difference between a portrait and a picture of a person in front of a gray smear. Most people under-prompt them, then wonder why their character looks pasted onto nothing. Z2J Background manufactures the background line for you - deterministically, reproducibly, and with zero effort - which makes it the cheapest win in the ComfyUI-Zero2JSON pack. It's the quieter sibling of Z2J Scene: scene owns the location and its atmosphere, background owns the surface behind the subject and how it blurs.

    In a FLUX2-JSON workflow it fills the background description slot, giving the structured prompt a "what's behind them" component that keeps the subject grounded instead of floating. If you're batch-farming portraits or character sheets, this node is the one that keeps backgrounds from collapsing into "blurred background" over and over.

    How it works

    Same core as every node here - position-as-seed hashing. (seed, prompt_index, slot) goes through xxhash32, and the hash picks a template plus one entry from each pool. The background_default.json profile ships 4 templates over three pools - surface (15 options), detail (12), blur_quality (10) - about 7,200 combinations. Small by this pack's standards, and that's fine: for backgrounds you mostly need surface type and a blur call, not a million variants. "Brick wall with peeling paint, soft focus" is a complete answer.

    The inputs that matter

    • seed - world seed.
    • prompt_index - position coordinate; bump to walk background variants.
    • profile - dropdown of background_*.json files; add your own to profiles/ and restart.
    • prefix / suffix - anchors around the generated text, e.g. a suffix tying the background to the scene.

    There's no filter dropdown here - just the base inputs plus profile. Output is one text string, meant for the FLUX2-JSON background field or any text input.

    Install

    It's the same single repo as all seventeen nodes in this pack:

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

    Restart ComfyUI. The only requirement is xxhash>=3.0.0; there are no models to fetch and no API keys. Manager users: search "ComfyUI-Zero2JSON".

    Where people get burned

    The classic failure is contradiction - background says "snowy mountain range" while the scene node says "tropical beach bar," and the model renders a sad compromise. Because these two nodes come from the same pack, people wire both in and forget they need to agree. When you pair them, pick the seed and prompt_index so the generated background and scene land in the same world, or just let one of them win and keep the other fixed. And remember the output is text - connect it to something before you conclude it's doing nothing.

    CategoryZero2JSON/Scene

    Inputs (5)

    NameTypeDefaultDescription
    seedINT00–4294967295World seed for deterministic generation
    prompt_indexINT00–4294967295Position in infinite prompt space
    profileoptCOMBObackground_default.jsonSelect vocabulary profile
    prefixoptSTRINGText to prepend to generated prompt
    suffixoptSTRINGText to append to generated prompt

    Outputs (1)

    NameTypeDescription
    textSTRINGβ€”