Commit Graph
202 Commits
Author SHA1 Message Date
google-labs-jules[bot]andAEmotionStudio dfd2fe0611 feat(ux): improve accessibility for matrix modal and copy button
- Restore focus to main canvas when closing the matrix modal to support keyboard navigation
- Update aria-label to 'Copied' on copy button success to support screen readers
- Conditionally restore original aria-label to prevent overwriting on error

Co-authored-by: AEmotionStudio <163354043+AEmotionStudio@users.noreply.github.com>
2026-02-09 23:32:27 +00:00
google-labs-jules[bot]andAEmotionStudio 5fdd35ff05 feat(ux): improve accessibility for matrix modal and copy button
- Restore focus to main canvas when closing the matrix modal to support keyboard navigation
- Update aria-label to 'Copied' on copy button success to support screen readers
- Restore original aria-label after timeout

Co-authored-by: AEmotionStudio <163354043+AEmotionStudio@users.noreply.github.com>
2026-02-09 16:07:22 +00:00
AEmotionStudio b78538578b feat: Add server-side parameter saving API and changelog
- Add api_routes.py with POST /shader_noise_ksampler/save_params endpoint
- Update frontend to use fetch() API instead of browser download
- Register API routes with PromptServer in __init__.py
- Add CHANGELOG.md with version history
- Update README.md with navigation links and version 1.3.0
- Video comparer optimizations for memory efficiency
2026-01-29 23:53:29 -08:00
Æmotion Studio 9bee5a33d4 Merge pull request #43 from AEmotionStudio/fix/shader-imports-and-video-comparer
Fix shader imports and refactor video comparer
2026-01-29 18:04:03 -08:00
AEmotionStudio d62aa6a8be fix(video_comparer): resolve PR review issues
- Remove duplicate VideoComparer class from root (only nodes/ version used)
- Fix memory threshold check order: check 16GB before 12GB so force cleanup can trigger
- Fix metadata key calculation using proper key mapping instead of broken string replace
2026-01-29 17:55:42 -08:00
AEmotionStudio 7c4c806687 Fix shader imports and refactor video comparer
- Fix absolute imports in shaders/ to use relative paths
- Correct indentation in shader files
- Refactor video_comparer.py and nodes/video_comparer.py
- Add new example workflows
- Update gitignore and package.json
2026-01-29 17:44:22 -08:00
Æmotion Studio 2491688c0b Merge pull request #41 from AEmotionStudio/feature/typescript-migration
feat: Complete TypeScript migration with 85 unit tests
2026-01-28 16:49:15 -08:00
AEmotionStudio 50b37bea2c fix: Make TITLE_GRADIENT_COLORS module-private
Remove export keyword from TITLE_GRADIENT_COLORS since it's only used
internally by createTitleGradient() and never imported elsewhere.

All 85 tests pass.
2026-01-28 12:38:25 -08:00
AEmotionStudio ca4704bff0 fix: Address PR #41 review comments (round 7)
- Simplify redundant shimmer conditionals:
  Both branches called calculateShimmerPosition(1.0) identically.
  Now unconditionally compute shimmer, only cache lastTime conditionally.

- Use TITLE_CORNER_RADIUS constant:
  Replaced local 'const cornerRadius = 8' in both golden_eyeball.ts and
  gradient_title.ts with the shared TITLE_CORNER_RADIUS constant.

All 85 tests pass.
2026-01-28 12:02:31 -08:00
AEmotionStudio 829189e15e fix: Address PR #41 review comments (round 6)
- Remove debug console.log statements:
  - matrix_button.ts: 'MatrixButton module loaded'
  - video_comparer.ts: module load, widget constructor/setter, setup logs
  - shader_renderer.ts: 'ShaderRenderer module loaded'
  - advanced_comparer.ts: module load and setup complete logs

- Extract shared animation utilities to golden_eyeball.ts:
  - shouldUpdateFrame(): frame counter advancement
  - resetShadowContext(): context shadow property reset
  - createTitleGradient(): standard vertical background gradient
  - calculateShimmerPosition(): shimmer math calculation
  - TITLE_GRADIENT_COLORS: shared color constants
  - TITLE_CORNER_RADIUS: shared corner radius constant

- Refactor to use shared utilities:
  - gradient_title.ts now imports and uses shared utilities
  - golden_eyeball.ts drawGradientTitle uses its own exports

