luweigen commited on
Commit
4cefe13
·
verified ·
1 Parent(s): 85480b4

Upload models for the Android app

Browse files
README.md ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ tags:
4
+ - onnx
5
+ - inpainting
6
+ - android
7
+ - qnn
8
+ ---
9
+
10
+ # Moebius inpainting — ONNX models prepared for Android
11
+
12
+ Derived from [simonw/Moebius-ONNX](https://huggingface.co/simonw/Moebius-ONNX) (ONNX export of [hustvl/Moebius](https://github.com/hustvl/Moebius), Apache-2.0)
13
+ for the native Android app in the `onnx-android` project. Files are downloaded by the app and checked against sha256 values compiled into the APK.
14
+
15
+ | Set | Files | For |
16
+ |---|---|---|
17
+ | `htp` | `hyb.json` + `hyb.s*.cpu.onnx` (CPU segments) + `hyb.s*.htp_ctx.onnx` / `_ctx_qnn.bin` (QNN HTP context binaries), `vae_*.static_ctx.onnx` / `_ctx_qnn.bin` | Snapdragon 8 Elite (SM8750, HTP v79) only. UNet split into 13 segments: 64×64 attention blocks and the timestep embedding on CPU, the rest on the NPU. Context binaries compiled offline with onnxruntime-qnn 2.7.0 (QNN 2.51); the device needs qnn-runtime ≥ 2.51 |
18
+ | `cpu` | `unet.einsum.onnx`, `vae_encoder.static.onnx`, `vae_decoder.static.onnx` | Any device, CPU EP, fp32. Static shapes (UNet batch 2), Einsum rewritten to MatMul, condition embedding replaced by a `context` input (2×10×3072, shipped in the APK) |
19
+
20
+ Changes from the original graphs: static shapes, `input_ids` → `context` input, Einsum → Transpose/Reshape/MatMul, normalization pre-scaling (HTP fp16 range), graph splitting. Weights are unchanged.
hyb.json ADDED
@@ -0,0 +1,226 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "segments": [
3
+ {
4
+ "file": "hyb.s0.htp.onnx",
5
+ "device": "htp",
6
+ "nodes": [
7
+ 0,
8
+ 81
9
+ ],
10
+ "inputs": [
11
+ "context",
12
+ "latent"
13
+ ],
14
+ "outputs": [
15
+ "/m/diff_model/encoder_hid_proj/Add_output_0",
16
+ "/m/diff_model/up_blocks.2/attentions.2/transformer_blocks.0/attn2/Reshape_4_output_0",
17
+ "/m/diff_model/up_blocks.2/attentions.2/transformer_blocks.0/attn2/Einsum_1/in2_R",
18
+ "/m/diff_model/up_blocks.2/attentions.1/transformer_blocks.0/attn2/Reshape_4_output_0",
19
+ "/m/diff_model/up_blocks.2/attentions.1/transformer_blocks.0/attn2/Einsum_1/in2_R",
20
+ "/m/diff_model/up_blocks.2/attentions.0/transformer_blocks.0/attn2/Reshape_4_output_0",
21
+ "/m/diff_model/up_blocks.2/attentions.0/transformer_blocks.0/attn2/Einsum_1/in2_R",
22
+ "/m/diff_model/down_blocks.0/attentions.1/transformer_blocks.0/attn2/Reshape_4_output_0",
23
+ "/m/diff_model/down_blocks.0/attentions.1/transformer_blocks.0/attn2/Einsum_1/in2_R",
24
+ "/m/diff_model/down_blocks.0/attentions.0/transformer_blocks.0/attn2/Reshape_4_output_0",
25
+ "/m/diff_model/down_blocks.0/attentions.0/transformer_blocks.0/attn2/Einsum_1/in2_R",
26
+ "/m/diff_model/conv_in/conv_pw/Conv_output_0",
27
+ "/m/diff_model/down_blocks.0/resnets.0/conv1/Add_output_0"
28
+ ]
29
+ },
30
+ {
31
+ "file": "hyb.s1.cpu.onnx",
32
+ "device": "cpu",
33
+ "nodes": [
34
+ 82,
35
+ 95
36
+ ],
37
+ "inputs": [
38
+ "timesteps"
39
+ ],
40
+ "outputs": [
41
+ "/m/diff_model/time_embedding/linear_2/Gemm_output_0"
42
+ ]
43
+ },
44
+ {
45
+ "file": "hyb.s2.htp.onnx",
46
+ "device": "htp",
47
+ "nodes": [
48
+ 96,
49
+ 114
50
+ ],
51
+ "inputs": [
52
+ "/m/diff_model/time_embedding/linear_2/Gemm_output_0",
53
+ "/m/diff_model/down_blocks.0/resnets.0/conv1/Add_output_0",
54
+ "/m/diff_model/conv_in/conv_pw/Conv_output_0"
55
+ ],
56
+ "outputs": [
57
+ "/m/diff_model/down_blocks.0/resnets.0/nonlinearity_1/Mul_output_0",
58
+ "/m/diff_model/down_blocks.0/resnets.0/Add_1_output_0"
59
+ ]
60
+ },
61
+ {
62
+ "file": "hyb.s3.cpu.onnx",
63
+ "device": "cpu",
64
+ "nodes": [
65
+ 115,
66
+ 198
67
+ ],
68
+ "inputs": [
69
+ "/m/diff_model/down_blocks.0/resnets.0/Add_1_output_0",
70
+ "/m/diff_model/down_blocks.0/attentions.0/transformer_blocks.0/attn2/Einsum_1/in2_R",
71
+ "/m/diff_model/down_blocks.0/attentions.0/transformer_blocks.0/attn2/Reshape_4_output_0"
72
+ ],
73
+ "outputs": [
74
+ "/m/diff_model/down_blocks.0/attentions.0/Add_output_0"
75
+ ]
76
+ },
77
+ {
78
+ "file": "hyb.s4.htp.onnx",
79
+ "device": "htp",
80
+ "nodes": [
81
+ 199,
82
+ 227
83
+ ],
84
+ "inputs": [
85
+ "/m/diff_model/down_blocks.0/attentions.0/Add_output_0",
86
+ "/m/diff_model/down_blocks.0/resnets.0/nonlinearity_1/Mul_output_0"
87
+ ],
88
+ "outputs": [
89
+ "/m/diff_model/down_blocks.0/resnets.1/Add_1_output_0"
90
+ ]
91
+ },
92
+ {
93
+ "file": "hyb.s5.cpu.onnx",
94
+ "device": "cpu",
95
+ "nodes": [
96
+ 228,
97
+ 310
98
+ ],
99
+ "inputs": [
100
+ "/m/diff_model/down_blocks.0/resnets.1/Add_1_output_0",
101
+ "/m/diff_model/down_blocks.0/attentions.1/transformer_blocks.0/attn2/Einsum_1/in2_R",
102
+ "/m/diff_model/down_blocks.0/attentions.1/transformer_blocks.0/attn2/Reshape_4_output_0"
103
+ ],
104
+ "outputs": [
105
+ "/m/diff_model/down_blocks.0/attentions.1/Add_output_0"
106
+ ]
107
+ },
108
+ {
109
+ "file": "hyb.s6.htp.onnx",
110
+ "device": "htp",
111
+ "nodes": [
112
+ 311,
113
+ 1631
114
+ ],
115
+ "inputs": [
116
+ "/m/diff_model/down_blocks.0/attentions.1/Add_output_0",
117
+ "/m/diff_model/down_blocks.0/resnets.0/nonlinearity_1/Mul_output_0",
118
+ "/m/diff_model/encoder_hid_proj/Add_output_0"
119
+ ],
120
+ "outputs": [
121
+ "/m/diff_model/up_blocks.2/resnets.0/Add_1_output_0"
122
+ ]
123
+ },
124
+ {
125
+ "file": "hyb.s7.cpu.onnx",
126
+ "device": "cpu",
127
+ "nodes": [
128
+ 1632,
129
+ 1714
130
+ ],
131
+ "inputs": [
132
+ "/m/diff_model/up_blocks.2/resnets.0/Add_1_output_0",
133
+ "/m/diff_model/up_blocks.2/attentions.0/transformer_blocks.0/attn2/Einsum_1/in2_R",
134
+ "/m/diff_model/up_blocks.2/attentions.0/transformer_blocks.0/attn2/Reshape_4_output_0"
135
+ ],
136
+ "outputs": [
137
+ "/m/diff_model/up_blocks.2/attentions.0/Add_output_0"
138
+ ]
139
+ },
140
+ {
141
+ "file": "hyb.s8.htp.onnx",
142
+ "device": "htp",
143
+ "nodes": [
144
+ 1715,
145
+ 1744
146
+ ],
147
+ "inputs": [
148
+ "/m/diff_model/up_blocks.2/attentions.0/Add_output_0",
149
+ "/m/diff_model/down_blocks.0/attentions.0/Add_output_0",
150
+ "/m/diff_model/down_blocks.0/resnets.0/nonlinearity_1/Mul_output_0"
151
+ ],
152
+ "outputs": [
153
+ "/m/diff_model/up_blocks.2/resnets.1/Add_1_output_0"
154
+ ]
155
+ },
156
+ {
157
+ "file": "hyb.s9.cpu.onnx",
158
+ "device": "cpu",
159
+ "nodes": [
160
+ 1745,
161
+ 1827
162
+ ],
163
+ "inputs": [
164
+ "/m/diff_model/up_blocks.2/resnets.1/Add_1_output_0",
165
+ "/m/diff_model/up_blocks.2/attentions.1/transformer_blocks.0/attn2/Einsum_1/in2_R",
166
+ "/m/diff_model/up_blocks.2/attentions.1/transformer_blocks.0/attn2/Reshape_4_output_0"
167
+ ],
168
+ "outputs": [
169
+ "/m/diff_model/up_blocks.2/attentions.1/Add_output_0"
170
+ ]
171
+ },
172
+ {
173
+ "file": "hyb.s10.htp.onnx",
174
+ "device": "htp",
175
+ "nodes": [
176
+ 1828,
177
+ 1857
178
+ ],
179
+ "inputs": [
180
+ "/m/diff_model/up_blocks.2/attentions.1/Add_output_0",
181
+ "/m/diff_model/conv_in/conv_pw/Conv_output_0",
182
+ "/m/diff_model/down_blocks.0/resnets.0/nonlinearity_1/Mul_output_0"
183
+ ],
184
+ "outputs": [
185
+ "/m/diff_model/up_blocks.2/resnets.2/Add_1_output_0"
186
+ ]
187
+ },
188
+ {
189
+ "file": "hyb.s11.cpu.onnx",
190
+ "device": "cpu",
191
+ "nodes": [
192
+ 1858,
193
+ 1942
194
+ ],
195
+ "inputs": [
196
+ "/m/diff_model/up_blocks.2/resnets.2/Add_1_output_0",
197
+ "/m/diff_model/up_blocks.2/attentions.2/transformer_blocks.0/attn2/Einsum_1/in2_R",
198
+ "/m/diff_model/up_blocks.2/attentions.2/transformer_blocks.0/attn2/Reshape_4_output_0"
199
+ ],
200
+ "outputs": [
201
+ "/m/diff_model/up_blocks.2/attentions.2/Add_output_0"
202
+ ]
203
+ },
204
+ {
205
+ "file": "hyb.s12.htp.onnx",
206
+ "device": "htp",
207
+ "nodes": [
208
+ 1943,
209
+ 1953
210
+ ],
211
+ "inputs": [
212
+ "/m/diff_model/up_blocks.2/attentions.2/Add_output_0"
213
+ ],
214
+ "outputs": [
215
+ "noise"
216
+ ]
217
+ }
218
+ ],
219
+ "final": "noise",
220
+ "graph_inputs": [
221
+ "latent",
222
+ "timesteps",
223
+ "context"
224
+ ],
225
+ "source": "unet.ns.onnx"
226
+ }
hyb.s0.htp_ctx.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:85a38fd492685bc234f39c63271e0aab6988574f885b1a46e0eb32773376cfff
3
+ size 3048
hyb.s0.htp_ctx_qnn.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:14d594fc7eb8f1962c721ac9a7c08102ae76399112458e23c8f4740c4c5a3505
3
+ size 6656000
hyb.s1.cpu.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:52ca5f2d075e78bc817abc3b1a529a678cb8ba31761c096a9b11f68e9ceb8cdd
3
+ size 8207345
hyb.s10.htp_ctx.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:71b793201d91088165e5c78125798846b1bc8a5cfc50c470044e4e8015304596
3
+ size 1171
hyb.s10.htp_ctx_qnn.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3191c169c31045a0fcae347a54a5d8cb5914abee0dac005f79d79fe7ef08133e
3
+ size 3497984
hyb.s11.cpu.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:161a6fba36c0dd3501d90bae60dd5fe29d7ca56294a4f1c2889825fb6752eae1
3
+ size 11532733
hyb.s12.htp_ctx.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e3c27c58e9451041ad12367ed3c8dc130b5c478190220bf0a9a17a55e30b6952
3
+ size 808
hyb.s12.htp_ctx_qnn.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:72b2f694a27711da6e4dad140a234d1106801e0f5db0fb0cc76cc0b3eab28a3a
3
+ size 540672
hyb.s2.htp_ctx.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e2c445d0c4a107dc3c77c6922525bb131d315cfc6acc579d4d7b559e609836e9
3
+ size 1307
hyb.s2.htp_ctx_qnn.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9969dfaad79c0da3108bdb9acd0931a99a861d91f7b4a62178093234c6f918fe
3
+ size 1716224
hyb.s3.cpu.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c44e3a8d70a000193710f852eb64cbf3bc3c39c43b186d61558ba5e3b6d0c9bd
3
+ size 11533031
hyb.s4.htp_ctx.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b53c90a674718939cb5526fa80d393085856ab807bf0182d74e8fe04093cf13c
3
+ size 1059
hyb.s4.htp_ctx_qnn.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b2c1f0521e39506f17f215801b802f6c398fd6c6d3351353c31152718345bba3
3
+ size 2347008
hyb.s5.cpu.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5ccf1ab479d093f8fa7200ce48cf4a1a18383e3e078827dc7f53b3b018ea4253
3
+ size 11532277
hyb.s6.htp_ctx.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:125e0ead3c788560982ef4af6473297adf91d751504fef1a3c8e2f3ba8d48491
3
+ size 1168
hyb.s6.htp_ctx_qnn.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d25a2b3958ff43467559f09d1bc7ec34ad63b93b006f135e83b66190eb138557
3
+ size 492933120
hyb.s7.cpu.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:37e835ac7a7ae833b2919b80e7abd92e234d9f04f15e9731061025d28afc661a
3
+ size 11531477
hyb.s8.htp_ctx.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f4b0e53b99ca29db870b8a912bb0ffc3db5e19e1185028a6648d2d5e499b7136
3
+ size 1188
hyb.s8.htp_ctx_qnn.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2f680e82df385db1f4e248043a0afcf1c9bfe7185759494d04e8a670f9e81cec
3
+ size 3502080
hyb.s9.cpu.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b98768bda6f9d8cecd8b9dee343e62f5e406278f213d4788c23c412653bb8482
3
+ size 11531477
unet.einsum.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4b1d9c08d9b38a97171dc72d68c01b8caee5c6fa5ddc0ef42d5b3b7914820b6a
3
+ size 904522395
vae_decoder.static.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:20e26ae7333e4374e685932afa4986441b3c14712e256fc74e9555fee5957e2f
3
+ size 198090837
vae_decoder.static_ctx.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:290b0db465b37598ed12cb14eaa944b07f241018bb548d8085784186b047562d
3
+ size 726
vae_decoder.static_ctx_qnn.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:701d86e0529dc8cb004256cf0890a5ed71f1d7e090550081a76f5fa8215662e6
3
+ size 111640576
vae_encoder.static.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:390dfee84e3b3361b4eb290a829f42984f1e129c583c08abc917accb7be0f5b6
3
+ size 136758234
vae_encoder.static_ctx.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e5946bfbd701c8aa3878475c89a9e739e4750bbb84587e57931d7204e285db4a
3
+ size 730
vae_encoder.static_ctx_qnn.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b233315cc79790ef62854b2fbe0323b39797829f20b2af81ec86d13ac5becd2e
3
+ size 76587008