Spaces:
Runtime error
Runtime error
File size: 1,089 Bytes
09c675d 5704551 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
function(token_val, width, height, size, model_choice, model_path){
let app=document.querySelector("gradio-app");
app=app.shadowRoot??app;
app.querySelector("#sdinfframe").style.height=80+Number(height)+"px";
// app.querySelector("#setup_row").style.display="none";
app.querySelector("#model_path_input").style.display="none";
let frame=app.querySelector("#sdinfframe").contentWindow.document;
if(frame.querySelector("#setup").value=="0")
{
window.my_setup=setInterval(function(){
let app=document.querySelector("gradio-app");
app=app.shadowRoot??app;
let frame=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, model_choice, model_path];
} |