将标准动态范围(SDR)图像转换为高动态范围(HDR)EXR 文件 — 浮点值,其范围远远超出 8 位 SDR 输出所能承载的范围。
基于 LumiVid(论文)— Lightricks 研究引入了用于 HDR 生成的 LogC3 编码扩散模型。LumiPic 是将相同技术应用于单图像扩散转换器;该技术与基础模型无关。这里发布了两个在不同基础模型上训练的 LoRA 系列。
20 张相同的 HDR 输出,在两个极端曝光偏移下查看 — 高光在 EV+6 时仍保持结构,阴影在 EV-6 时仍保留信息。
曝光 +6(高光压低):

曝光 -6(阴影提亮):

5 次以上训练迭代,每个 LoRA 563 MB。质量最佳,基础模型较大(约 54 GB)。
v5b_step2000.safetensors — Qwen 默认版。总体最稳健;在风格化/AI 生成的 SDR 输入上表现最佳。v9_step1500.safetensors — 替代版。与 LumiVid 对齐的增强(联合 HDR+SDR EV 偏移,亮度模糊 p=1.0)。在自然照片上略胜一筹。hdrdit_v1_QE2511.safetensors — 原始 v1 版本。单次训练迭代,每个 LoRA 88 MB。Apache 2.0 许可基础模型,比 Qwen 小 5 倍,端到端速度最快。
klein4b_alpha_step1750.safetensors — klein-4B 默认版。忠实的 HDR 外观;平衡良好。klein4b_alpha_step1000.safetensors — 替代版。激进的 HDR(更高 p99)但倾向于过曝明亮的高光。单次训练迭代,每个 LoRA 158 MB。更大的 klein 变体 — 容量更大,HDR 更细腻。基础模型在 Hugging Face 上受访问限制(首次运行前请在基础模型页面申请访问)。
klein9b_alpha_step2000.safetensors — klein-9B 默认版。稳定且表现良好(平均 p99 为 9.1,在我们的 20 图像基准测试中无场景过饱和)。klein9b_alpha_step1250.safetensors — 大多数“优质”场景(20 中有 13 个在 5-50 p99 范围内,0 个过饱和)。按场景质量计数实际上是最佳的。klein9b_alpha_step1000.safetensors — 最激进(平均 p99 为 20.6,但 4 个场景过饱和)。过拟合前的峰值 HDR 范围。klein9b_alpha_step{250,500,750,1500,1750}.safetensors — 中间快照,可供实验使用。klein-9B 上的训练过拟合曲线很陡峭(平均 p99:1000=20.6 → 1250=11.1 → 1500=9.3 → 1750=9.6 → 2000=9.1)。Step 2000 是最安全的默认值;Step 1250 是实际使用的最佳点。
Qwen-Image-Edit-2511:
from diffusers import QwenImageEditPipeline
import torch
from PIL import Image
pipe = QwenImageEditPipeline.from_pretrained("Qwen/Qwen-Image-Edit-2511", torch_dtype=torch.bfloat16)
pipe.load_lora_weights("oumoumad/LumiPic", weight_name="v5b_step2000.safetensors")
pipe = pipe.to("cuda")
image = Image.open("photo.jpg").convert("RGB")
output = pipe(prompt="Convert this image to HDR", image=image,
num_inference_steps=40, guidance_scale=3.0, output_type="pt")
# Decode LogC3 → linear HDR (see logc3.py in GitHub repo)FLUX.2-klein-base-4B / 9B(需要最前沿的 diffusers:pip install "git+https://github.com/huggingface/diffusers.git"):
from diffusers import Flux2KleinPipeline
import torch
from PIL import Image
# 4B (Apache 2.0, ungated)
pipe = Flux2KleinPipeline.from_pretrained("black-forest-labs/FLUX.2-klein-base-4B", torch_dtype=torch.bfloat16)
pipe.load_lora_weights("oumoumad/LumiPic", weight_name="klein4b_alpha_step1750.safetensors")
# 9B (gated — accept license on HF first)
# pipe = Flux2KleinPipeline.from_pretrained("black-forest-labs/FLUX.2-klein-base-9B", torch_dtype=torch.bfloat16)
# pipe.load_lora_weights("oumoumad/LumiPic", weight_name="klein9b_alpha_step2000.safetensors")
pipe.enable_model_cpu_offload() # or pipe.to("cuda") if you have 32GB+
image = Image.open("photo.jpg").convert("RGB")
output = pipe(prompt="Convert this image to HDR", image=image,
num_inference_steps=25, guidance_scale=3.0, output_type="pt")完整的推理代码(含 EXR 输出)请参见 GitHub 仓库(Qwen 对应 inference.py,klein 对应 inference_klein.py)。
git clone https://github.com/oumad/LumiPic.git && cd LumiPic
pip install -r requirements.txt
python inference.py --image photo.jpg # Qwen path (production)
python inference_klein.py --image photo.jpg # klein path (alpha)基础模型和LoRA权重会在首次运行时自动下载。
三个即用型工作流:
SDR_To_HDR_QE11.json — Qwen-Image-Edit-2511SDR_To_HDR_klein4b.json — FLUX.2-klein-base-4BSDR_To_HDR_klein9b.json — FLUX.2-klein-base-9B两者均使用 ComfyUI_Gear 中的 Gear · LogC3 Decode + Save EXR 节点进行 LogC3 解码和 EXR 写入。将 JSON 文件拖放到画布上,将匹配的 LoRA 文件放置在 ComfyUI/models/loras/{qwen,flux}/hdr/ 目录中,安装 ComfyUI_Gear,使用提示词 "Convert this image to HDR" 进行队列处理。
.npy 目标的分支(npy-float32-targets branch);klein LoRA 使用上游版本,并对 flux2_model.py 应用了 4 行 VAE 显存优化补丁。