jegly commited on
Commit
4a0d16e
·
verified ·
1 Parent(s): 4a78daa

Upload 17 files

Browse files
README.md CHANGED
@@ -1,3 +1,107 @@
1
  ---
2
- license: bsd-3-clause
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ license: bsd-3-clause-clear
3
+ base_model: Qualcomm-AI-Research/Neodragon
4
+ tags:
5
+ - text-to-video
6
+ - litert
7
+ - tflite
8
+ - on-device
9
+ - android
10
+ library_name: litert
11
  ---
12
+
13
+ # Neodragon — LiteRT (.tflite) conversions for on-device text-to-video
14
+
15
+ LiteRT conversions of [Qualcomm-AI-Research/Neodragon](https://huggingface.co/Qualcomm-AI-Research/Neodragon),
16
+ prepared for [Box](https://github.com/jegly/Box) — an open-source, fully offline
17
+ on-device AI app for Android.
18
+
19
+ These are **converted artifacts only**. The models, research and original weights
20
+ are Qualcomm AI Research's work; see the
21
+ [upstream repo](https://huggingface.co/Qualcomm-AI-Research/Neodragon) and
22
+ [paper](https://qualcomm-ai-research.github.io/neodragon).
23
+
24
+ Generates a 320×512 clip entirely on-device — no network, no server, no account.
25
+
26
+ ## Licence — please read before use
27
+
28
+ The weights are released by Qualcomm under **two** licences, and both carry over
29
+ to these conversions:
30
+
31
+ 1. **[BSD 3-Clause Clear](https://spdx.org/licenses/BSD-3-Clause-Clear.html)** —
32
+ permits redistribution and derivative works (a conversion is a derivative)
33
+ with notices retained. Note the "Clear" variant grants **no patent licence**.
34
+ 2. **[Qualcomm Responsible AI License](https://www.qualcomm.com/site/responsible-ai-license)** —
35
+ adds use restrictions. It is not a grant licence; it sits on top of the BSD
36
+ grant and **flows down to you**. Prohibited uses include military use,
37
+ criminal/predictive-policing applications, social scoring, biometric
38
+ categorisation, emotion recognition in workplaces or education, and
39
+ distributing generated content without disclosing that it is machine
40
+ generated. Read the full text before using these files.
41
+
42
+ Box surfaces these restrictions in a consent screen before download and marks
43
+ generated output as AI-generated.
44
+
45
+ ## What's here
46
+
47
+ Fixed-shape LiteRT graphs. Filenames are deliberately **flat** — Box's downloader
48
+ flattens remote paths into a single directory.
49
+
50
+ ### Video pipeline (picture → video)
51
+ | file | size | shape |
52
+ |---|---|---|
53
+ | `dt5_text_encoder.tflite` | 495 MB | `(1,128)` ids + mask → `(1,128,4096)` |
54
+ | `context_adapter_dynamic_int8.tflite` | 124 MB | `(1,128,4096)` → `(1,128,1536)` |
55
+ | `clip_l_text_encoder.tflite` | 472 MB | `(1,77)` → pooled 768 |
56
+ | `clip_g_text_encoder_int8.tflite` | 670 MB | `(1,77)` → pooled 1280 |
57
+ | `dit_stage0_10x16_int4.tflite` | 816 MB | pyramid stage 0 |
58
+ | `dit_stage1_20x32_int4.tflite` | 817 MB | pyramid stage 1 |
59
+ | `dit_stage2_40x64_int4.tflite` | 822 MB | pyramid stage 2 |
60
+ | `causal_video_vae_encoder_320x512.tflite` | 419 MB | `(1,3,1,320,512)` → `(1,16,1,40,64)` |
61
+ | `causal_video_vae_decoder.tflite` | 38 MB | `(1,16,2,40,64)` → `(1,3,9,320,512)` |
62
+
63
+ The three DiT graphs are the same 1.5B weights at three input resolutions; the
64
+ pipeline calls one per pyramid stage. Each accepts **exactly two** conditioning
65
+ latents, which is what limits this set to 9-frame clips.
66
+
67
+ ### First-frame pipeline (text → picture, SSD1B at 640×1024)
68
+ | file | size | shape |
69
+ |---|---|---|
70
+ | `ssd_1b_clip_l.tflite` | 443 MB | `(1,77)` → `(1,77,768)` `hidden_states[-2]` |
71
+ | `ssd_1b_clip_g.tflite` | 2.65 GB | `(1,77)` → `(1,1280)` + `(1,77,1280)` |
72
+ | `ssd_1b_unet_640x1024.tflite` | 5.07 GB | `(1,4,80,128)` + t + ehs + text_embeds + time_ids |
73
+ | `ssd_1b_vae_decoder_640x1024.tflite` | 189 MB | `(1,4,80,128)` → `(1,3,640,1024)` |
74
+
75
+ ### Tokenizer assets
76
+ | file | note |
77
+ |---|---|
78
+ | `clip_vocab.json`, `clip_merges.txt` | CLIP BPE, shared by all four CLIP encoders |
79
+ | `t5_spiece.model` | DT5 unigram SentencePiece |
80
+
81
+ `clip_merges.txt` retains its `#version: 0.2` header line — **skip it when
82
+ loading**, or every merge rank shifts by one and tokenization silently corrupts.
83
+
84
+ ## Notes for anyone reusing these
85
+
86
+ - **CPU only.** The LiteRT GPU delegate supports at most rank-4 tensors, and
87
+ Neodragon's latents are 5D `(b,c,t,h,w)`. On a Tensor G5, `--gpu` places 256 of
88
+ 3402 ops on the GPU and then segfaults (`RESHAPE: Tensor dimensions must be
89
+ less than 5`). This is structural, not a configuration problem.
90
+ - **Two different CLIP pairs.** `clip_*` are Neodragon's own encoders (for the
91
+ DiT's pooled vector); `ssd_1b_clip_*` are SSD1B's (for SDXL conditioning).
92
+ Their weights differ. The tokenizer vocabularies are identical, so one
93
+ tokenizer serves both.
94
+ - **SDXL uses `hidden_states[-2]`**, not `last_hidden_state`, from both CLIP
95
+ encoders. Using the last layer does not crash — it quietly degrades output.
96
+ - **The SSD1B UNet is fp32** because int8 quantisation fails in
97
+ `ai_edge_quantizer` 0.8.0 on one layer
98
+ (`CrossAttnDownBlock2D_2/ResnetBlock2D_0/conv2`: *"input operand has more
99
+ dimensions than allowed by the axis remapping"*).
100
+ - Measured on a Pixel 10 Pro Fold (Tensor G5), CPU: DiT stages ≈ 1.1 / 3.9 /
101
+ 17.3 s per call.
102
+
103
+ ## Credit
104
+
105
+ All credit for the model and research to **Qualcomm AI Research** — Animesh
106
+ Karnewar and the Neodragon authors. These conversions exist only to make that
107
+ work runnable on more devices.
causal_video_vae_decoder.tflite ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:24717e1cb2d1b1ee249ac2397a6911169cfb35db7cc5ed41d5333ca8063c3cb2
3
+ size 39720268
causal_video_vae_encoder_320x512.tflite ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:78ea025166a77df00db1ecfb1ead93d0f5e4cb7f40d1aa87f9a78cb710c50dc4
3
+ size 438938584
clip_g_text_encoder_int8.tflite ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:920b4c071f5e5dade89a6326b2fc613d38764458bd3870074f325cf779b19fff
3
+ size 702166032
clip_l_text_encoder.tflite ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:69cf4cd3f148a025cdad38258b7779e1b9139bab189ce1c72402ccca144eada2
3
+ size 494994068
clip_merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
clip_vocab.json ADDED
The diff for this file is too large to render. See raw diff
 
context_adapter_dynamic_int8.tflite ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8f104b49625df78a8c6718aa61912e2b3d5161baf2714cce0b11a27f95eaf241
3
+ size 130314976
dit_stage0_10x16_int4.tflite ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:db7bb98dd08b3674c4635997f06027d76b9b074a262ffad990f9040cc9eaa60c
3
+ size 855641104
dit_stage1_20x32_int4.tflite ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0cd4dc5ea02ff3ba0bc91634d5c74221b47e9a78e3565f60df18a68ef08ac45b
3
+ size 856659680
dit_stage2_40x64_int4.tflite ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a8a5937d904ac374f5dad6f98a45db8110392b7bbac1aff2f5771985137eb8d2
3
+ size 861885920
dt5_text_encoder.tflite ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d46dd2e3f3dbe1892659551358f1bb4c7dac9930f4bfb79d6e56b2d6c5329b2b
3
+ size 518898176
ssd_1b_clip_g.tflite ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:42323338f0d10b4996819ea1def61ac10ee0eb098c8f0ce264aa9e7866af5cb0
3
+ size 2779194992
ssd_1b_clip_l.tflite ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:18a2403570beaae0068afd014cd93436ae690767a092617a63fc8b9e889c027d
3
+ size 464132792
ssd_1b_unet_640x1024.tflite ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fc8c6fe749a565c1b9c52feb494aef775c580b9094fa361401f1da2c8589d822
3
+ size 5314769280
ssd_1b_vae_decoder_640x1024.tflite ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:61c45862baaff2e68223b7d3e37f330da5702afd0f49f2d89ffb8b0544772f03
3
+ size 198303220
t5_spiece.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d60acb128cf7b7f2536e8f38a5b18a05535c9e14c7a355904270e15b0945ea86
3
+ size 791656