Nodes/Prompt Factory/⛅️ Environment
ComfyUI Node

⛅️ Environment

Where's this happening? A backdrop node that rolls itself

By satche·Created 2 years ago·Updated about a year ago· 5
⛅️ Environment
    • STRING
    locationrandom
    seed0

    Meet the node

    ⛅️ Environment answers the "where is this happening?" question for a Prompt Factory scene, and in the version you'll find on comfy.icu it's trimmed to the absolute minimum: a location pick (indoors or outdoors) and the shared seed. That's it. One roll, one tag string, straight into the merge. (If you've seen an older config floating around that also carried time-of-day and weather tags, that's the pack evolving - the published node exposes location and seed, and that's what you should rely on.)

    Why you'd use it

    It closes the loop on the scene. Character, Clothes and Composition describe a person in a frame; Environment tells the model where they are. A location tag is cheap and effective on the anime tag lineage, and the config keeps the list short (living room, forest, beach, mountain) so outputs stay predictable enough to batch and riff on. Pair it with Composition's quality prefix and you've got a decent prompt skeleton in a few clicks.

    How it behaves

    The standard Prompt Factory machinery: config-driven tag selection, deterministic per seed. random rolls the location, a concrete value locks it, none drops the tag. Output is one STRING that you wire into MergeStrings along with the other fragments, then CLIPTextEncode, then sample.

    Same caveat as Clothes, one more time: no cross-node coherence. beach can land next to a snowy scene because Environment never talks to the rest of the graph. The repo's rules.json sketches the fix (a swimsuit forces a beach/pool location, night drops the sun) without enforcing it in the shipped code - so if coherence matters, pick the location yourself and keep the fragments consistent.

    Install

    Pack-level, and it's a light one: ComfyUI Manager → search "Prompt Factory", or by hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/satche/comfyui-prompt-factory
    pip install -r requirements.txt
    

    No models, no GPU dependencies - dpath and numpy are the whole list. Restart after install. If the clone 404s, use Manager or comfy node registry-install comfyui-prompt-factory.

    Troubleshooting

    • Scenes with no backdrop: the Environment output isn't connected to the merge node. That's the one real way to break this node.
    • Same location every time: location is set to a concrete value; flip it back to random.
    • Wish there were more places: edit the location list in config.json - adding tags is the pack's intended power move.
    Category⚙️ Prompt Factory/⭐️ My Nodes

    Inputs (2)

    NameTypeDefaultDescription
    locationCOMBOrandom4 options: random, indoors, outdoors, none
    seedINT00–18446744073709550000

    Outputs (1)

    NameTypeDescription
    STRINGSTRING