An LLM-powered orchestrator for creating POV-Ray 3D scenes and animations. RayLM leverages AI to automatically generate complex 3D scenes from text prompts, with built-in syntax verification and auto-repair capabilities.
🎨 AI-Powered 3D: Generate photorealistic 3D scenes and animations using natural language prompts. No manual modeling required!
Watch RayLM generate photorealistic 3D scenes from simple text prompts
RayLM uses a multi-stage AI-powered workflow to generate and render POV-Ray scenes:
A generator LLM (default: Gemini 3 Pro) translates your text prompt into POV-Ray SDL (Scene Description Language) code, including camera, lighting, geometry, and materials.
A verifier LLM (default: Claude Sonnet 4.5) reviews the generated code for syntax errors, compliance with POV-Ray 3.7 standards, and structural correctness.
POV-Ray renders the scene into an image or animation (using FFmpeg for video stitching).
If rendering fails due to syntax errors, the verifier LLM automatically fixes the code and retries (up to 3 attempts).
Automatically generates complex 3D scenes without manual modeling using advanced LLMs.
Separate generation and verification steps ensure coherent and well-structured scenes.
Generate animated sequences with FFmpeg integration for video stitching.
Automatic error detection and code fixing with up to 3 retry attempts.
Accepts user prompts from command line or files, with support for random scene generation.
Creates photorealistic scenes with proper lighting, materials, and composition up to 4K resolution.
Python 3.7+
Required for running the script
Zaguán API Key
Register at zaguanai.com to get your API key
POV-Ray Renderer (MANDATORY)
Download from github.com/POV-Ray/povray
FFmpeg (for animations)
Required for animation mode - ffmpeg.org
# Follow official installation instructions for your OS
# Ensure 'povray' command is available in your PATH# Linux
sudo apt install ffmpeg
# macOS
brew install ffmpeg
# Windows: Download from https://ffmpeg.orgpip install openai python-dotenv# Option 1: Environment variables
export ZAGUAN_API_KEY="your_api_key_here"
export ZAGUAN_BASE_URL="your_zaguan_base_url" # Optional
# Option 2: Create .env file
echo "ZAGUAN_API_KEY=your_api_key_here" > .env
echo "ZAGUAN_BASE_URL=your_zaguan_base_url" >> .envpython raylm3.5.py "A glass sphere on a checkered floor with dramatic lighting"python raylm3.5.py "Rotating crystal" --animation --frames 60python raylm3.5.py "Sunset over mountains" --width 3840 --height 2160 --quality 11python raylm3.5.py --prompt-file scene_description.txtpython raylm3.5.py "Abstract geometric shapes" --no-render“A photorealistic scene of a crystal sphere floating above a marble pedestal in a dark room. The sphere should be transparent with internal reflections. Dramatic side lighting from a single point light source creates strong shadows. Camera angle is slightly below eye level, looking up at the sphere. The marble has subtle veining and a polished finish.”
Start with simple scenes and gradually add complexity. Use the --no-render flag to quickly iterate on code generation before committing to full renders.