anima
decoder
sorryhyun commited on
Commit
96a559b
·
verified ·
1 Parent(s): beb531f

Card: Use first, x2 section with samples; x2 preview moved to old/

Browse files
.gitattributes CHANGED
@@ -41,3 +41,11 @@ samples/mono_head.png filter=lfs diff=lfs merge=lfs -text
41
  samples/mono_head_crop.png filter=lfs diff=lfs merge=lfs -text
42
  samples/mono_vae.png filter=lfs diff=lfs merge=lfs -text
43
  samples/mono_vae_crop.png filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
41
  samples/mono_head_crop.png filter=lfs diff=lfs merge=lfs -text
42
  samples/mono_vae.png filter=lfs diff=lfs merge=lfs -text
43
  samples/mono_vae_crop.png filter=lfs diff=lfs merge=lfs -text
44
+ samples/x2_color_head.png filter=lfs diff=lfs merge=lfs -text
45
+ samples/x2_color_head_crop.png filter=lfs diff=lfs merge=lfs -text
46
+ samples/x2_color_vae.png filter=lfs diff=lfs merge=lfs -text
47
+ samples/x2_color_vae_crop.png filter=lfs diff=lfs merge=lfs -text
48
+ samples/x2_mono_head.png filter=lfs diff=lfs merge=lfs -text
49
+ 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
README.md CHANGED
@@ -18,14 +18,26 @@ writes RGB pixels directly, in place of the VAE decode. The head and its trainin
18
 
19
  | | |
20
  |---|---|
