oldjeff123 commited on
Commit
86652ca
·
verified ·
1 Parent(s): f87a902

Upload index.html with huggingface_hub

Browse files
Files changed (1) hide show
  1. index.html +110 -23
index.html CHANGED
@@ -1,29 +1,116 @@
 
1
  <!DOCTYPE html>
2
  <html lang="en">
3
-
4
  <head>
5
- <meta charset="UTF-8" />
6
- <link rel="stylesheet" href="style.css" />
7
-
8
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
9
- <title>Transformers.js - Object Detection</title>
 
10
  </head>
11
-
12
  <body>
13
- <h1>Object Detection w/ 🤗 Transformers.js</h1>
14
- <label id="container" for="upload">
15
- <svg width="25" height="25" viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
16
- <path fill="#000"
17
- d="M3.5 24.3a3 3 0 0 1-1.9-.8c-.5-.5-.8-1.2-.8-1.9V2.9c0-.7.3-1.3.8-1.9.6-.5 1.2-.7 2-.7h18.6c.7 0 1.3.2 1.9.7.5.6.7 1.2.7 2v18.6c0 .7-.2 1.4-.7 1.9a3 3 0 0 1-2 .8H3.6Zm0-2.7h18.7V2.9H3.5v18.7Zm2.7-2.7h13.3c.3 0 .5 0 .6-.3v-.7l-3.7-5a.6.6 0 0 0-.6-.2c-.2 0-.4 0-.5.3l-3.5 4.6-2.4-3.3a.6.6 0 0 0-.6-.3c-.2 0-.4.1-.5.3l-2.7 3.6c-.1.2-.2.4 0 .7.1.2.3.3.6.3Z">
18
- </path>
19
- </svg>
20
- Click to upload image
21
- <label id="example">(or try example)</label>
22
- </label>
23
- <label id="status">Loading model...</label>
24
- <input id="upload" type="file" accept="image/*" />
25
-
26
- <script src="index.js" type="module"></script>
27
- </body>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
 
29
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!-- index.html content here -->
2
  <!DOCTYPE html>
3
  <html lang="en">
 
4
  <head>
5
+ <meta charset="UTF-8" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
7
+ <title>AI Tentacle Chat - Text to Image Generator</title>
8
+ <link rel="stylesheet" href="style.css" />
9
+ <meta name="theme-color" content="#0f172a" />
10
+ <meta name="description" content="AI chat-bot that takes text input and generates an image of a single tentacle curved into your described shape. Include style, texture, and shape details in your message." />
11
  </head>
 
12
  <body>
13
+ <header class="app-header">
14
+ <div class="brand">
15
+ <svg class="logo" viewBox="0 0 24 24" aria-hidden="true">
16
+ <path d="M12 2c5.5 0 10 4.2 10 9.5S15.5 21 12 22c0 0 4-3 4-8.5S12 2 12 2z" fill="currentColor"></path>
17
+ </svg>
18
+ <h1>AI Tentacle Chat Bot</h1>
19
+ </div>
20
+ <nav class="header-links">
21
+ <a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank" rel="noopener noreferrer">Built with anycoder</a>
22
+ <a id="model-docs" href="#" target="_blank" rel="noopener noreferrer" aria-label="GPT-5 documentation">GPT-5</a>
23
+ </nav>
24
+ </header>
25
+
26
+ <main class="container">
27
+ <section class="panel left-panel" aria-labelledby="prompt-heading">
28
+ <h2 id="prompt-heading">Chat with AI Bot</h2>
29
+ <p class="helper">Send a text message to the AI chat-bot describing a single tentacle. Include the style, texture, and shape you want it to curve into. The bot will generate an image based on your text input.</p>
30
+
31
+ <form id="prompt-form" novalidate>
32
+ <label class="field" for="prompt">
33
+ <span class="field-label">Chat message</span>
34
+ <textarea id="prompt" name="prompt" rows="6" required placeholder="Describe the single tentacle’s style, texture, and the exact shape it should curve into (e.g., treble clef, heart, S-curve)."></textarea>
35
+ </label>
36
+
37
+ <div class="row">
38
+ <label class="field grow" for="negPrompt">
39
+ <span class="field-label">Negative prompt (optional)</span>
40
+ <input id="negPrompt" name="negPrompt" type="text" placeholder="e.g., multiple tentacles, extra limbs, text, watermark" />
41
+ </label>
42
+ <label class="field small" for="steps">
43
+ <span class="field-label">Steps</span>
44
+ <input id="steps" name="steps" type="number" min="4" max="50" value="20" />
45
+ </label>
46
+ </div>
47
 
