File size: 828 Bytes
5704551
bb89ebf
5704551
 
 
 
 
bb89ebf
5704551
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
function(token_val, width, height, size){
    let app=document.querySelector("gradio-app");
    app.querySelector("#sdinfframe").style.height=height+"px";
    let frame=app.querySelector("#sdinfframe").contentWindow.document;
    if(frame.querySelector("#setup").value=="0")
    {
        window.my_setup=setInterval(function(){
            let frame=document.querySelector("gradio-app").querySelector("#sdinfframe").contentWindow.document;
            console.log("Check PyScript...")
            if(frame.querySelector("#setup").value=="1")
            {
                frame.querySelector("#draw").click();
                clearInterval(window.my_setup);
            }
        },100)
    }
    else
    {
        frame.querySelector("#draw").click();
    }
    return [token_val, width, height, size];
}