All 85 tests pass.
2026-01-28 04:26:42 -08:00
AEmotionStudio 00ba3bc17f fix: Address PR #41 review comments (round 5)
- Remove redundant Side-by-Side case in computeSize():
  The case set height = Math.max(500, width) which was identical to the
  default initialization, so it was effectively dead code.

- Extract resetButtonTimeout helper in copyCodeSection():
  Both success and error handlers had identical timeout reset logic.
  Consolidated into a single helper function, reducing ~25 lines.

All 85 tests pass.
2026-01-28 04:10:04 -08:00
AEmotionStudio a17ba641d5 fix: Address PR #41 review comments (round 4)
- Restore getExtraMenuOptions context menu in advanced_comparer.ts:
  - Layout Mode submenu with all 8 comparison modes
  - Reset to Default Size option
  - Consistent with video_comparer.ts implementation

- Create COMPARER_MODES constant to eliminate duplicate arrays:
  - Used in @comparer_mode property definition
  - Used in layoutWidget combo values
  - Used in context menu submenu

- Share AnimationCache type in gradient_title.ts:
  - Import AnimationCache from golden_eyeball.js
  - Remove duplicate RenderCache interface definition
  - Note: gradient_title.ts intentionally has its own drawGradientTitle
    for equation-styled titles (different visual from golden eyeball)

All 85 tests pass.
2026-01-28 03:56:07 -08:00
AEmotionStudio 1112364bb2 fix: Address PR #41 review comments (round 3)
- Add .js extension to local imports for browser ES module compatibility
  (./golden_eyeball → ./golden_eyeball.js, ./comfy_utils → ./comfy_utils.js)

- Remove unused api import from advanced_comparer.ts and video_comparer.ts
  (no longer needed since imageDataToUrl moved to comfy_utils)

- Remove unreachable dead code in gradient_title.ts
  (else branch was never reached due to early return for collapsed state)

All 85 tests pass.
2026-01-28 03:42:24 -08:00
AEmotionStudio 3dc9cc1b29 fix: Address PR #41 review comments (round 2)
- Remove export from drawGoldenEyeball (internal function only)
  Makes it a private implementation detail in golden_eyeball.ts

- Remove unused CACHE properties in video_comparer.ts:
  - titleCanvas, titleCtx, lastWidth, lastHeight, collapsed
  - Now only keeps frameCount, frameSkip, lastTime needed by AnimationCache
  - Remove dead cleanup code in onRemoved

- Extract shared imageDataToUrl utility:
  - Create new comfy_utils.ts module
  - Update advanced_comparer.ts to import shared function
  - Update video_comparer.ts to import shared function
  - Eliminates duplicated URL building logic

All 85 tests pass.
2026-01-28 03:26:52 -08:00
AEmotionStudio d8e7f48127 refactor: Extract shared golden eyeball rendering functions
- Create new golden_eyeball.ts module with:
  - drawGoldenEyeball: parameterized rayCount (8 for advanced, 6 for video)
  - drawGradientTitle: shared gradient background with animated eyeball
  - AnimationCache type for frame timing optimization

- Update advanced_comparer.ts:
  - Import shared functions from golden_eyeball.ts
  - Remove duplicate (~200 lines) drawGoldenEyeball and drawGradientTitle
  - Pass rayCount=8 for fuller eyeball effect

- Update video_comparer.ts:
  - Import shared functions from golden_eyeball.ts
  - Remove duplicate (~157 lines) drawGoldenEyeball and drawGradientTitle
  - Pass rayCount=6 for simpler eyeball effect

Addresses PR #41 review comments about code duplication across widget files.
Net reduction: ~350 lines of duplicated rendering code.
2026-01-28 03:01:34 -08:00
AEmotionStudio c9042f9571 refactor: Extract duplicated image scaling logic into helper method
- Add calculateScaledDimensions() private method to AdvancedImageComparerWidget
- Replace duplicated aspect ratio calculation in 5 draw methods:
  - drawImage
  - drawImageSideBySide
  - drawImageStacked
  - drawImageInCell
  - drawImageInPair

The helper calculates scaled dimensions to fit an image within usable area
while maintaining aspect ratio, eliminating ~15 lines of repeated logic.

