TL;DR
Jodi (Joint Diffusion) unifies visual generation and understanding into a single 1.6B-parameter diffusion transformer by jointly modeling the distributions of RGB images alongside multiple label domains (depth, surface normals, segmentation, edges, albedo, and human pose). Using a flexible Role-Switch mechanism and linear attention, Jodi seamlessly alternates between generating images and labels together, controllable image synthesis from any condition, and multi-task dense perception—achieving state-of-the-art results among generalist visual models.
What Problem Does This Paper Address?
In computer vision, generation (e.g., text-to-image synthesis) and understanding (e.g., depth estimation, semantic segmentation) have traditionally been tackled by disjoint specialized models. While recent generalist models attempt to cover both, they typically treat them as separate input-to-output translation pipelines that require independent inference passes and ignore the structural consistency between visual domains.
The authors observe a foundational probabilistic link: the joint distribution $p(\mathbf{x}, \mathbf{y}^1, \dots, \mathbf{y}^M)$ over image $\mathbf{x}$ and visual domains $\mathbf{y}$ naturally yields:
- Joint generation: $p(\mathbf{x}, \mathbf{y}^1, \dots)$
- Controllable generation: $p(\mathbf{x} \mid \mathbf{y}^1, \dots)$
- Visual perception: $p(\mathbf{y}^1, \dots \mid \mathbf{x})$
Jointly modeling up to 8 high-resolution visual domains, however, causes standard transformer full-attention mechanisms to explode quadratically in both compute and memory. Jodi solves both the conceptual unification and the architectural bottleneck.
Methods
Jodi is built on the Sana architecture using a rectified flow diffusion framework:
- Deep Compression Autoencoder (DC-AE): All image and label domains (represented in RGB space) are compressed by a factor of $32\times$, keeping sequence lengths manageable for high-resolution ($1024 \times 1024$) processing.
- Role-Switch Mechanism: In each training iteration, every domain is randomly assigned one of three roles:
[G](Generate): Diffused via linear noise interpolation $(1-t)\mathbf{y}_0 + t\epsilon$.[C](Condition): Kept clean/unnoised as conditioning input.[X](Ignore): Zeroed out and omitted from attention.- Masked Linear Attention: Standard self-attention scales as $\mathcal{O}(M^2 N^2)$ for $M$ domains and $N$ tokens per domain. Jodi employs a masked linear attention formulation (using kernelized ReLU features), reducing complexity to $\mathcal{O}(M N D^2)$ time and $\mathcal{O}(M N D)$ space, enabling simultaneous training on 8 visual domains on commodity hardware.
- Domain-Invariant Positional Embeddings: Because Sana normally omits explicit positional embeddings (NoPE), tokens across different domains lack spatial alignment cues. Jodi introduces shared 2D sinusoidal embeddings across all domains for matching spatial coordinates, augmented with distinct domain and role embeddings via AdaLN-Zero layers.
Input Domains (Image, Depth, Normals, Edges, etc.)
│
[DC-AE Encoder]
│
┌──────────────────┴──────────────────┐
[ G ] [ C ] [ X ]
(Target: Noised) (Condition: Clean) (Ignored: Zeroed)
└──────────────────┬──────────────────┘
▼
[Masked Linear Diffusion DiT]
(Domain-Invariant Positional Embeddings)
│
[Flow Matching Loss]
Datasets
- Joint-1.6M (Introduced): A synthetic-annotation dataset containing 200K high-resolution images ($>1024 \times 1024$) sourced from Subjects200K, Aesthetic-4K, and Pexels. Pseudo-labels for 7 domains were generated using specialized state-of-the-art predictors: Informative Drawings (line art), PiDiNet (edges), Depth Anything V2 / Lotus (depth), Lotus (normals), RGB2X (albedo), OneFormer (segmentation), and OpenPose (human skeleton). Captions were generated using BLIP-2 and Qwen2-VL.
- Ground-Truth Data (90K images): BSDS500 (edges), Hypersim (depth, normals, albedo), and ADE20K (semantic segmentation).
- Evaluation Benchmarks: NYUv2, ScanNet, DIODE (depth); NYUv2, ScanNet, iBims (surface normals); Hypersim test set (albedo); BSDS500 (edges); ADE20K (segmentation).
Key Insights and Ideas
- Unified Multi-Task Perception in One Step: Traditional multi-task diffusion systems infer each perceptual map in separate passes. Jodi can predict all label maps simultaneously ($p(\mathbf{y}^1, \dots, \mathbf{y}^M \mid \mathbf{x})$) in a single flow trajectory, drastically cutting cumulative inference time.
- Ensemble-Through-Joint-Perception: Multi-label prediction is slightly noisier due to imperfect pseudo-labels during training. However, because generating 5 domains at once is $5\times$ faster than sequential generation, one can run 5 multi-label passes and average them—achieving better accuracy than single-label specialized inference in the same wall-clock budget.
- Domain-Invariant Embeddings Are Non-Negotiable: Visualizing attention maps reveals that without domain-invariant positional embeddings, models fail to cross-align features across visual modalities. Sharing positional indices across domains provides an inductive bias that ensures strict pixel-to-pixel alignment.
- Rapid Transfer to New Domains: Thanks to its joint linear representation, Jodi adapts to new domains (e.g., doodle sketches, pixel art, irradiance) within 2,000 fine-tuning steps (~10 GPU hours on a single RTX A6000), converging far faster than fine-tuning from a pure image backbone.
Key Results
- Controllable Generation: Across single-condition image generation benchmarks, Jodi outperforms generalist models (OmniGen, PixWizard, OneDiffusion) and specialist models (ControlNet, UniControl):
- Depth control: 13.6 FID (vs. PixWizard's 14.4 and OmniGen's 20.4).
- Normal control: 13.6 FID (vs. PixWizard's 16.7 and OneDiffusion's 21.6).
- Edge control: 13.7 FID / 0.20 LPIPS (vs. PixWizard's 22.9 / 0.29).
- Multi-condition generation (combining depth, normal, edge, and line art) further improves image fidelity to 10.2 FID.
- Dense Understanding & Perception:
- Edge Detection: Outperforms dedicated baselines on BSDS500 with 0.826 ODS and 0.851 OIS (vs. PiDiNet's 0.807 / 0.823).
- Geometry Estimation: Achieves competitive performance with specialist models like Lotus-D and GeoWizard (e.g., 18.6° mean angular error on NYUv2 normals via ensembling; 8.3% AbsRel depth error on NYUv2).
- Efficiency: Linear attention keeps training memory well under 48 GiB across 8 domains, whereas standard full attention exceeds RTX A6000 memory past 4 domains, and FlashAttention requires $2.3\times$ longer step latency.
Limitations and Future Work
- RGB Representation Bottleneck: Representing discrete or non-photometric domains in 3-channel RGB causes issues:
- Semantic Segmentation: With 150 ADE20K classes mapped into RGB space, colors overlap or fail to capture semantic proximity (e.g., "van" vs. "car" get widely different colors, while unrelated classes share similar RGB values). Grouping into 12 superclasses helps (57.5 mIoU), but a custom discrete tokenization space is needed.
- OpenPose: Skeletons are rendered as pixel sticks rather than geometric coordinates, leading to occasional limb distortions.
- Data Scaling: Complex multi-person compositions and fine text rendering still show artifacts due to the modest size of the training set (200K base images). Dedicated domain-specific encoders and decoders beyond standard image VAEs remain an open direction.
Summary updated