yasir commited on
Commit
40784d0
·
verified ·
1 Parent(s): e3a66bb

Update script.js

Browse files
Files changed (1) hide show
  1. script.js +25 -32
script.js CHANGED
@@ -298,40 +298,33 @@ if(isreal == false){
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)=>{
312
- if (response.status === 500) {
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
- pi.innerHTML = ''
321
- pi.innerText = ''
322
- img.src = data.trim().replace(/^"|"$/g, '');
323
- div.appendChild(img);
 
 
 
 
 
324
  btn.disabled = false
325
- console.log(data)
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()