shimbaaa commited on
Commit
617093a
·
verified ·
1 Parent(s): 790ee55

Dupe-R-IMG: merge DiT + T5 encoder + VAE (297.5M)

Browse files
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ supra2img.himg filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ library_name: transformers
4
+ pipeline_tag: text-to-image
5
+ tags:
6
+ - image
7
+ - text-to-image
8
+ - duper
9
+ - dit
10
+ - rectified-flow
11
+ ---
12
+
13
+ # Dupe-R-IMG
14
+
15
+ The **Supra2-IMG** denoiser, the **flan-t5-base** encoder and the **sd-vae-ft-mse** VAE
16
+ packed into one `model.safetensors`
17
+
18
+ | section | params | source | license |
19
+ |---|---|---|---|
20
+ | `dit.*` | 104,193,168 | [SupraLabs/Supra2-IMG](https://huggingface.co/SupraLabs/Supra2-IMG) | apache-2.0 |
21
+ | `text_encoder.*` | 109,628,544 | [google/flan-t5-base](https://huggingface.co/google/flan-t5-base) | apache-2.0 |
22
+ | `vae.*` | 83,653,863 | [stabilityai/sd-vae-ft-mse](https://huggingface.co/stabilityai/sd-vae-ft-mse) | mit |
23
+ | **total** | **297,475,575** | | |
24
+
25
+ ## What this is
26
+
27
+ A **repackaging, not a weight blend**. The DiT was trained against exactly these two
28
+ encoders, so averaging anything would break it. Every tensor is copied unmodified and
29
+ re-namespaced:
30
+
31
+ - `dit.*` — SupraDiT denoiser, 14 blocks, d_model 576, patch 2
32
+ - `text_encoder.*` — T5 encoder stack, `shared.weight` token embedding included
33
+ - `vae.*` — full AutoencoderKL
34
+
35
+ Not bundled: the T5 `decoder.*` stack (113M) and `lm_head.weight` (24.7M). Text-to-image
36
+ never runs the seq2seq half.
37
+
38
+ ## Files
39
+
40
+ | file | size | what |
41
+ |---|---|---|
42
+ | `model.safetensors` | ~567 MB | all 297,475,575 params, prefixed `dit.` / `text_encoder.` / `vae.` |
43
+ | `supra2img.himg` | supra2img converted to .himg ~417 MB | `mmap` `PROT_READ`, zero-copy load |
44
+ | `model_final_ema.pt` | ~416 MB | untouched upstream checkpoint (bf16) |
45
+ | `config.json` | | geometry, per-section param counts, component provenance |
46
+ | `vae_config.json` | | native `AutoencoderKL` config (separate name on purpose) |
47
+ | `tokenizer.json`, `spiece.model`, … | | flan-t5 tokenizer |
48
+
49
+ Prefer `.himg` when memory is tight: so a 417 MB model
50
+ costs no resident RAM. `model.safetensors` is the portable single-file form.
51
+
52
+ ## Precision
53
+
54
+ Stored `float16`, **compute `float32`** (upcast on load). Storage-only: a build comparing
55
+ the C core against a PyTorch reference from this same file still agrees at 1e-6, since
56
+ both read identical bytes. Only parity against the original upstream checkpoint moves
57
+ (~1e-3), which is not visible in a pixel. The `.himg` is exact float32 if you need bit
58
+ parity.
59
+
60
+ ## Specs
61
+
62
+ | | |
63
+ |---|---|
64
+ | resolution | 256x256 |
65
+ | latent | 4 x 32 x 32 |
66
+ | context | 128 tokens (flan-t5-base) |
67
+ | sampler | rectified flow, Euler (Heun supported) |
68
+ | default steps / cfg | 50 / 3.0 |
69
+ | latent scale | 0.18215 |
70
+
71
+ ## Usage
72
+
73
+ ```python
74
+ import json
75
+ from huggingface_hub import hf_hub_download
76
+ from safetensors import safe_open
77
+ from diffusers import AutoencoderKL
78
+
79
+ repo = "ShimbaLLM/Dupe-R-IMG"
80
+ dit_sd, te_sd, vae_sd = {}, {}, {}
81
+ with safe_open(hf_hub_download(repo, "model.safetensors"), framework="pt") as f:
82
+ for k in f.keys():
83
+ (dit_sd if k.startswith("dit.") else
84
+ te_sd if k.startswith("text_encoder.") else
85
+ vae_sd)[k.split('.', 1)[1]] = f.get_tensor(k).float()
86
+
87
+ vae = AutoencoderKL.from_config(
88
+ json.load(open(hf_hub_download(repo, "vae_config.json"))))
89
+ vae.load_state_dict(vae_sd)
90
+ ```
91
+
92
+ The T5 encoder stack and the SupraDiT module definitions are in `config.json` under
93
+ `components`, and in the notebook that produced this release.
94
+
95
+ ## Licenses
96
+
97
+ Bundled components keep their own licenses and carry independent provenance in
98
+ `config.json`: DiT apache-2.0 (SupraLabs), T5 encoder apache-2.0 (Google), VAE mit
99
+ (Stability AI). All three permit redistribution, individually and combined.
config.json ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "model_type": "duper_img",
3
+ "repo_id": "ShimbaLLM/Dupe-R-IMG",
4
+ "total_params": 297377143,
5
+ "n_tensors": 596,
6
+ "storage_dtype": "float16",
7
+ "compute_dtype": "float32",
8
+ "tensor_sections": [
9
+ "dit",
10
+ "text_encoder",
11
+ "vae"
12
+ ],
13
+ "section_params": {
14
+ "dit": 104094736,
15
+ "text_encoder": 109628544,
16
+ "vae": 83653863
17
+ },
18
+ "image_size": 256,
19
+ "latent_size": 32,
20
+ "context_length": 128,
21
+ "latent_scaling_factor": 0.18215,
22
+ "components": {
23
+ "dit": {
24
+ "_class_name": "SupraDiT",
25
+ "source": "SupraLabs/Supra2-IMG",
26
+ "license": "apache-2.0",
27
+ "params": 104094736,
28
+ "latent_ch": 4,
29
+ "latent_size": 32,
30
+ "patch": 2,
31
+ "d_model": 576,
32
+ "depth": 14,
33
+ "n_heads": 9,
34
+ "mlp_ratio": 4.0,
35
+ "ctx_dim": 768,
36
+ "max_ctx": 128,
37
+ "img_size": 256
38
+ },
39
+ "text_encoder": {
40
+ "_class_name": "T5EncoderModel",
41
+ "source": "google/flan-t5-base",
42
+ "license": "apache-2.0",
43
+ "params": 109628544,
44
+ "note": "encoder stack only; decoder not bundled",
45
+ "d_model": 768,
46
+ "num_layers": 12,
47
+ "num_heads": 12,
48
+ "d_ff": 2048,
49
+ "d_kv": 64,
50
+ "feed_forward_proj": "gated-gelu",
51
+ "vocab_size": 32128,
52
+ "n_positions": 512
53
+ },
54
+ "vae": {
55
+ "_class_name": "AutoencoderKL",
56
+ "source": "stabilityai/sd-vae-ft-mse",
57
+ "license": "mit",
58
+ "params": 83653863,
59
+ "in_channels": 3,
60
+ "out_channels": 3,
61
+ "latent_channels": 4,
62
+ "block_out_channels": [
63
+ 128,
64
+ 256,
65
+ 512,
66
+ 512
67
+ ],
68
+ "layers_per_block": 2,
69
+ "norm_num_groups": 32,
70
+ "act_fn": "silu",
71
+ "scaling_factor": 0.18215,
72
+ "sample_size": 256
73
+ },
74
+ "sampler": {
75
+ "type": "rectified_flow",
76
+ "time_range": [
77
+ 0.0,
78
+ 1.0
79
+ ],
80
+ "default_steps": 50,
81
+ "default_cfg_scale": 3.0,
82
+ "default_sampler": "euler",
83
+ "supports_heun": true
84
+ }
85
+ },
86
+ "notes": "Repackaging of Supra2-IMG + flan-t5-base (encoder) + sd-vae-ft-mse. Tensors copied unmodified under dit./text_encoder./vae. prefixes; upcast to float32 at load. Not a weight blend."
87
+ }
generation_config.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "decoder_start_token_id": 0,
4
+ "eos_token_id": 1,
5
+ "pad_token_id": 0,
6
+ "transformers_version": "4.27.0.dev0"
7
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a1eb3c6f441a6300590ff5eb79c9f00171c66dc43659e019221e35b8bb6e637e
3
+ size 594821830
model_final_ema.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e96aa0537e0fd120af82b3a606dd50c90ae079ac7aa97b38a8da4882daeeee48
3
+ size 416651529
special_tokens_map.json ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "additional_special_tokens": [
3
+ "<extra_id_0>",
4
+ "<extra_id_1>",
5
+ "<extra_id_2>",
6
+ "<extra_id_3>",
7
+ "<extra_id_4>",
8
+ "<extra_id_5>",
9
+ "<extra_id_6>",
10
+ "<extra_id_7>",
11
+ "<extra_id_8>",
12
+ "<extra_id_9>",
13
+ "<extra_id_10>",
14
+ "<extra_id_11>",
15
+ "<extra_id_12>",
16
+ "<extra_id_13>",
17
+ "<extra_id_14>",
18
+ "<extra_id_15>",
19
+ "<extra_id_16>",
20
+ "<extra_id_17>",
21
+ "<extra_id_18>",
22
+ "<extra_id_19>",
23
+ "<extra_id_20>",
24
+ "<extra_id_21>",
25
+ "<extra_id_22>",
26
+ "<extra_id_23>",
27
+ "<extra_id_24>",
28
+ "<extra_id_25>",
29
+ "<extra_id_26>",
30
+ "<extra_id_27>",
31
+ "<extra_id_28>",
32
+ "<extra_id_29>",
33
+ "<extra_id_30>",
34
+ "<extra_id_31>",
35
+ "<extra_id_32>",
36
+ "<extra_id_33>",
37
+ "<extra_id_34>",
38
+ "<extra_id_35>",
39
+ "<extra_id_36>",
40
+ "<extra_id_37>",
41
+ "<extra_id_38>",
42
+ "<extra_id_39>",
43
+ "<extra_id_40>",
44
+ "<extra_id_41>",
45
+ "<extra_id_42>",
46
+ "<extra_id_43>",
47
+ "<extra_id_44>",
48
+ "<extra_id_45>",
49
+ "<extra_id_46>",
50
+ "<extra_id_47>",
51
+ "<extra_id_48>",
52
+ "<extra_id_49>",
53
+ "<extra_id_50>",
54
+ "<extra_id_51>",
55
+ "<extra_id_52>",
56
+ "<extra_id_53>",
57
+ "<extra_id_54>",
58
+ "<extra_id_55>",
59
+ "<extra_id_56>",
60
+ "<extra_id_57>",
61
+ "<extra_id_58>",
62
+ "<extra_id_59>",
63
+ "<extra_id_60>",
64
+ "<extra_id_61>",
65
+ "<extra_id_62>",
66
+ "<extra_id_63>",
67
+ "<extra_id_64>",
68
+ "<extra_id_65>",
69
+ "<extra_id_66>",
70
+ "<extra_id_67>",
71
+ "<extra_id_68>",
72
+ "<extra_id_69>",
73
+ "<extra_id_70>",
74
+ "<extra_id_71>",
75
+ "<extra_id_72>",
76
+ "<extra_id_73>",
77
+ "<extra_id_74>",
78
+ "<extra_id_75>",
79
+ "<extra_id_76>",
80
+ "<extra_id_77>",
81
+ "<extra_id_78>",
82
+ "<extra_id_79>",
83
+ "<extra_id_80>",
84
+ "<extra_id_81>",
85
+ "<extra_id_82>",
86
+ "<extra_id_83>",
87
+ "<extra_id_84>",
88
+ "<extra_id_85>",
89
+ "<extra_id_86>",
90
+ "<extra_id_87>",
91
+ "<extra_id_88>",
92
+ "<extra_id_89>",
93
+ "<extra_id_90>",
94
+ "<extra_id_91>",
95
+ "<extra_id_92>",
96
+ "<extra_id_93>",
97
+ "<extra_id_94>",
98
+ "<extra_id_95>",
99
+ "<extra_id_96>",
100
+ "<extra_id_97>",
101
+ "<extra_id_98>",
102
+ "<extra_id_99>"
103
+ ],
104
+ "eos_token": "</s>",
105
+ "pad_token": "<pad>",
106
+ "unk_token": "<unk>"
107
+ }
spiece.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d60acb128cf7b7f2536e8f38a5b18a05535c9e14c7a355904270e15b0945ea86
3
+ size 791656
supra2img.himg ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:96063c5be9980786da79dc5b041aa279fa56a325e92f386e4a9cf91c51fc87a5
3
+ size 416673792
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "additional_special_tokens": [
3
+ "<extra_id_0>",
4
+ "<extra_id_1>",
5
+ "<extra_id_2>",
6
+ "<extra_id_3>",
7
+ "<extra_id_4>",
8
+ "<extra_id_5>",
9
+ "<extra_id_6>",
10
+ "<extra_id_7>",
11
+ "<extra_id_8>",
12
+ "<extra_id_9>",
13
+ "<extra_id_10>",
14
+ "<extra_id_11>",
15
+ "<extra_id_12>",
16
+ "<extra_id_13>",
17
+ "<extra_id_14>",
18
+ "<extra_id_15>",
19
+ "<extra_id_16>",
20
+ "<extra_id_17>",
21
+ "<extra_id_18>",
22
+ "<extra_id_19>",
23
+ "<extra_id_20>",
24
+ "<extra_id_21>",
25
+ "<extra_id_22>",
26
+ "<extra_id_23>",
27
+ "<extra_id_24>",
28
+ "<extra_id_25>",
29
+ "<extra_id_26>",
30
+ "<extra_id_27>",
31
+ "<extra_id_28>",
32
+ "<extra_id_29>",
33
+ "<extra_id_30>",
34
+ "<extra_id_31>",
35
+ "<extra_id_32>",
36
+ "<extra_id_33>",
37
+ "<extra_id_34>",
38
+ "<extra_id_35>",
39
+ "<extra_id_36>",
40
+ "<extra_id_37>",
41
+ "<extra_id_38>",
42
+ "<extra_id_39>",
43
+ "<extra_id_40>",
44
+ "<extra_id_41>",
45
+ "<extra_id_42>",
46
+ "<extra_id_43>",
47
+ "<extra_id_44>",
48
+ "<extra_id_45>",
49
+ "<extra_id_46>",
50
+ "<extra_id_47>",
51
+ "<extra_id_48>",
52
+ "<extra_id_49>",
53
+ "<extra_id_50>",
54
+ "<extra_id_51>",
55
+ "<extra_id_52>",
56
+ "<extra_id_53>",
57
+ "<extra_id_54>",
58
+ "<extra_id_55>",
59
+ "<extra_id_56>",
60
+ "<extra_id_57>",
61
+ "<extra_id_58>",
62
+ "<extra_id_59>",
63
+ "<extra_id_60>",
64
+ "<extra_id_61>",
65
+ "<extra_id_62>",
66
+ "<extra_id_63>",
67
+ "<extra_id_64>",
68
+ "<extra_id_65>",
69
+ "<extra_id_66>",
70
+ "<extra_id_67>",
71
+ "<extra_id_68>",
72
+ "<extra_id_69>",
73
+ "<extra_id_70>",
74
+ "<extra_id_71>",
75
+ "<extra_id_72>",
76
+ "<extra_id_73>",
77
+ "<extra_id_74>",
78
+ "<extra_id_75>",
79
+ "<extra_id_76>",
80
+ "<extra_id_77>",
81
+ "<extra_id_78>",
82
+ "<extra_id_79>",
83
+ "<extra_id_80>",
84
+ "<extra_id_81>",
85
+ "<extra_id_82>",
86
+ "<extra_id_83>",
87
+ "<extra_id_84>",
88
+ "<extra_id_85>",
89
+ "<extra_id_86>",
90
+ "<extra_id_87>",
91
+ "<extra_id_88>",
92
+ "<extra_id_89>",
93
+ "<extra_id_90>",
94
+ "<extra_id_91>",
95
+ "<extra_id_92>",
96
+ "<extra_id_93>",
97
+ "<extra_id_94>",
98
+ "<extra_id_95>",
99
+ "<extra_id_96>",
100
+ "<extra_id_97>",
101
+ "<extra_id_98>",
102
+ "<extra_id_99>"
103
+ ],
104
+ "eos_token": "</s>",
105
+ "extra_ids": 100,
106
+ "model_max_length": 512,
107
+ "name_or_path": "google/t5-v1_1-base",
108
+ "pad_token": "<pad>",
109
+ "sp_model_kwargs": {},
110
+ "special_tokens_map_file": "/home/younes_huggingface_co/.cache/huggingface/hub/models--google--t5-v1_1-base/snapshots/650d7745bf1e502d6949b22cc19155cd656d3d4e/special_tokens_map.json",
111
+ "tokenizer_class": "T5Tokenizer",
112
+ "unk_token": "<unk>"
113
+ }
vae_config.json ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_class_name": "AutoencoderKL",
3
+ "_diffusers_version": "0.4.2",
4
+ "act_fn": "silu",
5
+ "block_out_channels": [
6
+ 128,
7
+ 256,
8
+ 512,
9
+ 512
10
+ ],
11
+ "down_block_types": [
12
+ "DownEncoderBlock2D",
13
+ "DownEncoderBlock2D",
14
+ "DownEncoderBlock2D",
15
+ "DownEncoderBlock2D"
16
+ ],
17
+ "in_channels": 3,
18
+ "latent_channels": 4,
19
+ "layers_per_block": 2,
20
+ "norm_num_groups": 32,
21
+ "out_channels": 3,
22
+ "sample_size": 256,
23
+ "up_block_types": [
24
+ "UpDecoderBlock2D",
25
+ "UpDecoderBlock2D",
26
+ "UpDecoderBlock2D",
27
+ "UpDecoderBlock2D"
28
+ ]
29
+ }