Addresses PR #41 review comment about code duplication.
2026-01-28 02:39:30 -08:00
AEmotionStudio 50b21d6f12 fix: Remove dead code flagged in PR review #41 (additional)
- Remove unused 'last_y' property from AdvancedImageComparerWidget class
  (property was set but never read)
- Remove unused 'declare const app' statement in gradient_title.ts
- Simplify import handling: use direct 'import { app }' instead of alias

Files modified:
- web/src/advanced_comparer.ts
- web/src/gradient_title.ts
2026-01-28 02:02:52 -08:00
AEmotionStudio f0127c0ffc fix: Remove dead code flagged in PR review #41
- Remove unreachable else branch in drawGradientTitle that could never execute
  after early return for collapsed state (line 301-303)
- Remove hidden clearCacheButton debug widget that served no functional purpose
  (lines 768-771, also from interface)

Files modified:
- web/src/advanced_comparer.ts
2026-01-28 01:49:31 -08:00
AEmotionStudio b543ba3e98 fix: Remove unused CACHE properties flagged in PR review
- Remove unused titleCanvas, titleCtx, lastWidth, lastHeight,
  collapsed.canvas, collapsed.ctx, collapsed.lastWidth from CACHE
- Keep only animation-related properties: lastTime, frameCount, frameSkip
- Remove dead cleanup code in onRemoved that referenced removed properties
- Addresses PR #41 review comments (cursor[bot])

Files modified:
- web/src/gradient_title.ts
- web/src/advanced_comparer.ts
2026-01-28 01:35:04 -08:00
AEmotionStudio 1b59dc2ac8 feat: Complete TypeScript migration with 85 unit tests
- Migrate 7 JavaScript files to TypeScript with full type annotations
- Add TypeScript infrastructure: tsconfig.json, package.json, vitest.config.ts
- Add type declarations for ComfyUI and LiteGraph APIs (web/types/)
- Add comprehensive test suite with Vitest:
  - noise_visualizer.test.ts (29 tests) - Canvas rendering methods
  - matrix_button.test.ts (19 tests) - Window utilities
  - integration.test.ts (16 tests) - Extension registration
  - shader_rendering.test.ts (21 tests) - WebGL pipeline
- Add test mocks for Canvas 2D, WebGL, and ComfyUI APIs
- Update .gitignore to track TypeScript sources

Files migrated:
- gradient_title.ts (245 lines)
- shader_params_save_button.ts (540 lines)
- noise_visualizer.ts (1,578 lines)
- advanced_comparer.ts (905 lines, optimized from 1,772)
- shader_renderer.ts (615 lines, optimized from 2,396)
- video_comparer.ts (1,179 lines, optimized from 2,402)
- matrix_button.ts (3,360 lines, fully typed)
2026-01-28 01:00:10 -08:00
Æmotion Studio 485152c3be Merge pull request #40 from AEmotionStudio/dev
refactor: Major codebase restructuring for separation of concerns
2026-01-27 00:45:41 -08:00
AEmotionStudio cb391fa5d9 fix: Consistent shader registration and tensor-aware interpolation
- shader_noise_ksampler.py: register_shader_generator now registers to both
  the legacy SHADER_GENERATORS dict and the new centralized registry,
  matching the behavior in __init__.py for backward compatibility

- core/transforms.py: resize_noise_spatial now considers INPUT tensor
  dimensionality when selecting interpolation mode, not just target_size.
  For 5D video tensors with 2D target_size (H, W), uses frame-by-frame
  bilinear interpolation via new _resize_5d_tensor_spatial helper.
  Previously would incorrectly select bilinear mode for 5D tensors.
2026-01-27 00:32:53 -08:00
AEmotionStudio 37bf766c1b fix: Handle spatial dimensions before channels in shape correction
Fixes two issues where shape matching/correction handles channel dimensions
before spatial dimensions, causing errors when both differ:

- blending.py: _match_tensor_shape and _match_video_tensor_shape now handle
  spatial interpolation (Step 3) before channel copying (Step 4)
- sampler.py: _correct_frame_shape and _correct_image_shape now handle
  spatial interpolation before channel copying

The issue was that when creating torch.zeros_like(target) for channel
adjustment, the target has target's spatial dimensions, but the source
slice being copied has source's spatial dimensions. If both differ,
the assignment fails with incompatible shapes.

