+
    „°ñjÁ  ã                   ór  a € R t0 t ^ RIt^ RIHt ^ RIHt ^ RIHtHt  ! R R]	]4      t
]
P                  R]
P                  R]
P                  R]
P                  R]
P                  R]
P                   R]
P"                  R]
P$                  R/t] ^ k  ! R R]P(                  4      t ! R	 R
]4      tR R ltR# )é    N)ÚEnum)Úoverride)ÚComfyExtensionÚioc                   ó6   € ] tR t^tRtRtRtRtRtRt	Rt
RtR	tR
# )ÚAspectRatioz1:1 (Square)z2:3 (Portrait Photo)z3:2 (Photo)z3:4 (Portrait Standard)z4:3 (Standard)z9:16 (Portrait Widescreen)z16:9 (Widescreen)z21:9 (Ultrawide)© N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__ÚSQUAREÚPHOTO_VÚPHOTO_HÚ
STANDARD_VÚ
STANDARD_HÚWIDESCREEN_VÚWIDESCREEN_HÚULTRAWIDE_HÚ__static_attributes__r	   ó    ÚAC:\Ai_Coding\apps\studio\ComfyUI\comfy_extras\nodes_resolution.pyr   r      s*   † Ø€FØ$€GØ€GØ*€JØ!€JØ/€LØ&€LØ$„Kr   r   c                   óT   a € ] tR t^t o Rt]R 4       t]RV 3R lR ll4       tRtV t	R# )ÚResolutionSelectorzBCalculate width and height from aspect ratio and megapixel target.c                óô  € \         P                  ! R RRR\         P                  P                  R\        \        P
                  RR7      \         P                  P                  RRR	R
RRR7      \         P                  P                  RRR7      \         P                  P                  R^^^€^RRR7      .\         P                  P                  RRR7      \         P                  P                  RRR7      .R7      # )r   zResolution SelectorÚ	utilitieszwCalculate width and height from aspect ratio and megapixel target. Useful for setting up Empty Latent Image dimensions.Úaspect_ratioz+The aspect ratio for the output dimensions.)ÚoptionsÚdefaultÚtooltipÚ
megapixelsg      ð?gš™™™™™¹?g      0@g{®Gáz„?u9   Target total megapixels. 1.0 MP â‰ˆ 1024x1024 for square.)r   ÚminÚmaxÚstepr    Úpreviewz1Live preview of the calculated output resolution.)r    ÚmultiplezANearest multiple of the result to set the selected resolution to.T)Úidr   r"   r#   r$   r    ÚadvancedÚwidthz?Calculated width in pixels multiplied by the selected multiple.Úheightz@Calculated height in pixels multiplied by the selected multiple.)Únode_idÚdisplay_nameÚcategoryÚdescriptionÚinputsÚoutputs)
r   ÚSchemaÚComboÚInputr   r   ÚFloatÚResolutionPreviewÚIntÚOutput)Úclss   &r   Údefine_schemaÚ ResolutionSelector.define_schema!   s  € ä�yŠyØ(Ø.Ø ð Rä—‘—‘Ø"Ü'Ü'×.Ñ.ØIð	 ó ô —‘—‘Ø ØØØØØWð ó ô ×$Ñ$×*Ñ*ØØOð +ó ô —‘—‘Ø!ØØØØØ_Ø!ð ó ð'ô< —‘—‘ØÐ%fð ó ô —‘—‘ØÐ&hð ó ð	ôE*
ð *	
r   Nc                óF   <€ V ^8„  d   QhRS[ RS[RS[RS[P                  /# )é   r   r!   r&   Úreturn)ÚstrÚfloatÚintr   Ú
NodeOutput)ÚformatÚ__classdict__s   "€r   Ú__annotate__ÚResolutionSelector.__annotate__P   s0   ø€ ÷ ,ñ ,¡3ð ,±Eð ,ÁSð ,Ñ[]×[hÑ[hñ ,r   c                ó.  € \         V,          w  rVVR ,          R ,          p\        P                  ! WuV,          ,          4      p\        WX,          V,          4      V,          p	\        Wh,          V,          4      V,          p
\        P
                  ! Wš4      # )i   )ÚASPECT_RATIOSÚmathÚsqrtÚroundr   rA   )r8   r   r!   r&   r%   Úw_ratioÚh_ratioÚtotal_pixelsÚscaler)   r*   s   &&&&&      r   ÚexecuteÚResolutionSelector.executeO   so   € ä(¨Õ6ÑˆØ! DÕ(¨4Õ/ˆÜ—	’	˜,°GÕ*;Õ<Ó=ˆÜ�g•o¨Õ0Ó1°HÕ<ˆÜ�w•¨Õ1Ó2°XÕ=ˆÜ�}Š}˜UÓ+Ð+r   r	   ©N)
r
   r   r   r   Ú__doc__Úclassmethodr9   rO   r   Ú__classdictcell__©rC   s   @r   r   r      s4   ø‡ € ÙLàñ+
ó ð+
ðZ ÷,ñ ,ó ö,r   r   c                   ó<   a € ] tR t^Yt o ]V 3R lR l4       tRtV tR# )ÚResolutionExtensionc                óT   <€ V ^8„  d   QhRS[ S[S[P                  ,          ,          /# ©r<   r=   )ÚlistÚtyper   Ú	ComfyNode)rB   rC   s   "€r   rD   Ú ResolutionExtension.__annotate__[   s"   ø€ ÷ 
ñ 
¡T©$©r¯|©|Õ*<Õ%=ñ 
r   c              ƒ  ó   "  € \         .# 5irQ   )r   )Úselfs   &r   Úget_node_listÚ!ResolutionExtension.get_node_listZ   s   é € ô ð
ð 	
ùs   ‚
r	   N)r
   r   r   r   r   r`   r   rT   rU   s   @r   rW   rW   Y   s   ø‡ € Ø÷
ó ö
r   rW   c                ó$   € V ^8„  d   QhR\         /# rY   ©rW   )rB   s   "r   rD   rD   a   s   € ÷ !ñ !Ô 3ñ !r   c               ƒ   ó   "  € \        4       # 5irQ   rc   r	   r   r   Úcomfy_entrypointre   a   s   é € ÜÓ Ð ùs   ‚c                ó„   € V ^8„  d   Qh/ ^ \         9   d,   \        \        \        \        \        3,          3,          ;R&   # )r<   rG   )Ú__conditional_annotations__Údictr   Útupler@   )rB   s   "r   rD   rD      s.   € ‡�÷"	ò 	Œt”K¤¤s¬C x¥Ð0Õ1ñ 	ò# r   )é   rj   )r<   é   )rk   r<   )rk   é   )rl   rk   )é	   é   )rn   rm   )é   rm   )rg   rH   Úenumr   Útyping_extensionsr   Úcomfy_api.latestr   r   r>   r   r   r   r   r   r   r   r   r   rG   r\   r   rW   re   rD   )rg   s   @r   Ú<module>rs      sª   øðß €Ý Ý &ß /ô%�#�tô %ð ×Ñ˜Ø×Ñ˜Ø×Ñ˜Ø×Ñ˜FØ×Ñ˜FØ×Ñ˜gØ×Ñ˜gØ×Ñ˜Wð	5€ó 	ô8,˜Ÿ™ô 8,ôv
˜.ô 
÷!r   