@@ -139,7 +139,6 @@ def encrypt(self, project_name, template_id, images, **kwargs):
139139 PromptServer .instance .send_sync (
140140 "riceround_toast" , {"content" : "发布失败,请检查发布步骤" , "type" : "error" }
141141 )
142- return {}
143142 else :
144143 PromptServer .instance .send_sync (
145144 "riceround_toast" ,
@@ -575,8 +574,10 @@ def _transform_node_types(self, prompt):
575574 def add_decrypt_node (self , workflow ):
576575 new_node_ids = set ()
577576 self .last_node_id += 1
577+ decrypt_node_id = self .last_node_id
578+ decrypt_to_save_link_id = self .last_link_id + 1
578579 encrypt_node = {
579- "id" : self . last_node_id ,
580+ "id" : decrypt_node_id ,
580581 "type" : "RiceRoundDecryptNode" ,
581582 "pos" : [420 , 0 ],
582583 "size" : [500 , 150 ],
@@ -593,7 +594,10 @@ def add_decrypt_node(self, workflow):
593594 "slot_index" : 0 ,
594595 }
595596 ],
596- "properties" : {"Node name for S&R" : "RiceRoundDecryptNode" },
597+ "properties" : {
598+ "Node name for S&R" : "RiceRoundDecryptNode" ,
599+ "cnr_id" : "comfyui_riceround" ,
600+ },
597601 "widgets_values" : [str (self .template_id ), 735127949069071 , "randomize" ],
598602 }
599603 for idx , (owner_id , owner_node ) in enumerate (self .input_node_map .items ()):
@@ -611,11 +615,38 @@ def add_decrypt_node(self, workflow):
611615 encrypt_node ["inputs" ].append (input_entry )
612616 if link_type not in ["IMAGE" , "STRING" ]:
613617 link_type = "STRING"
614- links = [link_id , owner_id , 0 , self . last_node_id , idx , link_type ]
618+ links = [link_id , owner_id , 0 , decrypt_node_id , idx , link_type ]
615619 workflow ["links" ].append (links )
620+ self .last_node_id += 1
621+ save_image_node = {
622+ "id" : self .last_node_id ,
623+ "type" : "SaveImage" ,
624+ "pos" : [982 , 5 ],
625+ "size" : [315 , 58 ],
626+ "flags" : {},
627+ "order" : 21 ,
628+ "mode" : 0 ,
629+ "inputs" : [
630+ {
631+ "name" : "images" ,
632+ "type" : "IMAGE" ,
633+ "link" : decrypt_to_save_link_id ,
634+ "label" : "图像" ,
635+ }
636+ ],
637+ "outputs" : [],
638+ "properties" : {"Node name for S&R" : "SaveImage" , "cnr_id" : "comfy-core" },
639+ "widgets_values" : ["ComfyUI" ],
640+ }
641+ encrypt_node ["outputs" ][0 ]["links" ] = [decrypt_to_save_link_id ]
642+ workflow ["links" ].append (
643+ [decrypt_to_save_link_id , decrypt_node_id , 0 , self .last_node_id , 0 , "IMAGE" ]
644+ )
645+ new_node_ids .add (decrypt_node_id )
616646 new_node_ids .add (self .last_node_id )
617- workflow ["nodes" ].append ( encrypt_node )
647+ workflow ["nodes" ].extend ([ encrypt_node , save_image_node ] )
618648 workflow ["last_node_id" ] = self .last_node_id
649+ workflow ["last_link_id" ] = decrypt_to_save_link_id
619650 return new_node_ids
620651
621652 def output_file (self , workflow , prefix ):
0 commit comments