By handling spatial interpolation first, the source tensor's spatial
dimensions match the target before any channel slicing occurs.
2026-01-27 00:08:31 -08:00
AEmotionStudio f59f39024d fix: Resolve PR review issues for get_shader_generator and _wrap_legacy_generator
- Fix _wrap_legacy_generator to convert ShaderParams to dict using to_dict()
  for legacy function compatibility (matches fallback_wrapper behavior)
- Fix get_shader_generator to return fallback_wrapper instead of None for
  unknown shader types (consistent with shader_noise_ksampler.py behavior)

Resolves:
- Duplicate get_shader_generator implementations with inconsistent behavior
- Legacy wrapper doesn't convert ShaderParams to dict
2026-01-26 23:29:38 -08:00
AEmotionStudioandClaude Opus 4.5 150004c67b Merge main into dev, resolving conflicts
Kept dev branch versions of shader files which use centralized
imports from utility modules (utils.color_utils, utils.shape_masks,
utils.noise_utils, core.params) rather than inline definitions.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 23:07:59 -08:00
AEmotionStudioandClaude Opus 4.5 3f92bcaad9 fix: Add video format detection to match_noise_shape
- Add _detect_video_channel_dim helper using the same heuristics as
  blending.py and sampler.py for consistent format detection
- Add optional channel_dim parameter to match_noise_shape for explicit
  format specification when known
- Auto-detect B,C,F,H,W vs B,F,C,H,W format for video tensors when
  channel_dim is not provided

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 22:52:27 -08:00
AEmotionStudioandClaude Opus 4.5 929a46d4cd fix: Remove unconditional debug print statements from _correct_noise_shape
Remove debug print statements that would spam logs in production when
noise shape correction occurs during normal operation.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 22:40:35 -08:00
AEmotionStudioandClaude Opus 4.5 0aa6fa6224 fix: Address parameter validation, video interpolation, and function signatures
- Add ShaderParams.validate() calls when creating params in sampler.py
  to ensure octaves are clamped and values are properly converted
- Fix _correct_noise_shape to properly handle B,F,C,H,W video format
  by transposing before trilinear interpolation and handling frame count
- Wrap legacy generator functions in get_shader_generator to accept
  both 'params' (new) and 'shader_params' (legacy) keyword arguments

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 22:24:31 -08:00
AEmotionStudioandClaude Opus 4.5 d6cfe8d928 fix: Resolve video format inconsistency and remove unused imports
- Align default video tensor format between sampler.py and blending.py
  to B,F,C,H,W (channel_dim=2, frame_dim=1) for consistent handling
- Remove unused imports: SUPPORTED_BLEND_MODES, SUPPORTED_TRANSFORMS,
  blend_noises, apply_noise_transform

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 22:06:57 -08:00
AEmotionStudio fccba7876d fix: Handle fallback generator signature and function/class registration
- get_shader_generator now wraps fallback to translate params -> shader_params
- Properly handles both class-based generators (with .generate) and plain functions
- Converts ShaderParams to dict for legacy generate_noise_tensor compatibility
2026-01-26 21:44:26 -08:00
AEmotionStudio ab44bbcb2b fix: Resolve shader registration, unused variable, and parameter mismatch
- register_shader_generator now registers to both legacy dict and new registry
- Removed unused inner_class_lower variable in model_compat.py
- Changed generator_args key from 'shader_params' to 'params' to match BaseNoiseGenerator signature
- Added ShaderParams import and wrap params before passing to generators
2026-01-26 21:29:12 -08:00
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 3d8faac18d fix: Address import and interface issues
## Fixed Issues

### High Severity
- Fixed missing relative import dot (shader_noise_ksampler.py)
  - Changed from 'shaders.registry' to '.shaders.registry'
  - Added 'shader_registry' public alias to registry.py

- Fixed generator returning class instead of callable (shader_noise_ksampler.py)
  - get_shader_generator now returns generator_class.generate (the static method)
  - Callers can now use generator_func(**kwargs) as expected

- Fixed parameter name mismatch (core/sampler.py)
  - Changed 'shader_params' to 'params' in generator_args
  - Matches BaseNoiseGenerator.generate() signature
2026-01-26 20:54:10 -08:00
AEmotionStudio bc7646913d fix: Address blend mode formulas and registry issues
## Fixed Issues

