Spaces:
Runtime error
Runtime error
xyplon
commited on
Commit
•
ba24613
1
Parent(s):
f555f13
Update static/models.js
Browse files- static/models.js +12 -1
static/models.js
CHANGED
@@ -9,7 +9,17 @@ let prompt = document.getElementById('prompt')
|
|
9 |
let negativePrompt = document.getElementById('negative-prompt')
|
10 |
let model = 'rvs4'
|
11 |
let style = 'Cinematic'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
|
|
|
13 |
|
14 |
const modelElement = document.getElementById('model');
|
15 |
modelElement.addEventListener('change', function() {
|
@@ -106,7 +116,8 @@ btn.onclick = async () => {
|
|
106 |
"width": Number(width),
|
107 |
"height": Number(height),
|
108 |
"model": model,
|
109 |
-
'style': style
|
|
|
110 |
};
|
111 |
|
112 |
|
|
|
9 |
let negativePrompt = document.getElementById('negative-prompt')
|
10 |
let model = 'rvs4'
|
11 |
let style = 'Cinematic'
|
12 |
+
function generateRandomString(length) {
|
13 |
+
var result = '';
|
14 |
+
var characters = 'abcdefghijklmnopqrstuvwxyz';
|
15 |
+
var charactersLength = characters.length;
|
16 |
+
for (var i = 0; i < length; i++) {
|
17 |
+
result += characters.charAt(Math.floor(Math.random() * charactersLength));
|
18 |
+
}
|
19 |
+
return result;
|
20 |
+
}
|
21 |
|
22 |
+
var hash = generateRandomString(11);
|
23 |
|
24 |
const modelElement = document.getElementById('model');
|
25 |
modelElement.addEventListener('change', function() {
|
|
|
116 |
"width": Number(width),
|
117 |
"height": Number(height),
|
118 |
"model": model,
|
119 |
+
'style': style,
|
120 |
+
"hash": hash
|
121 |
};
|
122 |
|
123 |
|