Add OKLab and Oklch image utilities and nodes, refactor color space nodes#8999
Add OKLab and Oklch image utilities and nodes, refactor color space nodes#8999JPPhoto wants to merge 4 commits intoinvoke-ai:mainfrom
Conversation
|
@dwringer Mind playing with composition nodes here to see if they do what they used to? I made a lot of changes to their internals and fixed what I believe was a bug while I was at it. |
2f83d75 to
e17dbe9
Compare
d2b3e32 to
78f82c4
Compare
3c5171e to
c0a5023
Compare
a2f6373 to
02ca0d5
Compare
0d4da3d to
90766fe
Compare
|
I have two questions on the conversions portion of this:
|
The conversions are tensor-based primarily because that matches the rest of the image-processing path here and keeps the code composable with the existing torch-heavy internals. A lot of the current color-space operations in
I considered pulling in a dependency like that, but I decided against it for this change for a few reasons:
If this grows further or we start needing a much broader standardized color-management feature set, I think revisiting a dedicated dependency would be reasonable. For this PR, though, keeping it local and consistent with the existing torch-based processing seemed like the lower-risk choice. |
e8850b3 to
39fa20e
Compare
39fa20e to
c365536
Compare
Summary
Added shared OKLab/OKLCH and related color-conversion utilities, a new
unsharp_mask_oklabimage node, and a newimg_hue_adjust_oklchimage node. The PR also consolidates color-conversion logic into the shared backend module, exports the public helpers throughinvokeai.invocation_apifor custom nodes, standardizes public hue contracts to degrees for polar/hue-based spaces, and regenerates frontend API types/schema.This PR also fixes an existing
Oklchblend bug incomposition-nodes:mainwas treatingOklchhue inconsistently and wrapping it like a unit-range value in some blend paths. The refactor standardizesOklchhue to degrees throughout the shared/public conversion path and updates blend wrapping accordingly, soOklchblend results may differ slightly frommainwhere the old behavior was incorrect.Related Issues / Discussions
QA Instructions
pytest tests/backend/image_util/test_color_conversion.py tests/app/invocations/test_image.py -qMerge Plan
Checklist
What's Newcopy (if doing a release after this PR)