Nodes/kubakub nodes/kubakub scene surroundings
ComfyUI Node

kubakub scene surroundings

OpenStreetMap neighbours, as grey boxes, for free

By kubakubkub·Created about a month ago·Updated 2 days ago· 10
kubakub scene surroundings
  • scene
  • scene
  • plan
  • view
  • report
◄location►
◄radius_m250►
◄own_buildingremove►
◄viewabove►
◄file►
◄groundtrue►
◄facing_deg-1►
◄default_height_m0►
◄turn_deg0.0►
◄along_m0.00►
◄out_m0.00►
◄lift_m0.0►
◄file_scale1.000►
◄terrainflat►
◄level_m40►

Every festival 3D file is the building alone. So every previz shows your facade floating in a black void, which is fine for framing and useless for judging whether the show will read from down the street. kubakub scene surroundings drops the neighbourhood in - neighbouring buildings as plain grey boxes, taken from OpenStreetMap, plus optionally the real ground of the place.

The surroundings are context and nothing else. They never become regions, they never get IDs, the projection never lands on them. They exist so your scene preview, walkthrough, pieces render (audience view) and scene relight have a street to stand in - and so the light has something to bounce off.

Inputs

scene from kubakub scene render. Put this node between scene render and whichever preview node you're using.

location is the middle of your facade as latitude, longitude. In Google Maps: right-click the wall, click the numbers to copy them. A map link containing @lat,lon works too. Empty gives you a sample square and downloads nothing.

radius_m (default 250) is how far around the place buildings get pulled in. 150–300 m is a square and its streets; larger only pays off for views from far away.

own_building is the one that needs thinking about. remove leaves out the map's footprint of the building itself, because your model stands there. keep is for the case where your model is only the facade - then the rest of the building from the map stays behind it.

view is just the check picture: from above, from the street, or off (no Blender render at all, which is what you want in a final graph where you've stopped checking).

The download, which is off by default

This is the only node in the pack that touches the network, and the author made you opt in explicitly. Write this into kubakub.ini under [settings]:

[settings]
surroundings_download = on

Then the node sends the coordinates and radius to the OpenStreetMap server (overpass-api.de) once per place and keeps the answer in ComfyUI/user/kubakub_cache/surroundings. After that the place works offline, including for a smaller radius or a spot a few metres away. The map server gets busy: the node asks three times, and if it still gets nothing it falls back to what's already on your disk for that place and says so in the report. If a place isn't cached and downloads are off, the error tells you to turn them on.

Data credit where it's due - the buildings are OpenStreetMap contributors under the ODbL; the real terrain comes from the Mapzen/Tilezen tiles on AWS Open Data.

terrain has two settings. flat puts everything on one level. real heights is the interesting one: it downloads the actual ground of the place - hills, slopes, river banks - sets the buildings down on it, and stands the audience cameras on it, meeting your model at the facade. The catch is resolution: about 10–30 m between real measurements, so no kerbs or steps, and in a dense town the data partly follows the roofs. That's why level_m (default 40) keeps the ground level within 40 m of your facade and blends into the real heights beyond, so your model isn't sitting on a slope the survey data invented.

Your own surroundings, and fine-tuning the fit

Give it file instead of a location and it uses your own model - a city model, a Houdini export, a scan - in the same space as the building (same origin and axes). Not .blend; export .glb, .fbx or .obj. file_scale brings it into metres. ground adds a flat disc under the street so buildings don't float and light has somewhere to land - turn it off if your own file brings its ground.

The fit is worked out from the map by default: facing_deg at -1 reads the compass direction from the wall of the footprint nearest the location, and that gets turned onto your model's facade with the location at the middle of the model at ground level. When it's slightly off, don't re-download - nudge it: turn_deg rotates around the middle of the facade, along_m slides it along the wall, out_m moves it toward or away from the audience, lift_m raises or lowers it (useful when the model's lowest point is a cellar). default_height_m sets the height for buildings the map has no data for; 0 means the median of the neighbours that do. Expect a lot of flat-topped blocks in towns that never mapped heights - that's fine for sight lines and shadows, wrong for a skyline.

Outputs

