Card: Use first, x2 section with samples; x2 preview moved to old/
Browse files- .gitattributes +8 -0
- README.md +47 -19
- anima_pixel_head_x2_preview.safetensors → old/anima_pixel_head_x2_preview.safetensors +0 -0
- samples/x2_color_head.png +3 -0
- samples/x2_color_head_crop.png +3 -0
- samples/x2_color_vae.png +3 -0
- samples/x2_color_vae_crop.png +3 -0
- samples/x2_mono_head.png +3 -0
- samples/x2_mono_head_crop.png +3 -0
- samples/x2_mono_vae.png +3 -0
- samples/x2_mono_vae_crop.png +3 -0
.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 |
-
|
|
| 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 |
-
-
|
| 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 |  |  |
|
| 132 |
+
| crop |  |  |
|
| 133 |
+
| monochrome |  |  |
|
| 134 |
+
| crop |  |  |
|
| 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
|
samples/x2_color_head_crop.png
ADDED
|
|
Git LFS Details
|
samples/x2_color_vae.png
ADDED
|
|
Git LFS Details
|
samples/x2_color_vae_crop.png
ADDED
|
|
Git LFS Details
|
samples/x2_mono_head.png
ADDED
|
|
Git LFS Details
|
samples/x2_mono_head_crop.png
ADDED
|
|
Git LFS Details
|
samples/x2_mono_vae.png
ADDED
|
|
Git LFS Details
|
samples/x2_mono_vae_crop.png
ADDED
|
|
Git LFS Details
|