+
    ƒ°ñjv  ã                   óD   € ^ RI t ^ RI Ht  ! R R]P                  4      tR# )é    N)Únnc                   óT   a a€ ] tR t^t oRV 3R lltR tR tR tR tR t	Rt
VtV ;t# )	ÚLitEmac                óÊ  <€ \         SV `  4        VR 8  g   VR8”  d   \        R4      h/ V n        V P	                  R\
        P                  ! V\
        P                  R7      4       T P	                  RV'       d'   \
        P                  ! ^ \
        P                  R7      M%\
        P                  ! R	\
        P                  R7      4       VP                  4        F~  w  rEVP                  '       g   K  VP                  RR4      pV P                  P                  WF/4       V P	                  WeP                  4       P                  4       P                  4       K€  	  . V n        R# )
g        ç      ð?zDecay must be between 0 and 1Údecay©ÚdtypeÚnum_updatesÚ.Ú Néÿÿÿÿ)ÚsuperÚ__init__Ú
ValueErrorÚm_name2s_nameÚregister_bufferÚtorchÚtensorÚfloat32ÚintÚnamed_parametersÚrequires_gradÚreplaceÚupdateÚcloneÚdetachÚdataÚcollected_params)ÚselfÚmodelr   Úuse_num_upatesÚnameÚpÚs_nameÚ	__class__s   &&&&   €Ú9C:\Ai_Coding\apps\studio\ComfyUI\comfy\ldm\modules\ema.pyr   ÚLitEma.__init__   s÷   ø€ Ü‰ÑÔØ�3Œ;˜% #œ+ÜÐ<Ó=Ð=àˆÔØ×Ñ˜W¤e§l¢l°5ÄÇÁÔ&NÔOØ×Ñ˜]×P^¬E¯LªL¸Ä%Ç)Á)Õ,LÜ�\Š\˜"¤E§I¡IÔ.ô	0ð ×-Ñ-Ö/‰GˆDØ��ŠàŸ™ c¨2Ó.�Ø×"Ñ"×)Ñ)¨4¨.Ô9Ø×$Ñ$ V¯W©W«Y×-=Ñ-=Ó-?×-DÑ-DÖEñ 0ð !#ˆÖó    c                óv   € V = V P                  R \        P                  ! ^ \        P                  R7      4       R# )r   r	   N)r   r   r   r   r   )r    s   &r'   Úreset_num_updatesÚLitEma.reset_num_updates   s'   € ØÐØ×Ñ˜]¬E¯LªL¸Ä%Ç)Á)Ô,LÖMr)   c           	     ó
  € V P                   pV P                  ^ 8¼  dY   V ;P                  ^,          un        \        V P                   ^V P                  ,           ^
V P                  ,           ,          4      pRV,
          p\        P                  ! 4       ;_uu_ 4        \        VP                  4       4      p\        V P                  4       4      pV F’  pWF,          P                  '       df   V P                  V,          pWW,          P                  WF,          4      WW&   WW,          P                  W5V,          WF,          ,
          ,          4       K€  W`P                  9  d   K’  Q h	  RRR4       R#   + '       g   i     R# ; i)r   r   N)r   r   Úminr   Úno_gradÚdictr   Únamed_buffersr   r   Útype_asÚsub_)r    r!   r   Úone_minus_decayÚm_paramÚshadow_paramsÚkeyÚsnames   &&      r'   ÚforwardÚLitEma.forward   s  € Ø—
‘
ˆà×Ñ˜qÔ Ø×Ò Õ!ÕÜ˜Ÿ
™
 Q¨×)9Ñ)9Õ%9¸bÀ4×CSÑCSÕ>SÕ$TÓUˆEà �+ˆä�]Š]�_�_Ü˜5×1Ñ1Ó3Ó4ˆGÜ  ×!3Ñ!3Ó!5Ó6ˆMã�Ø•<×-×-Ð-Ø ×.Ñ.¨sÕ3�EØ+8Õ+?×+GÑ+GÈÍÓ+U�MÑ(Ø!Õ(×-Ñ-¨oÈuÕAUÐX_ÕXdÕAdÕ.eÖfà×&8Ñ&8Ö8Ð8Ð8ñ ÷	 �_�_Š_ús   ÂCE1Å#E1Å1F	c                óX  € \        VP                  4       4      p\        V P                  4       4      pV Fq  pW$,          P                  '       dE   W$,          P                  P                  W0P                  V,          ,          P                  4       K_  W@P                  9  d   Kq  Q h	  R # )N)r0   r   r1   r   r   Úcopy_r   )r    r!   r5   r6   r7   s   &&   r'   Úcopy_toÚLitEma.copy_to2   s|   € Ü�u×-Ñ-Ó/Ó0ˆÜ˜T×/Ñ/Ó1Ó2ˆÛˆCØ�|×)×)Ð)Ø•×!Ñ!×'Ñ'¨×6HÑ6HÈÕ6MÕ(N×(SÑ(SÖTà×"4Ñ"4Ö4Ð4Ð4ó	 r)   c                óX   € V Uu. uF  q"P                  4       NK  	  upV n        R# u upi )z•
Save the current parameters for restoring later.
Args:
  parameters: Iterable of `torch.nn.Parameter`; the parameters to be
    temporarily stored.
N)r   r   )r    Ú
parametersÚparams   && r'   ÚstoreÚLitEma.store;   s#   € ñ =GÓ G¹J°5§¡¦¹JÑ GˆÖùÒ Gs   …'c                óŽ   € \        V P                  V4       F*  w  r#VP                  P                  VP                  4       K,  	  R# )a’  
Restore the parameters stored with the `store` method.
Useful to validate the model with EMA parameters without affecting the
original optimization process. Store the parameters before the
`copy_to` method. After validation (or model saving), use this to
restore the former parameters.
Args:
  parameters: Iterable of `torch.nn.Parameter`; the parameters to be
    updated with the stored parameters.
N)Úzipr   r   r<   )r    r@   Úc_paramrA   s   &&  r'   ÚrestoreÚLitEma.restoreD   s4   € ô " $×"7Ñ"7¸ÖD‰NˆGØ�J‰J×Ñ˜WŸ\™\Ö*ó Er)   )r   r   )g§èH.ÿï?T)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__r   r+   r9   r=   rB   rG   Ú__static_attributes__Ú__classdictcell__Ú__classcell__)r&   Ú__classdict__s   @@r'   r   r      s*   ù‡ € ÷#ò&Nò9ò*5òH÷+ò +r)   r   )r   r   ÚModuler   © r)   r'   Ú<module>rS      s   ðÛ Ý ôK+ˆR�Y‰Yö K+r)   