Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize Hue & Saturation node #2774

Merged
merged 2 commits into from
Apr 9, 2024

Conversation

RunDevelopment
Copy link
Member

@RunDevelopment RunDevelopment commented Apr 9, 2024

Optimizations:

  • Remove normalization on output. This was entirely unnecessary.
  • Optimize with_lightness to reuse arrays.
  • Only do HSL conversion if necessary.
Configuration Before After Note
H=0 S=0 L=0 150ms 0 Pass through is free now
H=0 S=0 L=-35 710ms 90ms
H=0 S=0 L=33 1000ms 140ms Needs to do one more addition compared to L=-35
H=0 S=29 L=0 820ms 510ms
H=0 S=-39 L=0 740ms 480ms Saved a np.clip over S=29
H=-62 S=24 L=-18 1000ms 830ms

Tested on a 8468x4320 RGB image.

Before:
image

After:
image

@joeyballentine joeyballentine merged commit d9fec6d into chaiNNer-org:main Apr 9, 2024
14 checks passed
@RunDevelopment RunDevelopment deleted the opt-h&s branch April 9, 2024 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants