Run this model with HF Jobs
Run thepatch/same-l-decoder-lora on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/thepatch/same-l-decoder-lora. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/thepatch/same-l-decoder-lora on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use thepatch/same-l-decoder-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Stable Audio 3
How to use thepatch/same-l-decoder-lora with Stable Audio 3:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
SAME-L decoder LoRA (squeakfix_v3): round-trip artifact fix
Browse filesFiles changed (2)
- README.mdAdded+253
- squeakfix_v3.safetensorsAdded+3
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253---language:- enlibrary_name: stable-audio-3license: otherlicense_name: stable-audio-communitylicense_link: https://huggingface.co/stabilityai/SAME-L/blob/main/LICENSEbase_model: stabilityai/SAME-Ltags:- music- audio- autoencoder- lora- stable-audio-3---
# SAME-L Decoder LoRA (`squeakfix_v3`)
A LoRA on **SAME-L's decoder**. It changes how latents are rendered to audio, nothow latents are produced.
The encoder is untouched, so the latent space, the DiT and every existing DiTLoRA stay bit-compatible. This adapter stacks with them in any order.
It exists to fix one specific thing: the high-frequency squeaks and chirps thatSAME's autoencoder manufactures on percussion when audio goes round theencode/decode loop more than once β which is what every chained continuationdoes.
**Trained and used by [the collabage patch](https://huggingface.co/thepatch).**In production in a live `stable-audio-3` backend since 2026-08-14.
---
## Usage
Requires the `target: "decoder"` support in[Stability-AI/stable-audio-3](https://github.com/Stability-AI/stable-audio-3).No special loading path β the `target` field in the checkpoint config is whatroutes it.
```bashpython run_gradio.py --model medium-base \ --lora-ckpt-path squeakfix_v3.safetensors```
Stacked with a DiT LoRA, in either order:
```bashpython run_gradio.py --model medium-base \ --lora-ckpt-path my_style.safetensors squeakfix_v3.safetensors```
Directly on the autoencoder:
```pythonfrom stable_audio_3 import AutoencoderModelfrom stable_audio_3.models.lora.loader import load_and_apply_loras
ae = AutoencoderModel.from_pretrained("same-l", device="cuda").autoencoderload_and_apply_loras(ae, ["squeakfix_v3.safetensors"], "autoencoder")
latents = ae.encode(waveform)audio = ae.decode(latents)```
Strength is a **separate call** β `lora_configs` at inference only gates thesigma interval and layer filter:
```pythonfrom stable_audio_3.models.lora.model import set_lora_strengthset_lora_strength(ae.decoder, 1.0) # 0.0 renders at the stock decode```
Ship at strength **1.0**. It was trained there and it is where it was auditioned.
---
## What it fixes
SAME downsamples 44.1 kHz stereo by 4096Γ, so there is one latent frame per93 ms and a snare attack lives entirely inside a single frame. The decoder doesnot reconstruct that attack β it resynthesizes one, slightly differently everypass.
A single generation is fine. The problem is **feedback**: a continuationre-encodes previously decoded audio, so N chained continuations put the audiothrough N round trips. Measured on the round-trip ladder with no DiT involved,invented HF energy climbs ~15 dB over six iterations while lost HF stays flat,and every one of the twelve worst frames lands within 35 ms of a detected onset.
Nothing in SAME's training objective ever asked that `encode(decode(z)) β z` βevery loss is `real audio β latent β real audio` β so round-trip idempotence hasno reason to hold, and it does not. This adapter adds that objective after thefact, on the decoder only.
### Measured effect
**The win is at re-encode depth.** Every continuation and every transformre-encodes previously decoded audio, so a chained session compounds. Measured onaudio the model generated (medium + a DiT LoRA), the same latents decoded througheach adapter β HF tonality, i.e. spectral peakiness, which is what "the hi-hatbecame a whistle" looks like numerically:
| | tonal p95 at 1x | after 3 re-encodes | cost of depth ||---|---|---|---|| stock | 8.09 | 12.80 | **+4.71** || `squeakfix_v3` | 8.29 | 9.06 | **+0.78** |
The adapter cuts degradation-per-re-encode by ~83%. Chained continuations arewhere it earns its place.
**At 1Γ this metric is flat** (8.29 vs 8.09 β slightly worse, inside the noise).A subtle improvement on single generations is reported by ear, and it isplausible that it lives in pops and transient smear rather than tonality, but itis not something these numbers demonstrate. Treat 1Γ as neutral and the re-encodebehaviour as the reason to use this.
On the round-trip ladder against real held-out audio, which is the eval thecheckpoint was selected against:
| metric | stock | `squeakfix_v3` | Ξ ||---|---|---|---|| tonality p95 | 17.08 | **9.41** | β7.67 || transient excess (dB) | 6.32 | **1.24** | β5.08 || latent drift per round trip | 10.91 % | **5.85 %** | β5.06 pp || onset artifact (dB) | β3.50 | β7.53 | β4.03 |
`transient excess` is added-HF on transient frames minus that on sustainedframes; positive means the artifact rides percussion, which is its signature.
---
## Honest limits
**Any decoder LoRA trained this way stamps a comb into the output β this onedoesn't, and that is the whole reason it exists.** The autoencoder's un-patch isa bare reshape at `patch_size 256`, so output channel index andtime-position-within-patch are the same axis, and any channel-wise bias theadapter learns is repeated identically in every patch. That is a harmonic comb at`sr/256 = 172.27 Hz`, with an F3 fundamental β it reads as a wrong note, not asnoise. It is inaudible in a mix and obvious once a stem separator strips themasking content, which is how it was found.
`squeakfix_v3` was trained with an explicit penalty on that structure(`--lambda_patch 30`). A `v1` trained identically *without* it is the control.
Measured on the distribution that matters β audio **generated by the modelitself** (medium + a DiT LoRA), the same latents decoded through each adapter, sothe decoder is the only variable. Comb excess in dB over a control comb atmeaningless spacing, mean of 4 generations:
| variant | comb excess | vs stock ||---|---|---|| stock | 2.80 | β || v1 @ strength 1 | 13.70 | **+10.90** || **v3 @ strength 1** | 1.97 | **β0.83** || stock, +3 round trips | 1.64 | β1.17 || v1 @ 1, +3 round trips | 13.34 | +10.54 || **v3 @ 1, +3 round trips** | 1.37 | **β1.43** || v1 @ strength 2 | 18.52 | +15.72 || **v3 @ strength 2** | 3.49 | **+0.68** |
v1 adds ~11 dB of comb. **v3 sits at or slightly below stock**, and stays thereunder re-encoding. Even at strength 2 β double what it ships at, where everyeffect is 2β4Γ clearer β it is within 0.7 dB of stock, while v1 is nearly 16 dBabove it.
One caveat for anyone reproducing this: on **real** audio pushed round theautoencoder, rather than on model output, v3 measures +1.5 to +4.0 dB of combexcess instead of ~0. Real music and model output are different distributions andthe artifact does not behave the same on both. Measure on generated audio β thatis what the decoder is actually asked to render, and it is where the artifact wasaudible in the first place.
Other things worth knowing:
- **This is one checkpoint from one dataset**, and it was selected partly by ear. The in-loop ladder kept improving past step 2000; step 2000 is what was chosen on re-encode behaviour and listening. Your material may want a different one.- **The squeaks it targets are partly an upstream prompt-distribution problem.** Out-of-distribution prompts produce far more of the offending frames than in-distribution ones. This adapter reduces the artifact; it does not make prompt choice irrelevant.- **It is a SAME-L adapter.** SAME-S has the same patch grid but its artifact sits in a different band (1β8 kHz rather than 6 kHz and up) and wants a different recipe. Loading this on SAME-S will not error β it will just sound wrong.- **Neither half of the autoencoder is bit-deterministic** (encoder 1.5 % relative, decoder 7e-3 max abs). Any A/B you run against this adapter has to be read as a multiple of those floors; absolute tolerances are meaningless.
---
## Training
| | ||---|---|| base model | `stabilityai/SAME-L` || target | `decoder` (encoder frozen) || rank / alpha | 16 / 16.0 || trainable | 5.63M params, 98 tensors (~1.30 % of the decoder) || checkpoint | step 2000 of a run configured for 8000, stopped at 4000 || precision | fp32 training, fp16 storage || hardware | single GB10 (DGX Spark), ~2.9 s/step at 10 s crops, under 10 GB |
```bashpython scripts/train_decoder_lora.py \ --model same-l --rank 16 --steps 8000 --lr 1e-4 \ --w_real 0.4 --w_drift 0.3 --w_dit 0.3 \ --lambda_cycle 10.0 --lambda_tonal 0.3 --lambda_patch 30 \ --patch_size 256 --crop_seconds 10 --seed 0 \ --dit_latent_dir out/dit_latents \ --data_dir /path/to/audio --eval_audio /path/to/holdout.wav \ --out_dir out/declora```
The objective is self-supervised β audio only, no captions, no paired data.Latents come from three buckets: real audio, drifted audio (`E(D(E(x)))` at depthβ₯ 1, targeted against the **original** audio so the decoder is asked to undoaccumulated drift), and latents sampled from the base DiT. The DiT bucket earnsits place because generated latents drift 15β18.5 % against real audio's 10.5 %,and that gap is in the base model rather than in any adapter.
Losses: multi-resolution log-STFT L1 (K-weighted, kept deliberately β thisdecoder over-generates HF, so removing the perceptual de-emphasis would push thewrong way), relative round-trip consistency `βE(D(z)) β zβ/βzβ` with the encoderfrozen, a **one-sided** HF tonality penalty (so legitimate cymbal ring andsibilance are never punished), and the patch-grid penalty described above. Nodiscriminator: adversarial training makes a decoder invent *more* detail, and thefailure mode of plain reconstruction losses is the direction this wants.
Full method, ablations and traps: [Decoder LoRAworkflow](https://github.com/Stability-AI/stable-audio-3/blob/main/docs/workflows/decoder-lora.md).
---
## Files
| file | what it is ||---|---|| `squeakfix_v3.safetensors` | the adapter β SAME-L decoder, rank 16, trained with `--lambda_patch 30` |
Provenance (base model, step, full recipe) is embedded in the file's`lora_config` metadata, so it identifies itself without this card.
The `v1` column in the tables above is an internal checkpoint trained on theidentical recipe with `--lambda_patch 0`. It is not published β it is reportedbecause "the patch penalty matters" is a claim that needs the control.
## Citation
The autoencoder this adapts: [SAME](https://arxiv.org/abs/2605.18613).123version https://git-lfs.github.com/spec/v1oid sha256:99942d64e822138fc67445d3c664f31c714ca62cf5d9a21b20ba33a41d9e99edsize 11278296README.mdAdded+253
squeakfix_v3.safetensorsAdded+3