PiD:把 latent decoder 改成 Pixel Diffusion
PiD:把 latent decoder 改成 Pixel Diffusion
论文:PiD: Fast and High-Resolution Latent Decoding with Pixel Diffusion 作者:Yifan Lu, Qi Wu, Jay Zhangjie Wu, Zian Wang, Huan Ling, Sanja Fidler, Xuanchi Ren 时间 / 版本:2026-05-22, arXiv v1 链接:Paper / Project / Code / Model
开篇点评:这篇论文到底解决了什么问题
高分辨率图像生成里,大家通常把注意力放在 latent diffusion backbone 上,decoder 被当成最后一步工程组件:VAE decode 一下,再接一个 SR。PiD 的切入点正好相反:如果 latent 本来就丢掉了低层纹理,那么 deterministic decoder 再努力也只能重建一个平均化的低清图;后面的超分模型又看不到原 latent,只能盲修。
PiD 的回答是把 decoder 本身改成 pixel-space diffusion model。它不再先解码低分辨率 RGB 再超分,而是以 latent $z$ 和文本 $c$ 为条件,直接在 2K/4K pixel space 里 denoise。换句话说,decoder 不只是 tokenizer 的逆函数,而是一个带强 T2I prior 的 conditional generator。
![]()
图:官方 repo teaser。上半部分展示真实图像 latent 和生成图像 latent 的 decode 效果,下半部分把 PiD 放在 latency、UniPercept IQA 和 MLLM judge win rate 里比较。
我的判断是,这篇论文最值得关注的不是“又一个超分模型”,而是它改变了 latent model 的接口假设:latent-to-pixel 这一步可以是生成式的,也可以利用 text prior 和 partially denoised latent 做早停推理。
Paper Card
| 项目 | 信息 |
|---|---|
| Paper | PiD: Fast and High-Resolution Latent Decoding with Pixel Diffusion |
| 任务 | Latent-to-pixel decoding, decoding + upsampling |
| 方法 | Pixel Diffusion Decoder, 基于 PixelDiT T2I prior |
| 输入 / 输出 | latent $z$ + text $c$ -> high-res RGB $x_0$ |
| 支持 latent | FLUX.1, FLUX.2, SD3, DINOv2 RAE, SigLIP Scale-RAE;release 另有 SDXL / Qwen-Image checkpoint |
| 默认尺度 | 4x;SigLIP Scale-RAE 为 8x |
| 代码 / 模型 | GitHub / Hugging Face |
| 复现状态 | 推理代码和 4-step distilled checkpoints 公开;训练脚本 planned;数据包含 internal component |
Abstract:论文摘要解读
论文的核心 claim 可以拆成三句。
第一,传统 VAE/RAE decoder 是 reconstruction-oriented decoder,不擅长合成 latent 没有保存的高频细节。高分辨率场景里,这会导致文字、纹理、边界和细小结构变糊。
第二,PiD 把 latent decoding 改写为 conditional pixel diffusion。给定 latent 和 text,它直接生成高分辨率 pixel,而不是先生成低清 RGB 再做 SR。
第三,PiD 通过 noisy latent conditioning 和 DMD2 distillation,把这个生成式 decoder 做成实用推理模块:4-step student 可以在 GB200 上约 210 ms 解码 2048 图像,在 RTX 5090 上低于 1 秒并约 13 GB 显存。
Motivation:为什么 decoder 不是小问题
传统流程可以写成:
\[x_{dec}=D(z), \quad \hat{x}_0=U_s(x_{dec})\]这里 $D$ 是 VAE/RAE decoder,$U_s$ 是超分模块。这个流程的问题是职责错位:decoder 被要求“忠实重建”,SR 被要求“补细节”,但真正知道语义结构的是 latent $z$ 和文本 $c$。
RAE 让这个矛盾更明显。DINOv2、SigLIP 这类 semantic latent 保留了高层结构,但低层 appearance under-specified。传统 decoder 没有足够的 pixel prior,盲 SR 又没有 latent context,于是会在细节和语义一致性之间摇摆。
PiD 的出发点是:最后一步 decoder 也应该是生成模型,而且要能读 latent。
方法总览:Pixel Diffusion Decoder
PiD 的形式是:
\[\hat{x}_0 \sim p_{\theta}^{(s)}(x_0 \mid z,c), \quad x_0 \in R^{3 \times sH \times sW}\]也就是从噪声图像开始,在高分辨率 pixel space 里做 flow matching denoising,条件是 latent 和 text。
![]()
图:论文官方方法图。左侧是 noisy latent 经 adapter 注入 PixelDiT patch blocks;右侧是推理时从 LDM 中间 latent 早停,把剩余噪声强度交给 PiD。
这个结构有三个关键部件:
- PixelDiT T2I prior:从 pretrained 1024 PixelDiT checkpoint 出发,继续训练到 2K / multi-aspect,并使用 NTK-aware RoPE。
- Latent adapter:把 VAE/RAE latent 对齐到 pixel patch grid,再通过 Conv + ResBlocks 编码成 transformer token。
- Sigma-aware gate:根据 latent 噪声强度 $\sigma$ 控制注入力度,clean latent 多信任,noisy latent 少信任。
数据全流程:latent 如何进 DiT
训练时 PiD 不只喂 clean latent,而是人为构造 noisy latent:
\[\tilde{z}_{\sigma}=(1-\sigma)z+\sigma\xi,\quad \xi\sim N(0,I),\quad \sigma\sim U(0,\sigma_{max})\]论文使用 $\sigma_{max}=0.8$。这个设计是 PiD 能做 early termination 的核心:如果 LDM 还没完全 denoise,PiD 仍然能接收中间 latent,只是用较低 gate 信任它。
adapter 的代码路径在官方 repo 里很直接:PidNet 继承 PixDiT_T2I,新增 LQProjection2D。lq_projection_2d.py 里 latent branch 会把 latent nearest interpolate 或 fold 到 patch grid,再经过 Conv2d、SiLU、Conv2d 和 residual blocks,最后 flatten 为 [B, N, out_dim]。
注入形式可以概括为:
\[h_i \leftarrow h_i+\operatorname{sigmoid}(\operatorname{Linear}([h_i,l_i])-\alpha\sigma)\odot l_i\]代码里 gate 初始化为 content_proj.bias=2.0、log_alpha=log(5),注释写明初始近似 sigmoid(2 - 5*sigma)。这很具体:当 latent 接近 clean 时,adapter 信号更容易进入 DiT;当 latent 很 noisy 时,模型更多依赖 pixel prior 和 text。
Training:三段训练
PiD 的训练不是从零训练一个 decoder,而是分三段。
第一段是 high-resolution PixelDiT prior。论文使用 1.3B 参数 PixelDiT、frozen Gemma-2-2B-it text encoder、patch size 16、hidden size 1536、24 heads。2K prior 训练 batch 128、lr 2e-5、20k iterations,约 1 天 / 128 H100。
第二段是 latent-conditioned finetuning。训练数据包含 MultiAspect-4K-1M、rendered PDF data 和 internally procured high-resolution images,经 Q-Align 过滤后约 2.6M images。每张图有 long / medium / short caption,caption 由 Qwen3-VL-8B-Instruct 生成。
第三段是 DMD2 distillation。teacher 被蒸馏成 4-step student,并把 CFG 蒸馏进 student,所以推理时不需要 conditional/unconditional 两次 forward。论文给出的 4-step sigma schedule 是 {0.999, 0.866, 0.634, 0.342}。
训练目标使用 rectified flow:
\[x_t=t x_0+(1-t)\epsilon\] \[L_{FM}=E\left[\left\|v_{\theta}(x_t,t,c,\tilde{z}_{\sigma},\sigma)-(x_0-\epsilon)\right\|_2^2\right]\]Inference:测试时怎么用
官方 release 有两个入口:
| 入口 | 用途 |
|---|---|
from_ldm.py | prompt/class -> latent diffusion -> capture intermediate x_t 或 final x_0 -> PiD decode |
from_clean.py | image -> VAE/RAE encode -> 可选加噪 -> PiD decode |
from_ldm 是更有意思的路径。比如 FLUX 默认 28 steps,README 推荐保存 step 24;PiD 可以直接拿 step 24 的 latent 和对应 degrade_sigma 解码到 2048。这等于少跑若干 LDM steps,同时把 native VAE decode + diffusion SR 合成一步。
release checkpoint 也已经按 backbone 注册:
| Backbone | 2k | 2kto4k |
|---|---|---|
| flux / flux2 / sd3 | yes | yes |
| zimage / zimage-turbo | 复用 flux latent checkpoint | yes |
| sdxl | no | yes |
| qwenimage / qwenimage-2512 | no | yes |
| dinov2 | yes | no |
| siglip | yes, 8x | no |
一个需要注意的工程细节:README 说明 2026-06-02 发布了新的 FLUX.2 2kto4k _2606 checkpoint,用来修复旧版本 color drifting issue。checkpoint_registry.py 当前已经指向这个新 checkpoint,所以实际使用应以 registry 为准。
直观效果:VAE reconstruction 和 PiD decode 的区别
![]()
图:基于论文源码图拼接的 FLUX 输入 / native VAE / PiD decode 对比。VAE 更像低频重建,PiD 明显把小字和局部纹理重新合成出来。
这张图也说明了 PiD 的本质风险:它确实能补细节,但这类细节是生成出来的,不是 latent 中逐像素保存的。对照片和自然图像,这通常是优势;对 OCR、医学图像、证据型图像,它可能需要更严格的 fidelity 评估。
Evaluation:指标和 baseline 是否公平
论文主要比较三类 baseline:
- native VAE/RAE decoder;
- native decoder + Real-ESRGAN、SeedVR2-3B、TSD-SR、InvSR-1 等 SR;
- SSDD decoder + SR、LUA 等相关 decoder/SR 组合。
指标以 no-reference perceptual quality 为主:MUSIQ、NIQE、DEQA、MANIQA、Q-Align、UniPercept-IAA、UniPercept-IQA、VisualQuality-R1。另有 MLLM judge,使用 Gemini 3 Flash、GPT 5.5、Claude Opus 4.6 做 pairwise preference。
我的看法是:这个评估能支持“PiD 感知质量更好、更快于 diffusion SR”这个 claim,但不能单独支持“PiD 更忠实”。论文也通过 small-text reconstruction 展示了 PSNR/SSIM/LPIPS 的 tradeoff:4-step student 感知更好,像素对齐未必最强。
主表中的几个代表值:
| 设置 | PiD latent step | 代表质量结果 | GB200 compile latency |
|---|---|---|---|
| FLUX.1 VAE | 24/28 | MUSIQ 73.26, NIQE 3.50, Uni-IQA 75.21 | 211.2 ms |
| SD3 VAE | 24/28 | MUSIQ 74.00, NIQE 3.11, Uni-IQA 74.22 | 214.0 ms |
| FLUX.2 VAE | 45/50 | MUSIQ 73.79, NIQE 3.12, Uni-IQA 75.71 | 206.1 ms |
| DINOv2 RAE | 50/50 | MUSIQ 73.31, NIQE 3.38, Uni-IQA 76.52 | 212.4 ms |
| SigLIP Scale-RAE | 50/50 | MUSIQ 74.03, NIQE 3.34, Uni-IQA 72.78 | 208.7 ms |
DINOv2 这里有一个细节:PiD 并不是每个指标都第一,RAE decoder + TSD-SR 在 MUSIQ/NIQE 上仍很强。但 PiD 在更多指标上占优,同时比 diffusion SR 快很多。
实验与证据:哪些 claim 被支持
4-step distillation 的结果很有意思。在 FLUX.1 [dev] PiD(24/28) 设置里,student 4 steps 的感知指标甚至优于 teacher 50 steps:
| 模型 | Steps | MUSIQ | NIQE | DEQA | Uni-IAA | VQ-R1 |
|---|---|---|---|---|---|---|
| Teacher | 50 | 71.79 | 4.92 | 4.28 | 63.82 | 4.64 |
| Student | 4 | 73.26 | 3.50 | 4.31 | 66.21 | 4.68 |
这不代表 student 更“忠实”,而是 DMD2 把 student 推向更好的 perceptual distribution。论文的小文字 reconstruction 里也能看到类似现象:student LPIPS 最好,但 PSNR/SSIM 不一定最好。
ablation 则支持两个结构判断:
| Variant | MUSIQ | NIQE | DEQA | PSNR | SSIM | LPIPS |
|---|---|---|---|---|---|---|
| w/o T2I prior | 59.52 | 7.79 | 2.649 | 17.21 | 0.292 | 0.584 |
| w/o sigma-aware gate | 70.84 | 5.84 | 4.292 | 24.28 | 0.956 | 0.202 |
| Ours | 71.63 | 5.43 | 4.289 | 25.00 | 0.965 | 0.179 |
第一,没有 T2I prior,pixel decoder 质量大幅下降;第二,sigma-aware gate 对 noisy latent 和 early termination 可靠性有实际作用。注意这张 ablation 表是 teacher/pre-distill protocol,不能直接和主表 4-step distilled PiD 的 NIQE 3.50 混比。
![]()
图:根据官方 teaser / 项目页数值整理的速度与 MLLM preference 位置。PiD 不是比 Real-ESRGAN 更快,而是在明显高于 Real-ESRGAN 的感知质量下,比 diffusion SR 快。
复现与工程风险
PiD 的推理复现状态不错:GitHub 有推理代码,Hugging Face 有 checkpoint,README 给了 from_ldm.py 和 from_clean.py 的命令。model card 也说明所有 PiD_* checkpoint 都是 4-step distilled。
完整训练则还不是可复现状态。主要原因有三个:
- 训练数据包含 internally procured high-resolution images;
- Q-Align 过滤、caption 生成和数据混合细节没有完整脚本;
- README 写明 training scripts 仍是 planned,undistilled checkpoints coming soon。
另外要分清许可:GitHub 代码是 Apache 2.0;Hugging Face model card 标注 NSCLv1,限制 non-commercial research/evaluation。做产品化接入时不能只看代码 license。
实际试用建议:
- 先跑
from_ldm.py --backbone flux --ldm_inference_steps 28 --save_xt_steps 24 --pid_inference_steps 4。 - 4K 解码使用
--pid_ckpt_type 2kto4k。 - FLUX.2 2kto4k 用 registry 指向的
_2606checkpoint,不要用旧 checkpoint。 - 对文字、文档、医学或证据型图像,额外做 crop-level fidelity check,不要只看 IQA 分数。
总结
PiD 的核心贡献不是“又快又清晰”这么简单,而是把 decoder 的角色重新定义了:latent-to-pixel 不再是 deterministic reconstruction,而是带 text prior、latent condition 和噪声可靠性控制的 pixel diffusion generation。
这条路线对后续图像和视频 latent model 都有启发。越是高分辨率,越不能把 decoder 当成无关紧要的小尾巴;它决定了细节从哪里来,也决定了 latency 和显存怎么花。PiD 目前更像一个强 inference baseline:推理工件已经公开,工程入口清楚,但训练复现和 fidelity 评估还需要更透明的 evidence。
Recommended citation: Lu et al., PiD: Fast and High-Resolution Latent Decoding with Pixel Diffusion, arXiv:2605.23902, 2026.
Download Paper
