DALL·E mini Bruteforcer

Clicks the run button until success

当前为 2022-06-12 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name DALL·E mini Bruteforcer
  3. // @namespace HKR
  4. // @match https://hf.space/static/dalle-mini/dalle-mini/index.html
  5. // @match https://huggingface.co/spaces/dalle-mini/dalle-mini
  6. // @grant none
  7. // @version 1.0
  8. // @author HKR
  9. // @description Clicks the run button until success
  10. // ==/UserScript==
  11.  
  12. if(window.location.hostname == "hf.space") {
  13. (() => {
  14. const intervalMs = 5000;
  15.  
  16. window.alert = txt => {
  17. console.error(txt);
  18.  
  19. if(txt.includes("Too much traffic")) {
  20. console.warn(`\n\nWaiting ${intervalMs/1000} seconds and trying again...\n\n`);
  21. setTimeout(() => document.querySelector(".self-start").click(), intervalMs);
  22. }
  23. }
  24. })();
  25. }