Repository navigation
v4
Pre-release
Pre-release
What's New in V4
V4 is a complete rebuild of the watermark-dissolving pipeline, adding multi-model support, a richer codebook, and a new all-in-one attack that defeats the SynthID detector on both gemini-3.1-flash-image-preview and nano-banana-pro-preview after six rounds of iterative adversarial refinement.
The Breakthrough: Round-06 All-in-One Attack ✓
Previous rounds (spectral subtraction, blog-guided bin targeting, denoise-residual phase, VAE re-generation) all failed. Round 06 works by stacking every SynthID failure mode the Gemini app itself documents into a single 7-stage pipeline:
- VAE round-trip (Stable Diffusion
sd-vae-ft-mse) — projects the image off the natural-image manifold the SynthID decoder was never trained against (Gowal et al. 2026 §6.1) - Elastic deformation — smooth low-frequency random warp field that fragments the watermark's spatial phase consensus, simulating the "collage effect" Gemini's own help text identifies as a detection failure
- Global geometric combo — rotation + zoom + shift in one affine warp
- Resize-squeeze — AREA downsample → LANCZOS upsample, erases sub-pixel watermark info
- Color-contrast nudge — brightness / saturation / hue micro-shift
- Residual-phase FFT subtraction — blog-universal + codebook-harvested carrier bins
- JPEG chain + luma noise + bilateral filter
Two presets: final (balanced) and nuke (maximum strength). Output is visually indistinguishable from the original.
New: SpectralCodebookV4
- Multi-model: separate profiles for
gemini-3.1-flash-image-previewandnano-banana-pro-preview - Multi-color consensus: 6 solid-color backgrounds (black, white, blue, green, red, gray) per model per resolution — only bins with phase-locked across all colors are treated as carriers
- 7 resolutions × 2 models = 14 profiles, covering all common Gemini output sizes
- Format v5: LZMA-compressed, int8 phase, uint8 mag/cw, sparse-zeroed below the 0.55 coherence threshold — 221 MB → 24 MB (89% reduction, lossless for the bypass)
⬇️ Download
spectral_codebook_v4.npzfrom the release assets and place it inartifacts/.
New Files
| File | Purpose |
|---|---|
src/extraction/synthid_bypass_v4.py |
Core codebook + all bypass methods |
src/extraction/vae_regen.py |
SD-VAE re-generation stage (MPS / CUDA / CPU) |
scripts/build_codebook_v4.py |
Build a codebook from the hierarchical dataset |
scripts/dissolve_batch.py |
Run final / nuke presets over a folder |
scripts/calibrate_from_feedback.py |
Update carrier weights from detection feedback |
Quickstart
pip install torch diffusers safetensors accelerate opencv-python numpy scipy
python scripts/dissolve_batch.py \
--input ./watermarked/ \
--output ./cleaned/ \
--codebook artifacts/spectral_codebook_v4.npz \
--model gemini-3.1-flash-image-preview \
--strengths final nuke