x1/ x2/ layout; x1/anima_pixel_decoder_base: x1dll_1123_0821 (DINOv3 term)
Browse files
.gitattributes
CHANGED
|
@@ -50,3 +50,4 @@ samples/x2_mono_head_crop.png filter=lfs diff=lfs merge=lfs -text
|
|
| 50 |
samples/x2_mono_vae.png filter=lfs diff=lfs merge=lfs -text
|
| 51 |
samples/x2_mono_vae_crop.png filter=lfs diff=lfs merge=lfs -text
|
| 52 |
samples/sharp_compare.png filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 50 |
samples/x2_mono_vae.png filter=lfs diff=lfs merge=lfs -text
|
| 51 |
samples/x2_mono_vae_crop.png filter=lfs diff=lfs merge=lfs -text
|
| 52 |
samples/sharp_compare.png filter=lfs diff=lfs merge=lfs -text
|
| 53 |
+
samples/base_compare.png filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
|
@@ -18,40 +18,84 @@ writes RGB pixels directly, in place of the VAE decode. The head and its trainin
|
|
| 18 |
|
| 19 |
| | |
|
| 20 |
|---|---|
|
| 21 |
-
| Files | `
|
| 22 |
| Input | the input of the DiT's `final_layer.linear` (2048-dim per token, after the adaLN-modulated LayerNorm) |
|
| 23 |
| Output | a 16×16 RGB patch per token (×2 file: 32×32), in [-1, 1] |
|
| 24 |
| Architecture | linear projection of the feature + linear embedding of the x_t patch, 2 ConvNeXt, one 2× pixel-shuffle upsample, 1 ConvNeXt, linear to 8×8×3 |
|
| 25 |
| DiT | `anima-base-v1.0` (28 blocks) |
|
| 26 |
-
| Target | base points: the original image, with
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
|
| 28 |
|
| 29 |
## Use
|
| 30 |
|
| 31 |
- ComfyUI: the [ComfyUI-Anima-PixelDecoder](https://github.com/sorryhyun/ComfyUI-Anima-PixelDecoder)
|
| 32 |
-
node pack (ComfyUI Manager: "Anima Pixel Decoder"). Put the file in `models/pixel_heads/`,
|
| 33 |
add **Anima Pixel Head Tap** on the MODEL before the KSampler (stock or Spectrum) and decode
|
| 34 |
the sampler's LATENT with **Anima Pixel Decode** instead of VAE Decode. The file decides the
|
| 35 |
-
scale: ×1 for
|
| 36 |
Run the DiT on the fp32 stream (Anima Adapter Loader, `stream = fp32`).
|
| 37 |
- [anima_lora](https://github.com/sorryhyun/anima_lora): `inference.py --decoder pixel_head`
|
| 38 |
(`make test PIXEL=1`, `make test-turbo PIXEL=1`; ×2: `make test PIXEL=1 PIXEL_SCALE=2`); the
|
| 39 |
-
module, loader and feature tap are in `library/anima/pixel_head.py`.
|
| 40 |
-
`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
|
| 42 |
-
## Sharp
|
| 43 |
|
| 44 |
-
`
|
| 45 |
for crisper foliage, small detail and edges. It invents that detail: it is further from the VAE
|
| 46 |
decode pixel by pixel (base 28 steps, 32 renders: colour 32.57 dB against 33.36 for
|
| 47 |
-
`
|
| 48 |
screentone can turn into a coarse woven pattern with colour noise. For manga and screentone,
|
| 49 |
compare both files.
|
| 50 |
|
| 51 |
Base DiT, Euler 28 steps, shift 3, CFG 4, seed 0, the same latent in each row; 384×384 crops at
|
| 52 |
native resolution.
|
| 53 |
|
| 54 |
-
![VAE Decode,
|
| 55 |
|
| 56 |
The GAN term was trained at the base points only; the turbo point kept its regression loss.
|
| 57 |
|
|
@@ -70,8 +114,8 @@ The ×2 file was trained at the base points only; on the turbo it decodes with a
|
|
| 70 |
|
| 71 |
## Benchmark
|
| 72 |
|
| 73 |
-
The benchmarks, samples and held-out reads below were measured on
|
| 74 |
-
(
|
| 75 |
|
| 76 |
### In ComfyUI
|
| 77 |
|
|
@@ -125,7 +169,7 @@ flat grey (see Known limits).
|
|
| 125 |
|
| 126 |
## ×2 output
|
| 127 |
|
| 128 |
-
`anima_pixel_head_x2.safetensors` decodes and upscales 2× in one readout: the ×1 head plus a
|
| 129 |
second 2× stage (pixel shuffle, 2 ConvNeXt blocks at width 256, linear to 8×8×3 per position), so
|
| 130 |
a 1024² render leaves the head at 2048².
|
| 131 |
|
|
@@ -148,7 +192,7 @@ On the monochrome crop the ×2 head turns the screentone on the shorts into a wa
|
|
| 148 |
|
| 149 |
## Held-out reads
|
| 150 |
|
| 151 |
-
Held-out reads during training, ×1 (dB, colour / mono):
|
| 152 |
|
| 153 |
| decode point | colour | mono |
|
| 154 |
|---|---|---|
|
|
@@ -160,10 +204,10 @@ Held-out reads during training, ×1 (dB, colour / mono):
|
|
| 160 |
|
| 161 |
## Known limits
|
| 162 |
|
| 163 |
-
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
-
|
| 167 |
- ×2: screentone comes out as a wavy pattern instead of dots (see the monochrome crop).
|
| 168 |
- One trained head per file, one seed; no run spread.
|
| 169 |
|
|
|
|
| 18 |
|
| 19 |
| | |
|
| 20 |
|---|---|
|
| 21 |
+
| Files | `x1/anima_pixel_decoder_base.safetensors` (×1, the default, fp32, 95 MB); `x2/anima_pixel_head_x2.safetensors` (×2, fp32, 101 MB); earlier files below |
|
| 22 |
| Input | the input of the DiT's `final_layer.linear` (2048-dim per token, after the adaLN-modulated LayerNorm) |
|
| 23 |
| Output | a 16×16 RGB patch per token (×2 file: 32×32), in [-1, 1] |
|
| 24 |
| Architecture | linear projection of the feature + linear embedding of the x_t patch, 2 ConvNeXt, one 2× pixel-shuffle upsample, 1 ConvNeXt, linear to 8×8×3 |
|
| 25 |
| DiT | `anima-base-v1.0` (28 blocks) |
|
| 26 |
+
| Target | base points: the original image, with a DINOv3 ViT-S tile term; turbo point: VAE(x̂0) of the same forward, x̂0 = x_t − σ·v |
|
| 27 |
+
|
| 28 |
+
## Files
|
| 29 |
+
|
| 30 |
+
| path | output | what it is |
|
| 31 |
+
|---|---|---|
|
| 32 |
+
| `x1/anima_pixel_decoder_base.safetensors` | ×1 | the current head (2026-11-23), trained with a DINOv3 feature term |
|
| 33 |
+
| `x1/anima_pixel_head_old.safetensors` | ×1 | the previous head (LPIPS term), formerly `anima_pixel_head.safetensors` |
|
| 34 |
+
| `x1/anima_pixel_head_sharp_old.safetensors` | ×1 | an earlier ×1 head with a GAN finish, formerly `anima_pixel_head_sharp.safetensors` |
|
| 35 |
+
| `x2/anima_pixel_head_x2.safetensors` | ×2 | decode + 2× upscale in one readout |
|
| 36 |
+
| `x2/anima_pixel_head_x2_v2.safetensors` | ×2 | a ×2 GAN finish on a later ×1 base (run `x2llgf512_1122_2209`) |
|
| 37 |
+
| `multi/` | | reserved |
|
| 38 |
+
|
| 39 |
+
Files moved into `x1/` and `x2/` on 2026-11-23; links to the old root paths no longer resolve.
|
| 40 |
|
| 41 |
|
| 42 |
## Use
|
| 43 |
|
| 44 |
- ComfyUI: the [ComfyUI-Anima-PixelDecoder](https://github.com/sorryhyun/ComfyUI-Anima-PixelDecoder)
|
| 45 |
+
node pack (ComfyUI Manager: "Anima Pixel Decoder"). Put the file (no folder) in `models/pixel_heads/`,
|
| 46 |
add **Anima Pixel Head Tap** on the MODEL before the KSampler (stock or Spectrum) and decode
|
| 47 |
the sampler's LATENT with **Anima Pixel Decode** instead of VAE Decode. The file decides the
|
| 48 |
+
scale: ×1 for the `x1/` files, ×2 for the `x2/` files (node 0.3.1 or later).
|
| 49 |
Run the DiT on the fp32 stream (Anima Adapter Loader, `stream = fp32`).
|
| 50 |
- [anima_lora](https://github.com/sorryhyun/anima_lora): `inference.py --decoder pixel_head`
|
| 51 |
(`make test PIXEL=1`, `make test-turbo PIXEL=1`; ×2: `make test PIXEL=1 PIXEL_SCALE=2`); the
|
| 52 |
+
module, loader and feature tap are in `library/anima/pixel_head.py`. It fetches
|
| 53 |
+
`x1/anima_pixel_decoder_base` (and `x2/anima_pixel_head_x2` for ×2) on first use; any other
|
| 54 |
+
file: `make test PIXEL=1 PIXEL_HEAD=<path>`.
|
| 55 |
+
|
| 56 |
+
## Base
|
| 57 |
+
|
| 58 |
+
`x1/anima_pixel_decoder_base.safetensors` replaces the LPIPS term of the previous head with a
|
| 59 |
+
DINOv3 ViT-S/16 term on image tiles (12,000 rollouts). Screentone keeps its dot pattern and
|
| 60 |
+
hatching keeps its strokes, where earlier heads smoothed them; the cost is about 0.2 dB of
|
| 61 |
+
PSNR at the base points.
|
| 62 |
+
|
| 63 |
+
Base DiT, Euler 28 steps, shift 3, CFG 4, seed 0, the same latent in each row; 768×768 crops at
|
| 64 |
+
native resolution.
|
| 65 |
+
|
| 66 |
+

|
| 67 |
+
|
| 68 |
+
Held-out images against the original, at the decode points (dB / DINO distance ×1e-3, lower is
|
| 69 |
+
closer). `VAE(x̂0)` decodes the same step's x̂0 with the VAE, the comparison at equal input:
|
| 70 |
+
|
| 71 |
+
| point | set | head | VAE(x̂0) |
|
| 72 |
+
|---|---|---|---|
|
| 73 |
+
| base, σ 0.058 (50 steps) | test (30) | 34.00 / 0.109 | 35.10 / 0.136 |
|
| 74 |
+
| | text (8) | 29.00 / 0.085 | 30.27 / 0.083 |
|
| 75 |
+
| | manga (10) | 26.23 / 0.128 | 26.95 / 0.151 |
|
| 76 |
+
| base, σ 0.136 (20 steps) | test | 31.18 / 0.159 | 31.32 / 0.204 |
|
| 77 |
+
| | text | 26.34 / 0.127 | 26.41 / 0.139 |
|
| 78 |
+
| | manga | 24.02 / 0.178 | 23.93 / 0.210 |
|
| 79 |
+
| turbo, σ 0.5 | test | 22.84 / 0.492 | 22.73 / 0.486 |
|
| 80 |
+
| | text | 18.35 / 0.470 | 18.12 / 0.459 |
|
| 81 |
+
| | manga | 17.41 / 0.527 | 17.22 / 0.522 |
|
| 82 |
+
|
| 83 |
+
Against the same recipe trained with the LPIPS term (not published) on the same images, the
|
| 84 |
+
DINO distance is 12 – 34 % lower at the base points and unchanged at the turbo point.
|
| 85 |
|
| 86 |
+
## Sharp (old)
|
| 87 |
|
| 88 |
+
`x1/anima_pixel_head_sharp_old.safetensors` is an earlier ×1 head finished with a GAN term on PE-Spatial features,
|
| 89 |
for crisper foliage, small detail and edges. It invents that detail: it is further from the VAE
|
| 90 |
decode pixel by pixel (base 28 steps, 32 renders: colour 32.57 dB against 33.36 for
|
| 91 |
+
`anima_pixel_head_old`, mono 23.75 against 25.12), dense hatching breaks into short strokes, and dark
|
| 92 |
screentone can turn into a coarse woven pattern with colour noise. For manga and screentone,
|
| 93 |
compare both files.
|
| 94 |
|
| 95 |
Base DiT, Euler 28 steps, shift 3, CFG 4, seed 0, the same latent in each row; 384×384 crops at
|
| 96 |
native resolution.
|
| 97 |
|
| 98 |
+

|
| 99 |
|
| 100 |
The GAN term was trained at the base points only; the turbo point kept its regression loss.
|
| 101 |
|
|
|
|
| 114 |
|
| 115 |
## Benchmark
|
| 116 |
|
| 117 |
+
The benchmarks, samples and held-out reads below were measured on an earlier ×1 head of the
|
| 118 |
+
same architecture (no longer published). Decode time and VRAM do not depend on the weights.
|
| 119 |
|
| 120 |
### In ComfyUI
|
| 121 |
|
|
|
|
| 169 |
|
| 170 |
## ×2 output
|
| 171 |
|
| 172 |
+
`x2/anima_pixel_head_x2.safetensors` decodes and upscales 2× in one readout: the ×1 head plus a
|
| 173 |
second 2× stage (pixel shuffle, 2 ConvNeXt blocks at width 256, linear to 8×8×3 per position), so
|
| 174 |
a 1024² render leaves the head at 2048².
|
| 175 |
|
|
|
|
| 192 |
|
| 193 |
## Held-out reads
|
| 194 |
|
| 195 |
+
Held-out reads during training, earlier ×1 head (dB, colour / mono):
|
| 196 |
|
| 197 |
| decode point | colour | mono |
|
| 198 |
|---|---|---|
|
|
|
|
| 204 |
|
| 205 |
## Known limits
|
| 206 |
|
| 207 |
+
- Earlier ×1 heads (`_old`): screentone dots are smoothed into soft grey shading; textured
|
| 208 |
+
regions come out about 1 – 2.5 levels darker than the VAE in linear light; speed lines and
|
| 209 |
+
footnote-size glyphs are slightly soft under zoom.
|
| 210 |
+
- The lowest per-image PSNRs are manga pages and sketches.
|
| 211 |
- ×2: screentone comes out as a wavy pattern instead of dots (see the monochrome crop).
|
| 212 |
- One trained head per file, one seed; no run spread.
|
| 213 |
|
samples/base_compare.png
ADDED
|
|
Git LFS Details
|
x1/anima_pixel_decoder_base.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c136b269cd56cfdf4c840bfda36ff5170f0557114f43e5baad39be378245359a
|
| 3 |
+
size 99442360
|
x1/anima_pixel_head_old.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2b9d24cfb84a38aa9c764f21ed47496f6dd2ccb2ceff063f467ed3d1a7f4a5a2
|
| 3 |
+
size 99442192
|
x1/anima_pixel_head_sharp_old.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7e263cc6a3c9e51877f8ed20072da2aa3b509e90939dc7bca6a47a35498824bb
|
| 3 |
+
size 99442288
|
x2/anima_pixel_head_x2.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0f99a4e789a7eb0344d5c7cef96197debd2e60b556659fb098514849597dd7b1
|
| 3 |
+
size 105582272
|
x2/anima_pixel_head_x2_v2.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f36fa8dee602f50ed071262ae0b79d634b0848dfe7a935e05e7fe085e6162d7a
|
| 3 |
+
size 105582200
|