This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
Pattern Library Overview
This section contains a comprehensive library of animation and visual effect patterns for use with ComfyUI_Scriptable nodes. Each pattern includes complete code, mathematical explanations, and customization options.
Pattern Categories
Earthbound Patterns
Inspired by EarthBound's "Video Drugs" battle backgrounds using HDMA (Horizontal Direct Memory Access) effects. These patterns create retro psychedelic visual effects with scanline shifting, color cycling, and warping distortions.
See: Earthbound Patterns Overview
Psychedelic Patterns
Classic psychedelic visual effects including plasma, fractal noise, and color cycling. These patterns are foundational techniques in generative art and demoscene culture.
See: Psychedelic Patterns Overview
Animation Patterns
Mathematical animation techniques including plasma effects, Perlin noise, sine wave interference, Mandelbrot zoom, and recursive patterns. These patterns demonstrate fundamental mathematical concepts in visual form.
See: Animation Patterns Overview
Mathematical Foundations
Reference material explaining the mathematical concepts used throughout the pattern library, including Gaussian functions, Fourier transforms, complex numbers, and more.
Pattern Selection Guide
For Beginners
Start with these patterns to learn the basics:
- Plasma Effect - Simple sine wave superposition
- Color Cycling Gradient - Basic color manipulation
- Scanline Shift - Simple coordinate manipulation
For Retro Effects
Use Earthbound patterns for SNES-era aesthetics:
- HDMA Scanline Shift - Classic scanline distortion
- Earthbound Warping Distortion - Characteristic warping
- Moiré Interference - Retro interference patterns
For Looping Animations
Use patterns designed for seamless loops:
- Seamless Plasma Loop - 10-second loop at 60fps
- Radial Breathing Loop - Pulsing radial animation
- Kaleidoscope Loop - Symmetrical rotation loop
For Fractal Effects
Use patterns with self-similar detail:
- Fractal Brownian Motion - Multi-scale noise
- Perlin Noise Fractal - Smooth organic noise
- Recursive Pattern - Mathematical recursion
For Mathematical Visualizations
Use patterns that visualize mathematical concepts:
- Mandelbrot Zoom - Complex number iteration
- Sine Wave Interference - Wave superposition
- Mathematical Foundations - Concept reference
Performance Considerations
Resolution
- 512×512: Good balance of quality and performance
- 1024×1024: Higher quality, 4× slower
- 256×256: Faster, good for previews
Frame Count
- 30 frames: Good for short animations
- 60 frames: Standard for 1-second loops
- 600 frames: 10-second loops at 60fps
Optimization Tips
- Precompute coordinate grids
- Use vectorized torch operations
- Avoid Python loops over pixels
- Cache intermediate results when possible
Using Patterns
Basic Usage
- Copy the pattern code into a ScriptableImage node
- Set width and height parameters
- Adjust pattern parameters as needed
- Connect to SaveWEBM or SaveVideo for output
Customization
Each pattern includes parameters you can modify:
- Spatial frequency: Change
* 2to* 3for tighter patterns - Animation speed: Change
t/5tot/10for slower animation - Color palette: Modify RGB mapping equations
- Loop duration: Adjust frame count and period calculations
Pattern Contribution
To add a new pattern:
- Test the pattern in ComfyUI_Scriptable
- Document the mathematical formula
- Provide line-by-line code explanation
- Include performance notes
- Add to appropriate category
References
- Earthbound DMA effects: STARMEN.NET Battle Backgrounds
- Plasma effect: Wikipedia
- Perlin noise: Wikipedia
- Fractal Brownian Motion: The Book of Shaders