Skip to content

[LTX-2.5] ACEScct colour transforms + HLG/EXR export (fix branch, not to be merged) - #5

Open
christopher5106 wants to merge 1 commit into
mainfrom
fix_ltx2_hdr_acescct_export
Open

christopher5106 wants to merge 1 commit into
mainfrom
fix_ltx2_hdr_acescct_export

Conversation

@christopher5106

Copy link
Copy Markdown

Tracking PR for fix_ltx2_hdr_acescct_export, opened against main (the upstream mirror). It is never merged here. The commit is cherry-picked onto scenario while upstream reviews it.

Upstream PR: huggingface#14966

Adds ACEScct colour transforms (the LTX-2.5 SDR-To-HDR IC-LoRA's colour space) and an "acescct" mode to LTX2VideoHDRProcessor, plus an HLG BT.2020 10-bit HEVC writer and a half-float EXR writer behind an optional OpenEXR dependency. Checked against Lightricks' reference: transforms bit-identical, HLG bitstream byte-identical, EXR pixels identical. Tests: tests/pipelines/ltx2/test_ltx2_hdr_color.py (40).

This is the first of three PRs. The next two add SDR-To-HDR support to LTX2HDRPipeline, then seam keyframes and keyframe-aware decoding.

When upstream merges it: delete this branch, close this PR, sync main, and rebase scenario dropping the cherry-pick.

…-HDR

Port the colour pipeline of the LTX-2.5 SDR-To-HDR IC-LoRA from the Lightricks
LTX-2 reference (ltx_core.hdr, ltx_core.color, ltx_pipelines media_io):

- image_processor: sRGB EOTF, Bradford Rec.709/AP1/Rec.2020 matrices, ACEScct
  encode/decode, the srgb_gamma/srgb/acescg/acescct input transforms and the
  ACEScct -> ACEScg/Rec.709 linear output transform, as pure torch functions.
  LTX2VideoHDRProcessor gains hdr_transform="acescct" with input_colorspace /
  output_colorspace options; the LogC3 default is unchanged.
- export_utils: encode_hdr_tensor_to_hlg_mp4 (BT.2020 HLG 10-bit HEVC via
  PyAV/libx265) and save_exr_frame / export_to_exr_sequence (half-float ZIP
  EXR with chromaticities and colorSpace), behind a new optional
  is_openexr_available() guard.
- tests: exact values computed with colour-science, round trips, HLG stream
  properties and EXR read-back.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant