Skip to content

Add OKLab and Oklch image utilities and nodes, refactor color space nodes#8999

Open
JPPhoto wants to merge 3 commits intoinvoke-ai:mainfrom
JPPhoto:oklab-oklch-support
Open

Add OKLab and Oklch image utilities and nodes, refactor color space nodes#8999
JPPhoto wants to merge 3 commits intoinvoke-ai:mainfrom
JPPhoto:oklab-oklch-support

Conversation

@JPPhoto
Copy link
Copy Markdown
Collaborator

@JPPhoto JPPhoto commented Mar 27, 2026

Summary

Added shared OKLab/OKLCH and related color-conversion utilities, a new unsharp_mask_oklab image node, and a new img_hue_adjust_oklch image node. The PR also consolidates color-conversion logic into the shared backend module, exports the public helpers through invokeai.invocation_api for 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 Oklch blend bug in composition-nodes: main was treating Oklch hue inconsistently and wrapping it like a unit-range value in some blend paths. The refactor standardizes Oklch hue to degrees throughout the shared/public conversion path and updates blend wrapping accordingly, so Oklch blend results may differ slightly from main where the old behavior was incorrect.

Related Issues / Discussions

QA Instructions

  • Run pytest tests/backend/image_util/test_color_conversion.py tests/app/invocations/test_image.py -q

Merge Plan

Checklist

  • The PR has a short but descriptive title, suitable for a changelog
  • Tests added / updated (if applicable)
  • ❗Changes to a redux slice have a corresponding migration
  • Documentation added / updated (if applicable)
  • Updated What's New copy (if doing a release after this PR)

@github-actions github-actions bot added python PRs that change python files invocations PRs that change invocations backend PRs that change backend files frontend PRs that change frontend files python-tests PRs that change python tests labels Mar 27, 2026
@JPPhoto JPPhoto changed the title Add OKLab and Oklch image utilities and nodes Add OKLab and Oklch image utilities and nodes, refactor color space nodes. Mar 28, 2026
@JPPhoto JPPhoto changed the title Add OKLab and Oklch image utilities and nodes, refactor color space nodes. Add OKLab and Oklch image utilities and nodes, refactor color space nodes Mar 28, 2026
@JPPhoto
Copy link
Copy Markdown
Collaborator Author

JPPhoto commented Mar 28, 2026

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend PRs that change backend files frontend PRs that change frontend files invocations PRs that change invocations python PRs that change python files python-tests PRs that change python tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant