
    
3js                         S SK rS SKrS SKrS SKrS SKrS SKrS SKJr  S SK	J
r
  S SKJr  S SKrS SKJr  SSKJr  S rS	 rS
 rSS jr " S S\R,                  5      rg)    N)Image)common_upscale)io)MAX_RESOLUTION   )string_to_colorc                     US:X  aK  [        U R                  S5      R                  SSSS5      XX45      R                  SS5      S S 2S S 2S S 2S4   $ [        U R                  S5      XX45      R	                  S5      $ )Nlanczos      r   )r   	unsqueezerepeatmovedimsqueeze)maskwidthheightmethodcrops        W/home/wildlama/comfy/ComfyUI/custom_nodes/ComfyUI-KJNodes/nodes/image_transform_node.py_upscale_maskr      sy    dnnQ/66q!QBESY`hhijlnopqstvwyzpz{{$..+UFIQQRSTT    c                 Z    [        U R                  S5      XSS5      R                  S5      $ )z8Resize a 3D (B,H,W) tensor using bilinear interpolation.r   bilineardisabled)r   r   r   )tensorr   r   s      r   _resize_single_channelr      s*    &**1-uj*U]]^_``r   c                  .   [         R                  R                  SSS[        SSS9[         R                  R                  SSS[        SSS9[         R                  R                  SSS[        SS	S9[         R                  R                  S
