1 patterns-Overview
Balazs Horvath edited this page 2026-04-18 10:52:07 +02:00
This file contains ambiguous Unicode characters

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.

See: Mathematical Foundations

Pattern Selection Guide

For Beginners

Start with these patterns to learn the basics:

For Retro Effects

Use Earthbound patterns for SNES-era aesthetics:

For Looping Animations

Use patterns designed for seamless loops:

For Fractal Effects

Use patterns with self-similar detail:

For Mathematical Visualizations

Use patterns that visualize mathematical concepts:

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

  1. Precompute coordinate grids
  2. Use vectorized torch operations
  3. Avoid Python loops over pixels
  4. Cache intermediate results when possible

Using Patterns

Basic Usage

  1. Copy the pattern code into a ScriptableImage node
  2. Set width and height parameters
  3. Adjust pattern parameters as needed
  4. Connect to SaveWEBM or SaveVideo for output

Customization

Each pattern includes parameters you can modify:

  • Spatial frequency: Change * 2 to * 3 for tighter patterns
  • Animation speed: Change t/5 to t/10 for slower animation
  • Color palette: Modify RGB mapping equations
  • Loop duration: Adjust frame count and period calculations

Pattern Contribution

To add a new pattern:

  1. Test the pattern in ComfyUI_Scriptable
  2. Document the mathematical formula
  3. Provide line-by-line code explanation
  4. Include performance notes
  5. 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