@@ -1146,6 +1146,7 @@ class KontextReference:
11461146 @classmethod
11471147 def INPUT_TYPES (s ):
11481148 return {"required" : {
1149+ "img_size" : ("INT" , {"default" : 1024 , "min" : 0 , "max" : 4096 , "step" : 1 }),
11491150 "conditioning" : ("CONDITIONING" , ),
11501151 "vae" : ("VAE" , ),
11511152 },
@@ -1156,21 +1157,28 @@ def INPUT_TYPES(s):
11561157 },
11571158 }
11581159
1159- RETURN_TYPES = ("CONDITIONING" ,)
1160+ RETURN_TYPES = ("CONDITIONING" , "INT" , "INT" )
1161+ RETURN_NAMES = ("conditioning" , "width" , "height" )
11601162 FUNCTION = "append"
11611163
11621164 CATEGORY = "📂 SDVN"
11631165
1164- def append (s , conditioning , vae , image , image2 = None , image3 = None ):
1166+ def append (s , img_size , conditioning , vae , image , image2 = None , image3 = None ):
11651167 img_list = [image , image2 , image3 ]
11661168 for img in img_list :
11671169 if img is not None :
1168- img = UpscaleImage ().upscale ("Maxsize" , 1024 , 1024 , 1 , "None" , img )[0 ]
1170+ width , height = ALL_NODE ["SDVN Image Size" ]().imagesize (image = image , latent = None , maxsize = img_size )
1171+ break
1172+ else :
1173+ width , height = img_size , img_size
1174+ for img in img_list :
1175+ if img is not None :
1176+ img = UpscaleImage ().upscale ("Maxsize" , img_size , img_size , 1 , "None" , img )[0 ]
11691177 latent = ALL_NODE ["VAEEncode" ]().encode (vae , img )[0 ]
11701178 else :
11711179 latent = None
11721180 conditioning = ALL_NODE ["ReferenceLatent" ]().append (conditioning , latent )[0 ]
1173- return (conditioning ,)
1181+ return (conditioning ,width , height , )
11741182
11751183class CheckpointDownload :
11761184 @classmethod
0 commit comments