TenPoisk commited on
Commit
3422aee
1 Parent(s): 8c50084

Upload 5 files

Browse files
Files changed (5) hide show
  1. README (1).md +9 -0
  2. gen.txt +7 -0
  3. html2canvas.js +0 -0
  4. index (1).html +297 -0
  5. lib.txt +11 -0
README (1).md ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: MultiFusion — Stable Diffusion & Dall•E-2
3
+ metaTitle: DALL·E mini by craiyon.com on Hugging Face
4
+ emoji: 💧MF
5
+ colorFrom: yellow
6
+ colorTo: green
7
+ sdk: static
8
+ pinned: true
9
+ ---
gen.txt ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ [
2
+
3
+ {
4
+ @+img_id(count==9)
5
+ }
6
+
7
+ ]
html2canvas.js ADDED
The diff for this file is too large to render. See raw diff
 
index (1).html ADDED
@@ -0,0 +1,297 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <meta
6
+ name="viewport"
7
+ content="width=device-width, initial-scale=1, shrink-to-fit=no, maximum-scale=1"
8
+ />
9
+
10
+ <title>MultiFusion</title>
11
+
12
+ <script>
13
+ window.__gradio_mode__ = "app";
14
+ window.gradio_config = {
15
+ version: "3.0.26\n",
16
+ mode: "blocks",
17
+ dev_mode: false,
18
+ components: [
19
+ {
20
+ id: 1,
21
+ type: "column",
22
+ props: {
23
+ type: "column",
24
+ variant: "default",
25
+ visible: true,
26
+ style: {},
27
+ },
28
+ },
29
+ {
30
+ id: 2,
31
+ type: "markdown",
32
+ props: {
33
+ value:
34
+ '<h1><center>💧 Multi Fusion</center></h1>',
35
+ name: "markdown",
36
+ visible: true,
37
+ style: {},
38
+ },
39
+ },
40
+ {
41
+ id: 3,
42
+ type: "markdown",
43
+ props: {
44
+ value:
45
+ "<center>This space is designed to generate images with Stable Diffusion, Dall•E-2!</center>",
46
+ name: "markdown",
47
+ visible: true,
48
+ style: {},
49
+ },
50
+ },
51
+ {
52
+ id: 4,
53
+ type: "group",
54
+ props: { type: "group", visible: true, style: {} },
55
+ },
56
+ {
57
+ id: 5,
58
+ type: "box",
59
+ props: { type: "box", visible: true, style: {} },
60
+ },
61
+ {
62
+ id: 6,
63
+ type: "row",
64
+ props: {
65
+ type: "row",
66
+ visible: true,
67
+ style: { equal_height: true, mobile_collapse: false },
68
+ },
69
+ },
70
+ {
71
+ id: 7,
72
+ type: "textbox",
73
+ props: {
74
+ lines: 1,
75
+ max_lines: 1,
76
+ value: "",
77
+ label: "🧩 Enter your prompt",
78
+ show_label: false,
79
+ name: "textbox",
80
+ visible: true,
81
+ elem_id: "prompt",
82
+ style: { container: false },
83
+ },
84
+ },
85
+ {
86
+ id: 8,
87
+ type: "button",
88
+ props: {
89
+ value: "▶️",
90
+ variant: "primary",
91
+ name: "button",
92
+ visible: true,
93
+ style: {},
94
+ },
95
+ },
96
+ {
97
+ id: 9,
98
+ type: "gallery",
99
+ props: {
100
+ value: [],
101
+ label: "Generated images",
102
+ show_label: false,
103
+ name: "gallery",
104
+ visible: true,
105
+ elem_id: "gallery",
106
+ style: { grid: [3], height: "auto" },
107
+ },
108
+ },
109
+ {
110
+ id: 10,
111
+ type: "column",
112
+ props: {
113
+ type: "column",
114
+ variant: "default",
115
+ visible: true,
116
+ style: {},
117
+ },
118
+ },
119
+ {
120
+ id: 11,
121
+ type: "button",
122
+ props: {
123
+ value: "Screenshot",
124
+ variant: "secondary",
125
+ name: "button",
126
+ visible: true,
127
+ elem_id: "screenshot",
128
+ style: { full_width: true },
129
+ },
130
+ },
131
+ {
132
+ id: 12,
133
+ type: "markdown",
134
+ props: {
135
+ value:
136
+ '<details>\n<summary>Limitations</summary>\n<p style=\'line-height: normal; font-size: small\'>\nWe want to declare that we have no limits, censorship and other restrictions, we also guarantee complete confidentiality of all users, since this is a non-commercial project and we rely on moral support from users, we rely only on your intelligence, adequacy and your understanding, thank you .\n</p>\n</details>',
137
+ name: "markdown",
138
+ visible: true,
139
+ style: {},
140
+ },
141
+ },
142
+ {
143
+ id: 13,
144
+ type: "markdown",
145
+ props: {
146
+ value:
147
+ '<p style=\'text-align: center\'>\nUsually generation takes no more than 50 seconds (9 images are generated at a time)\n</p>',
148
+ name: "markdown",
149
+ visible: true,
150
+ style: {},
151
+ },
152
+ },
153
+ {
154
+ id: 14,
155
+ type: "markdown",
156
+ props: {
157
+ value:
158
+ '<hr />\n<p style=\'text-align: center\'>\n👑 Created by <a href="https://hf.co/viait" target="_blank">viaIT Group</a>\n<br/>\n<a href="https://github.com/borisdayma/dalle-mini" target="_blank">🗂 API</a> | <a href="https://stats.uptimerobot.com/4rjLpsYY7Z" target="_blank">📊 Status</a>\n<p style=\'text-align: center\'>💻 Local <a href="https://github.com/viait-group/multi-fusion" target="_blank">setup</a>\n</p>',
159
+ name: "markdown",
160
+ visible: true,
161
+ style: {},
162
+ },
163
+ },
164
+ ],
165
+ theme: "default",
166
+ css: ".container { max-width: 800px; margin: auto; }",
167
+ title: "Gradio",
168
+ enable_queue: false,
169
+ layout: {
170
+ id: 0,
171
+ children: [
172
+ {
173
+ id: 1,
174
+ children: [
175
+ { id: 2 },
176
+ { id: 3 },
177
+ {
178
+ id: 4,
179
+ children: [
180
+ {
181
+ id: 5,
182
+ children: [{ id: 6, children: [{ id: 7 }, { id: 8 }] }],
183
+ },
184
+ { id: 9 },
185
+ ],
186
+ },
187
+ ],
188
+ },
189
+ {
190
+ id: 10,
191
+ children: [{ id: 11 }, { id: 12 }, { id: 13 }, { id: 14 }],
192
+ },
193
+ ],
194
+ },
195
+ dependencies: [
196
+ {
197
+ targets: [8],
198
+ trigger: "click",
199
+ inputs: [7],
200
+ outputs: [9],
201
+ backend_fn: false,
202
+ js: "\n async (text) => {\n try {\n document.querySelector('#screenshot').style.display = 'none';\n response = await fetch('https://bf.dallemini.ai/generate', {\n method: 'POST',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({\n prompt: text\n })\n });\n response = await response.json()\n let imgs = response.images.map(r => \"data:image/png;base64,\" + r)\n document.querySelector('#screenshot').style.display = 'block';\n return imgs\n } catch (e) {\n alert(\"Too much traffic, please try again.\")\n IMG = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAMAAACahl6sAAAAOVBMVEXg4OB1dXXX19fd3d2EhIR9fX14eHjJycm2trbb29uurq6goKCZmZmIiIiBgYHNzc2np6e8vLySkpKXK8HrAAABuUlEQVR4nO3Z0bKCIBCAYQNFVCzr/R/2nHU6k8KpJi6wZf7vLu1id9gFhKYBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAb249h7pzr5jD29uhospnlfNo4L+boiLKYyZ0iblKYiu/iNER3PTquD9npPgbB98Za0/twH59JVasMtzXo1m+iHny7PrwpysSuebgxCtmOTlkma121l/TFZR2UqXxEebxEO/87QZlZ3inpeCPzVftkojUyJp2OWVgKy23qSsbg8evitBSXkUjHzYN9Is0oeWoYkkUKazsxRYlYKa6ldFSfs7K/8tsnUSLrXHAuG1SOXpp5t1LEiQxSe33ZqDJIC4TdkziRJkRN9J1CXFlpIj7J9RvNSd0kiUj1zSVjyiKr4X5yTRIx0kYlY8oinbzfFSaJWFlJSsaUpZpEqimttNkTOpo9nX4TOqbfdEFM6FgQpW7c8OofSrYo1Wwaq9nG1/NhVc2nbj2HD821kuOgeg7o3hyZBj1Hpo9D7M3K+HeIrSmPeq4Vfl3ruOhpnly9vdyEfa1KLkPF7nr66GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPjcD13rCcC3ILx/AAAAAElFTkSuQmCC\"\n document.querySelector('#screenshot').style.display = 'block';\n return Array(9).fill(IMG)\n }\n }\n ",
203
+ status_tracker: null,
204
+ queue: null,
205
+ api_name: null,
206
+ scroll_to_output: false,
207
+ show_progress: true,
208
+ },
209
+ {
210
+ targets: [11],
211
+ trigger: "click",
212
+ inputs: [],
213
+ outputs: [],
214
+ backend_fn: false,
215
+ js: "\n () => {\n const captureElement = document.getElementById(1)\n let bg_color = getComputedStyle(document.querySelector(\"#root .container\"))[\"background-color\"]\n captureElement.style.backgroundColor = bg_color; \n html2canvas(captureElement)\n .then(canvas => {\n canvas.style.display = 'none'\n document.body.appendChild(canvas)\n return canvas\n })\n .then(canvas => {\n const image = canvas.toDataURL('image/png').replace('image/png', 'image/octet-stream')\n const a = document.createElement('a')\n const date = new Date()\n const filename = `dallemini_${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}_${date.getHours()}-${date.getMinutes()}-${date.getSeconds()}.png`\n a.setAttribute('download', filename)\n a.setAttribute('href', image)\n a.click()\n canvas.remove()\n })\n }\n ",
216
+ status_tracker: null,
217
+ queue: null,
218
+ api_name: null,
219
+ scroll_to_output: false,
220
+ show_progress: true,
221
+ },
222
+ ],
223
+ };
224
+ </script>
225
+
226
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
227
+ <link
228
+ rel="preconnect"
229
+ href="https://fonts.gstatic.com"
230
+ crossorigin="anonymous"
231
+ />
232
+ <link
233
+ href="https://fonts.googleapis.com/css?family=Source Sans Pro"
234
+ rel="stylesheet"
235
+ />
236
+ <link
237
+ href="https://fonts.googleapis.com/css?family=IBM Plex Mono"
238
+ rel="stylesheet"
239
+ />
240
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/iframe-resizer/4.3.1/iframeResizer.contentWindow.min.js"></script>
241
+ <script
242
+ type="module"
243
+ crossorigin
244
+ src="https://gradio.s3-us-west-2.amazonaws.com/3.0.9b12/assets/index.8eca4ae7.js"
245
+ ></script>
246
+ <link
247
+ rel="stylesheet"
248
+ href="https://gradio.s3-us-west-2.amazonaws.com/3.0.9b12/assets/index.cbea297d.css"
249
+ />
250
+ <style>
251
+ #screenshot {
252
+ display: none;
253
+ }
254
+ .container > div > div {
255
+ padding: 0.5rem;
256
+ }
257
+ footer a {
258
+ color: rgb(156 163 175) !important;
259
+ }
260
+ footer img {
261
+ display: none !important;
262
+ }
263
+ </style>
264
+ <style id="mofo">
265
+ body {
266
+ display: none !important;
267
+ }
268
+ </style>
269
+ <script type="text/javascript">
270
+ if (
271
+ self === top ||
272
+ window.location.ancestorOrigins[0] === "https://huggingface.co"
273
+ ) {
274
+ var mofo = document.getElementById("mofo");
275
+ mofo.parentNode.removeChild(mofo);
276
+ } else {
277
+ top.location = self.location;
278
+ }
279
+ </script>
280
+ </head>
281
+
282
+ <body
283
+ style="
284
+ margin: 0;
285
+ padding: 0;
286
+ display: flex;
287
+ flex-direction: column;
288
+ flex-grow: 1;
289
+ "
290
+ >
291
+ <div
292
+ id="root"
293
+ style="display: flex; flex-direction: column; flex-grow: 1"
294
+ ></div>
295
+ <script src="html2canvas.js"></script>
296
+ </body>
297
+ </html>
lib.txt ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ 1.png
3
+ 2.png
4
+ 3.png
5
+ 4.png
6
+ 5.png
7
+ 6.png
8
+ 7.png
9
+ 8.png
10
+ 9.png
11
+ }