Video Maze V2
A first-person maze flythrough, generated from a seed
- images
Here's a fun one: Video Maze V2 doesn't touch a model at all. It renders a maze - a 3D, first-person, moving-through-corridors maze - straight to frames, using nothing but CPU math and a seed. Wire its images output into a Video Combine and you've got a looping maze flythrough clip with no sampling, no VRAM, no model download. Perfect for background footage, music video B-roll, or that synthwave aesthetic you've been circling.
This is the kind of node that makes DJZ-Nodes feel like a toy box. It's not going to be in every workflow, but it's a great example of "procedural video inside ComfyUI" and it's genuinely fun to tweak.
How it works
The maze itself is generated with a classic recursive backtracker - the algorithm that carves out a perfect maze where every cell is reachable. The twist is that it's seeded, so seed gives you a deterministic, reproducible maze: same seed, same layout, every time.
Then each frame is rendered with raycasting, the same trick old-school 3D engines (think Wolfenstein 3D) used. For every column of pixels, a ray is cast through the maze until it hits a wall; the wall's distance determines its height and lighting. That's why it's CPU-fast - no polygons, no GPU - and why the walls have that authentic retro-3D feel. V2 improves on V1's rendering with adjustable wall_thickness, camera_height, and camera_pitch (tilt the camera up to +45° for a skewed, stylish look, down to -45° for more floor).
The inputs that matter
width/height(128–4096),fps(1–60),max_frames(default 300) - output geometry and length. That 300-frame default at 30fps is a 10-second loop.seed- the whole maze layout. Change it and the corridors reshape.maze_size(15–100, default 30) - grid density. Bigger = longer corridors and a grander scale; small = tighter, more frantic passages.movement_speed(0.01–0.2) androtation_speed(0.01–0.15) - how fast you fly and turn. The default is a slow drift; crankrotation_speedfor a swooping, cinematic tour.fog_distance(5–50) andfov(30–120) - atmosphere and lens width. Shorter fog with a wide FOV is the classic synthwave tunnel look.color_scheme- six palettes (neon, classic, rainbow, monochrome, sunset, cyberpunk);wall_pattern- solid, gradient, brick, or circuit;lighting_mode- dynamic, static, pulsing, ambient;render_quality- standard/high/ultra (a quality/CPU tradeoff).ceiling_colorandfloor_color- hex colors for the void above and below the walls.
Output is images (IMAGE batch), frame after frame of your maze tour.
Installing it
Standard DJZ-Nodes install:
cd ComfyUI/custom_nodes
git clone https://github.com/MushroomFleet/DJZ-Nodes
cd DJZ-Nodes
pip install -r requirements.txt
Restart ComfyUI, or use ComfyUI Manager and search "DJZ-Nodes". Note the requirements include opencv-python, which the maze renderer uses for its line drawing.
Troubleshooting
- It's slow.
render_qualityat "ultra" with a largemaze_sizeon a big resolution is a lot of raycasts per frame. Drop quality, reducemaze_size, or render smaller and upscale later. - The camera just drifts into walls. Collision detection is basic; high
movement_speedcan push you through walls. Keep speed modest (0.05–0.08) and it behaves. - "Why is my maze the same every time?" That's the seed working as intended. To get variety, vary the seed - hook it to a seed generator node.
- Walls look aliased / jagged. Raise
render_quality- the higher modes step the raycast more finely per column.
It's not "real" AI video and it never pretends to be - but as a procedural background generator it's reliable, deterministic, and costs nothing to run. For the right aesthetic, that's a win.
Inputs (20)
| Name | Type | Default | Description |
|---|---|---|---|
| width | INT | 512128–4096 | — |
| height | INT | 512128–4096 | — |
| fps | INT | 301–60 | — |
| max_frames | INT | 3001–9999 | — |
| seed | INT | 00–4294967295 | — |
| maze_size | INT | 3015–100 | — |
| wall_height | FLOAT | 0.80.5–3 | — |
| wall_thickness | INT | 11–5 | — |
| camera_height | FLOAT | 0.30.1–1 | — |
| fog_distance | FLOAT | 205–50 | — |
| fov | FLOAT | 7530–120 | — |
| movement_speed | FLOAT | 0.050.01–0.2 | — |
| rotation_speed | FLOAT | 0.030.01–0.15 | — |
| color_scheme | COMBO | 6 options: neon, classic, rainbow, monochrome, sunset, cyberpunk | |
| wall_pattern | COMBO | 4 options: solid, gradient, brick, circuit | |
| lighting_mode | COMBO | 4 options: dynamic, static, pulsing, ambient | |
| render_quality | COMBO | 3 options: standard, high, ultra | |
| ceiling_color | STRING | #000000 | — |
| floor_color | STRING | #000000 | — |
| camera_pitch | FLOAT | 0-45–45 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |