-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
251 lines (225 loc) · 13.1 KB
/
index.html
File metadata and controls
251 lines (225 loc) · 13.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
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
249
250
251
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>NanoBanana Pro LoRA Dataset Generator</title>
<link rel="stylesheet" href="style.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Outfit:wght@300;400;500;600;700&display=swap" rel="stylesheet">
</head>
<body>
<div class="app-container">
<!-- Header -->
<header class="header">
<div class="logo">
<span class="logo-icon">🍌</span>
<h1>NanoBanana Pro LoRA Dataset Generator</h1>
</div>
<div class="header-actions">
<button class="btn btn-icon" onclick="showApiKeyModal()" title="API Key Settings">🔑</button>
<div class="status-bar">
<span class="status-dot" id="statusDot"></span>
<span id="statusText">Checking...</span>
</div>
</div>
</header>
<!-- Main Content -->
<main class="main-content">
<!-- Sidebar -->
<aside class="sidebar">
<!-- Dataset Panel -->
<div class="panel">
<h2>📁 Dataset</h2>
<div class="dataset-count">
<div class="count" id="pairCount">0</div>
<small id="countLabel">pairs in memory</small>
</div>
<div style="margin-top: 16px; display: flex; flex-direction: column; gap: 8px;">
<button class="btn btn-primary" onclick="downloadZIP()">📥 Download ZIP</button>
<button class="btn btn-secondary" onclick="clearResults()">🗑️ Clear All</button>
</div>
</div>
<!-- Settings Panel -->
<div class="panel">
<h2>⚙️ Settings</h2>
<div class="form-group">
<label>Aspect Ratio</label>
<select id="aspectRatio">
<option value="1:1">1:1 (Square)</option>
<option value="16:9">16:9 (Landscape)</option>
<option value="9:16">9:16 (Portrait)</option>
<option value="4:3">4:3</option>
<option value="3:4">3:4</option>
</select>
</div>
<div class="form-group">
<label>Resolution</label>
<select id="resolution">
<option value="1K">1K ($0.15/img)</option>
<option value="2K">2K ($0.15/img)</option>
<option value="4K">4K ($0.30/img)</option>
</select>
</div>
<div class="form-group">
<label class="checkbox-label">
<input type="checkbox" id="useVisionCaption" checked>
<span>Vision Captions</span>
</label>
<small>Use AI to describe the generated images</small>
</div>
<div class="form-group">
<label>LLM/Vision Model</label>
<select id="llmModel">
<option value="google/gemini-2.5-flash">Gemini 2.5 Flash (fast)</option>
<option value="google/gemini-2.5-pro">Gemini 2.5 Pro</option>
<option value="anthropic/claude-3.5-sonnet">Claude 3.5 Sonnet</option>
<option value="openai/gpt-4o">GPT-4o</option>
</select>
</div>
</div>
</aside>
<!-- Main Area -->
<section class="workspace">
<!-- Generation Panel -->
<div class="panel">
<h2>🎨 Generate Dataset</h2>
<div class="auto-intro">
<p>🚀 <strong>Static version</strong>: Runs entirely in your browser! Just describe what you want, AI generates everything.</p>
</div>
<!-- Mode Selector -->
<div class="form-group">
<label>🎯 Generation Mode</label>
<div class="mode-selector">
<button type="button" class="mode-btn active" data-mode="pair" onclick="setMode('pair')">
<span class="mode-icon">🔄</span>
<span class="mode-label">Pair Mode</span>
<span class="mode-desc">START → END transformation</span>
</button>
<button type="button" class="mode-btn" data-mode="single" onclick="setMode('single')">
<span class="mode-icon">🖼️</span>
<span class="mode-label">Single Image</span>
<span class="mode-desc">Style/Aesthetic LoRA</span>
</button>
<button type="button" class="mode-btn" data-mode="reference" onclick="setMode('reference')">
<span class="mode-icon">📷</span>
<span class="mode-label">Reference Image</span>
<span class="mode-desc">Variations from uploaded image</span>
</button>
</div>
</div>
<!-- Reference Image Upload (hidden by default) -->
<div id="referenceUploadSection" class="form-group hidden">
<label>📷 Reference Image</label>
<div class="reference-upload">
<div class="upload-zone" id="uploadZone" onclick="document.getElementById('referenceInput').click()">
<input type="file" id="referenceInput" accept="image/*" style="display:none" onchange="handleReferenceUpload(event)">
<div class="upload-placeholder" id="uploadPlaceholder">
<span class="upload-icon">📤</span>
<span>Click to upload or drag & drop</span>
<small>Character, product, or style reference</small>
</div>
<img id="referencePreview" class="reference-preview hidden" alt="Reference">
</div>
<button type="button" class="btn btn-secondary btn-sm" onclick="clearReference()" id="clearRefBtn" style="display:none">✕ Clear</button>
</div>
<small>Upload an image to create variations based on it</small>
</div>
<div class="form-group">
<label>🎯 Dataset Theme</label>
<input type="text" id="theme" placeholder="Ex: portraits of diverse people, landscape photography, cute animals...">
</div>
<!-- Transformation (only for pair mode) -->
<div id="transformationSection" class="form-group">
<label>🔄 Transformation to Learn</label>
<textarea id="transformation" rows="2" placeholder="Ex: progressively zoom out from close-up to full body shot, keeping the subject centered"></textarea>
</div>
<!-- Action Name (only for pair mode) -->
<div id="actionNameSection" class="form-group">
<label>🏷️ Action Name <small style="opacity: 0.6">(optional - AI will generate)</small></label>
<input type="text" id="actionName" placeholder="Leave empty for AI to generate, or: unzoom, zoom_out...">
</div>
<div class="form-group">
<label>✨ Trigger Word <small style="opacity: 0.6">(optional - prepended to .txt files)</small></label>
<input type="text" id="triggerWord" placeholder="e.g., MYZOOM, MYSTYLE...">
</div>
<!-- Custom System Prompt -->
<div class="form-group">
<label>🧠 Custom System Prompt</label>
<div id="systemPromptSection" class="collapsible-content">
<textarea id="customSystemPrompt" rows="4" placeholder="Customize the AI prompt generation behavior..."></textarea>
<small>Leave empty for default. This controls how the AI generates creative prompts for your dataset.</small>
<button type="button" class="btn btn-secondary btn-sm" onclick="resetSystemPrompt()" style="margin-top: 8px;">↻ Reset to Default</button>
</div>
</div>
<div class="form-group">
<label>📊 Number of <span id="pairOrImageLabel">Pairs</span> (max 40)</label>
<input type="number" id="numPairs" value="10" min="1" max="40">
<small>Estimated cost: <span id="costEstimate">~$3.00</span></small>
</div>
<div class="form-group">
<label>⚡ Parallel Requests</label>
<input type="number" id="maxConcurrent" value="3" min="1" max="10">
<small>Higher = faster but uses more concurrent API calls</small>
</div>
<div class="auto-actions">
<button class="btn btn-generate" onclick="startGeneration()">
🚀 Start Generation
</button>
<button class="btn btn-secondary" onclick="stopGeneration()">
⏹️ Stop
</button>
</div>
</div>
<!-- Progress Panel -->
<div id="progressPanel" class="panel progress-panel hidden">
<h2>⏳ Generation Progress</h2>
<div class="progress-info">
<div class="progress-bar">
<div class="progress-fill" id="progressFill"></div>
</div>
<div class="progress-text">
<span id="progressCurrent">0</span> / <span id="progressTotal">0</span> <span id="progressLabel">pairs</span>
</div>
<div class="progress-status" id="progressStatus">Initializing...</div>
</div>
<div id="progressLog" class="progress-log"></div>
</div>
<!-- Results Panel -->
<div class="panel results-panel">
<h2>🖼️ Results</h2>
<div id="loadingIndicator" class="loading hidden">
<div class="spinner"></div>
<span>Generating...</span>
</div>
<div id="results" class="results-grid"></div>
</div>
</section>
</main>
<!-- API Key Modal -->
<div id="apiKeyModal" class="modal hidden">
<div class="modal-content">
<h2>🔑 API Key Settings</h2>
<p class="modal-desc">Enter your FAL API key. Get one free at <a href="https://fal.ai/dashboard/keys" target="_blank">fal.ai/dashboard/keys</a></p>
<div class="form-group">
<label>FAL API Key</label>
<div class="api-key-input">
<input type="password" id="apiKeyInput" placeholder="Enter your FAL API key...">
<button class="btn btn-icon" onclick="toggleKeyVisibility()" title="Show/Hide">
<span id="keyVisibilityIcon">👁️</span>
</button>
</div>
<small>Stored only in your browser. Never sent anywhere except FAL.</small>
</div>
<div class="modal-actions">
<button class="btn btn-secondary" onclick="hideApiKeyModal()">Cancel</button>
<button class="btn btn-danger" onclick="clearApiKey()">Clear Key</button>
<button class="btn btn-primary" onclick="saveApiKey()">Save Key</button>
</div>
</div>
</div>
</div>
<script type="module" src="app.js"></script>
</body>
</html>