21
- | File | `anima_pixel_head.safetensors` (fp32, 95 MB; shape in the file's metadata) |
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, 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 LPIPS (weight 0.05); turbo point: VAE(x̂0) of the same forward, x̂0 = x_t − σ·v |
27
 
28
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  ## Compatibility
30
 
31
  Read the head only where it was trained:
@@ -36,8 +48,11 @@ Read the head only where it was trained:
36
  [anima-turbo-4step](https://huggingface.co/sorryhyun/anima-turbo-4step), Euler 4 steps,
37
  shift 3, CFG 1 (last-step σ 0.5). Trained on `anima_turbo_4step_v4_longer.safetensors`.
38
 
 
 
39
  The previous head is `old/anima_pixel_head.safetensors` (VAE(x̂0) target at every point, turbo
40
- point on that repo's `old/anima_turbo_4step.safetensors`).
 
41
 
42
  ## Benchmark
43
 
@@ -94,9 +109,35 @@ x 192–576, y 512–896.
94
  On the monochrome crop the VAE keeps the screentone dots on the shorts; the head renders them as
95
  flat grey (see Known limits).
96
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
97
  ## Held-out reads
98
 
99
- Held-out reads during training (dB, colour / mono):
100
 
101
  | decode point | colour | mono |
102
  |---|---|---|
@@ -112,21 +153,8 @@ Held-out reads during training (dB, colour / mono):
112
  dense hatching) come out about 1 – 2.5 levels darker than the VAE in linear light.
113
  The lowest per-image PSNRs are manga pages and sketches (turbo 28.7 – 30.9 dB).
114
  - Speed lines and footnote-size glyphs are slightly soft under zoom.
115
- - One trained head, one seed; no run spread.
116
-
117
- ## Use
118
-
119
- - ComfyUI: the [ComfyUI-Anima-PixelDecoder](https://github.com/sorryhyun/ComfyUI-Anima-PixelDecoder)
120
- node pack (ComfyUI Manager: "Anima Pixel Decoder"). Put this file in `models/pixel_heads/`,
121
- add **Anima Pixel Head Tap** on the MODEL before the KSampler (stock or Spectrum) and decode
122
- the sampler's LATENT with **Anima Pixel Decode** instead of VAE Decode. Run the DiT on the
123
- fp32 stream (Anima Adapter Loader, `stream = fp32`).
124
- - [anima_lora](https://github.com/sorryhyun/anima_lora): `inference.py --decoder pixel_head`
125
- (`make test PIXEL=1`, `make test-turbo PIXEL=1`); the module, loader and feature tap are in
126
- `library/anima/pixel_head.py`.
127
- - ×2 (test): `anima_pixel_head_x2_preview.safetensors` decodes and upscales 2× in one
128
- readout (Anima Pixel Decode `scale = 2`, `inference.py --pixel_scale 2`). A test file; it will
129
- be replaced.
130
 
131
  ## License
132
 
 
18
 
19
  | | |
20
  |---|---|
21
+ | Files | `anima_pixel_head.safetensors` (×1, fp32, 95 MB) and `anima_pixel_head_x2.safetensors` (×2, fp32, 101 MB); shape and scale in each file's metadata |
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 LPIPS (weight 0.05); turbo point: VAE(x̂0) of the same forward, x̂0 = x_t − σ·v |
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. Its `scale = auto`
35
+ decodes at the file's own scale: ×1 for `anima_pixel_head`, ×2 for `anima_pixel_head_x2`.
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
  ## Compatibility
42
 
43
  Read the head only where it was trained:
 
48
  [anima-turbo-4step](https://huggingface.co/sorryhyun/anima-turbo-4step), Euler 4 steps,
49
  shift 3, CFG 1 (last-step σ 0.5). Trained on `anima_turbo_4step_v4_longer.safetensors`.
50
 
51
+ The ×2 file was trained at the base points only; on the turbo it decodes with a warning.
52
+
53
  The previous head is `old/anima_pixel_head.safetensors` (VAE(x̂0) target at every point, turbo
54
+ point on that repo's `old/anima_turbo_4step.safetensors`); the ×2 preview is
55
+ `old/anima_pixel_head_x2_preview.safetensors`.
56
 
57
  ## Benchmark
58
 
 
109
  On the monochrome crop the VAE keeps the screentone dots on the shorts; the head renders them as
110
  flat grey (see Known limits).
111
 
112
+ ## ×2 output
113
+
114
+ `anima_pixel_head_x2.safetensors` decodes and upscales 2× in one readout: the ×1 head plus a
115
+ second 2× stage (pixel shuffle, 2 ConvNeXt blocks at width 256, linear to 8×8×3 per position), so
116
+ a 1024² render leaves the head at 2048². The file has no ×1 output and decodes at ×2 only.
117
+ Trained against real 2× images at the base points, with LPIPS, a tone term and a GAN term on
118
+ PE-Spatial features. Head time ~12 ms per image against ~3.2 s for VAE Decode → a ResShift ×2
119
+ upscaler.
120
+
121
+ Held-out against the real 2× image (one seed): 29.82 dB / LPIPS 0.158 on 12 test images,
122
+ 25.52 dB / LPIPS 0.145 on 5 text images.
123
+
124
+ Base DiT, Euler 28 steps, shift 3, CFG 4, seed 42, 1024×1024, the prompts of the samples above,
125
+ through anima_lora's `inference.py`; left VAE Decode (1024²), right the ×2 head (2048²). Crops:
126
+ left 384×384 of the VAE decode, bicubic to 768×768; right the same region of the ×2 output at
127
+ native resolution.
128
+
129
+ | | VAE Decode | ×2 head |
130
+ |---|---|---|
131
+ | colour | ![colour, VAE](samples/x2_color_vae.png) | ![colour, ×2 head](samples/x2_color_head.png) |
132
+ | crop | ![colour crop, VAE bicubic ×2](samples/x2_color_vae_crop.png) | ![colour crop, ×2 head](samples/x2_color_head_crop.png) |
133
+ | monochrome | ![mono, VAE](samples/x2_mono_vae.png) | ![mono, ×2 head](samples/x2_mono_head.png) |
134
+ | crop | ![mono crop, VAE bicubic ×2](samples/x2_mono_vae_crop.png) | ![mono crop, ×2 head](samples/x2_mono_head_crop.png) |
135
+
136
+ On the monochrome crop the ×2 head turns the screentone on the shorts into a wavy pattern.
137
+
138
  ## Held-out reads
139
 
140
+ Held-out reads during training, ×1 (dB, colour / mono):
141
 
142
  | decode point | colour | mono |
143
  |---|---|---|
 
153
  dense hatching) come out about 1 – 2.5 levels darker than the VAE in linear light.
154
  The lowest per-image PSNRs are manga pages and sketches (turbo 28.7 – 30.9 dB).
155
  - Speed lines and footnote-size glyphs are slightly soft under zoom.
156
+ - ×2: screentone comes out as a wavy pattern instead of dots (see the monochrome crop).
157
+ - One trained head per file, one seed; no run spread.
 
 
 
 
 
 
 
 
 
 
 
 
 
158
 
159
  ## License
160
 
anima_pixel_head_x2_preview.safetensors → old/anima_pixel_head_x2_preview.safetensors RENAMED
File without changes
samples/x2_color_head.png ADDED

Git LFS Details

  • SHA256: 380b165f0c8e126b0324db8a165716b7130de8d5f9a0f7b3505c631705ecfbd6
  • Pointer size: 132 Bytes
  • Size of remote file: 4.74 MB
samples/x2_color_head_crop.png ADDED

Git LFS Details

  • SHA256: 3e2d3396a2dbcd550cbe2a9e0952a54cdb6632dd7da61276f44150430ae90edd
  • Pointer size: 131 Bytes
  • Size of remote file: 709 kB
samples/x2_color_vae.png ADDED

Git LFS Details

  • SHA256: 0bf8e69ba765d7fab92107e4dbfd82ae42c5d9227be89ca796143f8bde3bfae1
  • Pointer size: 132 Bytes
  • Size of remote file: 1.08 MB
samples/x2_color_vae_crop.png ADDED

Git LFS Details

  • SHA256: f9505103feea90e39fb9f87d797b77109f48c089f78046cb4b826cf642fa4a3a
  • Pointer size: 131 Bytes
  • Size of remote file: 368 kB
samples/x2_mono_head.png ADDED

Git LFS Details

  • SHA256: dfd487ebc81c59c1573e6a1403e6d821426c40acf1afd81b99efa876ebb431cb
  • Pointer size: 132 Bytes
  • Size of remote file: 7.41 MB
samples/x2_mono_head_crop.png ADDED

Git LFS Details

  • SHA256: 37b37810688a82869c4e46156883507f9056b378d7f802018d35c35215ca54fe
  • Pointer size: 132 Bytes
  • Size of remote file: 1.19 MB
samples/x2_mono_vae.png ADDED

Git LFS Details

  • SHA256: d3cc89884959ac316287f798a011d22e49eab472e4806fd4b8af590f1cc3caf8
  • Pointer size: 132 Bytes
  • Size of remote file: 1.68 MB
samples/x2_mono_vae_crop.png ADDED

Git LFS Details

  • SHA256: a57170c763a32898a0673310fef82307384cd1af86cdc863ff7d75ea5da3f9e7
  • Pointer size: 131 Bytes
  • Size of remote file: 759 kB