adminuser742150 commited on
Commit
32476aa
·
verified ·
1 Parent(s): bd95623

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +135 -141
index.html CHANGED
@@ -1,143 +1,137 @@
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
- <script>
11
- window.__gradio_mode__ = "app";
12
- window.gradio_config = {"version": "3.0.26\n", "mode": "blocks", "dev_mode": false, "components": [{"id": 1, "type": "column", "props": {"type": "column", "variant": "default", "visible": true, "style": {}}}, {"id": 2, "type": "markdown", "props": {"value": "<h1><center>DALL\u00b7E mini by <a href=\"https://www.craiyon.com/\" target=\"_blank\">craiyon.com</a></center></h1>", "name": "markdown", "visible": true, "style": {}}}, {"id": 3, "type": "markdown", "props": {"value": "<center>AI model generating images from any prompt!</center>", "name": "markdown", "visible": true, "style": {}}}, {"id": 4, "type": "group", "props": {"type": "group", "visible": true, "style": {}}}, {"id": 5, "type": "box", "props": {"type": "box", "visible": true, "style": {}}}, {"id": 6, "type": "row", "props": {"type": "row", "visible": true, "style": {"equal_height": true, "mobile_collapse": false}}}, {"id": 7, "type": "textbox", "props": {"lines": 1, "max_lines": 1, "value": "", "label": "Enter your prompt", "show_label": false, "name": "textbox", "visible": true, "elem_id": "prompt", "style": {"container": false}}}, {"id": 8, "type": "button", "props": {"value": "Run", "variant": "primary", "name": "button", "visible": true, "style": {}}}, {"id": 9, "type": "gallery", "props": {"value": [], "label": "Generated images", "show_label": false, "name": "gallery", "visible": true, "elem_id": "gallery", "style": {"grid": [3], "height": "auto"}}}, {"id": 10, "type": "column", "props": {"type": "column", "variant": "default", "visible": true, "style": {}}}, {"id": 11, "type": "button", "props": {"value": "Screenshot", "variant": "secondary", "name": "button", "visible": true, "elem_id": "screenshot", "style": {"full_width": true}}}, {"id": 12, "type": "markdown", "props": {"value": "<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>", "name": "markdown", "visible": true, "style": {}}}, {"id": 13, "type": "markdown", "props": {"value": "<p style='text-align: center'>\nDALL\u00b7E mini is migrating to \ud83d\udd8d\ufe0f <a href=\"https://www.craiyon.com/\" target=\"_blank\">craiyon.com</a>\n</p>", "name": "markdown", "visible": true, "style": {}}}, {"id": 14, "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 style='text-align: center'>Powered by Google <a href=\"https://sites.research.google/trc/\" target=\"_blank\">TPU Research Cloud</a>\n</p>", "name": "markdown", "visible": true, "style": {}}}], "theme": "default", "css": ".container { max-width: 800px; margin: auto; }", "title": "Gradio", "enable_queue": false, "layout": {"id": 0, "children": [{"id": 1, "children": [{"id": 2}, {"id": 3}, {"id": 4, "children": [{"id": 5, "children": [{"id": 6, "children": [{"id": 7}, {"id": 8}]}]}, {"id": 9}]}]}, {"id": 10, "children": [{"id": 11}, {"id": 12}, {"id": 13}, {"id": 14}]}]}, "dependencies": [{"targets": [8], "trigger": "click", "inputs": [7], "outputs": [9], "backend_fn": false, "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 ", "status_tracker": null, "queue": null, "api_name": null, "scroll_to_output": false, "show_progress": true}, {"targets": [11], "trigger": "click", "inputs": [], "outputs": [], "backend_fn": false, "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 ", "status_tracker": null, "queue": null, "api_name": null, "scroll_to_output": false, "show_progress": true}]};
13
- </script>
14
-
15
- <link rel="preconnect" href="https://fonts.googleapis.com" />
16
- <link
17
- rel="preconnect"
18
- href="https://fonts.gstatic.com"
19
- crossorigin="anonymous"
20
- />
21
- <link
22
- href="https://fonts.googleapis.com/css?family=Source Sans Pro"
23
- rel="stylesheet"
24
- />
25
- <link
26
- href="https://fonts.googleapis.com/css?family=IBM Plex Mono"
27
- rel="stylesheet"
28
- />
29
- <script src="https://cdnjs.cloudflare.com/ajax/libs/iframe-resizer/4.3.1/iframeResizer.contentWindow.min.js"></script>
30
- <script type="module" crossorigin src="https://gradio.s3-us-west-2.amazonaws.com/3.0.9b12/assets/index.8eca4ae7.js"></script>
31
- <link rel="stylesheet" href="https://gradio.s3-us-west-2.amazonaws.com/3.0.9b12/assets/index.cbea297d.css">
32
- <style>
33
- body {
34
- min-height: 100vh;
35
- margin: 0;
36
- padding: 0;
37
- display: flex;
38
- flex-direction: column;
39
- flex-grow: 1;
40
- font-family: 'Source Sans Pro', 'Segoe UI', Arial, sans-serif;
41
- background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
42
- }
43
- #root {
44
- display: flex;
45
- flex-direction: column;
46
- flex-grow: 1;
47
- align-items: center;
48
- justify-content: center;
49
- min-height: 100vh;
50
- }
51
- .container {
52
- background: #fff;
53
- border-radius: 18px;
54
- box-shadow: 0 4px 24px rgba(0,0,0,0.08);
55
- padding: 2.5rem 2rem 2rem 2rem;
56
- max-width: 800px;
57
- margin: 2rem auto;
58
- width: 100%;
59
- }
60
- input[type="text"], textarea {
61
- width: 100%;
62
- padding: 0.75rem 1rem;
63
- border: 1px solid #e0e0e0;
64
- border-radius: 8px;
65
- font-size: 1rem;
66
- margin-bottom: 1rem;
67
- background: #f9fafb;
68
- transition: border 0.2s;
69
- }
70
- input[type="text"]:focus, textarea:focus {
71
- border: 1.5px solid #7b61ff;
72
- outline: none;
73
- }
74
- button, #screenshot {
75
- background: linear-gradient(90deg, #7b61ff 0%, #5eead4 100%);
76
- color: #fff;
77
- border: none;
78
- border-radius: 8px;
79
- padding: 0.75rem 1.5rem;
80
- font-size: 1.1rem;
81
- font-weight: 600;
82
- cursor: pointer;
83
- box-shadow: 0 2px 8px rgba(123,97,255,0.08);
84
- transition: background 0.2s, transform 0.1s;
85
- margin-bottom: 1rem;
86
- }
87
- button:hover, #screenshot:hover {
88
- background: linear-gradient(90deg, #5eead4 0%, #7b61ff 100%);
89
- transform: translateY(-2px) scale(1.03);
90
- }
91
- .gallery {
92
- display: grid;
93
- grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
94
- gap: 1.2rem;
95
- margin-top: 1.5rem;
96
- }
97
- .gallery img {
98
- width: 100%;
99
- border-radius: 12px;
100
- box-shadow: 0 2px 8px rgba(0,0,0,0.07);
101
- background: #f3f4f6;
102
- }
103
- .container > div > div {
104
- padding: 0.5rem;
105
- }
106
- footer a {
107
- color: rgb(156 163 175) !important;
108
- }
109
- footer img {
110
- display: none !important;
111
- }
112
- </style>
113
- <style id="mofo">
114
- body {
115
- display: none !important;
116
- }
117
- </style>
118
- <script type="text/javascript">
119
- if (self === top || window.location.ancestorOrigins[0] === "https://huggingface.co") {
120
- var mofo = document.getElementById("mofo");
121
- mofo.parentNode.removeChild(mofo);
122
- } else {
123
- top.location = self.location;
124
- }
125
- </script>
126
- </head>
127
-
128
- <body
129
- style="
130
- margin: 0;
131
- padding: 0;
132
- display: flex;
133
- flex-direction: column;
134
- flex-grow: 1;
135
- "
136
- >
137
- <div
138
- id="root"
139
- style="display: flex; flex-direction: column; flex-grow: 1"
140
- ></div>
141
- <script src="html2canvas.js"></script>
142
- </body>
143
- </html>
 
