π Z2J Scene
A world in a hash β Z2J Scene builds your location, time and weather
- text
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 ofscene_*.jsonfiles; drop your own intoprofiles/and restart.prefix/suffix- anchors around the generated text.scene_categoryandtime_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.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| seed | INT | 00β4294967295 | World seed for deterministic generation |
| prompt_index | INT | 00β4294967295 | Position in infinite prompt space |
| profileopt | COMBO | scene_default.json | Select vocabulary profile |
| prefixopt | STRING | Text to prepend to generated prompt | |
| suffixopt | STRING | Text to append to generated prompt | |
| scene_categoryopt | COMBO | any | Filter by scene category |
| time_hintopt | COMBO | any | Time of day context hint |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| text | STRING | β |