scene carries the surroundings forward. plan is the top view for checking the fit: surroundings grey, your model orange, the footprint that was left out as a violet line, the projector as a dot. view is the clay model in its street, per the view input. report tells you how many buildings, where their heights came from, which way the facade faces, and - the useful warning - when the projector ends up standing inside a neighbouring building, which is exactly the kind of thing you want to discover on screen rather than on site.

Cost is negligible next to everything else here: roughly 280 buildings within 250 m in a dense old town is 3.5 s to download and under a second per additional view.

Install is the normal pack route, plus Blender 4.x for the render outputs:

cd ComfyUI/custom_nodes && git clone https://github.com/kubakubkub/ComfyUI_KubaNodes
python -m pip install -r ComfyUI_KubaNodes/requirements.txt

While you're wiring it in: skip this node entirely if your deliverable is the matrix itself. It adds context to views, not content to the wall.

Categorykubakub/3d/scene

Inputs (16)

NameTypeDefaultDescription
sceneKUBA_SCENEFrom kubakub scene render.
locationSTRINGThe middle of your facade on a map, as 'latitude, longitude' (e.g. 48.85837, 2.29448). Google Maps: right click on the wall, click the numbers to copy them. A map link with @lat,lon works too. Downloads are off until you write surroundings_download = on into kubakub.ini: then the node sends these numbers and the radius to the OpenStreetMap server (overpass-api.de) once and keeps the answer. Empty: a sample square, nothing is downloaded.
radius_mFLOAT25030–1500How far around the place buildings are taken (metres). 150-300 is a square and its streets; larger only for views from far away.
own_buildingCOMBOremoveremove: the map's footprint of the building itself is left out, your model stands there. keep: for a model that is only the facade, so the rest of the building stays behind it.
viewCOMBOaboveThe check picture: from above, from the street, or off (no Blender render).
fileoptSTRINGYour own surroundings instead of the map: a model in the same space as the building (same origin and axes), e.g. exported from Houdini, Blender or a city model. Nothing is downloaded then. Not .blend: export .glb, .fbx or .obj.
groundoptBOOLEANtrueA flat ground under the street, so buildings do not float and light has something to land on. Off when your own file brings its ground.
facing_degoptFLOAT-1-1–360Compass direction your facade faces (0 = north, 90 = east, 180 = south). -1 = read from the map: the wall of the footprint nearest to the location.
default_height_moptFLOAT00–300Height for buildings the map has no height or level count for. 0 = the median of the ones around that have one.
turn_degoptFLOAT0.0-180–180Turns the surroundings around the middle of the facade (seen from above, + = counter-clockwise). For when the fit is a little off.
along_moptFLOAT0.00-500–500Moves the surroundings along the wall (+ = to the right as the audience sees it).
out_moptFLOAT0.00-500–500Moves the surroundings towards the audience (+) or behind the wall (-).
lift_moptFLOAT0.0-100–100Moves the surroundings up (+) or down, e.g. when the model's lowest point is a cellar.
file_scaleoptFLOAT1.0000.0001–10000Multiplies your own surroundings file into metres (0.01 for a file in cm).
terrainoptCOMBOflatflat: everything stands on one level. real heights: the ground of the place (hills, slopes, river banks; one more download per place, from the open terrain tiles on AWS), the buildings set down on it and the audience cameras standing on it. It meets your model at the facade. Coarse: about 10-30 m between real measurements, so no kerbs or steps. Needs a location.
level_moptFLOAT400–1000terrain = real heights: the ground stays level this far around the facade and blends into the real heights beyond, so your model stands on even ground (the height data is too coarse for a square). 0 = the raw heights.

Outputs (4)

NameTypeDescription
sceneKUBA_SCENEThe scene with its surroundings -> kubakub scene preview / scene walkthrough / pieces render / scene relight.
planIMAGETop view for checking the fit, the audience at the bottom: the surroundings (grey), your model (orange), the footprint that was left out (violet line), the projector (dot).
viewIMAGEThe clay model in its surroundings (the 'view' input).
reportSTRINGHow many buildings, where their heights come from, which way the facade faces, and warnings (e.g. the projector inside a building).