ComfyUI Node

EnvironmentVisualizer

Put your 360° skybox in a VR headset straight from ComfyUI

By willchil·Created 2 years ago·Updated about a year ago· 15
EnvironmentVisualizer
  • texture
  • depth
    name
    open_automaticallytrue

    You've generated a 2:1 panorama, run a depth model over it, and now you're staring at two flat images wondering what's next. EnvironmentVisualizer is the payoff node: it saves the pair and drops you into a WebXR viewer where the picture becomes a 3D space you can look around - in a browser tab, on a phone, or in an actual VR headset. The "I made 3D 360 VR panoramas with SD, including depth" trick people show off online? This is the last mile of that pipeline.

    What it does

    It's an output node with a boring-but-useful job. Feed it a 2:1 texture, optionally a matching 2:1 depth map, give the environment a name, and it writes them to environments/<name>/skybox.png and depth.png inside the pack's own folder. Then, if the toggle is on, it tells the front-end to pop the viewer open in a new tab the moment the queue finishes. Skip the depth input and you still get the viewer - the room just renders as a flat skybox instead of displaced geometry.

    The inputs that matter

    • texture - your panoramic image. It should be 2:1 (2048×1024 and friends).
    • name - the folder the scene is saved under. It's sanitized, capped at 25 characters (with a "..." for the overachievers), and duplicate names get " 2", " 3" appended rather than overwriting anything.
    • open_automatically - the toggle for auto-opening the viewer tab. On by default, which is nice until it isn't.
    • depth - optional. The grayscale map that gives the room real geometry. Feed it a batch and each frame becomes its own environment; if the texture and depth batch sizes disagree, the node throws an error.

    How the viewing works

    The pack quietly runs its own little HTTPS server on port 4443 while ComfyUI is up, and adds an "Environment Visualizer" button to the sidebar. The viewer builds a mesh from your depth map - the page has sliders for minimum distance, depth range, and mesh resolution - and in a headset you steer with the VR joysticks, or A/D and arrow keys on a keyboard. Because WebXR requires a secure context, the server has to be HTTPS, which is why the pack generates a self-signed certificate on first launch.

    Install

    ComfyUI Manager (search "ComfyUI-Environment-Visualizer"), or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/willchil/ComfyUI-Environment-Visualizer
    

    then restart ComfyUI. There's no requirements.txt - the pack runs on ComfyUI's bundled torch/PIL/numpy - so no model downloads and no pip pain. The one external requirement is openssl on your machine, because that's what mints the self-signed cert.

    The gotchas

    The browser warning is expected, not broken - it's your own self-signed cert, click through it (and for WebXR you'll need to accept it for the domain once). If the viewer never opens, openssl not being on PATH is the usual culprit. The server is always running while the pack is loaded, so when you're not using it, disable the pack from the Manager rather than carrying the port around. And here's the real trap: saved environments live inside the pack's environments/ folder, which is gitignored - uninstall or wipe the pack and your scenes go with it. Back them up if they matter.

    Categoryimage/equirectangular

    Inputs (4)

    NameTypeDefaultDescription
    textureIMAGE
    nameSTRING
    open_automaticallyBOOLEANtrue
    depthoptIMAGE

    Outputs (0)

    No outputs