Abstract
We introduce Posterior Distillation Sampling (PDS), a novel optimization method for parametric image editing based on diffusion models. Existing optimization-based methods, which leverage the powerful 2D prior of diffusion models to handle various parametric images, have mainly focused on generation. Unlike generation, editing requires a balance between conforming to the target attribute and preserving the identity of the source content. Recent 2D image editing methods have achieved this balance by leveraging the stochastic latent encoded in the generative process of diffusion models. To extend the editing capabilities of diffusion models shown in pixel space to parameter space, we reformulate the 2D image editing method into an optimization form named PDS. PDS matches the stochastic latents of the source and the target, enabling the sampling of targets in diverse parameter spaces that align with a desired attribute while maintaining the source's identity. We demonstrate that this optimization resembles running a generative process with the target attribute, but aligning this process with the trajectory of the source's generative process. Extensive editing results in Neural Radiance Fields and Scalable Vector Graphics representations demonstrate that PDS is capable of sampling targets to fulfill the aforementioned balance across various parameter spaces.
Introduction
Diffusion models have revolutionized image generation, but their primary operation in pixel space presents challenges for editing parametric representations like Neural Radiance Fields (NeRFs) and Scalable Vector Graphics (SVG). Editing these formats requires optimizing underlying parameters—such as NeRF weights or SVG paths—to ensure the rendered output aligns with a target text prompt while preserving the source's identity.
Existing methods like Score Distillation Sampling (SDS) excel at generation but often "forget" the original content's identity during editing. Delta Denoising Score (DDS) improves upon this but lacks an explicit mechanism for structural preservation. Posterior Distillation Sampling (PDS) addresses these gaps by matching "stochastic latents" between source and target, achieving a superior balance between attribute alignment and identity preservation.
Methodology
The core innovation of PDS is the transition from matching noise to matching stochastic latents.
Stochastic Latent Matching
In a standard diffusion process, an image is transformed into noise. The "stochastic latent" represents the specific trajectory or "DNA" encoding the structural details of an image. PDS reformulates 2D pixel-space editing techniques (like DDPM inversion) into an optimization objective. Instead of a generic generation command, PDS optimizes parameters so that the resulting stochastic latents match the original structure while aligning with the new text prompt.
Direct Parameter Updates
Unlike iterative methods that edit 2D images and attempt to reconstruct 3D scenes, PDS updates NeRF or SVG parameters directly. This approach ensures view consistency in 3D scenes, as geometric changes are applied to the underlying representation rather than individual frames. A final refinement stage using SDEdit is employed to remove artifacts and ensure high-fidelity visual results.
Experimental Results and Insights
3D NeRF Editing and Geometric Flexibility
PDS demonstrates remarkable geometric flexibility, enabling large-scale changes such as altering a subject's pose. In evaluations using 13 real-world scenes and 37 prompt pairs, PDS significantly outperformed baselines. Human evaluation showed a preference for PDS in 49.33% of cases, compared to 27.71% for Instruct-NeRF2NeRF.
SVG Fidelity
In the domain of vector graphics, PDS preserves the "soul" of the original SVG while modifying requested attributes. Experiments on 48 input pairs from the VectorFusion dataset showed that PDS achieves superior LPIPS scores, indicating higher perceptual similarity to the source compared to SDS and DDS.
Discussion and Limitations
PDS highlights that successful editing depends on staying close to the generative "trajectory" of the source. By aligning forward process posteriors, PDS prevents the target from drifting too far from the source identity.
However, challenges remain. There is often a discrepancy between the ideal prompt for reconstruction and the user-provided prompt, currently addressed via DreamBooth fine-tuning. Additionally, the method relies on a refinement stage for professional-grade fidelity and involves high computational costs, requiring approximately 30,000 iterations for NeRF scenes. Future work will focus on automating prompt alignment and reducing optimization time.
Summary updated