
    +jH                         d dl mZ d dlmZmZ d dlmZ d Z G d dej                  Z	 G d de          Z
d	e
fd
ZdS )    )override)ComfyExtensionio)set_torch_compile_wrapperc                     d | D             S )Nc                      g | ]}d |j         vS )transformer_options)name).0entrys     @/home/wildlama/comfy/ComfyUI/comfy_extras/nodes_torch_compile.py
<listcomp>z+skip_torch_compile_dict.<locals>.<listcomp>   s     QQQ%"%*4QQQ     )guard_entriess    r   skip_torch_compile_dictr      s    QQ=QQQQr   c                   Z    e Zd Zedej        fd            Zedej        fd            ZdS )TorchCompileModelreturnc           
          t          j        ddt           j                            d          t           j                            dddgd          gt           j                                        gd	          S )
Nr   experimentalmodelbackendinductor
cudagraphsT)optionsadvanced)node_idcategoryinputsoutputsis_experimental)r   SchemaModelInputComboOutput)clss    r   define_schemazTorchCompileModel.define_schema	   st    y'#w'''6!    X__&&' 
 
 
 	
r   c                     |                     d          }t          ||dt          i           t          j        |          S )NT)disable_dynamicguard_filter_fn)r   r   r   )cloner   r   r   
NodeOutput)r(   r   r   ms       r   executezTorchCompileModel.execute   sA    KKK--!7EVXoDpqqqq}Qr   N)	__name__
__module____qualname__classmethodr   r#   r)   r.   r0   r   r   r   r   r      sd        
bi 
 
 
 [
          [     r   r   c                   L    e Zd Zedeeej                          fd            ZdS )TorchCompileExtensionr   c                    K   t           gS N)r   )selfs    r   get_node_listz#TorchCompileExtension.get_node_list"   s       
 	
r   N)	r1   r2   r3   r   listtyper   	ComfyNoder:   r   r   r   r6   r6   !   sE        
T$r|*<%= 
 
 
 X
 
 
r   r6   r   c                  "   K   t                      S r8   )r6   r   r   r   comfy_entrypointr?   )   s       """r   N)typing_extensionsr   comfy_api.latestr   r   comfy_api.torch_helpersr   r   r=   r   r6   r?   r   r   r   <module>rC      s    & & & & & & / / / / / / / / = = = = = =R R R               2
 
 
 
 
N 
 
 
# 5 # # # # # #r   