Déjà-VAE: Training-Free Consistent Editing with Pseudo-Invertible Encoders and Latent Back-Projection
Organizations: Technion – Israel Institute of Technology · Reichman University
Abstract
Consistency is essential to generative workflows: repeated processing should preserve information beyond the changes explicitly requested. In latent diffusion models, this requires stability both when moving between latent and pixel spaces and when applying successive edits. Autoencoding errors and unintended changes from the editing model can accumulate across these operations, progressively altering image structure, texture, and color. We introduce Déjà-VAE, a framework that combines exact autoencoding consistency with calibrated editing stabilization, without training or fine-tuning. Its autoencoding component converts a pretrained variational autoencoder into a surjective pseudo-invertible neural network, with a fixed gain balancing deviations from the pretrained encoder and decoder. The modified decoder is an explicit nonlinear right inverse of the encoder , satisfying by construction. Consequently, is a reflexive generalized inverse: latent round trips preserve their input, up to numerical precision, and repeated image reconstruction is idempotent. To suppress editing drift, adaptive wavelet back-projection finds the closest latent to the editor's output in , subject to matching the previous latent on wavelet coefficients whose changes fall below calibrated thresholds. This correction is applied once per turn, with no additional network evaluations after calibration. Together, these components support workflows that remain in latent space or interleave generation with pixel-space operations and constraints. Tests across models and editing benchmarks show less drift than stock pipelines and dedicated consistency methods.
Figures & tables
| PSNR | LPIPS | ||||||
| Method | 5 | 15 | 25 | 5 | 15 | 25 | |
| Instruct Pix2Pix | Stock | 17.60 | 10.15 | 8.56 | 0.341 | 0.699 | 0.765 |
| REED-VAE | 19.81 | 13.36 | 11.36 | 0.180 | 0.450 | 0.580 | |
| Ours w/o BP | 20.65 | 13.65 | 11.33 | 0.172 | 0.458 | 0.608 | |
| Ours | 22.78 | 18.16 | 16.31 | 0.148 | 0.252 | 0.324 | |
| Ours Stock 95% CI | 5.18 0.87 | 8.00 0.80 | 7.75 0.75 | 0.193 0.022 | 0.447 0.026 | 0.441 0.028 | |
| No-op | Edit/undo | |||||
| Method | LPIPS | LPIPS | Cycle | |||
| FLUX.2 [klein] | Pixel | Stock | .41 | 18.7 | .48 | 89.0 |
| VAE-LFA | .33 | 11.8 | .43 | 87.2 | ||
| FreqEdit ∗ | .38 | 17.3 | .46 | 73.6 | ||
| Ours w/o BP | .35 | 17.3 | .44 | 88.6 | ||
| Ours w/o wrapper | .32 | 14.1 | .41 | 88.0 | ||
Appendix figures & tables21 assets
Supplementary material from the paper’s appendix.
Appendix
| Codec (VAE) | PCA basis | Range handling | Used in | ||
|---|---|---|---|---|---|
| SD 1.5 | 4 | 29.8 | 256 LAION [ 21 ] images | soft limit, pixel map | Section 4.3 |
| SD 2.1 ( sd-vae-ft-mse ) | 4 | 29.8 | same as SD 1.5 | soft limit, pixel map | Section 4.3 |
| SD 1.5, SD 2.1 | 4 | 30 | 256 LAION images | soft limit | Section 4.2 |
| FLUX.2 [klein] | 32 | 26 | 64 LAION images | soft limit | Sections 4.2 , 4.4 , 4.5 , 4.6 ; Figure 1 ; Appendix E |
| SD3-UE | 16 | 2.828 | the 16 lowest-variance directions of the FLUX.2 basis | soft limit | Sections 4.4 , 4.5 |
| Editor | Threshold (Eq. 13 ) | Calibration chains | Used in |
|---|---|---|---|
| InstructPix2Pix | band profile | first 100 LAION crops, fixed seed per crop | Section 4.3 |
| MagicBrush | band profile | as above | Section 4.3 |
| DiffEdit, Paint-by-Example, SD Inpainting | : no no-op prompt | — | Section 4.3 |
| FLUX.2 [klein] 9B | band profile | eight LAION crops, base seed 0 | Sections 4.4 , 4.5 , 4.6 |
| SD3-UE | band profile | eight LAION crops, base seed 0 | Sections 4.4 , 4.5 |
| Reconstruction (Section 4.2 ) | REED editing (Section 4.3 ) | No-op, edit/undo (Section 4.4 ) | Cumulative editing (Section 4.5 ) | |
|---|---|---|---|---|
| Data | REED’s 179 source images | REED’s 179 ImagenHub examples | VAE-LFA’s 120 images (60 photos, 60 illustrations) | 197 GEdit-Bench photo chains |
| Turns | 25 encode–decode cycles | 25 editing rounds | 10: no-ops, or five edit/undo pairs | 10 edits; LH-40: 40 turns; NoOp-50: 50 |
| Models | SD 1.5, SD 2.1, FLUX.2 VAEs | InstructPix2Pix, MagicBrush: 100 steps, guidance 7.5, image guidance 1.5, Euler ancestral; DiffEdit on SD 2.1; Paint-by-Example, SD Inpainting: 50 steps | FLUX.2 [klein] 9B: 4 steps, guidance 1.0; SD3-UE: 50 steps, guidance 7.5, image guidance 1.5 | FLUX.2 [klein] 9B: 4 steps, guidance 1.0; SD3-UE: 50 steps, guidance 7.5, image guidance 1.5 |
| Seeds | none (posterior mean) | per chain; per round for Paint-by-Example | ( ; round ) | for turn |
| Resolution | FLUX.2: output long edge , area capped at , scored at input size; SD3-UE: | FLUX.2: (score: ); SD3-UE: | ||
| Codec, BP | Table 5 | Tables 5 , 6 | Tables 5 , 6 | Tables 5 , 6 |
| Metric | Measures | Images compared | Better | Source |
| Reconstruction and REED (Sections 4.2 and 4.3 ) | ||||
| PSNR (dB), MSE, SSIM | Pixel fidelity | cycle vs. the original; REED: round vs. the same method’s round 1 | , , | standard |
| LPIPS | Perceptual distance (AlexNet) | as above | [ 29 ] | |
| No-op and edit/undo (Section 4.4 ) | ||||
| LPIPS, L1, SSIM | Drift; SSIM is VAE-LFA’s global grayscale SSIM | round 10 vs. the input, whole image | , , | VAE-LFA [ 25 ] |
| PSNR (dB), | Pixel drift and mean CIE76 color difference ( ) | round 10 vs. the input, whole image | , | ours |
| PSNR | LPIPS | |||
| VAE | @5 | @15 | @25 | @25 |
| SD 2.1 | 26.52 | 19.53 | 14.84 | 0.70 |
| SD 2.1 / REED-VAE (paper) | 30.50 | 24.10 | 20.93 | 0.25 |
| SD 2.1 / Déjà-VAE codec | 29.09 | 28.68 | 28.34 | 0.07 |
| SD 1.5 | 22.09 | 13.36 | 9.61 | 0.76 |
| SD 1.5 / Déjà-VAE codec | 28.07 | 27.76 | 27.50 | 0.07 |
| MSE | LPIPS | SSIM | PSNR | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Editor | Method | 5 | 15 | 25 | 5 | 15 | 25 | 5 | 15 | 25 | 5 | 15 | 25 |
| InstructPix2Pix | Stock VAE (SD 1.5) | 0.025 | 0.107 | 0.149 | 0.341 | 0.699 | 0.765 | 0.595 | 0.226 | 0.183 | 17.596 | 10.151 | 8.563 |
| Soft-limit control | 0.025 | 0.102 | 0.140 | 0.341 | 0.690 | 0.751 | 0.619 | 0.277 | 0.231 | 17.664 | 10.313 | 8.801 | |
| REED-VAE (paper) | 0.020 | 0.060 | 0.090 | 0.180 | 0.450 | 0.580 | 0.800 | 0.530 | 0.410 | 19.810 | 13.360 | 11.360 | |
| Ours w/o BP | 0.016 | 0.056 | 0.086 | 0.172 | 0.458 | 0.608 | 0.813 | 0.476 | 0.323 | 20.653 | 13.653 | 11.332 | |
| Ours | 0.015 | 0.033 | 0.044 | 0.148 | 0.252 | 0.324 | 0.850 | 0.744 | 0.675 | 22.779 | 18.155 | 16.314 | |
| FLUX.2 [klein] | SD3-UE | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Method | LPIPS | L1 | SSIM | PSNR | LPIPS | L1 | SSIM | PSNR | ||
| Released SD3-UE code | – | – | – | – | – | .88 | .46 | .02 | 5.9 | 55.2 |
| SD3-UE / VAE-LFA, released code | – | – | – | – | – | .68 | .30 | .47 | 8.8 | 45.6 |
| Stock | .41 | .13 | .77 | 15.8 | 18.7 | .48 | .15 | .73 | 14.4 | 25.1 |
| Ours w/o wrapper | .32 | .08 | .83 | 18.5 | 14.1 | .42 | .10 | .81 | 17.8 | 15.9 |
| VAE-LFA | .33 | .08 | .83 | 18.7 | 11.8 | .46 | .13 | .73 | 15.4 | 19.6 |
| FLUX.2 [klein] | SD3-UE | |||||||||||
| Drift (round 10) | Edits (%) | Drift (round 10) | Edits (%) | |||||||||
| Method | LPIPS | L1 | SSIM | Edit | Undo | Cycle | LPIPS | L1 | SSIM | Edit | Undo | Cycle |
| Released SD3-UE code | – | – | – | – | – | – | .86 | .45 | .03 | – | – | – |
| SD3-UE / VAE-LFA, released code | – | – | – | – | – | – | .70 | .32 | .42 | – | – | – |
| Stock | .48 | .16 | .63 | 99.2 | 89.1 | 89.0 | .60 | .21 | .58 | 93.5 | 58.7 | 55.2 |
| Ours w/o wrapper | .41 | .13 | .68 | 98.7 | 88.3 | 88.0 | .55 | .15 | .67 | 84.3 | 57.8 | 51.4 |
| photograph | illustration | all (120) | |||||||||||||||||||
| creature | architecture | scenery | creature | architecture | scenery | ||||||||||||||||
| Method | LPIPS | L1 | SSIM | LPIPS | L1 | SSIM | LPIPS | L1 | SSIM | LPIPS | L1 | SSIM | LPIPS | L1 | SSIM | LPIPS | L1 | SSIM | LPIPS | L1 | SSIM |
| No-op, round 10 | |||||||||||||||||||||
| FLUX.2 [klein] | |||||||||||||||||||||
| Stock | .32 | .09 | .85 | .38 | .14 | .73 | .40 | .12 | .78 | .34 | .11 | .82 | .49 | .16 | .73 | .52 | .15 | .73 | .41 | .13 | .77 |
| Ours w/o wrapper | .24 | .05 | .92 | .31 | .10 | .78 | .34 | .08 | .83 | .23 | .07 | .88 | .37 | .10 | .78 | .44 | .09 | .80 | .32 | .08 | .83 |
| photograph | illustration | all (120) | |||||||||||||||||||
| creature | architecture | scenery | creature | architecture | scenery | ||||||||||||||||
| Method | LPIPS | L1 | SSIM | LPIPS | L1 | SSIM | LPIPS | L1 | SSIM | LPIPS | L1 | SSIM | LPIPS | L1 | SSIM | LPIPS | L1 | SSIM | LPIPS | L1 | SSIM |
| Cycle, round 10 | |||||||||||||||||||||
| FLUX.2 [klein] | |||||||||||||||||||||
| Stock | .40 | .11 | .71 | .43 | .17 | .62 | .49 | .16 | .62 | .41 | .14 | .71 | .54 | .18 | .58 | .62 | .19 | .55 | .48 | .16 | .63 |
| Ours w/o wrapper | .33 | .09 | .74 | .37 | .13 | .66 | .44 | .14 | .67 | .31 | .12 | .76 | .45 | .15 | .63 | .55 | .16 | .60 | .41 | .13 | .68 |
| 10 turns (197 chains) | 40 turns : LH-40 (197 chains) | NoOp-50 | ||||||||||||||||
| Route | Method | Edit | IF@5 | CC | O@5 | Bg LPIPS | HPS | Edit | IF@5 | CC | O@5 | Bg LPIPS | HPS | LPIPS | PSNR | |||
| FLUX.2 [klein] 9B, 4 steps | ||||||||||||||||||
| Latent | Uncorrected | 65.48 | 7.11 | 77.98 | 24.82 | 0.383 | 20.6 | 64.77 | 8.12 | 57.04 | 24.25 | 0.671 | 38.2 | 0.700 | 39.2 | 10.77 | ||
| VAE-LFA [ 25 ] | 65.18 | 6.09 | 79.00 | 23.03 | 0.325 | 13.0 | 65.23 | 9.14 | 62.54 | 26.27 | 0.526 | 20.6 | 0.529 | 21.3 | 14.36 | |||
| FreqEdit [ 16 ] | 62.18 | 5.58 | 80.11 | 22.31 | 0.340 | 17.8 | 60.56 | 6.60 | 52.90 | 21.90 | 0.658 | 33.2 | 0.730 | 35.2 | 11.31 | |||
| BP | 65.13 | 7.61 | 84.28 | 26.05 | 0.206 | 8.9 | 64.47 | 7.61 | 83.88 | 26.07 | 0.219 | 9.2 | 0.030 | 3.7 | 30.22 | |||
| 10 turns | 40 turns (LH-40) | 50 no-op turns (NoOp-50) | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Bg LPIPS | Bg LPIPS | LPIPS | PSNR | ||||||||||||
| Route | Method | 512 | 1024 | 512 | 1024 | 512 | 1024 | 512 | 1024 | 512 | 1024 | 512 | 1024 | 512 | 1024 |
| Latent | Uncorrected | 0.383 | 0.420 | 20.6 | 21.0 | 0.671 | 0.710 | 38.2 | 38.8 | 0.700 | 0.736 | 39.2 | 39.8 | 10.77 | 10.55 |
| VAE-LFA [ 25 ] | 0.325 | 0.339 | 13.0 | 13.3 | 0.526 | 0.538 | 20.6 | 20.8 | 0.529 | 0.546 | 21.3 | 21.6 | 14.36 | 14.17 | |
| FreqEdit [ 16 ] | 0.340 | 0.370 | 17.8 | 18.1 | 0.658 | 0.697 | 33.2 | 33.7 | 0.730 | 0.785 | 35.2 | 35.5 | 11.31 | 11.14 | |
| BP | 0.206 | 0.194 | 8.9 | 9.2 | 0.219 | 0.203 | 9.2 | 9.5 | 0.030 | 0.053 | 3.7 | 4.0 | 30.22 | 29.07 | |
| Encoder | Decoder PSNR (dB) | Stock VAE | ||
|---|---|---|---|---|
| VAE | change (%) | real | generated | recon. (dB) |
| SD 1.5 | 2.21 | 44.5 | 43.6 | 28.0 |
| SD 2.1 | 2.21 | 45.4 | 42.2 | 29.1 |
| FLUX.2 [klein] | 5.85 | 43.3 | 42.3 | 36.7 |
| SD3-UE | 1.31 | 45.7 | 43.5 | 34.3 |
| SD 1.5 | FLUX.2 | |||
|---|---|---|---|---|
| PCA | random | PCA | random | |
| Encoder change (%) | 1.7 | 245–320 | 5.3 | 763–852 |
| Decoder PSNR (dB) | 44.5 | 28.8–31.0 | 44.3 | 19.2–20.2 |
| PSNR, cycle 1 (dB) | 28.2 | 5.2–12.6 | 35.7 | 12.0–14.1 |
| PSNR, cycle 25 (dB) | 27.5 | 6.7–12.3 | 32.0 | 12.1–13.4 |
| LPIPS, cycle 25 | 0.07 | 0.64–0.83 | 0.03 | 0.72–0.83 |
| LPIPS | PSNR | ||||||
|---|---|---|---|---|---|---|---|
| Editor | Method | 5 | 15 | 25 | 5 | 15 | 25 |
| IP2P | REED-VAE (paper) | 0.180 | 0.450 | 0.580 | 19.810 | 13.360 | 11.360 |
| Codec, no range handling | 0.175 | 0.484 | 0.651 | 20.321 | 12.941 | 10.356 | |
| Ours w/o BP | 0.172 | 0.458 | 0.608 | 20.653 | 13.653 | 11.332 | |
| MagicBrush | REED-VAE (paper) | 0.190 | 0.510 | 0.690 | 21.530 | 16.660 | 14.090 |
| Codec, no range handling | 0.148 | 0.453 | 0.649 | 21.862 | 16.027 | 12.477 | |
| No-op | Edit/undo | |||||||
| Route | No BP | Fixed | Ours | No BP | Fixed | Ours | ||
| FLUX.2 [klein] | ||||||||
| Wrapped pixel | .349 | .182 | .207 | .164 | .441 | .337 | .359 | .314 |
| Latent | .337 | .163 | .169 | .148 | .434 | .325 | .343 | .308 |
| SD3-UE | ||||||||
| Wrapped pixel | .469 | .345 | .305 | .282 | .596 | .554 | .567 | .522 |
| Versus | Versus fixed | |||||||
| Editor, route | LPIPS | L1 | SSIM | Worse/better | LPIPS | L1 | SSIM | Worse/better |
| No-op, round 10 | ||||||||
| FLUX.2 [klein], wrapped pixel | 2/18 | 3/55 | ||||||
| FLUX.2 [klein], latent | 2/9 | 3/24 | ||||||
| SD3-UE, wrapped pixel | 6/133 | 16/58 | ||||||
| SD3-UE, latent | 8/119 | 20/45 | ||||||
| Drift (LPIPS) | Edit success (%) | |||||
|---|---|---|---|---|---|---|
| Method | Map | No-op | Edit/undo | Edit | Undo | Cycle |
| Ours (Déjà-VAE + BP) | – | .164 | .314 | 98.6 | 87.5 | 87.0 |
| FreqEdit, early steps (original) | default | .384 | .465 | 98.7 | 73.8 | 73.6 |
| FreqEdit, last-step velocity | default | .889 | .965 | 54.7 | 19.0 | 12.2 |
| FreqEdit, last-step velocity | .368 | .416 | 86.2 | 68.0 | 64.8 | |
| FreqEdit, final latent | default | .891 | .967 | 51.0 | 19.5 | 11.7 |
Image Editing
Image editing changes selected visual content while preserving the parts of an image that should remain unchanged.
See all 351 papers