Skip to content

LTX-Video Support for ComfyUI

Automated PR - 2026-04-23

github-actions[bot]b82708a54f0d
diff --git a/README.md b/README.md
index a9aa499..db96039 100644
--- a/README.md
+++ b/README.md
@@ -53,6 +53,7 @@ LTX-2.3 Workflows:
* [`Text/image to video distilled model; two stages (with upsampling)`](./example_workflows/2.3/LTX-2.3_T2V_I2V_Two_Stage_Distilled.json)
* [`IC-LoRA distilled model depth + human pose + edges`](./example_workflows/2.3/LTX-2.3_ICLoRA_Union_Control_Distilled.json)
* [`IC-LoRA distilled model I2V motion tracking`](./example_workflows/2.3/LTX-2.3_ICLoRA_Motion_Track_Distilled.json)
+* [`IC-LoRA distilled model HDR`](./example_workflows/2.3/LTX-2.3_ICLoRA_HDR_Distilled.json)
Older Workflows (LTX-2.0):
@@ -80,6 +81,16 @@ The union LoRA is trained to understand and respond to both control signals (dep
1. **Parse multiple conditions**: Identify which control signals are present in the input
2. **Process at reduced resolution**: Work on downsampled latents to improve efficiency
+## HDR IC-LoRA
+
+We provide an **HDR IC-LoRA** that generates linear HDR video encoded in ARRI LogC3, enabling workflows that output high-dynamic-range content suitable for grading and EXR export.
+
+### Key Features
+
+- **Linear HDR output**: The LoRA produces frames in LogC3-compressed space; the `LTXVHDRDecodePostprocess` node decodes these back to linear HDR values.
+- **SDR preview + raw HDR**: The node outputs both a Reinhard-tonemapped SDR preview and the raw linear HDR tensor for downstream use.
+- **EXR export**: Optionally writes the linear HDR frames as a 16/32-bit EXR image sequence. To enable EXR writing, set `OPENCV_IO_ENABLE_OPENEXR=1` in the environment before starting ComfyUI. The exported EXR sequence is best viewed in [DJV](https://github.com/grizzlypeak3d/DJV) (or [DJV for macOS](https://djv.en.uptodown.com/mac/download)).
+
## Required Models
Download the following models:
@@ -104,6 +115,7 @@ Download the following models:
**LoRAs** Choose and download to `COMFYUI_ROOT_FOLDER/models/loras` folder.
* [`ltx-2.3-22b-ic-lora-union-control-ref0.5.safetensors`](https://huggingface.co/Lightricks/LTX-2.3-22b-IC-LoRA-Union-Control/blob/main/ltx-2.3-22b-ic-lora-union-control-ref0.5.safetensors)
* [`ltx-2.3-22b-ic-lora-motion-track-control-ref0.5.safetensors`](https://huggingface.co/Lightricks/LTX-2.3-22b-IC-LoRA-Motion-Track-Control/blob/main/ltx-2.3-22b-ic-lora-motion-track-control-ref0.5.safetensors)
+ * [`ltx-2.3-22b-ic-lora-hdr-0.9.safetensors`](https://huggingface.co/Lightricks/LTX-2.3-22b-IC-LoRA-HDR)
* [`ltx-2-19b-ic-lora-detailer.safetensors`](https://huggingface.co/Lightricks/LTX-2-19b-IC-LoRA-Detailer/blob/main/ltx-2-19b-ic-lora-detailer.safetensors)
* [`ltx-2-19b-ic-lora-pose-control.safetensors`](https://huggingface.co/Lightricks/LTX-2-19b-IC-LoRA-Pose-Control/blob/main/ltx-2-19b-ic-lora-pose-control.safetensors)
* [`ltx-2-19b-lora-camera-control-dolly-in.safetensors`](https://huggingface.co/Lightricks/LTX-2-19b-LoRA-Camera-Control-Dolly-In/blob/main/ltx-2-19b-lora-camera-control-dolly-in.safetensors)
diff --git a/__init__.py b/__init__.py
index bdce8c8..575121a 100644
--- a/__init__.py
+++ b/__init__.py
@@ -13,6 +13,7 @@ from .gemma_api_conditioning import GemmaAPITextEncode
from .gemma_encoder import LTXVGemmaCLIPModelLoader, LTXVGemmaEnhancePrompt
from .guide import LTXVAddGuideAdvanced, LTXVAddGuideAdvancedAttention
from .guiders import GuiderParametersNode, MultimodalGuiderNode
+from .hdr import LTXVHDRDecodePostprocess
from .iclora import (
LTXAddVideoICLoRAGuide,
LTXAddVideoICLoRAGuideAdvanced,
@@ -113,6 +114,7 @@ NODE_CLASS_MAPPINGS = {
"LTXVDilateVideoMask": LTXVDilateVideoMask,
"LTXVInpaintPreprocess": LTXVInpaintPreprocess,
"LTXVLaplacianPyramidBlend": LTXVLaplacianPyramidBlend,
+ "LTXVHDRDecodePostprocess": LTXVHDRDecodePostprocess,
}
# Consistent display names between static and dynamic node mappings in nodes_registry.py,
diff --git a/example_workflows/2.3/LTX-2.3_ICLoRA_HDR_Distilled.json b/example_workflows/2.3/LTX-2.3_ICLoRA_HDR_Distilled.json
new file mode 100644
index 0000000..e117a06
--- /dev/null
+++ b/example_workflows/2.3/LTX-2.3_ICLoRA_HDR_Distilled.json
@@ -0,0 +1,3122 @@
+{
+ "id": "394ed254-7306-42a2-9ae6-aa880ce4456d",
+ "revision": 0,
+ "last_node_id": 5125,
+ "last_link_id": 13676,
+ "nodes": [
+ {
+ "id": 1241,
+ "type": "LTXVConditioning",
+ "pos": [
+ -2827.383495127067,
+ 3450.198097882919
+ ],
+ "size": [
+ 210,
+ 78
+ ],
+ "flags": {},
+ "order": 20,
+ "mode": 0,
+ "inputs": [
+ {
+ "localized_name": "positive",
+ "name": "positive",
+ "type": "CONDITIONING",
+ "link": 13675
+ },
+ {
+ "localized_name": "negative",
+ "name": "negative",
+ "type": "CONDITIONING",
+ "link": 13676
+ },
+ {
+ "localized_name": "frame_rate",
+ "name": "frame_rate",
+ "type": "FLOAT",
+ "widget": {
+ "name": "frame_rate"
+ },
+ "link": 13641
+ }
+ ],
+ "outputs": [
+ {
+ "localized_name": "positive",
+ "name": "positive",
+ "type": "CONDITIONING",
+ "slot_index": 0,
+ "links": [
+ 13403
+ ]
+ },
+ {
+ "localized_name": "negative",
+ "name": "negative",
+ "type": "CONDITIONING",
+ "slot_index": 1,
+ "links": [
+ 13404
+ ]
+ }
+ ],
+ "properties": {
+ "cnr_id": "comfy-core",
+ "ver": "0.3.28",
+ "Node name for S&R": "LTXVConditioning"
+ },
+ "widgets_values": [
+ 24
+ ]
+ },
+ {
+ "id": 4828,
+ "type": "CFGGuider",
+ "pos": [
+ -1370.222061201338,
+ 3343.9152948910687
+ ],
+ "size": [
+ 270,
+ 114
+ ],
+ "flags": {},
+ "order": 26,
+ "mode": 0,
+ "inputs": [
+ {
+ "localized_name": "model",
+ "name": "model",
+ "type": "MODEL",
+ "link": 13401
+ },
+ {
+ "localized_name": "positive",
+ "name": "positive",
+ "type": "CONDITIONING",
+ "link": 13409
+ },
+ {
+ "localized_name": "negative",
+ "name": "negative",
+ "type": "CONDITIONING",
+ "link": 13410
+ },
+ {
+ "localized_name": "cfg",
+ "name": "cfg",
+ "type": "FLOAT",
+ "widget": {
+ "name": "cfg"
+ },
+ "link": null
+ }
+ ],
+ "outputs": [
+ {
+ "localized_name": "GUIDER",
+ "name": "GUIDER",
+ "type": "GUIDER",
+ "links": [
+ 13089
+ ]
+ }
+ ],
+ "properties": {
+ "cnr_id": "comfy-core",
+ "ver": "0.14.1",
+ "Node name for S&R": "CFGGuider"
+ },
+ "widgets_values": [
+ 1
+ ]
+ },
+ {
+ "id": 4832,
+ "type": "RandomNoise",
+ "pos": [
+ -1365.114242160968,
+ 3210.9164680280264
+ ],
+ "size": [
+ 279.7478557810682,
+ 82
+ ],
+ "flags": {},
+ "order": 0,
+ "mode": 0,
+ "inputs": [
+ {
+ "localized_name": "noise_seed",
+ "name": "noise_seed",
+ "type": "INT",
+ "widget": {
+ "name": "noise_seed"
+ },
+ "link": null
+ }
+ ],
+ "outputs": [
+ {
+ "localized_name": "NOISE",
+ "name": "NOISE",
+ "type": "NOISE",
+ "links": [
+ 13093
+ ]
+ }
+ ],
+ "properties": {
+ "cnr_id": "comfy-core",
+ "ver": "0.14.1",
+ "Node name for S&R": "RandomNoise"
+ },
+ "widgets_values": [
+ 42,
+ "fixed"
+ ]
+ },
+ {
+ "id": 5022,
+ "type": "PrimitiveString",
+ "pos": [
+ -3541.4905131482387,
+ 3127.0576945882585
+ ],
+ "size": [
+ 270,
+ 58
+ ],
+ "flags": {},
+ "order": 1,
+ "mode": 4,
+ "inputs": [
+ {
+ "localized_name": "value",
+ "name": "value",
+ "type": "STRING",
+ "widget": {
+ "name": "value"
+ },
+ "link": null
+ }
+ ],
+ "outputs": [
+ {
+ "localized_name": "STRING",
+ "name": "STRING",
+ "type": "STRING",
+ "links": [
+ 13457,
+ 13458
+ ]
+ }
+ ],
+ "title": "LTX API KEY",
+ "properties": {
+ "cnr_id": "comfy-core",
+ "ver": "0.14.1",
+ "Node name for S&R": "PrimitiveString"
+ },
+ "widgets_values": [
+ ""
+ ]
+ },
+ {
+ "id": 4831,
+ "type": "KSamplerSelect",
+ "pos": [
+ -1369.100034140749,
+ 3492.4707827927978
+ ],
+ "size": [
+ 270,
+ 74
+ ],
+ "flags": {},
+ "order": 2,
+ "mode": 0,
+ "inputs": [
+ {
+ "localized_name": "sampler_name",
+ "name": "sampler_name",
+ "type": "COMBO",
+ "widget": {
+ "name": "sampler_name"
+ },
+ "link": null
+ }
+ ],
+ "outputs": [
+ {
+ "localized_name": "SAMPLER",
+ "name": "SAMPLER",
+ "type": "SAMPLER",
+ "links": [
+ 13090
+ ]
+ }
+ ],
+ "properties": {
+ "cnr_id": "comfy-core",
+ "ver": "0.14.1",
+ "Node name for S&R": "KSamplerSelect"
+ },
+ "widgets_values": [
+ "euler_ancestral"
+ ]
+ },
+ {
+ "id": 5023,
+ "type": "LTXAVTextEncoderLoader",
+ "pos": [
+ -3535.3106283445645,
+ 3449.468948258329
+ ],
+ "size": [
+ 319.5887320217756,
+ 116.48069935058538
+ ],
+ "flags": {},
+ "order": 3,
+ "mode": 0,
+ "inputs": [
+ {
+ "localized_name": "text_encoder",
+ "name": "text_encoder",
+ "type": "COMBO",
+ "widget": {
+ "name": "text_encoder"
+ },
+ "link": null
+ },
+ {
+ "localized_name": "ckpt_name",
+ "name": "ckpt_name",
+ "type": "COMBO",
+ "widget": {
+ "name": "ckpt_name"
+ },
+ "link": null
+ },
+ {
+ "localized_name": "device",
+ "name": "device",
+ "type": "COMBO",
+ "widget": {
+ "name": "device"
+ },
+ "link": null
+ }
+ ],
+ "outputs": [
+ {
+ "localized_name": "CLIP",
+ "name": "CLIP",
+ "type": "CLIP",
+ "links": [
+ 13459,
+ 13460
+ ]
+ }
+ ],
+ "properties": {
+ "cnr_id": "comfy-core",
+ "ver": "0.14.1",
+ "Node name for S&R": "LTXAVTextEncoderLoader"
+ },
+ "widgets_values": [
+ "comfy_gemma_3_12B_it.safetensors",
+ "ltx-2.3-22b-dev.safetensors",
+ "default"
+ ]
+ },
+ {
+ "id": 5108,
+ "type": "CreateVideo",
+ "pos": [
+ 186.29822390643957,
+ 3140.1786963282343
+ ],
+ "size": [
+ 210,
+ 78
+ ],
+ "flags": {},
+ "order": 31,
+ "mode": 0,
+ "inputs": [
+ {
+ "localized_name": "images",
+ "name": "images",
+ "type": "IMAGE",
+ "link": 13667
+ },
+ {
+ "localized_name": "audio",
+ "name": "audio",
+ "shape": 7,
+ "type": "AUDIO",
+ "link": 13662
+ },
+ {
+ "localized_name": "fps",
+ "name": "fps",
+ "type": "FLOAT",
+ "widget": {
+ "name": "fps"
+ },
+ "link": null
+ }
+ ],
+ "outputs": [
+ {
+ "localized_name": "VIDEO",
+ "name": "VIDEO",
+ "type": "VIDEO",
+ "links": [
+ 13635
+ ]
+ }
+ ],
+ "properties": {
+ "cnr_id": "comfy-core",
+ "ver": "0.14.1",
+ "Node name for S&R": "CreateVideo"
+ },
+ "widgets_values": [
+ 30
+ ]
+ },
+ {
+ "id": 4829,
+ "type": "SamplerCustomAdvanced",
+ "pos": [
+ -1029.630679591605,
+ 3250.9871207978435
+ ],
+ "size": [
+ 212.3638671875,
+ 106
+ ],
+ "flags": {},
+ "order": 27,
+ "mode": 0,
+ "inputs": [
+ {
+ "localized_name": "noise",
+ "name": "noise",
+ "type": "NOISE",
+ "link": 13093
+ },
+ {
+ "localized_name": "guider",
+ "name": "guider",
+ "type": "GUIDER",
+ "link": 13089
+ },
+ {
+ "localized_name": "sampler",
+ "name": "sampler",
+ "type": "SAMPLER",
+ "link": 13090
+ },
+ {
+ "localized_name": "sigmas",
+ "name": "sigmas",
+ "type": "SIGMAS",
+ "link": 13463
+ },
+ {
+ "localized_name": "latent_image",
+ "name": "latent_image",
+ "type": "LATENT",
+ "link": 13647
+ }
+ ],
+ "outputs": [
+ {
+ "localized_name": "output",
+ "name": "output",
+ "type": "LATENT",
+ "links": [
+ 13648
+ ]
+ },
+ {
+ "localized_name": "denoised_output",
+ "name": "denoised_output",
+ "type": "LATENT",
+ "links": []
+ }
+ ],
+ "properties": {
+ "cnr_id": "comfy-core",
+ "ver": "0.14.1",
+ "Node name for S&R": "SamplerCustomAdvanced"
+ },
+ "widgets_values": []
+ },
+ {
+ "id": 5025,
+ "type": "ManualSigmas",
+ "pos": [
+ -1359.0320040284487,
+ 3616.827012939743
+ ],
+ "size": [
+ 499.94633283206986,
+ 67.3573576655076
+ ],
+ "flags": {},
+ "order": 4,
+ "mode": 0,
+ "inputs": [
+ {
+ "localized_name": "sigmas",
+ "name": "sigmas",
+ "type": "STRING",
+ "widget": {
+ "name": "sigmas"
+ },
+ "link": null
+ }
+ ],
+ "outputs": [
+ {
+ "localized_name": "SIGMAS",
+ "name": "SIGMAS",
+ "type": "SIGMAS",
+ "links": [
+ 13463
+ ]
+ }
+ ],
+ "properties": {
+ "cnr_id": "comfy-core",
+ "ver": "0.14.1",
+ "Node name for S&R": "ManualSigmas"
+ },
+ "widgets_values": [
+ "1.0, 0.99375, 0.9875, 0.98125, 0.975, 0.909375, 0.725, 0.421875, 0.0"
+ ]
+ },
+ {
+ "id": 5013,
+ "type": "LTXVCropGuides",
+ "pos": [
+ -765.2977035942622,
+ 3251.8018857310913
+ ],
+ "size": [
+ 187.5,
+ 100.83333333333334
+ ],
+ "flags": {},
+ "order": 28,
+ "mode": 0,
+ "inputs": [
+ {
+ "localized_name": "positive",
+ "name": "positive",
+ "type": "CONDITIONING",
+ "link": 13413
+ },
+ {
+ "localized_name": "negative",
+ "name": "negative",
+ "type": "CONDITIONING",
+ "link": 13414
+ },
+ {
+ "localized_name": "latent",
+ "name": "latent",
+ "type": "LATENT",
+ "link": 13648
+ }
+ ],
+ "outputs": [
+ {
+ "localized_name": "positive",
+ "name": "positive",
+ "type": "CONDITIONING",
+ "links": []
+ },
+ {
+ "localized_name": "negative",
+ "name": "negative",
+ "type": "CONDITIONING",
+ "links": []
+ },
+ {
+ "localized_name": "latent",
+ "name": "latent",
+ "type": "LATENT",
+ "links": [
+ 13618
+ ]
+ }
+ ],
+ "properties": {
+ "cnr_id": "comfy-core",
+ "ver": "0.3.75",
+ "Node name for S&R": "LTXVCropGuides"
+ },
+ "widgets_values": []
+ },
+ {
+ "id": 5109,
+ "type": "SaveVideo",
+ "pos": [
+ 198.51994048774512,
+ 3292.0921332279972
+ ],
+ "size": [
+ 627.0556530433919,
+ 500.11191809627644
+ ],
+ "flags": {},
+ "order": 32,
+ "mode": 0,
+ "inputs": [
+ {
+ "localized_name": "video",
+ "name": "video",
+ "type": "VIDEO",
+ "link": 13635
+ },
+ {
+ "localized_name": "filename_prefix",
+ "name": "filename_prefix",
+ "type": "STRING",
+ "widget": {
+ "name": "filename_prefix"
+ },
+ "link": null
+ },
+ {
+ "localized_name": "format",
+ "name": "format",
+ "type": "COMBO",
+ "widget": {
+ "name": "format"
+ },
+ "link": null
+ },
+ {
+ "localized_name": "codec",
+ "name": "codec",
+ "type": "COMBO",
+ "widget": {
+ "name": "codec"
+ },
+ "link": null
+ }
+ ],
+ "outputs": [],
+ "properties": {
+ "cnr_id": "comfy-core",
+ "ver": "0.14.1"
+ },
+ "widgets_values": [
+ "output",
+ "auto",
+ "auto"
+ ]
+ },
+ {
+ "id": 5111,
+ "type": "SimpleMath+",
+ "pos": [
+ -4156.579685227859,
+ 3965.09725239661
+ ],
+ "size": [
+ 210,
+ 98
+ ],
+ "flags": {},
+ "order": 21,
+ "mode": 0,
+ "inputs": [
+ {
+ "localized_name": "a",
+ "name": "a",
+ "shape": 7,
+ "type": "*",
+ "link": 13655
+ },
+ {
+ "localized_name": "b",
+ "name": "b",
+ "shape": 7,
+ "type": "*",
+ "link": null
+ },
+ {
+ "localized_name": "c",
+ "name": "c",
+ "shape": 7,
+ "type": "*",
+ "link": null
+ },
+ {
+ "localized_name": "value",
+ "name": "value",
+ "type": "STRING",
+ "widget": {
+ "name": "value"
+ },
+ "link": null
+ }
+ ],
+ "outputs": [
+ {
+ "localized_name": "INT",
+ "name": "INT",
+ "type": "INT",
+ "links": [
+ 13651
+ ]
+ },
+ {
+ "localized_name": "FLOAT",
+ "name": "FLOAT",
+ "type": "FLOAT",
+ "links": null
+ }
+ ],
+ "properties": {
+ "Node name for S&R": "SimpleMath+"
+ },
+ "widgets_values": [
+ "a*32"
+ ]
+ },
+ {
+ "id": 5029,
+ "type": "GetImageSize",
+ "pos": [
+ -3850.005775839848,
+ 4126.576568201332
+ ],
+ "size": [
+ 170.08770191538997,
+ 84.68418817693055
+ ],
+ "flags": {},
+ "order": 23,
+ "mode": 0,
+ "inputs": [
+ {
+ "localized_name": "image",
+ "name": "image",
+ "type": "IMAGE",
+ "link": 13653
+ }
+ ],
+ "outputs": [
+ {
+ "localized_name": "width",
+ "name": "width",
+ "type": "INT",
+ "links": [
+ 13658
+ ]
+ },
+ {
+ "localized_name": "height",
+ "name": "height",
+ "type": "INT",
+ "links": [
+ 13659
+ ]
+ },
+ {
+ "localized_name": "batch_size",
+ "name": "batch_size",
+ "type": "INT",
+ "links": [
+ 13660
+ ]
+ }
+ ],
+ "properties": {
+ "cnr_id": "comfy-core",
+ "ver": "0.16.0",
+ "Node name for S&R": "GetImageSize"
+ },
+ "widgets_values": []
+ },
+ {
+ "id": 5112,
+ "type": "ResizeImageMaskNode",
+ "pos": [
+ -4154.5626242519575,
+ 4116.035500558938
+ ],
+ "size": [
+ 270,
+ 106
+ ],
+ "flags": {},
+ "order": 22,
+ "mode": 0,
+ "inputs": [
+ {
+ "localized_name": "input",
+ "name": "input",
+ "type": "IMAGE,MASK",
+ "link": 13654
+ },
+ {
+ "localized_name": "resize_type",
+ "name": "resize_type",
+ "type": "COMFY_DYNAMICCOMBO_V3",
+ "widget": {
+ "name": "resize_type"
+ },
+ "link": null
+ },
+ {
+ "localized_name": "resize_type.multiple",
+ "name": "resize_type.multiple",
+ "type": "INT",
+ "widget": {
+ "name": "resize_type.multiple"
+ },
+ "link": 13651
+ },
+ {
+ "localized_name": "scale_method",
+ "name": "scale_method",
+ "type": "COMBO",
+ "widget": {
+ "name": "scale_method"
+ },
+ "link": null
+ }
+ ],
+ "outputs": [
+ {
+ "localized_name": "resized",
+ "name": "resized",
+ "type": "IMAGE",
+ "links": [
+ 13653,
+ 13661
+ ]
+ }
+ ],
+ "properties": {
+ "cnr_id": "comfy-core",
+ "ver": "0.16.0",
+ "Node name for S&R": "ResizeImageMaskNode"
+ },
+ "widgets_values": [
+ "scale to multiple",
+ 32,
+ "lanczos"
+ ]
+ },
+ {
+ "id": 5105,
+ "type": "GetVideoComponents",
+ "pos": [
+ -4418.795655523437,
+ 3953.3983979426775
+ ],
+ "size": [
+ 193.530859375,
+ 66
+ ],
+ "flags": {},
+ "order": 18,
+ "mode": 0,
+ "inputs": [
+ {
+ "localized_name": "video",
+ "name": "video",
+ "type": "VIDEO",
+ "link": 13669
+ }
+ ],
+ "outputs": [
+ {
+ "localized_name": "images",
+ "name": "images",
+ "type": "IMAGE",
+ "links": [
+ 13654
+ ]
+ },
+ {
+ "localized_name": "audio",
+ "name": "audio",
+ "type": "AUDIO",
+ "links": [
+ 13662
+ ]
+ },
+ {
+ "localized_name": "fps",
+ "name": "fps",
+ "type": "FLOAT",
+ "links": [
+ 13641
+ ]
+ }
+ ],
+ "properties": {
+ "cnr_id": "comfy-core",
+ "ver": "0.3.75",
+ "Node name for S&R": "GetVideoComponents"
+ },
+ "widgets_values": []
+ },
+ {
+ "id": 3059,
+ "type": "EmptyLTXVLatentVideo",
+ "pos": [
+ -2399.297235778659,
+ 3472.056477015808
+ ],
+ "size": [
+ 210,
+ 194
+ ],
+ "flags": {},
+ "order": 24,
+ "mode": 0,
+ "inputs": [
+ {
+ "localized_name": "width",
+ "name": "width",
+ "type": "INT",
+ "widget": {
+ "name": "width"
+ },
+ "link": 13658
+ },
+ {
+ "localized_name": "height",
+ "name": "height",
+ "type": "INT",
+ "widget": {
+ "name": "height"
+ },
+ "link": 13659
+ },
+ {
+ "localized_name": "length",
+ "name": "length",
+ "type": "INT",
+ "widget": {
+ "name": "length"
+ },
+ "link": 13660
+ },
+ {
+ "localized_name": "batch_size",
+ "name": "batch_size",
+ "type": "INT",
+ "widget": {
+ "name": "batch_size"
+ },
+ "link": null
+ }
+ ],
+ "outputs": [
+ {
+ "localized_name": "LATENT",
+ "name": "LATENT",
+ "type": "LATENT",
+ "links": [
+ 13663
+ ]
+ }
+ ],
+ "properties": {
+ "cnr_id": "comfy-core",
+ "ver": "0.3.43",
+ "Node name for S&R": "EmptyLTXVLatentVideo"
+ },
+ "widgets_values": [
+ 960,
+ 544,
+ 121,
+ 1
+ ]
+ },
+ {
+ "id": 5012,
+ "type": "LTXAddVideoICLoRAGuide",
+ "pos": [
+ -1817.1078409311435,
+ 3274.4635330570623
+ ],
+ "size": [
+ 316.886328125,
+ 282
+ ],
+ "flags": {},
+ "order": 25,
+ "mode": 0,
+ "inputs": [
+ {
+ "localized_name": "positive",
+ "name": "positive",
+ "type": "CONDITIONING",
+ "link": 13403
+ },
+ {
+ "localized_name": "negative",
+ "name": "negative",
+ "type": "CONDITIONING",
+ "link": 13404
+ },
+ {
+ "localized_name": "vae",
+ "name": "vae",
+ "type": "VAE",
+ "link": 13405
+ },
+ {
+ "localized_name": "latent",
+ "name": "latent",
+ "type": "LATENT",
+ "link": 13663
+ },
+ {
+ "localized_name": "image",
+ "name": "image",
+ "type": "IMAGE",
+ "link": 13661
+ },
+ {
+ "localized_name": "frame_idx",
+ "name": "frame_idx",
+ "type": "INT",
+ "widget": {
+ "name": "frame_idx"
+ },
+ "link": null
+ },
+ {
+ "localized_name": "strength",
+ "name": "strength",
+ "type": "FLOAT",
+ "widget": {
+ "name": "strength"
+ },
+ "link": null
+ },
+ {
+ "localized_name": "latent_downscale_factor",
+ "name": "latent_downscale_factor",
+ "type": "FLOAT",
+ "widget": {
+ "name": "latent_downscale_factor"
+ },
+ "link": null
+ },
+ {
+ "localized_name": "crop",
+ "name": "crop",
+ "type": "COMBO",
+ "widget": {
+ "name": "crop"
+ },
+ "link": null
+ },
+ {
+ "localized_name": "use_tiled_encode",
+ "name": "use_tiled_encode",
+ "type": "BOOLEAN",
+ "widget": {
+ "name": "use_tiled_encode"
+ },
+ "link": null
+ },
+ {
+ "localized_name": "tile_size",
+ "name": "tile_size",
+ "type": "INT",
+ "widget": {
+ "name": "tile_size"
+ },
+ "link": null
+ },
+ {
+ "localized_name": "tile_overlap",
+ "name": "tile_overlap",
+ "type": "INT",
+ "widget": {
+ "name": "tile_overlap"
+ },
+ "link": null
+ }
+ ],
+ "outputs": [
+ {
+ "localized_name": "positive",
+ "name": "positive",
+ "type": "CONDITIONING",
+ "links": [
+ 13409,
+ 13413
+ ]
+ },
+ {
+ "localized_name": "negative",
+ "name": "negative",
+ "type": "CONDITIONING",
+ "links": [
+ 13410,
+ 13414
+ ]
+ },
+ {
+ "localized_name": "latent",
+ "name": "latent",
+ "type": "LATENT",
+ "links": [
+ 13647
+ ]
+ }
+ ],
+ "properties": {
+ "Node name for S&R": "LTXAddVideoICLoRAGuide",
+ "cnr_id": "ComfyUI-LTXVideo",
+ "ver": "82bd963cdeb66d023bed8c99324a307020907ef8"
+ },
+ "widgets_values": [
+ 0,
+ 1,
+ 1,
+ "disabled",
+ false,
+ 256,
+ 64
+ ]
+ },
+ {
+ "id": 5117,
+ "type": "Note",
+ "pos": [
+ -128.9522638235353,
+ 2961.1212206931395
+ ],
+ "size": [
+ 210,
+ 88
+ ],
+ "flags": {},
+ "order": 5,
+ "mode": 0,
+ "inputs": [],
+ "outputs": [],
+ "properties": {},
+ "widgets_values": [
+ "Set OPENCV_IO_ENABLE_OPENEXR=1 in your shell before launching ComfyUI, otherwise save_exr will fail"
+ ],
+ "color": "#432",
+ "bgcolor": "#653"
+ },
+ {
+ "id": 5118,
+ "type": "Note",
+ "pos": [
+ 493.2978290212085,
+ 3170.8005369326115
+ ],
+ "size": [
+ 210,
+ 88
+ ],
+ "flags": {},
+ "order": 6,
+ "mode": 0,
+ "inputs": [],
+ "outputs": [],
+ "properties": {},
+ "widgets_values": [
+ "EXR output is best viewed in DJV — standard image viewers won't display linear HDR correctly."
+ ],
+ "color": "#432",
+ "bgcolor": "#653"
+ },
+ {
+ "id": 5119,
+ "type": "Note",
+ "pos": [
+ -4431.933188657127,
+ 3275.5592871256463
+ ],
+ "size": [
+ 210,
+ 88
+ ],
+ "flags": {},
+ "order": 7,
+ "mode": 0,
+ "inputs": [],
+ "outputs": [],
+ "properties": {},
+ "widgets_values": [
+ "equires ltx-2.3-22b-ic-lora-hdr-0.9.safetensors from Lightricks/LTX-2.3-22b-IC-LoRA-HDR. Place in models/loras/"
+ ],
+ "color": "#432",
+ "bgcolor": "#653"
+ },
+ {
+ "id": 5113,
+ "type": "Note",
+ "pos": [
+ -4733.252355567354,
+ 4257.835858092407
+ ],
+ "size": [
+ 299.4074520989052,
+ 203.246379625386
+ ],
+ "flags": {},
+ "order": 8,
+ "mode": 0,
+ "inputs": [],
+ "outputs": [],
+ "properties": {},
+ "widgets_values": [
+ "The flow will generate the closest 8XF-1 in the input video length\n\nExpected runinng times on H1 machine\n\nFull HD 1080*1920\n 161 frames 100 secs\n 241 frames 152 secs\n \n\n                   "
+ ],
+ "color": "#432",
+ "bgcolor": "#653"
+ },
+ {
+ "id": 5011,
+ "type": "LTXICLoRALoaderModelOnly",
+ "pos": [
+ -4164.21110027745,
+ 3243.0693856008756
+ ],
+ "size": [
+ 499.901763247988,
+ 130.8845841562129
+ ],
+ "flags": {},
+ "order": 19,
+ "mode": 0,
+ "inputs": [
+ {
+ "localized_name": "model",
+ "name": "model",
+ "type": "MODEL",
+ "link": 13672
+ },
+ {
+ "localized_name": "lora_name",
+ "name": "lora_name",
+ "type": "COMBO",
+ "widget": {
+ "name": "lora_name"
+ },
+ "link": null
+ },
+ {
+ "localized_name": "strength_model",
+ "name": "strength_model",
+ "type": "FLOAT",
+ "widget": {
+ "name": "strength_model"
+ },
+ "link": null
+ }
+ ],
+ "outputs": [
+ {
+ "localized_name": "model",
+ "name": "model",
+ "type": "MODEL",
+ "links": [
+ 13401
+ ]
+ },
+ {
+ "localized_name": "latent_downscale_factor",
+ "name": "latent_downscale_factor",
+ "type": "FLOAT",
+ "links": [
+ 13655
+ ]
+ }
+ ],
+ "properties": {
+ "Node name for S&R": "LTXICLoRALoaderModelOnly",
+ "cnr_id": "ComfyUI-LTXVideo",
+ "ver": "82bd963cdeb66d023bed8c99324a307020907ef8"
+ },
+ "widgets_values": [
+ "ltxv/ltx2/ltx-2.3-22b-ic-lora-hdr-0.9.safetensors",
+ 1
+ ]
+ },
+ {
+ "id": 5125,
+ "type": "LTXICLoRALoaderModelOnly",
+ "pos": [
+ -4156.737856255384,
+ 3066.1900360630175
+ ],
+ "size": [
+ 499.901763247988,
+ 130.8845841562129
+ ],
+ "flags": {},
+ "order": 17,
+ "mode": 0,
+ "inputs": [
+ {
+ "localized_name": "model",
+ "name": "model",
+ "type": "MODEL",
+ "link": 13671
+ },
+ {
+ "localized_name": "lora_name",
+ "name": "lora_name",
+ "type": "COMBO",
+ "widget": {
+ "name": "lora_name"
+ },
+ "link": null
+ },
+ {
+ "localized_name": "strength_model",
+ "name": "strength_model",
+ "type": "FLOAT",
+ "widget": {
+ "name": "strength_model"
+ },
+ "link": null
+ }
+ ],
+ "outputs": [
+ {
+ "localized_name": "model",
+ "name": "model",
+ "type": "MODEL",
+ "links": [
+ 13672
+ ]
+ },
+ {
+ "localized_name": "latent_downscale_factor",
+ "name": "latent_downscale_factor",
+ "type": "FLOAT",
+ "links": []
+ }
+ ],
+ "properties": {
+ "Node name for S&R": "LTXICLoRALoaderModelOnly",
+ "cnr_id": "ComfyUI-LTXVideo",
+ "ver": "82bd963cdeb66d023bed8c99324a307020907ef8"
+ },
+ "widgets_values": [
+ "ltxv/ltx2/ltx-2.3-22b-distilled-lora-384-1.1.safetensors",
+ 0.5
+ ]
+ },
+ {
+ "id": 3940,
+ "type": "CheckpointLoaderSimple",
+ "pos": [
+ -4583.85080572201,
+ 3073.132850297725
+ ],
+ "size": [
+ 383.4002295473938,
+ 108.51948797992713
+ ],
+ "flags": {},
+ "order": 9,
+ "mode": 0,
+ "inputs": [
+ {
+ "localized_name": "ckpt_name",
+ "name": "ckpt_name",
+ "type": "COMBO",
+ "widget": {
+ "name": "ckpt_name"
+ },
+ "link": null
+ }
+ ],
+ "outputs": [
+ {
+ "localized_name": "MODEL",
+ "name": "MODEL",
+ "type": "MODEL",
+ "links": [
+ 13671
+ ]
+ },
+ {
+ "localized_name": "CLIP",
+ "name": "CLIP",
+ "type": "CLIP",
+ "links": []
+ },
+ {
+ "localized_name": "VAE",
+ "name": "VAE",
+ "type": "VAE",
+ "links": [
+ 13405,
+ 13619
+ ]
+ }
+ ],
+ "properties": {
+ "cnr_id": "comfy-core",
+ "ver": "0.3.56",
+ "Node name for S&R": "CheckpointLoaderSimple"
+ },
+ "widgets_values": [
+ "ltx-2.3-22b-dev.safetensors"
+ ]
+ },
+ {
+ "id": 5114,
+ "type": "LTXVHDRDecodePostprocess",
+ "pos": [
+ -207.03749020730552,
+ 3122.6640852823707
+ ],
+ "size": [
+ 351.612890625,
+ 174
+ ],
+ "flags": {},
+ "order": 30,
+ "mode": 0,
+ "inputs": [
+ {
+ "localized_name": "image",
+ "name": "image",
+ "type": "IMAGE",
+ "link": 13664
+ },
+ {
+ "localized_name": "exposure",
+ "name": "exposure",
+ "shape": 7,
+ "type": "FLOAT",
+ "widget": {
+ "name": "exposure"
+ },
+ "link": null
+ },
+ {
+ "localized_name": "save_exr",
+ "name": "save_exr",
+ "shape": 7,
+ "type": "BOOLEAN",
+ "widget": {
+ "name": "save_exr"
+ },
+ "link": null
+ },
+ {
+ "localized_name": "output_dir",
+ "name": "output_dir",
+ "shape": 7,
+ "type": "STRING",
+ "widget": {
+ "name": "output_dir"
+ },
+ "link": null
+ },
+ {
+ "localized_name": "filename_prefix",
+ "name": "filename_prefix",
+ "shape": 7,
+ "type": "STRING",
+ "widget": {
+ "name": "filename_prefix"
+ },
+ "link": null
+ },
+ {
+ "localized_name": "half_precision",
+ "name": "half_precision",
+ "shape": 7,
+ "type": "BOOLEAN",
+ "widget": {
+ "name": "half_precision"
+ },
+ "link": null
+ }
+ ],
+ "outputs": [
+ {
+ "localized_name": "tonemapped",
+ "name": "tonemapped",
+ "type": "IMAGE",
+ "links": []
+ },
+ {
+ "localized_name": "hdr_linear",
+ "name": "hdr_linear",
+ "type": "IMAGE",
+ "links": [
+ 13667
+ ]
+ }
+ ],
+ "properties": {
+ "Node name for S&R": "LTXVHDRDecodePostprocess"
+ },
+ "widgets_values": [
+ 7.1,
+ true,
+ "output/hdr_exr3",
+ "frame",
+ true
+ ]
+ },
+ {
+ "id": 5121,
+ "type": "Note",
+ "pos": [
+ -504.4601702780707,
+ 2965.4285923622097
+ ],
+ "size": [
+ 210,
+ 88
+ ],
+ "flags": {},
+ "order": 10,
+ "mode": 0,
+ "inputs": [],
+ "outputs": [],
+ "properties": {},
+ "widgets_values": [
+ "in case of OOM use tile_size of 768\ntemporal size 16"
+ ],
+ "color": "#432",
+ "bgcolor": "#653"
+ },
+ {
+ "id": 4851,
+ "type": "VAEDecodeTiled",
+ "pos": [
+ -518.1273243034602,
+ 3125.1032336912526
+ ],
+ "size": [
+ 270,
+ 150
+ ],
+ "flags": {},
+ "order": 29,
+ "mode": 0,
+ "inputs": [
+ {
+ "localized_name": "samples",
+ "name": "samples",
+ "type": "LATENT",
+ "link": 13618
+ },
+ {
+ "localized_name": "vae",
+ "name": "vae",
+ "type": "VAE",
+ "link": 13619
+ },
+ {
+ "localized_name": "tile_size",
+ "name": "tile_size",
+ "type": "INT",
+ "widget": {
+ "name": "tile_size"
+ },
+ "link": null
+ },
+ {
+ "localized_name": "overlap",
+ "name": "overlap",
+ "type": "INT",
+ "widget": {
+ "name": "overlap"
+ },
+ "link": null
+ },
+ {
+ "localized_name": "temporal_size",
+ "name": "temporal_size",
+ "type": "INT",
+ "widget": {
+ "name": "temporal_size"
+ },
+ "link": null
+ },
+ {
+ "localized_name": "temporal_overlap",
+ "name": "temporal_overlap",
+ "type": "INT",
+ "widget": {
+ "name": "temporal_overlap"
+ },
+ "link": null
+ }
+ ],
+ "outputs": [
+ {
+ "localized_name": "IMAGE",
+ "name": "IMAGE",
+ "type": "IMAGE",
+ "links": [
+ 13664
+ ]
+ }
+ ],
+ "properties": {
+ "cnr_id": "comfy-core",
+ "ver": "0.14.1",
+ "Node name for S&R": "VAEDecodeTiled"
+ },
+ "widgets_values": [
+ 768,
+ 256,
+ 8,
+ 4
+ ]
+ },
+ {
+ "id": 5120,
+ "type": "Note",
+ "pos": [
+ -115.76719331864305,
+ 3351.7232425611232
+ ],
+ "size": [
+ 210,
+ 88
+ ],
+ "flags": {},
+ "order": 11,
+ "mode": 0,
+ "inputs": [],
+ "outputs": [],
+ "properties": {},
+ "widgets_values": [
+ "Exposure adjusts the SDR preview only (in stops, ±10 EV). Does not affect hdr_linear or the saved EXR."
+ ],
+ "color": "#432",
+ "bgcolor": "#653"
+ },
+ {
+ "id": 5020,
+ "type": "GemmaAPITextEncode",
+ "pos": [
+ -3000.5035963672367,
+ 3219.1125878543608
+ ],
+ "size": [
+ 337.49481491927054,
+ 160
+ ],
+ "flags": {},
+ "order": 13,
+ "mode": 4,
+ "inputs": [
+ {
+ "localized_name": "api_key",
+ "name": "api_key",
+ "type": "STRING",
+ "widget": {
+ "name": "api_key"
+ },
+ "link": 13457
+ },
+ {
+ "localized_name": "prompt",
+ "name": "prompt",
+ "type": "STRING",
+ "widget": {
+ "name": "prompt"
+ },
+ "link": null
+ },
+ {
+ "localized_name": "enhance_prompt",
+ "name": "enhance_prompt",
+ "type": "BOOLEAN",
+ "widget": {
+ "name": "enhance_prompt"
+ },
+ "link": null
+ },
+ {
+ "localized_name": "ckpt_name",
+ "name": "ckpt_name",
+ "type": "COMBO",
+ "widget": {
+ "name": "ckpt_name"
+ },
+ "link": null
+ }
+ ],
+ "outputs": [
+ {
+ "localized_name": "conditioning",
+ "name": "conditioning",
+ "type": "CONDITIONING",
+ "links": []
+ }
+ ],
+ "title": "🅛🅣🅧 Gemma API Text Encode - NEGATIVE",
+ "properties": {
+ "Node name for S&R": "GemmaAPITextEncode",
+ "cnr_id": "ComfyUI-LTXVideo",
+ "ver": "82bd963cdeb66d023bed8c99324a307020907ef8"
+ },
+ "widgets_values": [
+ "",
+ "pc game, console game, video game, cartoon, childish, ugly",
+ false,
+ "ltx-2.3-22b-dev.safetensors"
+ ]
+ },
+ {
+ "id": 5021,
+ "type": "GemmaAPITextEncode",
+ "pos": [
+ -3381.3465925104033,
+ 3225.131280627194
+ ],
+ "size": [
+ 347.3886205089311,
+ 160
+ ],
+ "flags": {},
+ "order": 14,
+ "mode": 4,
+ "inputs": [
+ {
+ "localized_name": "api_key",
+ "name": "api_key",
+ "type": "STRING",
+ "widget": {
+ "name": "api_key"
+ },
+ "link": 13458
+ },
+ {
+ "localized_name": "prompt",
+ "name": "prompt",
+ "type": "STRING",
+ "widget": {
+ "name": "prompt"
+ },
+ "link": null
+ },
+ {
+ "localized_name": "enhance_prompt",
+ "name": "enhance_prompt",
+ "type": "BOOLEAN",
+ "widget": {
+ "name": "enhance_prompt"
+ },
+ "link": null
+ },
+ {
+ "localized_name": "ckpt_name",
+ "name": "ckpt_name",
+ "type": "COMBO",
+ "widget": {
+ "name": "ckpt_name"
+ },
+ "link": null
+ }
+ ],
+ "outputs": [
+ {
+ "localized_name": "conditioning",
+ "name": "conditioning",
+ "type": "CONDITIONING",
+ "links": []
+ }
+ ],
+ "title": "🅛🅣🅧 Gemma API Text Encode - POSITIVE",
+ "properties": {
+ "Node name for S&R": "GemmaAPITextEncode",
+ "cnr_id": "ComfyUI-LTXVideo",
+ "ver": "82bd963cdeb66d023bed8c99324a307020907ef8"
+ },
+ "widgets_values": [
+ "",
+ "",
+ "ltx-2.3-22b-dev.safetensors",
+ "ltx-2.3-22b-dev.safetensors"
+ ]
+ },
+ {
+ "id": 2483,
+ "type": "CLIPTextEncode",
+ "pos": [
+ -3177.88687035676,
+ 3450.2955325886337
+ ],
+ "size": [
+ 307.2346496582031,
+ 204.2556610107422
+ ],
+ "flags": {},
+ "order": 15,
+ "mode": 0,
+ "inputs": [
+ {
+ "localized_name": "clip",
+ "name": "clip",
+ "type": "CLIP",
+ "link": 13459
+ },
+ {
+ "localized_name": "text",
+ "name": "text",
+ "type": "STRING",
+ "widget": {
+ "name": "text"
+ },
+ "link": null
+ }
+ ],
+ "outputs": [
+ {
+ "localized_name": "CONDITIONING",
+ "name": "CONDITIONING",
+ "type": "CONDITIONING",
+ "slot_index": 0,
+ "links": [
+ 13675
+ ]
+ }
+ ],
+ "title": "CLIP Text Encode (Positive Prompt)",
+ "properties": {
+ "cnr_id": "comfy-core",
+ "ver": "0.3.28",
+ "Node name for S&R": "CLIPTextEncode"
+ },
+ "widgets_values": [
+ "HDR footage"
+ ],
+ "color": "#232",
+ "bgcolor": "#353"
+ },
+ {
+ "id": 2612,
+ "type": "CLIPTextEncode",
+ "pos": [
+ -3182.789983056651,
+ 3707.344179774041
+ ],
+ "size": [
+ 309.5560766015442,
+ 120.13641397900165
+ ],
+ "flags": {},
+ "order": 16,
+ "mode": 0,
+ "inputs": [
+ {
+ "localized_name": "clip",
+ "name": "clip",
+ "type": "CLIP",
+ "link": 13460
+ },
+ {
+ "localized_name": "text",
+ "name": "text",
+ "type": "STRING",
+ "widget": {
+ "name": "text"
+ },
+ "link": null
+ }
+ ],
+ "outputs": [
+ {
+ "localized_name": "CONDITIONING",
+ "name": "CONDITIONING",
+ "type": "CONDITIONING",
+ "slot_index": 0,
+ "links": [
+ 13676
+ ]
+ }
+ ],
+ "title": "CLIP Text Encode (Negative Prompt)",
+ "properties": {
+ "cnr_id": "comfy-core",
+ "ver": "0.3.28",
+ "Node name for S&R": "CLIPTextEncode"
+ },
+ "widgets_values": [
+ "pc game, console game, video game, ugly, still, static, slow"
+ ],
+ "color": "#322",
+ "bgcolor": "#533"
+ },
+ {
+ "id": 5106,
+ "type": "LoadVideo",
+ "pos": [
+ -4748.7126219808315,
+ 3954.3999202444206
+ ],
+ "size": [
+ 282.798828125,
+ 242.76704259072628
+ ],
+ "flags": {},
+ "order": 12,
+ "mode": 0,
+ "inputs": [
+ {
+ "localized_name": "file",
+ "name": "file",
+ "type": "COMBO",
+ "widget": {
+ "name": "file"
+ },
+ "link": null
+ },
+ {
+ "localized_name": "choose file to upload",
+ "name": "upload",
+ "type": "IMAGEUPLOAD",
+ "widget": {
+ "name": "upload"
+ },
+ "link": null
+ }
+ ],
+ "outputs": [
+ {
+ "localized_name": "VIDEO",
+ "name": "VIDEO",
+ "type": "VIDEO",
+ "links": [
+ 13669
+ ]
+ }
+ ],
+ "properties": {
+ "cnr_id": "comfy-core",
+ "ver": "0.10.0",
+ "Node name for S&R": "LoadVideo"
+ },
+ "widgets_values": [
+ "hdr_input_video (1).mp4",
+ "image"
+ ]
+ }
+ ],
+ "links": [
+ [
+ 13089,
+ 4828,
+ 0,
+ 4829,
+ 1,
+ "GUIDER"
+ ],
+ [
+ 13090,
+ 4831,
+ 0,
+ 4829,
+ 2,
+ "SAMPLER"
+ ],
+ [
+ 13093,
+ 4832,
+ 0,
+ 4829,
+ 0,
+ "NOISE"
+ ],
+ [
+ 13401,
+ 5011,
+ 0,
+ 4828,
+ 0,
+ "MODEL"
+ ],
+ [
+ 13403,
+ 1241,
+ 0,
+ 5012,
+ 0,
+ "CONDITIONING"
+ ],
+ [
+ 13404,
+ 1241,
+ 1,
+ 5012,
+ 1,
+ "CONDITIONING"
+ ],
+ [
+ 13405,
+ 3940,
+ 2,
+ 5012,
+ 2,
+ "VAE"
+ ],
+ [
+ 13409,
+ 5012,
+ 0,
+ 4828,
+ 1,
+ "CONDITIONING"
+ ],
+ [
+ 13410,
+ 5012,
+ 1,
+ 4828,
+ 2,
+ "CONDITIONING"
+ ],
+ [
+ 13413,
+ 5012,
+ 0,
+ 5013,
+ 0,
+ "CONDITIONING"
+ ],
+ [
+ 13414,
+ 5012,
+ 1,
+ 5013,
+ 1,
+ "CONDITIONING"
+ ],
+ [
+ 13457,
+ 5022,
+ 0,
+ 5020,
+ 0,
+ "STRING"
+ ],
+ [
+ 13458,
+ 5022,
+ 0,
+ 5021,
+ 0,
+ "STRING"
+ ],
+ [
+ 13459,
+ 5023,
+ 0,
+ 2483,
+ 0,
+ "CLIP"
+ ],
+ [
+ 13460,
+ 5023,
+ 0,
+ 2612,
+ 0,
+ "CLIP"
+ ],
+ [
+ 13463,
+ 5025,
+ 0,
+ 4829,
+ 3,
+ "SIGMAS"
+ ],
+ [
+ 13618,
+ 5013,
+ 2,
+ 4851,
+ 0,
+ "LATENT"
+ ],
+ [
+ 13619,
+ 3940,
+ 2,
+ 4851,
+ 1,
+ "VAE"
+ ],
+ [
+ 13635,
+ 5108,
+ 0,
+ 5109,
+ 0,
+ "VIDEO"
+ ],
+ [
+ 13641,
+ 5105,
+ 2,
+ 1241,
+ 2,
+ "FLOAT"
+ ],
+ [
+ 13647,
+ 5012,
+ 2,
+ 4829,
+ 4,
+ "LATENT"
+ ],
+ [
+ 13648,
+ 4829,
+ 0,
+ 5013,
+ 2,
+ "LATENT"
+ ],
+ [
+ 13651,
+ 5111,
+ 0,
+ 5112,
+ 2,
+ "INT"
+ ],
+ [
+ 13653,
+ 5112,
+ 0,
+ 5029,
+ 0,
+ "IMAGE"
+ ],
+ [
+ 13654,
+ 5105,
+ 0,
+ 5112,
+ 0,
+ "IMAGE"
+ ],
+ [
+ 13655,
+ 5011,
+ 1,
+ 5111,
+ 0,
+ "FLOAT"
+ ],
+ [
+ 13658,
+ 5029,
+ 0,
+ 3059,
+ 0,
+ "INT"
+ ],
+ [
+ 13659,
+ 5029,
+ 1,
+ 3059,
+ 1,
+ "INT"
+ ],
+ [
+ 13660,
+ 5029,
+ 2,
+ 3059,
+ 2,
+ "INT"
+ ],
+ [
+ 13661,
+ 5112,
+ 0,
+ 5012,
+ 4,
+ "IMAGE"
+ ],
+ [
+ 13662,
+ 5105,
+ 1,
+ 5108,
+ 1,
+ "AUDIO"
+ ],
+ [
+ 13663,
+ 3059,
+ 0,
+ 5012,
+ 3,
+ "LATENT"
+ ],
+ [
+ 13664,
+ 4851,
+ 0,
+ 5114,
+ 0,
+ "IMAGE"
+ ],
+ [
+ 13667,
+ 5114,
+ 1,
+ 5108,
+ 0,
+ "IMAGE"
+ ],
+ [
+ 13669,
+ 5106,
+ 0,
+ 5105,
+ 0,
+ "VIDEO"
+ ],
+ [
+ 13671,
+ 3940,
+ 0,
+ 5125,
+ 0,
+ "MODEL"
+ ],
+ [
+ 13672,
+ 5125,
+ 0,
+ 5011,
+ 0,
+ "MODEL"
+ ],
+ [
+ 13675,
+ 2483,
+ 0,
+ 1241,
+ 0,
+ "CONDITIONING"
+ ],
+ [
+ 13676,
+ 2612,
+ 0,
+ 1241,
+ 1,
+ "CONDITIONING"
+ ]
+ ],
+ "floatingLinks": [
+ {
+ "id": 9,
+ "origin_id": 3940,
+ "origin_slot": 2,
+ "target_id": -1,
+ "target_slot": -1,
+ "type": "VAE",
+ "parentId": 50
+ }
+ ],
+ "groups": [
+ {
+ "id": 54,
+ "title": "Set prompts -> use API nodes to save on memory",
+ "bounding": [
+ -3550.82992899398,
+ 3056.3835974138815,
+ 943.4464338669131,
+ 781.0969963391614
+ ],
+ "color": "#3f789e",
+ "font_size": 24,
+ "flags": {},
+ "nodes": [
+ 1241,
+ 5022,
+ 5023,
+ 5020,
+ 5021,
+ 2483,
+ 2612
+ ]
+ },
+ {
+ "id": 106,
+ "title": "Preprocess",
+ "bounding": [
+ -2481.3784499715503,
+ 3199.9822209450444,
+ 1021.7363502001899,
+ 476.0742560707637
+ ],
+ "color": "#3f789e",
+ "font_size": 24,
+ "flags": {},
+ "nodes": [
+ 3059,
+ 5012
+ ]
+ },
+ {
+ "id": 110,
+ "title": "Load Models",
+ "bounding": [
+ -4569.272369215781,
+ 2985.5884155316703,
+ 923.5408529724591,
+ 411.7024469678196
+ ],
+ "color": "#3f789e",
+ "font_size": 24,
+ "flags": {},
+ "nodes": [
+ 5119,
+ 5011,
+ 5125,
+ 3940
+ ]
+ },
+ {
+ "id": 147,
+ "title": "Generate",
+ "bounding": [
+ -1380.222061201338,
+ 3137.3164680280265,
+ 812.4243576070752,
+ 556.8679025772241
+ ],
+ "color": "#b58b2a",
+ "font_size": 24,
+ "flags": {},
+ "nodes": [
+ 4828,
+ 4832,
+ 4831,
+ 4829,
+ 5025,
+ 5013
+ ]
+ },
+ {
+ "id": 150,
+ "title": "Decode",
+ "bounding": [
+ -528.1273243034603,
+ 3049.064085282371,
+ 1363.7029178345972,
+ 753.139966041903
+ ],
+ "color": "#b58b2a",
+ "font_size": 24,
+ "flags": {},
+ "nodes": [
+ 5108,
+ 5109,
+ 5118,
+ 5114,
+ 4851,
+ 5120
+ ]
+ },
+ {
+ "id": 151,
+ "title": "Load Video",
+ "bounding": [
+ -4772.246638055613,
+ 3862.3051369647715,
+ 1123.4092996076465,
+ 412.27301110276585
+ ],
+ "color": "#3f789e",
+ "font_size": 24,
+ "flags": {},
+ "nodes": [
+ 5111,
+ 5029,
+ 5112,
+ 5105,
+ 5106
+ ]
+ }
+ ],
+ "config": {},
+ "extra": {
+ "ds": {
+ "scale": 0.25062659558915107,
+ "offset": [
+ 6072.380930579425,
+ -1141.023170852825
+ ]
+ },
+ "frontendVersion": "1.42.8",
+ "reroutes": [
+ {
+ "id": 2,
+ "pos": [
+ -3577.4351727813882,
+ 2764.5861947085327
+ ],
+ "linkIds": [
+ 13401
+ ]
+ },
+ {
+ "id": 3,
+ "parentId": 2,
+ "pos": [
+ -1450.5069529881953,
+ 2787.133374683058
+ ],
+ "linkIds": [
+ 13401
+ ]
+ },
+ {
+ "id": 15,
+ "pos": [
+ -4154.433482919622,
+ 2679.2562666021327
+ ],
+ "linkIds": [
+ 13405,
+ 13619
+ ]
+ },
+ {
+ "id": 16,
+ "parentId": 15,
+ "pos": [
+ -2224.293000061299,
+ 2680.588944802606
+ ],
+ "linkIds": [
+ 13405,
+ 13619
+ ]
+ },
+ {
+ "id": 24,
+ "pos": [
+ -2540.5242168918344,
+ 3127.1895166392273
+ ],
+ "linkIds": [
+ 13403
+ ]
+ },
+ {
+ "id": 27,
+ "pos": [
+ -2506.5463283391796,
+ 3156.436751802816
+ ],
+ "linkIds": [
+ 13404
+ ]
+ },
+ {
+ "id": 28,
+ "pos": [
+ -1415.3477011112568,
+ 2994.621408297922
+ ],
+ "linkIds": [
+ 13409,
+ 13413
+ ]
+ },
+ {
+ "id": 33,
+ "pos": [
+ -1410.6521115590617,
+ 3756.8014069346286
+ ],
+ "linkIds": [
+ 13647
+ ]
+ },
+ {
+ "id": 34,
+ "parentId": 33,
+ "pos": [
+ -1054.4499903469894,
+ 3756.14800685318
+ ],
+ "linkIds": [
+ 13647
+ ]
+ },
+ {
+ "id": 50,
+ "parentId": 58,
+ "pos": [
+ -575.6474014486616,
+ 2684.590774676828
+ ],
+ "linkIds": [
+ 13619
+ ],
+ "floating": {
+ "slotType": "output"
+ }
+ },
+ {
+ "id": 56,
+ "parentId": 24,
+ "pos": [
+ -1831.6648873514375,
+ 3127.2817666594783
+ ],
+ "linkIds": [
+ 13403
+ ]
+ },
+ {
+ "id": 57,
+ "parentId": 27,
+ "pos": [
+ -1860.2895662704748,
+ 3156.8052710750476
+ ],
+ "linkIds": [
+ 13404
+ ]
+ },
+ {
+ "id": 58,
+ "parentId": 16,
+ "pos": [
+ -1886.8526246237643,
+ 2681.1981337977513
+ ],
+ "linkIds": [
+ 13405,
+ 13619
+ ]
+ },
+ {
+ "id": 62,
+ "pos": [
+ -1387.4324013123603,
+ 3028.9649455419553
+ ],
+ "linkIds": [
+ 13410,
+ 13414
+ ]
+ },
+ {
+ "id": 64,
+ "parentId": 28,
+ "pos": [
+ -780.1414675292615,
+ 2998.96506128471
+ ],
+ "linkIds": [
+ 13413
+ ]
+ },
+ {
+ "id": 65,
+ "parentId": 62,
+ "pos": [
+ -809.4332009376844,
+ 3030.3246947110756
+ ],
+ "linkIds": [
+ 13414
+ ]
+ },
+ {
+ "id": 68,
+ "pos": [
+ -4177.471543205669,
+ 4334.597598062699
+ ],
+ "linkIds": [
+ 13641
+ ]
+ },
+ {
+ "id": 76,
+ "parentId": 68,
+ "pos": [
+ -2938.1396274190256,
+ 4323.10924033608
+ ],
+ "linkIds": [
+ 13641
+ ]
+ },
+ {
+ "id": 77,
+ "pos": [
+ -2520.920753825341,
+ 4134.656887117143
+ ],
+ "linkIds": [
+ 13658
+ ]
+ },
+ {
+ "id": 78,
+ "pos": [
+ -2493.337702393049,
+ 4156.010074645364
+ ],
+ "linkIds": [
+ 13659
+ ]
+ },
+ {
+ "id": 79,
+ "pos": [
+ -2464.7150146057065,
+ 4171.834988524348
+ ],
+ "linkIds": [
+ 13660
+ ]
+ },
+ {
+ "id": 80,
+ "pos": [
+ -3854.611984863232,
+ 4391.170438528521
+ ],
+ "linkIds": [
+ 13661
+ ]
+ },
+ {
+ "id": 81,
+ "parentId": 80,
+ "pos": [
+ -1817.3949121767814,
+ 4383.499201074506
+ ],
+ "linkIds": [
+ 13661
+ ]
+ },
+ {
+ "id": 82,
+ "pos": [
+ -4152.613960063276,
+ 4435.666198435675
+ ],
+ "linkIds": [
+ 13662
+ ]
+ },
+ {
+ "id": 83,
+ "parentId": 82,
+ "pos": [
+ 81.86870674502408,
+ 4421.030069887574
+ ],
+ "linkIds": [
+ 13662
+ ]
+ }
+ ],
+ "workflowRendererVersion": "LG",
+ "VHS_latentpreview": false,
+ "VHS_latentpreviewrate": 0,
+ "VHS_MetadataImage": true,
+ "VHS_KeepIntermediate": true,
+ "workspace_info": {
+ "id": "elBQFQknIoLYTEwIloQuw"
+ },
+ "node_versions": {
+ "comfy-core": "0.3.30",
+ "comfyui-kjnodes": "1.0.8"
+ },
+ "linkExtensions": [
+ {
+ "id": 13401,
+ "parentId": 3
+ },
+ {
+ "id": 13403,
+ "parentId": 56
+ },
+ {
+ "id": 13404,
+ "parentId": 57
+ },
+ {
+ "id": 13405,
+ "parentId": 58
+ },
+ {
+ "id": 13409,
+ "parentId": 28
+ },
+ {
+ "id": 13410,
+ "parentId": 62
+ },
+ {
+ "id": 13413,
+ "parentId": 64
+ },
+ {
+ "id": 13414,
+ "parentId": 65
+ },
+ {
+ "id": 13619,
+ "parentId": 50
+ },
+ {
+ "id": 13641,
+ "parentId": 76
+ },
+ {
+ "id": 13647,
+ "parentId": 34
+ },
+ {
+ "id": 13658,
+ "parentId": 77
+ },
+ {
+ "id": 13659,
+ "parentId": 78
+ },
+ {
+ "id": 13660,
+ "parentId": 79
+ },
+ {
+ "id": 13661,
+ "parentId": 81
+ },
+ {
+ "id": 13662,
+ "parentId": 83
+ }
+ ],
+ "prompt": {
+ "1241": {
+ "inputs": {
+ "frame_rate": [
+ "5105",
+ 2
+ ],
+ "positive": [
+ "2483",
+ 0
+ ],
+ "negative": [
+ "2612",
+ 0
+ ]
+ },
+ "class_type": "LTXVConditioning",
+ "_meta": {
+ "title": "LTXVConditioning"
+ }
+ },
+ "2483": {
+ "inputs": {
+ "text": "HDR footage",
+ "clip": [
+ "5023",
+ 0
+ ]
+ },
+ "class_type": "CLIPTextEncode",
+ "_meta": {
+ "title": "CLIP Text Encode (Positive Prompt)"
+ }
+ },
+ "2612": {
+ "inputs": {
+ "text": "pc game, console game, video game, ugly, still, static, slow",
+ "clip": [
+ "5023",
+ 0
+ ]
+ },
+ "class_type": "CLIPTextEncode",
+ "_meta": {
+ "title": "CLIP Text Encode (Negative Prompt)"
+ }
+ },
+ "3059": {
+ "inputs": {
+ "width": [
+ "5029",
+ 0
+ ],
+ "height": [
+ "5029",
+ 1
+ ],
+ "length": [
+ "5029",
+ 2
+ ],
+ "batch_size": 1
+ },
+ "class_type": "EmptyLTXVLatentVideo",
+ "_meta": {
+ "title": "EmptyLTXVLatentVideo"
+ }
+ },
+ "3940": {
+ "inputs": {
+ "ckpt_name": "ltx-2.3-22b-dev.safetensors"
+ },
+ "class_type": "CheckpointLoaderSimple",
+ "_meta": {
+ "title": "Load Checkpoint"
+ }
+ },
+ "4828": {
+ "inputs": {
+ "cfg": 1,
+ "model": [
+ "5011",
+ 0
+ ],
+ "positive": [
+ "5012",
+ 0
+ ],
+ "negative": [
+ "5012",
+ 1
+ ]
+ },
+ "class_type": "CFGGuider",
+ "_meta": {
+ "title": "CFGGuider"
+ }
+ },
+ "4829": {
+ "inputs": {
+ "noise": [
+ "4832",
+ 0
+ ],
+ "guider": [
+ "4828",
+ 0
+ ],
+ "sampler": [
+ "4831",
+ 0
+ ],
+ "sigmas": [
+ "5025",
+ 0
+ ],
+ "latent_image": [
+ "5012",
+ 2
+ ]
+ },
+ "class_type": "SamplerCustomAdvanced",
+ "_meta": {
+ "title": "SamplerCustomAdvanced"
+ }
+ },
+ "4831": {
+ "inputs": {
+ "sampler_name": "euler_ancestral"
+ },
+ "class_type": "KSamplerSelect",
+ "_meta": {
+ "title": "KSamplerSelect"
+ }
+ },
+ "4832": {
+ "inputs": {
+ "noise_seed": 42
+ },
+ "class_type": "RandomNoise",
+ "_meta": {
+ "title": "RandomNoise"
+ }
+ },
+ "4851": {
+ "inputs": {
+ "tile_size": 768,
+ "overlap": 256,
+ "temporal_size": 8,
+ "temporal_overlap": 4,
+ "samples": [
+ "5013",
+ 2
+ ],
+ "vae": [
+ "3940",
+ 2
+ ]
+ },
+ "class_type": "VAEDecodeTiled",
+ "_meta": {
+ "title": "VAE Decode (Tiled)"
+ }
+ },
+ "5011": {
+ "inputs": {
+ "lora_name": "ltxv/ltx2/ltx-2.3-22b-ic-lora-hdr-0.9.safetensors",
+ "strength_model": 1,
+ "model": [
+ "5125",
+ 0
+ ]
+ },
+ "class_type": "LTXICLoRALoaderModelOnly",
+ "_meta": {
+ "title": "🅛🅣🅧 IC-LoRA Loader Model Only"
+ }
+ },
+ "5012": {
+ "inputs": {
+ "frame_idx": 0,
+ "strength": 1,
+ "latent_downscale_factor": 1,
+ "crop": "disabled",
+ "use_tiled_encode": false,
+ "tile_size": 256,
+ "tile_overlap": 64,
+ "positive": [
+ "1241",
+ 0
+ ],
+ "negative": [
+ "1241",
+ 1
+ ],
+ "vae": [
+ "3940",
+ 2
+ ],
+ "latent": [
+ "3059",
+ 0
+ ],
+ "image": [
+ "5112",
+ 0
+ ]
+ },
+ "class_type": "LTXAddVideoICLoRAGuide",
+ "_meta": {
+ "title": "🅛🅣🅧 Add Video IC-LoRA Guide"
+ }
+ },
+ "5013": {
+ "inputs": {
+ "positive": [
+ "5012",
+ 0
+ ],
+ "negative": [
+ "5012",
+ 1
+ ],
+ "latent": [
+ "4829",
+ 0
+ ]
+ },
+ "class_type": "LTXVCropGuides",
+ "_meta": {
+ "title": "LTXVCropGuides"
+ }
+ },
+ "5023": {
+ "inputs": {
+ "text_encoder": "comfy_gemma_3_12B_it.safetensors",
+ "ckpt_name": "ltx-2.3-22b-dev.safetensors",
+ "device": "default"
+ },
+ "class_type": "LTXAVTextEncoderLoader",
+ "_meta": {
+ "title": "LTXV Audio Text Encoder Loader"
+ }
+ },
+ "5025": {
+ "inputs": {
+ "sigmas": "1.0, 0.99375, 0.9875, 0.98125, 0.975, 0.909375, 0.725, 0.421875, 0.0"
+ },
+ "class_type": "ManualSigmas",
+ "_meta": {
+ "title": "ManualSigmas"
+ }
+ },
+ "5029": {
+ "inputs": {
+ "image": [
+ "5112",
+ 0
+ ]
+ },
+ "class_type": "GetImageSize",
+ "_meta": {
+ "title": "Get Image Size"
+ }
+ },
+ "5105": {
+ "inputs": {
+ "video": [
+ "5106",
+ 0
+ ]
+ },
+ "class_type": "GetVideoComponents",
+ "_meta": {
+ "title": "Get Video Components"
+ }
+ },
+ "5106": {
+ "inputs": {
+ "file": "hdr_input_video (1).mp4",
+ "video-preview": ""
+ },
+ "class_type": "LoadVideo",
+ "_meta": {
+ "title": "Load Video"
+ }
+ },
+ "5108": {
+ "inputs": {
+ "fps": 30,
+ "images": [
+ "5114",
+ 1
+ ],
+ "audio": [
+ "5105",
+ 1
+ ]
+ },
+ "class_type": "CreateVideo",
+ "_meta": {
+ "title": "Create Video"
+ }
+ },
+ "5109": {
+ "inputs": {
+ "filename_prefix": "output",
+ "format": "auto",
+ "codec": "auto",
+ "video-preview": "",
+ "video": [
+ "5108",
+ 0
+ ]
+ },
+ "class_type": "SaveVideo",
+ "_meta": {
+ "title": "Save Video"
+ }
+ },
+ "5111": {
+ "inputs": {
+ "value": "a*32",
+ "a": [
+ "5011",
+ 1
+ ]
+ },
+ "class_type": "SimpleMath+",
+ "_meta": {
+ "title": "🔧 Simple Math"
+ }
+ },
+ "5112": {
+ "inputs": {
+ "resize_type": "scale to multiple",
+ "resize_type.multiple": [
+ "5111",
+ 0
+ ],
+ "scale_method": "lanczos",
+ "input": [
+ "5105",
+ 0
+ ]
+ },
+ "class_type": "ResizeImageMaskNode",
+ "_meta": {
+ "title": "Resize Image/Mask"
+ }
+ },
+ "5114": {
+ "inputs": {
+ "exposure": 7.1,
+ "save_exr": true,
+ "output_dir": "output/hdr_exr3",
+ "filename_prefix": "frame",
+ "half_precision": true,
+ "image": [
+ "4851",
+ 0
+ ]
+ },
+ "class_type": "LTXVHDRDecodePostprocess",
+ "_meta": {
+ "title": "🅛🅣🅧 LTXVHDR Decode Postprocess"
+ }
+ },
+ "5125": {
+ "inputs": {
+ "lora_name": "ltxv/ltx2/ltx-2.3-22b-distilled-lora-384-1.1.safetensors",
+ "strength_model": 0.5,
+ "model": [
+ "3940",
+ 0
+ ]
+ },
+ "class_type": "LTXICLoRALoaderModelOnly",
+ "_meta": {
+ "title": "🅛🅣🅧 IC-LoRA Loader Model Only"
+ }
+ }
+ },
+ "comfy_fork_version": "develop@c72d4981"
+ },
+ "version": 0.4
+}
diff --git a/example_workflows/assets/hdr_input_video.mp4 b/example_workflows/assets/hdr_input_video.mp4
new file mode 100644
index 0000000..db35432
--- /dev/null
+++ b/example_workflows/assets/hdr_input_video.mp4
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:96c2a8f737e1e49583e56b1d0f17e487876b1e424b049434efe8132914eb3e64
+size 1968386
diff --git a/hdr.py b/hdr.py
new file mode 100644
index 0000000..1e7608a
--- /dev/null
+++ b/hdr.py
@@ -0,0 +1,245 @@
+"""HDR utilities and ComfyUI node for HDR IC-LoRA inference.
+
+Provides HDR compression/decompression transforms and a single ComfyUI node:
+
+- LTXVHDRDecodePostprocess: Decompress VAE output, tonemap for preview,
+ and optionally save raw linear HDR frames as EXR.
+"""
+
+import logging
+import os
+
+import torch
+from torch import Tensor
+
+from .nodes_registry import comfy_node
+
+logger = logging.getLogger("LTXVideo.hdr")
+
+
+# ---------------------------------------------------------------------------
+# HDR Transform Classes (ported from ltx_core/hdr.py)
+# ---------------------------------------------------------------------------
+
+
+class LogC3:
+ """ARRI LogC3 (EI 800) HDR compression.
+
+ Maps linear [0, inf) -> [0, 1] via the camera log curve, then scales to
+ [-1, 1] for VAE input.
+ """
+
+ A = 5.555556
+ B = 0.052272
+ C = 0.247190
+ D = 0.385537
+ E = 5.367655
+ F = 0.092809
+ CUT = 0.010591
+
+ def compress(self, hdr: Tensor) -> Tensor:
+ x = torch.clamp(hdr, min=0.0)
+ log_part = self.C * torch.log10(self.A * x + self.B) + self.D
+ lin_part = self.E * x + self.F
+ logc = torch.where(x >= self.CUT, log_part, lin_part)
+ logc = torch.clamp(logc, 0.0, 1.0)
+ return logc * 2.0 - 1.0
+
+ def decompress(self, z: Tensor) -> Tensor:
+ logc = torch.clamp((z + 1.0) / 2.0, 0.0, 1.0)
+ cut_log = self.E * self.CUT + self.F
+ lin_from_log = (torch.pow(10.0, (logc - self.D) / self.C) - self.B) / self.A
+ lin_from_lin = (logc - self.F) / self.E
+ return torch.where(logc >= cut_log, lin_from_log, lin_from_lin)
+
+
+# ---------------------------------------------------------------------------
+# Transform registry — singleton (stateless)
+# ---------------------------------------------------------------------------
+
+_LOGC3 = LogC3()
+
+
+def _hdr_decompress(decoded_01: Tensor) -> Tensor:
+ """Decompress VAE-decoded image from [0,1] to linear HDR [0, inf).
+
+ ComfyUI's VAE decode returns images in [0, 1] via ``(raw + 1) / 2``.
+ This function reverses that and applies LogC3 HDR decompression.
+ """
+ raw = decoded_01.float() * 2.0 - 1.0
+ return _LOGC3.decompress(raw)
+
+
+def _linear_to_srgb(x: Tensor) -> Tensor:
+ """Convert linear [0, 1] to sRGB [0, 1]."""
+ return torch.where(
+ x <= 0.0031308,
+ 12.92 * x,
+ 1.055 * torch.pow(x.clamp(min=0.0031308), 1.0 / 2.4) - 0.055,
+ ).clamp(0.0, 1.0)
+
+
+# ---------------------------------------------------------------------------
+# ComfyUI Node
+# ---------------------------------------------------------------------------
+
+
+@comfy_node(name="LTXVHDRDecodePostprocess")
+class LTXVHDRDecodePostprocess:
+ """Decompress HDR from VAE output, tonemap for preview, optionally save EXR.
+
+ Place after VAE Decode in an HDR IC-LoRA workflow. Recovers linear HDR
+ values from the compressed latent space and tonemaps them to SDR for
+ display. When ``save_exr`` is enabled, also writes the raw linear HDR
+ frames as an EXR image sequence.
+ make sure to set OPENCV_IO_ENABLE_OPENEXR=1 environment in the command line # Must be set before cv2 import
+
+
+ Outputs:
+ tonemapped: SDR preview [0, 1] after Reinhard tonemap + sRGB gamma.
+ hdr_linear: Raw linear HDR values [0, inf) for further processing.
+ """
+
+ @classmethod
+ def INPUT_TYPES(s):
+ return {
+ "required": {
+ "image": ("IMAGE",),
+ },
+ "optional": {
+ "exposure": (
+ "FLOAT",
+ {
+ "default": 0.0,
+ "min": -10.0,
+ "max": 10.0,
+ "step": 0.1,
+ "display": "slider",
+ "tooltip": (
+ "Exposure in stops (EV). 0 = no change, "
+ "+1 = 2x brighter, -1 = half brightness."
+ ),
+ },
+ ),
+ "save_exr": (
+ "BOOLEAN",
+ {
+ "default": False,
+ "tooltip": "Save raw linear HDR frames as EXR sequence.",
+ },
+ ),
+ "output_dir": (
+ "STRING",
+ {
+ "default": "output/hdr_exr",
+ "tooltip": (
+ "Directory for EXR frames (relative to ComfyUI "
+ "output directory, or absolute path)."
+ ),
+ },
+ ),
+ "filename_prefix": (
+ "STRING",
+ {"default": "frame"},
+ ),
+ "half_precision": (
+ "BOOLEAN",
+ {
+ "default": True,
+ "tooltip": (
+ "Save EXR as float16 (half). Smaller files, "
+ "negligible quality loss for most workflows."
+ ),
+ },
+ ),
+ },
+ }
+
+ RETURN_TYPES = ("IMAGE", "IMAGE")
+ RETURN_NAMES = ("tonemapped", "hdr_linear")
+ OUTPUT_NODE = True
+ FUNCTION = "postprocess"
+ CATEGORY = "Lightricks/HDR"
+ DESCRIPTION = (
+ "Decompresses VAE-decoded output from HDR IC-LoRA (LogC3) and applies "
+ "Reinhard tonemapping. Place after VAE Decode. 'tonemapped' is the "
+ "SDR preview; 'hdr_linear' is raw linear HDR for downstream use. "
+ "Enable 'save_exr' to write an EXR image sequence."
+ "if save_exr is enabled, make sure to set OPENCV_IO_ENABLE_OPENEXR=1 environment in the command line"
+ )
+
+ def postprocess(
+ self,
+ image: torch.Tensor,
+ exposure: float = 0.0,
+ save_exr: bool = False,
+ output_dir: str = "output/hdr_exr",
+ filename_prefix: str = "frame",
+ half_precision: bool = True,
+ ) -> tuple:
+
+ hdr = _hdr_decompress(image)
+ hdr = torch.clamp(hdr, min=0.0, max=1e4)
+
+ # Reinhard tonemap with exposure (stops → linear multiplier)
+ exposure_mult = 2.0**exposure
+ hdr_exposed = hdr * exposure_mult
+ tonemapped_linear = (hdr_exposed / (1.0 + hdr_exposed)).clamp(0.0, 1.0)
+ tonemapped = _linear_to_srgb(tonemapped_linear)
+
+ if save_exr:
+ assert os.environ.get("OPENCV_IO_ENABLE_OPENEXR") == "1", (
+ "EXR output is enabled (save_exr = TRUE), but OpenCV does not support EXR by default. "
+ "To enable it, set the environment variable OPENCV_IO_ENABLE_OPENEXR=1 before starting ComfyUI, then restart. "
+ "Alternatively, disable EXR output or switch to PNG/JPG."
+ )
+ self._save_exr_frames(hdr, output_dir, filename_prefix, half_precision)
+
+ return (tonemapped, hdr)
+
+ @staticmethod
+ def _save_exr_frames(
+ hdr_image: torch.Tensor,
+ output_dir: str,
+ filename_prefix: str,
+ half_precision: bool,
+ ) -> None:
+ try:
+ import cv2
+ except ImportError:
+ logger.error(
+ "opencv-python is required for EXR export. "
+ "Install with: pip install opencv-python"
+ )
+ return
+
+ import folder_paths
+ import numpy as np
+
+ if not os.path.isabs(output_dir):
+ output_dir = os.path.join(folder_paths.get_output_directory(), output_dir)
+
+ os.makedirs(output_dir, exist_ok=True)
+
+ frames = hdr_image.cpu().numpy()
+ exr_type = (
+ cv2.IMWRITE_EXR_TYPE_HALF if half_precision else cv2.IMWRITE_EXR_TYPE_FLOAT
+ )
+ params = [
+ cv2.IMWRITE_EXR_TYPE,
+ exr_type,
+ cv2.IMWRITE_EXR_COMPRESSION,
+ cv2.IMWRITE_EXR_COMPRESSION_ZIP,
+ ]
+
+ for i in range(frames.shape[0]):
+ frame_bgr = frames[i][:, :, ::-1].astype(np.float32).copy()
+ path = os.path.join(output_dir, f"{filename_prefix}_{i:05d}.exr")
+ cv2.imwrite(path, frame_bgr, params)
+
+ logger.info(
+ "Saved %d EXR frame(s) to %s (%s)",
+ frames.shape[0],
+ output_dir,
+ "float16" if half_precision else "float32",
+ )