### High Severity
- Fixed overlay blend mode formula (core/blending.py)
  - Now computes full overlay result then interpolates with base
  - Returns base unchanged when strength=0

- Fixed hard_light blend mode formula (core/blending.py)
  - Now computes full hard light result then interpolates with base
  - term2 no longer produces incorrect values at strength=0

### Medium Severity
- Fixed difference blend mode formula (core/blending.py)
  - Now interpolates between base and abs(base-shader)
  - No longer adds difference to base

- Fixed duplicate empty SHADER_GENERATORS registry (shader_noise_ksampler.py)
  - Now imports and uses centralized shader_registry
  - get_shader_generator and register_shader_generator delegate to registry

- Fixed apply_common_postprocessing ignoring shape mask (shaders/base.py)
  - Now calls apply_shape_mask with coords parameter as documented
2026-01-26 20:35:15 -08:00
AEmotionStudio 57a1177c6c fix: Address additional bugbot issues
## Fixed Issues

### High Severity
- Fixed class vs instance attribute mismatch in AdvancedImageComparer (nodes/comparer.py)
  - compare_images now uses type(self) to access class attributes
  - Ensures cache is properly shared with clear_cache() and get_cache_info()

- Fixed bilinear interpolation on 3D tensor crash (core/blending.py)
  - Frame interpolation now reshapes to 4D (B*C, 1, F, H*W) before bilinear

### Medium Severity
- Fixed linear_increase yielding zero for single stage (core/sampler.py)
  - Added min_factor=0.25 and special case for single stage
  - Matches behavior of linear_decrease

- Fixed inconsistent zero-stage handling (core/sampler.py)
  - calculate_step_points now returns [] for num_stages=0
  - Matches calculate_stage_strengths and calculate_step_ranges

### Low Severity
- Fixed unconditional warning in _log_blend_stats (core/blending.py)
  - Warning now gated behind debug_level >= 1
2026-01-26 20:20:42 -08:00
AEmotionStudio e2f02251c8 fix: Address bugbot issues with video tensor handling
## Fixed Issues

### High Severity
- Fixed _match_video_tensor_shape returning zeros when channels match
  - Now properly handles spatial dimension mismatches
  - Returns correctly interpolated data instead of discarding

- Fixed bilinear interpolation failing on 5D video tensors
  - _correct_noise_shape now uses trilinear for 5D tensors
  - Added _interpolate_video_framewise as fallback

### Medium Severity
- Fixed video shape fallback discarding channel adjustments
  - Now uses result tensor instead of original source

- Fixed video tensor format assumption (B,F,C,H,W vs B,C,F,H,W)
  - Added _detect_video_format to determine tensor layout
  - Handles both formats correctly in _match_video_tensor_shape

- Fixed channel dimension check using wrong index for videos
  - Now detects channel dim dynamically based on tensor format

### Low Severity
- Removed sys.path modification in shaders/base.py
  - Replaced with proper relative imports (from ..utils, from ..core)
