+
    „°ñj5  ã                  óš   € ^ RI Ht ^ RIt^ RIt^ RIHt ^ RIHtH	t	H
t
 ]'       d   ^ RIHt ^ RIHt RtRtR	 R
 ltRRRRR.3R R lltR# )é    )ÚannotationsN)Ú
WrappersMP)ÚTYPE_CHECKINGÚCallableÚOptional)ÚModelPatcher)ÚWrapperExecutorztorch.compileÚtorch_compile_kwargsc               ó    € V ^8„  d   QhRRRR/# )é   Úcompiled_module_dictzdict[str, Callable]Úreturnr   © )Úformats   "ÚIC:\Ai_Coding\apps\studio\ComfyUI\comfy_api\torch_helpers\torch_compile.pyÚ__annotate__r      s   € ÷ 'ñ 'Ð6Ið 'Èhñ 'ó    c                ó   a € R V 3R llpV# )zC
Create a wrapper that will refer to the compiled_diffusion_model.
c               ó   € V ^8„  d   QhRR/# )r   Úexecutorr	   r   )r   s   "r   r   Ú1apply_torch_compile_factory.<locals>.__annotate__   s   € ÷ 	Eñ 	E¨oñ 	Er   c                ó  <€  / pSP                  4        F[  w  rE\        P                  P                  V P                  V4      W4&   \        P                  P                  V P                  WE4       K]  	  V ! V/ VB VP                  4        F/  w  rE\        P                  P                  V P                  WE4       K1  	  #   XP                  4        F/  w  rE\        P                  P                  T P                  YE4       K1  	  i ; i)N)ÚitemsÚcomfyÚutilsÚget_attrÚ	class_objÚset_attr)r   ÚargsÚkwargsÚorig_modulesÚkeyÚvaluer   s   &*,   €r   Úapply_torch_compile_wrapperÚ@apply_torch_compile_factory.<locals>.apply_torch_compile_wrapper   sÊ   ø€ ð	EØˆLØ2×8Ñ8Ö:‘
�Ü$)§K¡K×$8Ñ$8¸×9KÑ9KÈSÓ$Q�Ñ!Ü—‘×$Ñ$ X×%7Ñ%7¸ÖDñ ;ñ ˜TÐ, VÑ,à*×0Ñ0Ö2‘
�Ü—‘×$Ñ$ X×%7Ñ%7¸ÖDò 3ø˜l×0Ñ0Ö2‘
�Ü—‘×$Ñ$ X×%7Ñ%7¸ÖDò 3ús   ƒA8B? Â?ADr   )r   r$   s   f r   Úapply_torch_compile_factoryr&      s   ø€ ÷	Eð 	Eð 'Ð&r   FÚdiffusion_modelc               ó0   € V ^8„  d   QhRRRRRRRRR	R
RR/# )r   Úmodelr   ÚbackendÚstrÚoptionszOptional[dict[str, str]]ÚmodezOptional[str]ÚdynamiczOptional[bool]Úkeysz	list[str]r   )r   s   "r   r   r   !   s:   € ÷ $?ñ $? \ð $?¸Cð $?ÐJað $?Ø$1ð$?ØR`ð$?à$-ñ$?r   c           
     ój  € V P                  \        P                  \        4       V'       g   R.pRVRVRVRVRV/p	/ p
V F,  p\        P
                  ! R
RV P                  V4      /V	B W«&   K.  	  \        V
R7      pV P                  \        P                  \        V4       W�P                  \        &   R	# )aH  
Perform torch.compile that will be applied at sample time for either the whole model or specific params of the BaseModel instance.

When keys is None, it will default to using ["diffusion_model"], compiling the whole diffusion_model.
When a list of keys is provided, it will perform torch.compile on only the selected modules.
r'   r*   r,   r-   Ú	fullgraphr.   r)   )r   Nr   )Úremove_wrappers_with_keyr   ÚAPPLY_MODELÚCOMPILE_KEYÚtorchÚcompileÚget_model_objectr&   Úadd_wrapper_with_keyÚmodel_optionsÚTORCH_COMPILE_KWARGS)r)   r*   r,   r-   r1   r.   r/   r   r    Úcompile_kwargsÚcompiled_modulesr"   Úwrapper_funcs   &&&&&&&*,    r   Úset_torch_compile_wrapperr>   !   s¾   € ð 
×"Ñ"¤:×#9Ñ#9¼;ÔGçØ!Ð"ˆð 	�7Ø�7Ø�Ø�YØ�7ð€Nð ÐÛˆÜ %§¢ñ !Ø×,Ñ,¨SÓ1ð!à ñ!ÐÓñ ô /Ø-ô€Lð 
×Ñœz×5Ñ5´{ÀLÔQà0>×ÑÔ,Ó-r   )Ú
__future__r   r5   Úcomfy.utilsr   Úcomfy.patcher_extensionr   Útypingr   r   r   Úcomfy.model_patcherr   r	   r4   r:   r&   r>   r   r   r   Ú<module>rD      sQ   ðÝ "Û ã Ý .ß 4Ñ 4ßÝ0Ý7ð €Ø-Ð õ'ð" cgØ26À%ÐaeØ/@Ð.A÷$?ñ $?r   