Nodes/DJZ-Nodes/Video Cube V1
ComfyUI Node

Video Cube V1

A spinning 3D cube in three render styles, from wireframe to points

By MushroomFleet·Created 2 years ago·Updated 5 months ago· 77
Video Cube V1
    • images
    width512
    height512
    fps30
    max_frames120
    cube_size1.0
    distance5.0
    fov75
    rotation_x0.02
    rotation_y0.03
    rotation_z0.01
    color_scheme
    render_style
    lighting_mode

    Video Cube V1 is a tiny software 3D renderer whose entire subject is one spinning cube. It builds the cube's vertices, rotates them in 3D, projects them with a real perspective camera (FOV, distance, the works), and draws each frame in one of three render styles - wireframe, solid, or points. No GPU, no model, no dependencies beyond numpy and cv2. It's the kind of node that looks like a toy until you want a reliable abstract rotating object in your compositing pipeline, at which point it's exactly right.

    How it works

    The math is textbook 3D graphics, done by hand:

    • create_cube_vertices / create_cube_faces - the cube's 8 corners and 6 faces
    • rotate_points - rotation about X, Y, and Z using the per-frame rotation_x/y/z values (which are in radians per frame - 0.02–0.03 is a gentle spin, 0.1 is a tumble)
    • project_points - perspective projection using fov (30–120) and distance (2–20) to position the camera
    • render_frame - draws it as wireframe (edges only - the classic 80s demo look), solid (filled faces with per-face lighting), or points (just vertices - which looks fantastic as abstract motion)
    • lighting_mode - basic, ambient, dynamic, or none, tinting faces by their normals

    cube_size (0.1–5) sets the cube's scale; color_scheme (rainbow, monochrome, neon, pastel, cyberpunk) sets the palette.

    Inputs and outputs

    Required: width, height (128–4096, step 64), fps (1–60), max_frames (1–9999), cube_size, distance, fov, rotation_x/y/z, color_scheme, render_style, lighting_mode. Output: images - a max_frames-long IMAGE batch.

    Where it sits in a workflow

    Same playbook as the corridor and maze: this family of DJZ nodes is at its best as a camera-motion supplier. Render the spinning cube, then feed the frames into img2img with a prompt like "chrome cube on a pedestal" and you get an AI-styled object with mathematically perfect rotation - no struggling to coax a consistent camera move out of a video model. In points mode it's also a great abstract-texture source for compositing and motion backgrounds.

    Install

    Part of DJZ-Nodes by Drift Johnson. ComfyUI Manager → "DJZ-Nodes", or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/MushroomFleet/DJZ-Nodes
    cd DJZ-Nodes
    pip install -r requirements.txt
    

    Restart ComfyUI. numpy/torch/cv2 - nothing extra.

    Gotchas

    Rotation inputs are per-frame deltas, so the values you set are "how much it turns each frame," not a total. Because it's CPU vector math, 4096² runs at high max_frames will crawl - 512² is the sweet spot for speed, and you can always upscale. And distance interacts with fov: if the cube looks clipped or tiny, adjust distance before FOV, since they fight each other.

    Categorysd

    Inputs (13)

    NameTypeDefaultDescription
    widthINT512128–4096
    heightINT512128–4096
    fpsINT301–60
    max_framesINT1201–9999
    cube_sizeFLOAT1.00.1–5
    distanceFLOAT5.02–20
    fovFLOAT7530–120
    rotation_xFLOAT0.02-0.1–0.1
    rotation_yFLOAT0.03-0.1–0.1
    rotation_zFLOAT0.01-0.1–0.1
    color_schemeCOMBO5 options: rainbow, monochrome, neon, pastel, cyberpunk
    render_styleCOMBO3 options: wireframe, solid, points
    lighting_modeCOMBO4 options: basic, ambient, dynamic, none

    Outputs (1)

    NameTypeDescription
    imagesIMAGE