Spaces:
Running
Running
yasir
commited on
Update script.js
Browse files
script.js
CHANGED
@@ -298,40 +298,33 @@ if(isreal == false){
|
|
298 |
});
|
299 |
}*/
|
300 |
function final1(){
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
pi.innerText = 'you have reached your limit of 50 generation per hour, you will get 50 more image generaions after an hour!!'
|
314 |
-
}
|
315 |
-
})
|
316 |
-
.then((response) => response.text())
|
317 |
-
.then((data) => {
|
318 |
-
|
319 |
const img = document.createElement('img');
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
|
|
|
|
|
|
|
|
|
|
324 |
btn.disabled = false
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
.catch((error) => {
|
330 |
-
btn.disabled = false
|
331 |
-
console.error('An error occurred:', error);
|
332 |
-
pi.innerText =`An error occurred, try changing your prompt or use "Realistic Vision" Model for NSFW ${error}`;
|
333 |
-
});
|
334 |
-
}
|
335 |
|
336 |
|
337 |
final1()
|
|
|
298 |
});
|
299 |
}*/
|
300 |
function final1(){
|
301 |
+
const id = idlist[0].trim().replace(/^"|"$/g, '');
|
302 |
+
fetch(url2, {
|
303 |
+
method: 'POST',
|
304 |
+
headers: {
|
305 |
+
'Content-Type': 'application/json',
|
306 |
+
},
|
307 |
+
body: JSON.stringify({
|
308 |
+
id: id,
|
309 |
+
}),
|
310 |
+
})
|
311 |
+
.then((response) => response.text())
|
312 |
+
.then((data) => {
|
|
|
|
|
|
|
|
|
|
|
|
|
313 |
const img = document.createElement('img');
|
314 |
+
pi.innerHTML = ''
|
315 |
+
pi.innerText = ''
|
316 |
+
img.src = data.trim().replace(/^"|"$/g, '');
|
317 |
+
div.appendChild(img);
|
318 |
+
btn.disabled = false
|
319 |
+
console.log(data)
|
320 |
+
})
|
321 |
+
|
322 |
+
.catch((error) => {
|
323 |
btn.disabled = false
|
324 |
+
console.error('An error occurred:', error);
|
325 |
+
pi.innerText = 'An error occurred, try changing your prompt';
|
326 |
+
});
|
327 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
328 |
|
329 |
|
330 |
final1()
|