## New Directory Structure - utils/: Shared utilities (color_utils, shape_masks, noise_utils) - core/: Central logic (params, constants, blending, transforms, model_compat, sampler, debug, logging) - shaders/: Shader generators with BaseNoiseGenerator ABC and plugin registry - nodes/: ComfyUI node class definitions ## Key Changes - Centralized color interpolation logic eliminating duplication across shader files - Unified shape mask generation with 20+ shape types - Consolidated simplex/FBM/perlin noise implementations - Created ShaderParams class for parameter normalization and validation - Implemented ShaderRegistry for plugin-based shader registration - Extracted blending operations and noise transforms to dedicated modules - Added model compatibility layer for channel detection - Moved stub visualizer/debugger to core/debug.py - Added centralized logging configuration ## Refactored Shaders - domain_warp.py: Now uses shared utilities and BaseNoiseGenerator - tensor_field.py: Now uses shared utilities and BaseNoiseGenerator - curl_noise.py: Now uses shared utilities and BaseNoiseGenerator - temporal_coherent_noise.py: Now uses shared utilities and BaseNoiseGenerator ## Cleanup - Removed duplicate SHADER_GENERATORS registry - Added comprehensive type hints to all new modules - Maintained backward compatibility with legacy API
30 lines
630 B
Python
30 lines
630 B
Python
"""
|
|
Shader noise generators for ComfyUI-ShaderNoiseKSampler.
|
|
|
|
This package provides various noise generation algorithms:
|
|
- domain_warp: Domain warping noise
|
|
- tensor_field: Tensor field noise
|
|
- curl_noise: Curl/fluid noise
|
|
- temporal_coherent: Temporally coherent noise for animations
|
|
"""
|
|
|
|
from .base import BaseNoiseGenerator
|
|
from .registry import (
|
|
ShaderRegistry,
|
|
register_shader,
|
|
get_shader,
|
|
list_shaders,
|
|
shader_generator,
|
|
)
|
|
|
|
__all__ = [
|
|
# Base class
|
|
"BaseNoiseGenerator",
|
|
# Registry
|
|
"ShaderRegistry",
|
|
"register_shader",
|
|
"get_shader",
|
|
"list_shaders",
|
|
"shader_generator",
|
|
]
|