@@ -1201,6 +1201,8 @@ def INPUT_TYPES(s):
12011201 CATEGORY = "📂 SDVN"
12021202
12031203 def apply_controlnet (self , model , vae , image , model_patch , preprocessor , resolution , strength , mask = None ):
1204+ image = UpscaleImage ().upscale ("Maxsize" , resolution , resolution , 1 , "None" , image )[0 ]
1205+ latent = ALL_NODE ["VAEEncode" ]().encode (vae , image )[0 ]
12041206 if preprocessor == "InvertImage" :
12051207 image = ALL_NODE ["ImageInvert" ]().invert (image )[0 ]
12061208 elif preprocessor != "None" :
@@ -1213,13 +1215,11 @@ def apply_controlnet(self, model, vae, image, model_patch, preprocessor, resolut
12131215 else :
12141216 print (
12151217 "You have not installed it yet Controlnet Aux (https://github.com/Fannovel16/comfyui_controlnet_aux)" )
1216- image = UpscaleImage ().upscale ("Maxsize" , resolution , resolution , 1 , "None" , image )[0 ]
12171218 if model_patch in self .modellist :
12181219 model_patch = ALL_NODE ["SDVN AnyDownload List" ]().any_download_list (model_patch )[0 ]
12191220 else :
12201221 model_patch = ALL_NODE ["ModelPatchLoader" ]().load_model_patch (model_patch )[0 ]
12211222 model = ALL_NODE ["QwenImageDiffsynthControlnet" ]().diffsynth_controlnet ( model , model_patch , vae , image , strength , mask )[0 ]
1222- latent = ALL_NODE ["VAEEncode" ]().encode (vae , image )[0 ]
12231223 results = ALL_NODE ["PreviewImage" ]().save_images (image )
12241224 results ["result" ] = (model , latent )
12251225 return results
0 commit comments