2026-01-26 20:02:00 -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
Æmotion Studio 131143526b Merge pull request #39 from AEmotionStudio/bolt-simplex-gradients-optimization-13271204946422163234
⚡ Bolt: Optimize Simplex Noise Gradient Lookup
2026-01-25 14:03:20 -08:00
google-labs-jules[bot] 9d49ef40bf perf: optimize simplex noise gradient lookup
Replaced runtime bitwise logic and branching in `TemporalCoherentNoiseGenerator.simplex_noise_3d` with `torch.nn.functional.embedding` and a precomputed gradient table.
This yields a ~1.28x speedup (43ms -> 33ms) for 3D noise generation on CPU while maintaining mathematical equivalence.
2026-01-25 07:40:36 +00:00
Æmotion Studio 3758715936 Merge pull request #36 from AEmotionStudio/sentinel-parameter-sanitization-4581240770368865446
🛡️ Sentinel: Fix potential DoS via parameter validation
2026-01-24 00:43:19 -08:00
Æmotion Studio f936e7554c Merge pull request #38 from AEmotionStudio/bolt-optimize-domain-warp-colors-7443544008451271540
⚡ Bolt: Optimize DomainWarp color interpolation
2026-01-24 00:43:09 -08:00
google-labs-jules[bot] c1bbb7463f Fix: Remove accidental debug script
- Deleted `verify_comments.py` which was inadvertently included in the previous commit.
2026-01-24 08:10:13 +00:00
google-labs-jules[bot] dd588a540d Restore shape restoration logic in simplex_noise_3d
Fixed a regression where 3D inputs [H, W, 3] resulted in [1, H, W, 1] outputs instead of [H, W, 1] due to missing squeeze operations.
2026-01-24 08:07:32 +00:00
google-labs-jules[bot] cb42a80044 Fix: Address PR comments on parameter validation
- Added OverflowError handling for seed conversion to prevent crashes with infinite inputs.
- Added explicit NaN/Inf checks for float parameters before clamping, as min/max operations propagate NaN.
- Added NaN/Inf checks for seeds to prevent invalid conversions.
2026-01-24 07:34:42 +00:00
Æmotion Studio 64731b5f5e Merge pull request #37 from AEmotionStudio/ux/improve-modal-feedback-7316539427329001047
🎨 Palette: Improve modal accessibility and copy feedback
2026-01-23 23:31:54 -08:00
google-labs-jules[bot] 820f3931c6 Refactor DomainWarp color interpolation for performance and clarity
- Extracted color schemes into a module-level `COLOR_SCHEMES` constant.
- Implemented `_get_color_tensors` with `lru_cache` to prevent redundant tensor creation.
- Replaced manual `if/elif` interpolation logic with `_interpolate_colors` using `torch.bucketize` and cached tensors.
- Cleaned up imports to robustly handle relative importing.
- Preserved exact logic for `viridis` and procedural schemes (plasma, rainbow).
2026-01-24 07:31:38 +00:00
google-labs-jules[bot] 5b2c5868bc 🎨 Palette: Improve modal accessibility and copy feedback
💡 What:
- Exposed the `showToast` utility from `web/shader_params_save_button.js` as `window.showComfyToast`.
- Updated `web/matrix_button.js` to use `window.showComfyToast` for the "Copy Code" feedback.
- Added `:focus-visible` styles to the "Shader Matrix" modal buttons and tabs.

🎯 Why:
- To provide consistent and delightful feedback when copying code snippets.
- To improve accessibility for keyboard users by making focus states clearly visible.

📸 Before/After:
- Before: Copy button text changed to "Copied!". No visible focus ring on dark modal buttons.
- After: "Code copied to clipboard!" toast appears. Interactive elements have a bright purple focus ring.

♿ Accessibility:
- Added `:focus-visible` outline styles using the theme's accent color.
2026-01-24 07:19:36 +00:00
google-labs-jules[bot] 180cac0744 Fix: Harden shader parameter validation to prevent DoS
- Validate and clamp `seed` and `base_seed` parameters to the safe 64-bit integer range [-9e18, 9e18] to prevent PyTorch `RuntimeError` crashes.
- Enable and enforce clamping for float parameters (`scale`, `warp_strength`, etc.) to reasonable bounds (+/- 1,000,000) to prevent numerical instability or Infinity/NaN propagation.
- Update `shader_params_reader.py` to implement these checks in `validate_and_sanitize_params`.
2026-01-24 07:15:33 +00:00
Æmotion Studio 51fa176353 Merge pull request #33 from AEmotionStudio/ux/save-toast-13038202423661223723
🎨 Palette: Add Toast Notification for Shader Params Save
2026-01-23 02:01:42 -08:00
google-labs-jules[bot] 80823e7e36 🎨 Palette: Add Toast Notification for Shader Params Save
💡 What: Replaced subtle button text changes and console logs with a Toast notification system for the "Save Shader Parameters" button.
🎯 Why: Users need clear, accessible feedback when saving parameters to know if the action succeeded or failed. The previous method was easy to miss.
📸 Verification: Verified via Playwright script `verify_toast.py` with mock environment. Screenshot confirms visibility and styling.
♿ Accessibility: Included `role='alert'` and high-contrast styling for the notifications.
🔧 Fixes:
- Addressed potential zombie process in verification script.
- Added fallback cleanup for toast elements if CSS transitions are disabled.
- Fixed event listener memory leak in toast fallback.
- Standardized fallback logic in test environment.
- Fixed inconsistent memory leak fix in verification test file.
- Removed temporary verification files.
2026-01-23 09:47:28 +00:00