2 Commits
Author SHA1 Message Date
AEmotionStudio 570ad9933f fix: Address video channel detection and type consistency issues
## Fixed Issues

### High Severity
- Fixed incorrect video channel detection with default frame_dim_idx=-1
  - Now uses heuristics to detect video tensor format from shape
  - Handles both B,C,F,H,W and B,F,C,H,W formats correctly

### Medium Severity
- Fixed type mismatch between sampler and generator interface
  - Generator args now wrap dict in ShaderParams for attribute-style access
  - Fixes AttributeError when generators use params.shape_type etc.

- Fixed duplicate get_shader_generator implementations
  - __init__.py now returns static generate method (consistent with shader_noise_ksampler.py)
  - Both versions now have same behavior

### Low Severity
- Fixed missing exception handling for non-dict JSON files
  - load_shader_params now validates JSON is a dict before use
  - Catches ValueError, AttributeError, TypeError in addition to existing exceptions
2026-01-26 21:12:35 -08:00
AEmotionStudio e79e49506d refactor: Major codebase restructuring for separation of concerns
## 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
2026-01-26 19:48:23 -08:00