Hippotes's picture
Upload folder using huggingface_hub
7d624d7 verified
|
Raw History Blame Contribute Delete
2.17 kB
# Ming-Image VAE decoder finetune
A finetuned decoder for the Ming-Image VAE (same weights as the Qwen-Image-Layered RGBA VAE). The encoder is untouched, latents are identical and the file is a drop-in replacement in ComfyUI.
The stock decoder leaves an 8 px block pattern and fine grain in flat areas such as skies, walls and design backgrounds. This finetune removes that pattern, keeps texture on skin, foliage and fabric, and even decodes transparency more accurately.
## Results
On 50 hold-out pictures, fp16 compute.
| | Stock | Finetune |
|---|---|---|
| PSNR (dB) | 31.60 | 32.06 |
| LPIPS (AlexNet) | 0.0497 | 0.0207 |
| 8 px grid strength in the error | 0.146 | 0.012 |
| Mean abs error on flat pixels (levels of 255) | 1.42 | 0.83 |
RGBA round trip on 10 hold-out photos with synthetic masks, alpha PSNR in dB:
| Mask | Stock | Finetune |
|---|---|---|
| Soft gradient | 24.95 | 38.12 |
| Hard shapes | 44.82 | 49.56 |
| Hair strands | 23.24 | 24.05 |
| Text | 40.68 | 43.83 |
| Mean alpha on fully transparent pixels | 0.0033 | 0.0010 |
### Block pattern
Round-trip error on the flattest hold-out crop, amplified 10x. The bottom row averages the error by pixel position modulo 8 over all 50 photos. The stock decoder has a strong periodic bias aligned with the latent grid; the finetune is close to flat.
![noise](assets/noise.png)
### Texture on generations
Ming-Image generations decoded from the same latents. Top row stock, bottom row finetune.
![zoom](assets/zoom.png)
### Training curves
![training](assets/training.png)
## Training
- Trainable: decoder and post-quant conv. Frozen: encoder and quant conv.
- Data: 3,500 photos. Random crops after a 0.5x to 1.0x downscale, horizontal flips.
- Steps 0 to 5k: L1 + LPIPS, 256 px crops, batch 8, AdamW lr 2e-5, EMA 0.999.
- Steps 5k to 15k: adds a PatchGAN discriminator (hinge loss, adaptive weight x0.1).
- Steps 15k to 20k: 512 px crops, batch 4, lr 1e-5. Half of the samples get a random alpha mask (gradients, shapes, hair strands, text). Alpha L1 against the input alpha, RGB L1 weighted by alpha, LPIPS and GAN on composites over gray. GAN weight x0.2, adaptive weight capped at 0.01.