48
+ <div class="row">
49
+ <label class="field small" for="width">
50
+ <span class="field-label">Width</span>
51
+ <input id="width" name="width" type="number" min="256" max="1024" step="64" value="512" />
52
+ </label>
53
+ <label class="field small" for="height">
54
+ <span class="field-label">Height</span>
55
+ <input id="height" name="height" type="number" min="256" max="1024" step="64" value="512" />
56
+ </label>
57
+
58
+ <label class="toggle field">
59
+ <span class="field-label">Use GPU (WebGPU)</span>
60
+ <div class="toggle-wrap">
61
+ <input type="checkbox" id="useGPU" name="useGPU" />
62
+ <span class="toggle-switch" aria-hidden="true"></span>
63
+ </div>
64
+ <span id="gpu-support" class="hint" role="status" aria-live="polite"></span>
65
+ </label>
66
+ </div>
67
+
68
+ <button id="generate" type="submit" class="primary-btn">
69
+ <span class="btn-text">Send Message & Generate Image</span>
70
+ <span class="spinner" aria-hidden="true"></span>
71
+ </button>
72
+ <div id="status" class="status" role="status" aria-live="polite"></div>
73
+ </form>
74
+
75
+ <details class="tips">
76
+ <summary>Prompt tips</summary>
77
+ <ul>
78
+ <li>Always specify it’s a single tentacle.</li>
79
+ <li>Describe the exact shape (e.g., “S-curve”, “heart shape”, “treble clef”).</li>
80
+ <li>Add style and texture cues (glossy, bioluminescent, clay, watercolor, photorealistic).</li>
81
+ <li>Use a negative prompt to avoid extra limbs or multiple tentacles.</li>
82
+ </ul>
83
+ </details>
84
+ </section>
85
+
86
+ <section class="panel right-panel" aria-labelledby="result-heading">
87
+ <div class="result-header">
88
+ <h2 id="result-heading">AI Bot Response</h2>
89
+ <div class="actions">
90
+ <button id="downloadBtn" class="secondary-btn" disabled>Download</button>
91
+ <button id="copySeedBtn" class="secondary-btn" disabled>Copy seed</button>
92
+ </div>
93
+ </div>
94
+ <div class="canvas-wrap">
95
+ <canvas id="resultCanvas" width="512" height="512" role="img" aria-label="Generated tentacle image"></canvas>
96
+ <div id="overlay" class="overlay hidden" aria-hidden="true">
97
+ <div class="loader" aria-hidden="true"></div>
98
+ <p id="overlayText">Loading model…</p>
99
+ </div>
100
+ </div>
101
+ <p class="note">Chat Bot Output: Your text message generates a single tentacle image</p>
102
+ </section>
103
+ </main>
104
+
105
+ <footer class="footer">
106
+ <p>Made with transformers.js in the browser. No data leaves your device.</p>
107
+ </footer>
108
+
109
+ <!-- Required transformers.js import snippet -->
110
+ <script type="module">
111
+ import { pipeline } from 'https://cdn.jsdelivr.net/npm/@huggingface/transformers@3.7.3';
112
+ </script>
113
+ <script type="module" src="index.js"></script>
114
+ </body>
115
+ </html>
116
+ ```