Nodes/DJZ-Nodes/Video Maze V2
ComfyUI Node

Video Maze V2

A first-person maze flythrough, generated from a seed

By MushroomFleet·Created 2 years ago·Updated 5 months ago· 78
Video Maze V2
    • images
    width512
    height512
    fps30
    max_frames300
    seed0
    maze_size30
    wall_height0.8
    wall_thickness1
    camera_height0.3
    fog_distance20
    fov75
    movement_speed0.05
    rotation_speed0.03
    color_scheme
    wall_pattern
    lighting_mode
    render_quality
    ceiling_color#000000
    floor_color#000000
    camera_pitch0

    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) and rotation_speed (0.01–0.15) - how fast you fly and turn. The default is a slow drift; crank rotation_speed for a swooping, cinematic tour.
    • fog_distance (5–50) and fov (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_color and floor_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_quality at "ultra" with a large maze_size on a big resolution is a lot of raycasts per frame. Drop quality, reduce maze_size, or render smaller and upscale later.
    • The camera just drifts into walls. Collision detection is basic; high movement_speed can 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.

    Categorysd

    Inputs (20)

    NameTypeDefaultDescription
    widthINT512128–4096
    heightINT512128–4096
    fpsINT301–60
    max_framesINT3001–9999
    seedINT00–4294967295
    maze_sizeINT3015–100
    wall_heightFLOAT0.80.5–3
    wall_thicknessINT11–5
    camera_heightFLOAT0.30.1–1
    fog_distanceFLOAT205–50
    fovFLOAT7530–120
    movement_speedFLOAT0.050.01–0.2
    rotation_speedFLOAT0.030.01–0.15
    color_schemeCOMBO6 options: neon, classic, rainbow, monochrome, sunset, cyberpunk
    wall_patternCOMBO4 options: solid, gradient, brick, circuit
    lighting_modeCOMBO4 options: dynamic, static, pulsing, ambient
    render_qualityCOMBO3 options: standard, high, ultra
    ceiling_colorSTRING#000000
    floor_colorSTRING#000000
    camera_pitchFLOAT0-45–45

    Outputs (1)

    NameTypeDescription
    imagesIMAGE