Nodes/ComfyUI-Zero2JSON/🌍 Z2J Scene
ComfyUI Node

🌍 Z2J Scene

A world in a hash β€” Z2J Scene builds your location, time and weather

By MushroomFleetΒ·Created 7 months agoΒ·Updated 5 months agoΒ· 1
🌍 Z2J Scene
    • text
    β—„seed0β–Ί
    β—„prompt_index0β–Ί
    β—„profilescene_default.jsonβ–Ί
    β—„prefixβ–Ί
    β—„suffixβ–Ί
    β—„scene_categoryanyβ–Ί
    β—„time_hintanyβ–Ί

    The scene is where most prompts fall apart, because "a city street" is doing four jobs at once - the place, the time of day, the weather, the little ambient details that make it feel inhabited. Z2J Scene splits those jobs into pools and reassembles them into one deterministic sentence. It's the flagship of the scene family in ComfyUI-Zero2JSON and the natural companion to Z2J Background: scene builds the location and its atmosphere, background paints what's behind the subject.

    In the FLUX2-JSON workflow it feeds the scene field of the prompt assembler. Given how well FLUX2's LLM-style encoder handles structured, descriptive prompts, a generated scene line like "dockside market at dusk, fog rolling in, with the smell of salt and lamplight" slots in far more cleanly than a comma-soup of location tags.

    How it works

    Position-as-seed, same as the whole pack: (seed, prompt_index, slot) hashed with xxhash32, hash selects a template and one option per pool. The scene_default.json profile has 4 templates over four pools - location (17), time_context (12), weather_atmosphere (12), ambient_detail (10) - about 98,000 combinations. Locations run from interiors to urban to fantasy and sci-fi, and the weather pool does most of the heavy lifting for mood.

    The inputs that matter

    • seed - world seed.
    • prompt_index - the position coordinate; farm this to walk the space of scenes.
    • profile - dropdown of scene_*.json files; drop your own into profiles/ and restart.
    • prefix / suffix - anchors around the generated text.
    • scene_category and time_hint - filter dropdowns (interior/exterior/studio… and day/night/dawn…). Read the fine print: in the shipped v1.0.0 code these inputs are declared but not applied by the generator. They're accepted and ignored, so don't count on them narrowing anything yet. Check for a newer release before relying on them.

    Output is a single text string, wired into the FLUX2-JSON scene field or any text input.

    Install

    One repo, all seventeen nodes:

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

    Restart ComfyUI. The requirement is a single line, xxhash>=3.0.0 - no models, no API keys, nothing to download. ComfyUI Manager users can search "ComfyUI-Zero2JSON".

    Where people get burned

    The most common mistake is letting scene and background fight: a scene that says "inside a cluttered workshop" next to a background that says "open field at sunset" produces exactly the confused image you'd expect. Treat scene as the location the whole image lives in and background as the fill behind the subject - they should agree, not compete. And the usual visibility gotcha applies: an unconnected text output shows nothing in ComfyUI, so hook it to a display or the FLUX2 field before you assume the node is broken.

    CategoryZero2JSON/Scene

    Inputs (7)

    NameTypeDefaultDescription
    seedINT00–4294967295World seed for deterministic generation
    prompt_indexINT00–4294967295Position in infinite prompt space
    profileoptCOMBOscene_default.jsonSelect vocabulary profile
    prefixoptSTRINGText to prepend to generated prompt
    suffixoptSTRINGText to append to generated prompt
    scene_categoryoptCOMBOanyFilter by scene category
    time_hintoptCOMBOanyTime of day context hint

    Outputs (1)

    NameTypeDescription
    textSTRINGβ€”