1
  <!DOCTYPE html>
2
  <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>DALL·E Mini Generator</title>
7
+ <style>
8
+ body {
9
+ margin: 0;
10
+ padding: 0;
11
+ font-family: "Source Sans Pro", sans-serif;
12
+ background: linear-gradient(135deg, #ece9f7 0%, #d4f1f9 100%);
13
+ display: flex;
14
+ justify-content: center;
15
+ align-items: center;
16
+ min-height: 100vh;
17
+ }
18
+
19
+ .container {
20
+ background: #fff;
21
+ border-radius: 16px;
22
+ padding: 2rem;
23
+ box-shadow: 0 6px 30px rgba(0, 0, 0, 0.1);
24
+ max-width: 700px;
25
+ width: 100%;
26
+ text-align: center;
27
+ }
28
+
29
+ h1 {
30
+ margin-bottom: 0.5rem;
31
+ font-size: 1.8rem;
32
+ color: #333;
33
+ }
34
+
35
+ p {
36
+ margin-bottom: 1.5rem;
37
+ font-size: 1rem;
38
+ color: #666;
39
+ }
40
+
41
+ input {
42
+ width: 100%;
43
+ padding: 0.8rem 1rem;
44
+ border-radius: 10px;
45
+ border: 1px solid #ddd;
46
+ margin-bottom: 1rem;
47
+ font-size: 1rem;
48
+ background: #fafafa;
49
+ }
50
+
51
+ input:focus {
52
+ outline: none;
53
+ border-color: #7b61ff;
54
+ box-shadow: 0 0 0 2px rgba(123, 97, 255, 0.2);
55
+ }
56
+
57
+ button {
58
+ background: linear-gradient(90deg, #7b61ff, #5eead4);
59
+ border: none;
60
+ color: white;
61
+ font-size: 1rem;
62
+ font-weight: 600;
63
+ padding: 0.8rem 1.6rem;
64
+ border-radius: 10px;
65
+ cursor: pointer;
66
+ transition: 0.2s ease;
67
+ }
68
+
69
+ button:hover {
70
+ transform: translateY(-2px);
71
+ background: linear-gradient(90deg, #5eead4, #7b61ff);
72
+ }
73
+
74
+ .gallery {
75
+ margin-top: 1.5rem;
76
+ display: grid;
77
+ grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
78
+ gap: 1rem;
79
+ }
80
+
81
+ .gallery img {
82
+ width: 100%;
83
+ border-radius: 12px;
84
+ box-shadow: 0 2px 10px rgba(0,0,0,0.08);
85
+ background: #f9f9f9;
86
+ }
87
+ </style>
88
+ </head>
89
+ <body>
90
+ <div class="container">
91
+ <h1>🎨 DALL·E Mini Generator</h1>
92
+ <p>Generate AI-powered images from any text prompt.</p>
93
+
94
+ <input id="prompt" type="text" placeholder="Enter your prompt here..." />
95
+ <button onclick="generateImages()">Generate</button>
96
+
97
+ <div id="gallery" class="gallery"></div>
98
+ </div>
99
+
100
+ <script>
101
+ async function generateImages() {
102
+ const prompt = document.getElementById("prompt").value.trim();
103
+ const gallery = document.getElementById("gallery");
104
+
105
+ if (!prompt) {
106
+ alert("Please enter a prompt first!");
107
+ return;
108
+ }
109
+
110
+ gallery.innerHTML = "<p>⏳ Generating images...</p>";
111
+
112
+ try {
113
+ const response = await fetch("https://bf.dallemini.ai/generate", {
114
+ method: "POST",
115
+ headers: {
116
+ "Content-Type": "application/json",
117
+ "Accept": "application/json",
118
+ },
119
+ body: JSON.stringify({ prompt }),
120
+ });
121
+
122
+ const data = await response.json();
123
+ gallery.innerHTML = "";
124
+
125
+ data.images.forEach(imgBase64 => {
126
+ const img = document.createElement("img");
127
+ img.src = "data:image/png;base64," + imgBase64;
128
+ gallery.appendChild(img);
129
+ });
130
+ } catch (error) {
131
+ console.error(error);
132
+ gallery.innerHTML = "<p>⚠️ Error: Too much traffic, try again later.</p>";
133
+ }
134
+ }
135
+ </script>
136
+ </body>
137
+ </html>