SS[        SSS9/$ )zMShared pad_top/bottom/left/right input definitions for extra_padding options.pad_topr   r   zPadding pixels on top.defaultminmaxsteptooltip
pad_bottomzPadding pixels on bottom.pad_leftzPadding pixels on left.	pad_rightzPadding pixels on right.)r   IntInputr    r   r   _pad_inputsr-      s     	Yqn1Vno
\1!aYtu
Z~AWpq
[!QXrs	 r   c           	         U R                   S   U R                   S   pX-   U-   n
X-   U-   nUS:X  a  U=(       d    / SQn[        R                  " U R                   S   XU R                   S   U R                  U R                  S9n[        [        SU R                   S   5      5       H  nX   USS2SS2SS2U4'   M     XSS2XU-   2X3U	-   2SS24'   U$ US	:X  GaM  [        R                  " U R                   S   XU R                   S   U R                  U R                  S9nXSS2XU-   2X3U	-   2SS24'   US:  a4  U SS2SS2SS2SS24   R                  S
US
S
5      USS2SU2X3U	-   2SS24'   US:  a6  U SS2S
S2SS2SS24   R                  S
US
S
5      USS2X-   S2X3U	-   2SS24'   US:  a4  USS2SS2X3S-   2SS24   R                  S
S
US
5      USS2SS2SU2SS24'   US:  a;  USS2SS2X9-   S-
  X9-   2SS24   R                  S
S
US
5      USS2SS2X9-   S2SS24'   U$ US:X  aY  X-   S-
  U	-  S-   nX-   S-
  U-  S-   nU R                  SUUS5      nXU	-  -
  U	-  nXU-  -
  U-  nUSS2UUU
-   2UUU-   2SS24   $ US:X  a  U R                  S5      nU R                  S5      nU R                  S5      R                  S5      n[        R                  " [        R                  " U U/SS9[        R                  " UU/SS9/SS9nUR                   S   UR                   S   nnUU-   S-
  U-  S-   nU
U-   S-
  U-  S-   nUR                  SUUS5      nUUU-  -
  U-  nUUU-  -
  U-  nUSS2UUU
-   2UUU-   2SS24   $ U $ )zApply padding to a BHWC tensor. Returns the padded tensor.
mode: 'color' or 'edge'
edge_mode: 'clamp', 'repeat', 'mirror' (only used when mode='edge')
fill_rgb: list of [r, g, b] float values 0-1 (only used when mode='color')
r   r   color)        r0   r0   r   r   devicedtypeNclampr   r   mirror)dim)shapetorchzerosr2   r3   ranger#   expandr   flipcat)r   r    r'   r(   r)   mode	edge_modefill_rgbhwnew_hnew_wfillpaddedctiles_xtiles_ytiledoff_xoff_y	flipped_h	flipped_v
flipped_hvmirror_blockmb_hmb_ws                             r   _apply_paddingrS   &   s    <<?FLLOqK*$EL9$Ew*?V\\!_eFLLOTZTaTaioiuiuvs1fll1o./A!%F1aA: 0?Eq'!)#Xqj%8!;< GV\\!_eFLLOTZTaTaioiuiuv?Eq'!)#Xqj%8!;<Q;:@AaCA:N:U:UVXZacegi:jF1hwh! 3Q67><B1bc1a<<P<W<WXZ\fhjln<oF1gij(A:"5q89a<)/1hz6I10L)M)T)TUWY[]egi)jF1a(A%&q=+1!Q
1XZ8OQR2R+S+Z+Z[]_aclnp+qF1aa'(	h	9q=Q&*9q=Q&*a'15\!Q&q[A%QeEk)5u+<a?@@	h	KKN	KKN	[[^((+
yyIIvy)q1IIy*-15"
  "''*L,>,>q,Ad4<!#,q04<!#,q0##Aw;4'4/$&$.QeEk)5u+<a?@@Mr   c                   :    \ rS rSr\S 5       r\ SS j5       rSrg)ImageTransformKJ`   c           $         [         R                  " SSS/ SQSS[         R                  R                  S[         R                  R	                  S[         R
                  [         R                  /5      S	S
9[         R                  R                  SSSS9[         R                  R                  SSS[        SSS9[         R                  R                  SSS[        SSS9[         R                  R                  S/ SQSSS9[         R                  R                  S[         R                  R                  S/ S9[         R                  R                  S/ S9[         R                  R                  S/ S9[         R                  R                  S/ S9[         R                  R                  S / S9[         R                  R                  S![         R                  R                  S"S#S$S%S&S'S9[         R                  R                  S(S#S$S%S&S)S9/S9[         R                  R                  S*[         R                  R                  S+/ S,QS-S.S9[         R                  R                  S"S#S$S%S&S'S9[         R                  R                  S(S#S$S%S&S)S9/S9[         R                  R                  S/[         R                  R                  S0S%S&S1S2S3S9[         R                  R                  S4S%S&S1S2S5S9/S9/S69[         R                  R                  S7S8SS9SS:9[         R                  R                  S;[         R                  R                  S</ S9[         R                  R                  S![        5       S9[         R                  R                  S*[        5       [         R                  R                  S+/ S,QS-S.S9/-   S9[         R                  R                  S=[        5       S9[         R                  R                  S>[        5       [         R                  R                  S+/ S,QS-S.S9/-   S9/S69[         R                  R                  S?[         R                  R                  S</ S9[         R                  R                  S@/ S9/S69[         R                  R                  SASBSSSC9/
[         R                  R                  [         R                  R	                  S[         R
                  [         R                  /5      SDSESSF9[         R                  R                  SGSHSSI9[         R                   R                  SJSJSSI9[         R                  R                  SKSKSSI9[         R                  R                  SLSLSMSN9[         R                  R                  SOSOSPSN9/SQ9$ )RNrU   zImage Transform KJzKJNodes/image)
resizer   padupscalezkeep proportionbboxzbounding box	transformrotater5   Tu  
Interactive image transform node: crop, resize, pad, and rotate.  
Connect an image input — the preview appears automatically.  

Cropping:  
Click + drag to draw a crop region.  
Drag inside to move, drag edges/corners to resize.  
Right-click to delete a region.  
Ctrl to snap to grid.  
Shift + resize to constrain aspect ratio.  
Alt + resize to resize symmetrically.  

Padding:  
Shift + drag to adjust padding position.

Rotate button enables rotation cross (drag to rotate, right-click to reset).  
Set target_width/height to resize output (0 = keep original).  
Use keep_proportion to control how the image fits the target.  
Use extra_padding to add padding with color or edge fill (clamp/repeat/mirror).imageimg_or_maskzThe image or mask to transform.)r&   r   z/Optional mask to transform alongside the image.)optionalr&   target_widthr   r   z2Target output width. 0 = keep original dimensions.r!   target_heightz3Target output height. 0 = keep original dimensions.upscale_method)znearest-exactr   areabicubicr
   r
   z"Interpolation method for resizing.)optionsr"   r&   keep_proportionkeep_long_edge)keyinputskeep_short_edgetotal_pixelsstretchr   	pad_colorpad_x      ?r0         ?g{Gz?zuHorizontal position of content within padding (0=left, 0.5=center, 1=right). Shift+drag content in preview to adjust.pad_yzsVertical position of content within padding (0=top, 0.5=center, 1=bottom). Shift+drag content in preview to adjust.pad_edger?   )r4   r   r5   r4   zOclamp: extend edge pixels. repeat: tile the image. mirror: tile with mirroring.
multiplier
width_multg      0@g?z'Multiply the crop width by this factor.height_multz(Multiply the crop height by this factor.)rf   divisible_byr   i   )r"   r#   r$   r%   extra_paddingr   pad_crop_colorpad_crop_edgeinvert_cropenabledbboxes )r"   
socketlessadvancedcroppedoutput)iddisplay_nameis_output_listcropped_maskoutput_mask)r   r   r[   	bbox_maskr   zWidth of the output image.)r   r&   r   zHeight of the output image.)node_idr   categorysearch_aliasesis_experimentaldescriptionrj   outputs)r   Schema	MatchTyper+   Templater   Maskr*   r   ComboDynamicComboOptionFloatr-   StringOutputBBOX)clss    r   define_schemaImageTransformKJ.define_schemaa   s8   yy&-$ L S( ""7BLL,A,A-RTRZRZ\^\c\cQd,e  pQ"  Rft=no^QA>XY  dX  Y_aQNYZ  eZ  [/9t  H  Rv  w%%&7OO**/?*KOO**/@*LOO**~b*IOO**y*DOO**vb*AOO**{w#TX %\ ' ]w#TX %Z ' [D*  OO**z{<Ycj$u ' ww#TX %\ ' ]w#TX %Z ' [C*  OO**||SdPT[_$M ' O}ctQU\`$N ' PE* )B% 6 ^QA3QO%%oOO**z"*EOO**{;=*QOO**z+-{<Ycj$u ' wS C*  OO**/?*VOO**{}{<Ycj$u ' wX H* @%  %%mOO**z"*EOO**y*D>%  		"PTUg4l ##BLL$9$9-"((TVT[T[I\$]bk  {C  TX#  Y~MZ^_vF4P{UYZgGEabhXGde]V
 V	
r   Nc                 #  ^$ UR                  SS5      nUR                  SS5      nUR                  SS5      nUR                  SS5      nUR                  SS5      nUS	   nUR                  S
S5      nUR                  SS5      nUR                  SS5      nUR                  SS5      nUR                  SS5      nUR                  SS5      nUS   n/ SQnU	(       a@   [        R                  " U	5      n[        U[        5      (       a  SU;   a  [        US   5      nUS S  Vs/ s H  nUS-  PM
     nnUR                  S:H  nU(       a#  UR                  S5      R                  SSSS5      n[        R                  " 5       n[        R                  " US   R                  5       R!                  5       S-  R#                  [$        R&                  5      5      nS[(        R*                  " SS5      S S3nUR-                  [.        R0                  R3                  UU5      SSS9  S U/0nUR4                  S   nUR4                  S!   n / n!S"n"U	(       a   [        R                  " U	5      n#[        U#[        5      (       a[  U#R                  S#/ 5       V$^$s/ s H*  m$T$(       d  M  [7        U$4S$ jS% 5       5      (       d  M(  T$PM,     n!n$U#R                  S&S"5      n"OM[        U#[8        5      (       a8  U# V$^$s/ s H*  m$T$(       d  M  [7        U$4S' jS% 5       5      (       d  M(  T$PM,     n!n$[:        R<                  " SUU UR>                  S(9n%U"S:w  Gah  SS)K J!n&  SS K"J#s  J$n'  Un(US*;   =(       d    US+:H  n)U)(       Ga  UR4                  S   UR4                  S!   n+n*[K        U*U+5      n,URM                  SS5      n-U'RO                  U-U,U,U,U,/S,S-9n.U&" U.U"* S.U(S/9n/U/R4                  S!   U/R4                  S   n1n0U0S!-  U1S!-  n3n2U/S S 2S S 2U2U*S!-  -
  U2U*S!-  -
  U*-   2U3U+S!-  -
  U3U+S!-  -
  U+-   24   RM                  SS5      nU
bm  U'RO                  U
R                  S5      U,U,U,U,/S,S-9n4U&" U4U"* S.S"/S/9n5U5S S 2S S 2U2U*S!-  -
  U2U*S!-  -
  U*-   2U3U+S!-  -
  U3U+S!-  -
  U+-   24   RQ                  S5      n
U'RO                  U%R                  S5      U,U,U,U,/S0SS19n6U&" U6U"* S.S"/S/9n7U7S S 2S S 2U2U*S!-  -
  U2U*S!-  -
  U*-   2U3U+S!-  -
  U3U+S!-  -
  U+-   24   RQ                  S5      n%OU&" URM                  SS5      U"* S2U(S/9RM                  SS5      nU
b)  U&" U
R                  S5      U"* S2S"/S/9RQ                  S5      n
U&" U%R                  S5      U"* S2S"/S/9RQ                  S5      n%UR4                  S   nUR4                  S!   n U
bl  U
R4                  S3   U:w  d  U
R4                  S   U :w  aF  U
R4                  S3   U :X  a&  U
R4                  S   U:X  a  U
RS                  S3S5      n
O[U        U
U U5      n
US4;   n8US4;   n9U8(       Ga  U9(       Gd  US:  d  US:  d  US:  d  US:  a  US5:X  a  S6OS7n:[W        UUUUUU:UU5      n;U;nUR4                  S   nUR4                  S!   n [:        RX                  " SUU U%R>                  S(9n<U%U<S S 2UUU%R4                  S   -   2UUU%R4                  S!   -   24'   U<n%U
bi  [:        RX                  " U
R4                  S   UU U
R>                  U
RZ                  S89n=U
U=S S 2UUU
R4                  S   -   2UUU
R4                  S!   -   24'   U=n
U!(       d  S /n!/ n>/ n?/ n@/ nAU! G	H  nBUBS LnCUC(       Ga  WBR                  S9S5      nDUBR                  S:S5      nEUDS:  a  U WD-  OSnFWES:  a  UWE-  OSnG[]        [_        WBS;   UBS<   5      WF-  5      nH[]        [_        UBS=   UBS>   5      UG-  5      nI[]        [K        UBS;   UBS<   5      UF-  5      nJ[]        [K        UBS=   UBS>   5      UG-  5      nK[K        S[_        UHU S-
  5      5      nH[K        S[_        UIUS-
  5      5      nI[K        UHS-   [_        UJU 5      5      nJ[K        UIS-   [_        UKU5      5      nKUS S 2UIUK2UHUJ2S S 24   nLU%S S 2UIUK2UHUJ24   nMW@Ra                  UHUIUJUH-
  UKUI-
  45        [:        RX                  " SUU 5      nNSUNSUIUK2UHUJ24'   WARa                  UN5        U
b  U
S S 2WIWK2WHWJ24   OS nOOMUnLU%nMW@Ra                  SSU U45        WARa                  [:        R<                  " SUU 5      5        U
nOSSU U4u  nHnInJnKUS?:X  a>  WLR4                  S   ULR4                  S!   nQnP[c        UQU-  5      nR[c        UPU-  5      nSURnUSnUS:  d  US:  GaX  WLR4                  S   ULR4                  S!   nQnPUS:  a  UOWQnRUS:  a  UOWPnSUS:  =(       d    US:  =(       d    US:  =(       d    US:  nTUS4;   nUUT(       a>  WU(       d  U8(       d0  US:  a  [K        SWRU-
  U-
  5      nRUS:  a  [K        SWSU-
  U-
  5      nSUS@:X  a0  [_        WRWQ-  WSWP-  5      nV[c        UQUV-  5      nR[c        UPUV-  5      nSGOUSA:X  a0  [K        WRWQ-  WSWP-  5      nV[c        UQUV-  5      nR[c        UPUV-  5      nSGOUSB:X  aP  WRWS-  nWWQWP-  nX[]        [d        Rf                  " UWUX-  5      5      nS[]        [d        Rf                  " UWUX-  5      5      nRGOIUSC:X  a  [K        WRWQ-  WSWP-  5      nV[c        UQUV-  5      nY[c        UPUV-  5      nZ[i        WLRM                  SS5      UYUZUSD5      n[U[RM                  SS5      nLWOb  [k        WOWYWZUSD5      nO[U        WMWYWZ5      nMUYWR-
  S!-  n3UZWS-
  S!-  n2WLS S 2U2U2US-   2U3U3UR-   2S S 24   nLWOb  WOS S 2U2U2WS-   2U3U3WR-   24   nOWMS S 2U2U2WS-   2U3U3WR-   24   nMGOqUS4;   Gaj  [_        WRWQ-  WSWP-  5      nV[c        UQUV-  5      nY[c        UPUV-  5      nZ[i        WLRM                  SS5      UYUZUS5      n[U[RM                  SS5      n\US:  a  UOWQn]US:  a  UOWPn^[c        W]WY-
  U-  5      n_[c        U^WZ-
  U-  5      n`U]U_-
  UY-
  naU^U`-
  UZ-
  nbU]nRU^nSUS+:X  a  S7OS6n:[W        W\W`WbW_WaU:UU5      nLWOb^  [k        WOWYWZUS5      nc[:        RX                  " UcR4                  S   WSWRUcR>                  UcRZ                  S89n4UcU4S S 2W`U`UZ-   2W_U_UY-   24'   U4nO[U        WMWYWZ5      nd[:        RX                  " SWSWRUMR>                  S(9n6UdU6S S 2W`U`UZ-   2W_U_UY-   24'   U6nMUS:  a  WRURU-  -
  nRWSUSU-  -
  nSWRS:  a  WSS:  a  USE;   aO  [i        WLRM                  SS5      WRWSUS5      RM                  SS5      nLWOb  [k        WOWRWSUS5      nO[U        WMWRWS5      nMOWLS S 2S WS2S WR2S S 24   nLWOb  WOS S 2S WS2S WR24   nOWMS S 2S WS2S WR24   nMOUS:  a  WLR4                  S!   ULR4                  S!   U-  -
  neULR4                  S   ULR4                  S   U-  -
  nfUeULR4                  S!   :w  d  WfWLR4                  S   :w  a0  WLS S 2S Wf2S We2S S 24   nLWOb  WOS S 2S Wf2S We24   nOWMS S 2S Wf2S We24   nMUS4;   ngU8(       Gd9  Wg(       Gd1  US:  d  US:  d  US:  d  US:  Ga  WLR4                  S   ULR4                  S!   ninhUSF:X  a  S7OS6n:[W        WLUUUUU:UU5      nLULR4                  S   ULR4                  S!   nknjWObO  [:        RX                  " WOR4                  S   WjWkUOR>                  UORZ                  S89nlUOUlS S 2UUWh-   2UUWi-   24'   UlnOWMR4                  S3   UMR4                  S   nnnmUmWh:w  d  WnWi:w  a  [U        WMWiWh5      nM[:        RX                  " SWjWkWMR>                  S(9noUMUoS S 2UUWh-   2UUWi-   24'   UonMWOc2  [:        RX                  " SWLR4                  S   ULR4                  S!   5      nOWMb  WOR4                  S   UOR4                  S!   nqnpWMR4                  S   UMR4                  S!   nnnmUmUp:w  d  WnWq:w  a  [U        WMWqWp5      nMSWMRm                  SS5      -
  nr[:        RJ                  " WOUr5      nOUSG:X  aT  WC(       aM  URo                  5       ns[q        [_        SUsR4                  S   5      5       H  nUU   WsS S 2WIWK2WHWJ2U4'   M     WsnLU(       a  WLS S 2S S 2S S 2S4   nLU>Ra                  WL5        U?Ra                  WO5        G	M     U>S   R4                  S!   U>S   R4                  S   nunt[r        Rt                  " U>U?W@WAUtUuUSH9$ ! [        R                  [        4 a     GNzf = fs  snf s  sn$f s  sn$f ! [        R                   a     GNf = f)INr?   r4   ro   rp   rr   ru   rq   rv   rg   r    r   r'   r(   r)   rx   r   r{   )r   r   r   	fillColorr   g     o@r   r      crop_preview_i 06xz.webpWEBPP   )formatqualitypreview_filenamer   r0   r}   c              3   ,   >#    U  H	  oT;   v   M     g 7fNr,   .0kbs     r   	<genexpr>+ImageTransformKJ.execute.<locals>.<genexpr>   s$       RH  cG]^WXRX  cG   )startXstartYendXendYrotationc              3   ,   >#    U  H	  oT;   v   M     g 7fr   r,   r   s     r   r   r      s     ?uPt1QPtr   )r2   )r]   )rs   rz   rs   	replicate)r>   F)r;   rE   constant)r>   valueT)rn   rs   rn   r/   edger1   previewWidthpreviewHeightr   r   r   r   rt   rh   rk   rl   r   center)rm   rh   rk   rl   rt   rz   r|   )ui);getjsonloads
isinstancedictr   JSONDecodeError	Exceptionndimr   r   folder_pathsget_temp_directoryr   	fromarraycpunumpyastypenpuint8randomrandintsaveospathjoinr7   alllistr8   onesr2   !torchvision.transforms.functionalr]   torch.nn.functionalnn
functionalr$   r   rY   r   	transposer   rS   r9   r3   intr#   appendroundmathsqrtr   r   r4   cloner:   r   
NodeOutput)vr   r^   ra   rb   rc   rg   rw   rx   r{   r}   r   r?   ro   rr   ru   rv   	extra_topextra_bottom
extra_leftextra_rightextra_edge_modeextra_pad_modefill_color_rgb_parsed_tmprG   r@   input_is_masktemp_dirpil_imgr   
preview_ui
img_height	img_width	bbox_listr   parsedr   content_mask	tv_rotateFrot_fillis_edge_moderA   rB   pad_amtimg_chw
img_paddedimg_rotatedchcwcycxmask_paddedmask_rotated	cm_padded
cm_rotatedis_pad_firstkp_is_pad_modepad_mode
padded_imgcm_newm_newall_croppedall_cropped_masksall_bbox_tuplesall_bbox_masks	bbox_datahas_bboxpreview_widthpreview_heightsxsyx_miny_minx_maxy_maxr   cropped_content_maskbmr   crop_hcrop_wtwth	has_extra	kp_is_padratiorl   aspect_ratioscale_wscale_hsamplesresizedfull_twfull_thr(   r    r)   r'   mask_resized
cm_resizedfinal_wfinal_hkp_handles_eph_curw_currC   rD   padded_maskcm_hcm_wcm_epout_hout_w	fill_maskinvertedr   r   sv                                       `                                                                                 r   executeImageTransformKJ.execute   s    $''W=	##GS1##GS1$((s;
%))-=)*;<!%%i3	$((q9"&&z15
#''Q7'++KA&**?JG!-0 #"jj0k400[K5O%4[5M%NN (6bq'9:'9!AI'9: 

aOOB'..q!Q:E  224//58<<>#7#7#9C#?"G"G"QR*6>>!X+Fs*K5QRWW\\(,<=fVXY(+;*<=
[[^
KKN	 	
F+fd++,2JJx,D  !I,Dqc  RH  cG  RH  OH,DI  !I%zz*c:H--,2 vFqaC?uPt?u<uFI v
 zz!Z5<<P q=M++H)-JJkoakNkL{{1~u{{1~1a)--A.UU7Wgw,PWbUc
'
XIeRZ[$**1-{/@/@/CBq"'B#Aq"qAv+b16kAo*ErAQRF{SUXY]^X^S^abSbGb$bckklmoqr#"#%%q(9GWgW^;_fq%"rK#,[8)EY\X]#^L'1b16k"qAv+/.I2PQUVPV;WY\]ab\bWbefWfKf(fgoopqrDEE,"8"8";gwPWY`=ahrz{E|	&y8)EQTPUV
)!QQ!VBaK!O0KRRSWXRX[Y[^_cd^dYdghYhMh*hiqqrst!%--A"6	$U]^ffghjlm#$T^^A%6	$VYUZ[ccdefD()?)?)BXIVZbeafgoopqrQJAI zz"~+tzz"~/J::b>Y.4::b>Z3O>>"b1D1$	:ND &)BB(,EEIM\TUEUYcfgYgkvyzkz"0K"?wVH'y,
T_aikz  }E  FJEQJAI[[J	,BUBUVFp|F1i	,*<*<Q*? ??JWcWiWijkWlLlAllm!LDJJqM:yQUQ\Q\dhdndnocga9TZZ]#::JzRVR\R\]^R_G_<__` I"I ,H )na @!*!B2?!2CY.4BQ4FZ.0CC	( 3Yv5FG"LMC	( 3Yv5FG"LMC	( 3Yv5FG"LMC	( 3Yv5FG"LMAs5)a-89As5*q.9:EAIs5)'<=EAIs5*'=>5;eQ >?'3AuU{E%K4O'P$&&ueemUU]'ST[[J	:251eEk5;./%%b)DHDTtAuU{E%K$?@Z^'3$&&1i'DE%%ejjJ	&JK#-.9j-H*ueU ,.!(q!17==3C6J./6K/0! " a=1#4!(q!17==3C%1A%5\6&3a&7]V
 &Mb\A-=babS^abSb	+/HH	)<#a' BOk$AB$q( BN\$AB"&66VR&[9Ev~.Bv~.B$(99VR&[9Ev~.Bv~.B$6#%7L#)F?LTYY|l'BCDBTYY|l'BCDB$.VR&[9E#FUN3G#FUN3G,W__R-CWgWegopG%ooa4G#/'4\7GUcem'n+ABVX_ah+i(!B,1,B!B,1,B%aBrE2be8Q&>?G#/'3Ar"R%xBrE4I'J+?2be8RPRSUPUX@U+V($(AAVR&[9E#FUN3G#FUN3G,W__R-CWgWegqrG%ooa4G.:Q.>lFG/<q/@mfG$g&75%@AH#Ww%6%$?@G '( 2W <I!(7!2W!<J B B)8J)FvGH,Wgz8U^`hjsu}~G#/'4\7GUceo'p&+kk,2D2DQ2GRXdXkXks  tF  tF  'G]iAwww'>RYIY@Y$YZ'2!78LgW^!_J %Ar2>R>Y>Y ZIWaIa!8(8GCS:SST+4(!#rL01BrL01B6b1f&*xx"0Q1GRQ_ak"l"t"tuvxz"{'3+8r2~_i+jL/EFZ\^`b/c,")!SbS#2#q."9'3+73B3+DL/CAssCRCK/P, !!--*gmmA.>.MN!--*gmmA.>.MNgmmA..'W]]1=M2M%a'8G8Q&>?G#/'3Axx'4I'J+?8G8XgX@U+V( ,/HHM9q=L[\L\`jmn`nr}  AB  sB&}}Q/q1Au%3%F6G()\:Wbdln}  @H  I&}}Q/q1Au+"'++l.@.@.CUEZfZmZm  vB  vH  vH  #IK]iK9Yu_#<jTYIY>Y YZ#.L177;=Q=W=WXZ=[d5=DEM+ABVX]_d+e(Aue<P<W<WXSga9U?2Jz%?O4OOP',$ #${{1gmmA.>a@PQ $/+11!4l6H6H6Ku177:<P<V<VWX<Yd5=DEM+ABVX]_d+e("6"<"<Q"BB	$yyyA i'H ;;=s1hnnQ&789A?G{HQeU5[!;< :" !!Q1*-w'$$\2y #| $A,,Q/Q1E1Ea1Hv}}[*;_n^cekpz{{[	 (()4 :2 !I !w'' s}   ?AE: $AFA AF* AF !AF =AF AF* AF* 2AF%AF%AF%#AF* E:AFFAFF 
AF* F*AGGAGr,   r   )__name__
__module____qualname____firstlineno__classmethodr   r8  __static_attributes__r,   r   r   rU   rU   `   s2    W
 W
t 9=F| F|r   rU   )r4   N)r   r   r8   r   r   r   r   PILr   comfy.utilsr   comfy_api.latestr   r   nodesr   utility.utilityr   r   r   r-   rS   	ComfyNoderU   r,   r   r   <module>rF     sT        	   &     -Ua
7tc|r|| c|r   