Spaces:
Running
Running
Create Lana
#47
by
Ribenji
- opened
- Lana +0 -0
- README.md +0 -1
- html2canvas.js +0 -0
- index.html +49 -289
Lana
ADDED
File without changes
|
README.md
CHANGED
@@ -1,6 +1,5 @@
|
|
1 |
---
|
2 |
title: DALL·E mini
|
3 |
-
metaTitle: "DALL·E mini by craiyon.com on Hugging Face"
|
4 |
emoji: 🥑
|
5 |
colorFrom: yellow
|
6 |
colorTo: green
|
|
|
1 |
---
|
2 |
title: DALL·E mini
|
|
|
3 |
emoji: 🥑
|
4 |
colorFrom: yellow
|
5 |
colorTo: green
|
html2canvas.js
DELETED
The diff for this file is too large to render.
See raw diff
|
|
index.html
CHANGED
@@ -1,295 +1,55 @@
|
|
|
|
1 |
<!DOCTYPE html>
|
2 |
<html lang="en">
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
dev_mode: false,
|
16 |
-
components: [
|
17 |
-
{
|
18 |
-
id: 1,
|
19 |
-
type: "column",
|
20 |
-
props: {
|
21 |
-
type: "column",
|
22 |
-
variant: "default",
|
23 |
-
visible: true,
|
24 |
-
style: {},
|
25 |
-
},
|
26 |
-
},
|
27 |
-
{
|
28 |
-
id: 2,
|
29 |
-
type: "markdown",
|
30 |
-
props: {
|
31 |
-
value:
|
32 |
-
'<h1><center>DALL\u00b7E mini by <a href="https://www.craiyon.com/" target="_blank">craiyon.com</a></center></h1>',
|
33 |
-
name: "markdown",
|
34 |
-
visible: true,
|
35 |
-
style: {},
|
36 |
-
},
|
37 |
-
},
|
38 |
-
{
|
39 |
-
id: 3,
|
40 |
-
type: "markdown",
|
41 |
-
props: {
|
42 |
-
value:
|
43 |
-
"<center>AI model generating images from any prompt!</center>",
|
44 |
-
name: "markdown",
|
45 |
-
visible: true,
|
46 |
-
style: {},
|
47 |
-
},
|
48 |
-
},
|
49 |
-
{
|
50 |
-
id: 4,
|
51 |
-
type: "group",
|
52 |
-
props: { type: "group", visible: true, style: {} },
|
53 |
-
},
|
54 |
-
{
|
55 |
-
id: 5,
|
56 |
-
type: "box",
|
57 |
-
props: { type: "box", visible: true, style: {} },
|
58 |
-
},
|
59 |
-
{
|
60 |
-
id: 6,
|
61 |
-
type: "row",
|
62 |
-
props: {
|
63 |
-
type: "row",
|
64 |
-
visible: true,
|
65 |
-
style: { equal_height: true, mobile_collapse: false },
|
66 |
-
},
|
67 |
-
},
|
68 |
-
{
|
69 |
-
id: 7,
|
70 |
-
type: "textbox",
|
71 |
-
props: {
|
72 |
-
lines: 1,
|
73 |
-
max_lines: 1,
|
74 |
-
value: "",
|
75 |
-
label: "Enter your prompt",
|
76 |
-
show_label: false,
|
77 |
-
name: "textbox",
|
78 |
-
visible: true,
|
79 |
-
elem_id: "prompt",
|
80 |
-
style: { container: false },
|
81 |
-
},
|
82 |
-
},
|
83 |
-
{
|
84 |
-
id: 8,
|
85 |
-
type: "button",
|
86 |
-
props: {
|
87 |
-
value: "Run",
|
88 |
-
variant: "primary",
|
89 |
-
name: "button",
|
90 |
-
visible: true,
|
91 |
-
style: {},
|
92 |
-
},
|
93 |
-
},
|
94 |
-
{
|
95 |
-
id: 9,
|
96 |
-
type: "gallery",
|
97 |
-
props: {
|
98 |
-
value: [],
|
99 |
-
label: "Generated images",
|
100 |
-
show_label: false,
|
101 |
-
name: "gallery",
|
102 |
-
visible: true,
|
103 |
-
elem_id: "gallery",
|
104 |
-
style: { grid: [3], height: "auto" },
|
105 |
-
},
|
106 |
-
},
|
107 |
-
{
|
108 |
-
id: 10,
|
109 |
-
type: "column",
|
110 |
-
props: {
|
111 |
-
type: "column",
|
112 |
-
variant: "default",
|
113 |
-
visible: true,
|
114 |
-
style: {},
|
115 |
-
},
|
116 |
-
},
|
117 |
-
{
|
118 |
-
id: 11,
|
119 |
-
type: "button",
|
120 |
-
props: {
|
121 |
-
value: "Screenshot",
|
122 |
-
variant: "secondary",
|
123 |
-
name: "button",
|
124 |
-
visible: true,
|
125 |
-
elem_id: "screenshot",
|
126 |
-
style: { full_width: true },
|
127 |
-
},
|
128 |
-
},
|
129 |
-
{
|
130 |
-
id: 12,
|
131 |
-
type: "markdown",
|
132 |
-
props: {
|
133 |
-
value:
|
134 |
-
'<details>\n<summary>Bias and Limitations</summary>\n<p style=\'line-height: normal; font-size: small\'>\nWhile the capabilities of image generation models are impressive, they may also reinforce or exacerbate societal biases. While the extent and nature of the biases of the DALL\u00b7E mini model have yet to be fully documented, given the fact that the model was trained on unfiltered data from the Internet, it may generate images that contain stereotypes against minority groups. Work to analyze the nature and extent of these limitations is ongoing, and will be documented in more detail in the <a href="https://huggingface.co/dalle-mini/dalle-mini" target="_blank">DALL\u00b7E mini model card</a>.\n</p>\n</details>',
|
135 |
-
name: "markdown",
|
136 |
-
visible: true,
|
137 |
-
style: {},
|
138 |
-
},
|
139 |
-
},
|
140 |
-
{
|
141 |
-
id: 13,
|
142 |
-
type: "markdown",
|
143 |
-
props: {
|
144 |
-
value:
|
145 |
-
'<p style=\'text-align: center\'>\nNew model available on \ud83d\udd8d\ufe0f <a href="https://www.craiyon.com/" target="_blank">craiyon.com</a>\n</p>',
|
146 |
-
name: "markdown",
|
147 |
-
visible: true,
|
148 |
-
style: {},
|
149 |
-
},
|
150 |
-
},
|
151 |
-
{
|
152 |
-
id: 14,
|
153 |
-
type: "markdown",
|
154 |
-
props: {
|
155 |
-
value:
|
156 |
-
'<hr />\n<p style=\'text-align: center\'>\nCreated by <a href="https://twitter.com/borisdayma" target="_blank">Boris Dayma</a> et al. 2021-2022\n<br/>\n<a href="https://github.com/borisdayma/dalle-mini" target="_blank">GitHub</a> | <a href="https://wandb.ai/dalle-mini/dalle-mini/reports/DALL-E-mini-Generate-images-from-any-text-prompt--VmlldzoyMDE4NDAy" target="_blank">Project Report</a>\n<p style=\'text-align: center\'>Powered by Google <a href="https://sites.research.google/trc/" target="_blank">TPU Research Cloud</a>\n</p>',
|
157 |
-
name: "markdown",
|
158 |
-
visible: true,
|
159 |
-
style: {},
|
160 |
-
},
|
161 |
-
},
|
162 |
-
],
|
163 |
-
theme: "default",
|
164 |
-
css: ".container { max-width: 800px; margin: auto; }",
|
165 |
-
title: "Gradio",
|
166 |
-
enable_queue: false,
|
167 |
-
layout: {
|
168 |
-
id: 0,
|
169 |
-
children: [
|
170 |
-
{
|
171 |
-
id: 1,
|
172 |
-
children: [
|
173 |
-
{ id: 2 },
|
174 |
-
{ id: 3 },
|
175 |
-
{
|
176 |
-
id: 4,
|
177 |
-
children: [
|
178 |
-
{
|
179 |
-
id: 5,
|
180 |
-
children: [{ id: 6, children: [{ id: 7 }, { id: 8 }] }],
|
181 |
-
},
|
182 |
-
{ id: 9 },
|
183 |
-
],
|
184 |
-
},
|
185 |
-
],
|
186 |
-
},
|
187 |
-
{
|
188 |
-
id: 10,
|
189 |
-
children: [{ id: 11 }, { id: 12 }, { id: 13 }, { id: 14 }],
|
190 |
-
},
|
191 |
-
],
|
192 |
-
},
|
193 |
-
dependencies: [
|
194 |
-
{
|
195 |
-
targets: [8],
|
196 |
-
trigger: "click",
|
197 |
-
inputs: [7],
|
198 |
-
outputs: [9],
|
199 |
-
backend_fn: false,
|
200 |
-
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 ",
|
201 |
-
status_tracker: null,
|
202 |
-
queue: null,
|
203 |
-
api_name: null,
|
204 |
-
scroll_to_output: false,
|
205 |
-
show_progress: true,
|
206 |
-
},
|
207 |
-
{
|
208 |
-
targets: [11],
|
209 |
-
trigger: "click",
|
210 |
-
inputs: [],
|
211 |
-
outputs: [],
|
212 |
-
backend_fn: false,
|
213 |
-
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 ",
|
214 |
-
status_tracker: null,
|
215 |
-
queue: null,
|
216 |
-
api_name: null,
|
217 |
-
scroll_to_output: false,
|
218 |
-
show_progress: true,
|
219 |
-
},
|
220 |
-
],
|
221 |
-
};
|
222 |
-
</script>
|
223 |
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
/>
|
248 |
-
<style>
|
249 |
-
#screenshot {
|
250 |
-
display: none;
|
251 |
-
}
|
252 |
-
.container > div > div {
|
253 |
-
padding: 0.5rem;
|
254 |
-
}
|
255 |
-
footer a {
|
256 |
-
color: rgb(156 163 175) !important;
|
257 |
-
}
|
258 |
-
footer img {
|
259 |
-
display: none !important;
|
260 |
-
}
|
261 |
-
</style>
|
262 |
-
<style id="mofo">
|
263 |
-
body {
|
264 |
-
display: none !important;
|
265 |
-
}
|
266 |
-
</style>
|
267 |
-
<script type="text/javascript">
|
268 |
-
if (
|
269 |
-
self === top ||
|
270 |
-
window.location.ancestorOrigins[0] === "https://huggingface.co"
|
271 |
-
) {
|
272 |
-
var mofo = document.getElementById("mofo");
|
273 |
-
mofo.parentNode.removeChild(mofo);
|
274 |
-
} else {
|
275 |
-
top.location = self.location;
|
276 |
-
}
|
277 |
-
</script>
|
278 |
-
</head>
|
279 |
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
</body>
|
295 |
</html>
|
|
|
1 |
+
|
2 |
<!DOCTYPE html>
|
3 |
<html lang="en">
|
4 |
+
<head>
|
5 |
+
<meta charset="utf-8" />
|
6 |
+
<meta
|
7 |
+
name="viewport"
|
8 |
+
content="width=device-width, initial-scale=1, shrink-to-fit=no, maximum-scale=1"
|
9 |
+
/>
|
10 |
|
11 |
+
|
12 |
+
<script>
|
13 |
+
window.__gradio_mode__ = "app";
|
14 |
+
window.gradio_config = {"version": "3.0.10", "mode": "blocks", "dev_mode": false, "components": [{"id": 1, "type": "markdown", "props": {"value": "<h1><center>DALL\u00b7E mini</center></h1>", "name": "markdown", "visible": true, "style": {}}}, {"id": 2, "type": "markdown", "props": {"value": "<p>DALL\u00b7E mini is an AI model that generates images from any prompt you give!</p>\n", "name": "markdown", "visible": true, "style": {}}}, {"id": 3, "type": "group", "props": {"type": "group", "visible": true, "style": {}}}, {"id": 4, "type": "box", "props": {"type": "box", "visible": true, "style": {}}}, {"id": 5, "type": "row", "props": {"type": "row", "visible": true, "style": {"equal_height": true, "mobile_collapse": false}}}, {"id": 6, "type": "textbox", "props": {"lines": 1, "max_lines": 1, "value": "", "label": "Enter your prompt", "show_label": false, "name": "textbox", "visible": true, "style": {"container": false}}}, {"id": 7, "type": "button", "props": {"value": "Run", "variant": "primary", "name": "button", "visible": true, "style": {}}}, {"id": 8, "type": "gallery", "props": {"label": "Generated images", "show_label": false, "name": "gallery", "visible": true, "style": {"grid": [3], "height": "auto"}}}, {"id": 9, "type": "markdown", "props": {"value": "<hr />\n<p style='text-align: center'>\nCreated by <a href=\"https://twitter.com/borisdayma\" target=\"_blank\">Boris Dayma</a> et al. 2021-2022\n<br/>\n<a href=\"https://github.com/borisdayma/dalle-mini\" target=\"_blank\">GitHub</a> | <a href=\"https://wandb.ai/dalle-mini/dalle-mini/reports/DALL-E-mini-Generate-images-from-any-text-prompt--VmlldzoyMDE4NDAy\" target=\"_blank\">Project Report</a>\n</p>", "name": "markdown", "visible": true, "style": {}}}], "theme": "default", "css": ".container { max-width: 800px; margin: auto; }", "enable_queue": false, "layout": {"id": 0, "children": [{"id": 1}, {"id": 2}, {"id": 3, "children": [{"id": 4, "children": [{"id": 5, "children": [{"id": 6}, {"id": 7}]}]}, {"id": 8}]}, {"id": 9}]}, "dependencies": [{"targets": [7], "trigger": "click", "inputs": [6], "outputs": [8], "backend_fn": false, "js": "\n async (text) => {\n try {\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 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+HeIrSmPe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18 |
+
<link
|
19 |
+
rel="preconnect"
|
20 |
+
href="https://fonts.gstatic.com"
|
21 |
+
crossorigin="anonymous"
|
22 |
+
/>
|
23 |
+
<link
|
24 |
+
href="https://fonts.googleapis.com/css?family=Source Sans Pro"
|
25 |
+
rel="stylesheet"
|
26 |
+
/>
|
27 |
+
<link
|
28 |
+
href="https://fonts.googleapis.com/css?family=IBM Plex Mono"
|
29 |
+
rel="stylesheet"
|
30 |
+
/>
|
31 |
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/iframe-resizer/4.3.1/iframeResizer.contentWindow.min.js"></script>
|
32 |
+
<script type="module" crossorigin src="https://gradio.s3-us-west-2.amazonaws.com/3.0.9b12/assets/index.8eca4ae7.js"></script>
|
33 |
+
<link rel="stylesheet" href="https://gradio.s3-us-west-2.amazonaws.com/3.0.9b12/assets/index.cbea297d.css">
|
34 |
+
<style>
|
35 |
+
footer img {
|
36 |
+
display: none !important;
|
37 |
+
}
|
38 |
+
</style>
|
39 |
+
</head>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
|
41 |
+
<body
|
42 |
+
style="
|
43 |
+
margin: 0;
|
44 |
+
padding: 0;
|
45 |
+
display: flex;
|
46 |
+
flex-direction: column;
|
47 |
+
flex-grow: 1;
|
48 |
+
"
|
49 |
+
>
|
50 |
+
<div
|
51 |
+
id="root"
|
52 |
+
style="display: flex; flex-direction: column; flex-grow: 1"
|
53 |
+
></div>
|
54 |
+
</body>
|
|
|
55 |
</html>
|