if(destinations.includes("comfyworkflows")&&!this.cw_sharekey_input.value&&!confirm("You have NOT set your ComfyWorkflows.com share key. Your art will NOT be connected to your account (it will be shared anonymously). Continue?")){
return;
}
constpotential_outputs=[];
constpotential_output_nodes=[];
// iterate over the array of nodes to find the ones that are marked as SaveImage
// TODO: Add support for AnimateDiffCombine, etc. nodes that save videos/gifs, etc.
alert("Failed to share your art. Please try again.");
this.close();
return;
}
}catch(e){
alert("Failed to share your art. Please try again.");
this.close();
return;
}
}
constresponse_json=awaitresponse.json();
if(response_json.comfyworkflows.url){
this.final_message.innerHTML="Your art has been shared: <a href='"+response_json.comfyworkflows.url+"' target='_blank'>"+response_json.comfyworkflows.url+"</a>";
if(response_json.matrix.success){
this.final_message.innerHTML+="<br>Your art has been shared in the ComfyUI Matrix server's #share channel!";
}
}else{
if(response_json.matrix.success){
this.final_message.innerHTML="Your art has been shared in the ComfyUI Matrix server's #share channel!";
}
}
this.final_message.style.color="green";
// hide the share button
this.share_button.textContent="Shared!";
this.share_button.style.display="none";
// this.close();
}
constres=
[
$el("tr.td",{width:"100%"},[
$el("font",{size:6,color:"white"},[`Share your art`]),
]),
$el("br",{},[]),
$el("details",{
style:{
border:"1px solid #999",
padding:"5px",
borderRadius:"5px",
backgroundColor:"#222"
}
},[
$el("summary",{
style:{
color:"white",
cursor:"pointer",
}
},[`Matrix account`]),
$el("div",{
style:{
display:"flex",
flexDirection:"row",
}
},[
$el("div",{
textContent:"Homeserver",
style:{
marginRight:"10px",
}
},[]),
this.matrix_homeserver_input,
]),
$el("div",{
style:{
display:"flex",
flexDirection:"row",
}
},[
$el("div",{
textContent:"Username",
style:{
marginRight:"10px",
}
},[]),
this.matrix_username_input,
]),
$el("div",{
style:{
display:"flex",
flexDirection:"row",
}
},[
$el("div",{
textContent:"Password",
style:{
marginRight:"10px",
}
},[]),
this.matrix_password_input,
]),
]),
$el("details",{
style:{
border:"1px solid #999",
marginTop:"10px",
padding:"5px",
borderRadius:"5px",
backgroundColor:"#222"
}
},[
$el("summary",{
style:{
color:"white",
cursor:"pointer",
}
},[`Comfyworkflows.com account`]),
$el("h4",{
textContent:"Share key (found on your profile page)",
},[]),
$el("p",{size:3,color:"white"},["When provided, your art will be saved to your account."]),
this.cw_sharekey_input,
]),
$el("div",{},[
$el("p",{size:3,color:"white"},[`Select where to share your art:`]),