+
    „°ñjš  ã                   óÊ   € R t ^ RIt^ RIt^ RIt^ RIHtHt ]'       d   ^ RIHt ^ RI	H
t
 ^ RIHt ^ RIHt R R ltR	 R
 ltR R ltR R ltRR R lltR R ltR R ltR# )a¾  Registers the files a prompt produced as assets, at the moment the execution
result is emitted. Each output is matched to a path inside its declared base
directory and skipped when it escapes that directory or is not on disk, and a
run served from cache replays the same registration so cached results still
yield assets. Registering at emission rather than by inspecting the cache
afterwards keeps this independent of any cache eviction policy.
N)ÚTYPE_CHECKINGÚCallable)ÚAssetManager)ÚRegisteredAsset)ÚExecutionServer)Ú
CacheEntryc                ó>   € V ^8„  d   QhR\         R\        R,          /# )é   ÚentryÚreturnN©ÚdictÚstr)Úformats   "ÚDC:\Ai_Coding\apps\studio\ComfyUI\comfy_execution\asset_enrichment.pyÚ__annotate__r      s   € ÷ ñ ¤ð ¬¨t­ñ ó    c                ó  € ^ RI pVP                  V R,          4      pVf   R# \        P                  P	                  V4      p\        P                  P	                  \        P                  P                  Y0P                  R4      ;'       g    RV R,          4      4      p \        P                  P                  W4.4      V8w  d   R#  \        P                  P                  T4      '       g   R# T#   \         d     R# i ; i)zÒResolve an output entry to an absolute, in-base, on-disk file path.

Returns ``None`` (skip, no registration) when the type is unknown, the
resolved path escapes its base directory, or the file does not exist.
NÚtypeÚ	subfolderÚ Úfilename)
Úfolder_pathsÚget_directory_by_typeÚosÚpathÚabspathÚjoinÚgetÚ
commonpathÚ
ValueErrorÚisfile)r
   r   ÚbaseÚbase_absÚabs_paths   &    r   Ú_resolve_output_pathr%      sÈ   € ó à×-Ñ-¨e°F­mÓ<€DØ‚|ÙÜ�w‰w�‰˜tÓ$€HÜ�w‰w�‰œrŸw™wŸ|™|¨H·i±iÀÓ6L×6RÐ6RÐPRÐTYÐZdÕTeÓfÓg€HðÜ�7‰7×Ñ˜xÐ2Ó3°xÔ?Ùð @ô �7‰7�>‰>˜(×#Ò#ÙØ€Oøô	 ô Úðús   Â %C1 Ã1D Ã?D c          	      ó‚   € V ^8„  d   QhR\         R\        R,          R\        \        \        R,          .R3,          RR/# )r	   Ú	output_uiÚjob_idNÚregisterzRegisteredAsset | Noner   )r   r   r   )r   s   "r   r   r   ,   sN   € ÷ rñ rÜðrä�$�Jðrô œœS 4�ZÐ(Ð*BÐBÕCðrð 
ñ	rr   c           	     óÚ  € V P                  4        Fœ  p\        V\        4      '       g   K  V F{  p\        V\        4      '       d   RV9  g   RV9  d   K)   \	        V4      pVf   K;  V! WQ4      pVe5   VP
                  VR&   VP                  '       d   VP                  VR&   Ky  K{  K}  	  Kž  	  R#   \         d-    \        P                  ! RTP                  R4      RR7        K»  i ; i)	zQS10.6: producers that write the same output path are not coalesced (unsupported).r   r   NÚidÚ
preview_idz(Asset registration failed for output: %sT)Úexc_info)ÚvaluesÚ
isinstanceÚlistr   r%   r+   r,   Ú	ExceptionÚloggingÚwarningr   )r'   r(   r)   Úentriesr
   r$   Úresults   &&&    r   Ú_enrich_in_placer6   ,   sÞ   € ð ×#Ñ#Ö%ˆÜ˜'¤4×(Ò(ÙÛˆEÜ˜e¤T×*Ò*¨jÀÔ.EÈÐW\ÔI\Ùð
rÜ/°Ó6�ØÒ#ÙÙ! (Ó3�ØÒ%Ø"(§)¡)�E˜$‘KØ×(×(Ð(Ø.4×.?Ñ.?˜˜lÓ+ñ )ñ &ó ó &øô ô rÜ—’Ð JÈEÏIÉIÐV`ÓLaÐlp×qÐqðrús   ÁB3Á),B3ÂB3Â33C*Ã)C*c                óR   € V ^8„  d   QhR\         R\         \        \         3,          /# )r	   r'   r   r   )r   s   "r   r   r   E   s"   € ÷ ñ ¤4ð ¬D´´d°­Oñ r   c                ó*  € / pV P                  4        Fj  p\        V\        4      '       g   K  V FI  p\        V\        4      '       d   RV9  d   K"  VP	                  R4      p \        V4      pTf   KE  YAT&   KK  	  Kl  	  V#   \         d     Ka  i ; i)zjPop the previews save nodes named for their outputs, by output path, so none reaches clients or the cache.Úasset_preview)r.   r/   r0   r   Úpopr%   r1   )r'   Úpreviewsr4   r
   Úpreviewr$   s   &     r   Útake_asset_previewsr=   E   s“   € à "€HØ×#Ñ#Ö%ˆÜ˜'¤4×(Ò(ÙÛˆEÜ˜e¤T×*Ò*¨oÀUÔ.JÙØ—i‘i Ó0ˆGðÜ/°Ó6�ð Ô#Ø%,˜Ó"ó ñ &ð €Oøô	 ô Úðús   Á$BÂBÂBc                ó(   € V ^8„  d   QhR\         RR/# )r	   r'   r   N)r   )r   s   "r   r   r   X   s   € ÷ .ñ .œ$ð . 4ñ .r   c                 óî   € V P                  4        F`  p\        V\        4      '       g   K  V F?  p\        V\        4      '       g   K  VP	                  R R4       VP	                  RR4       KA  	  Kb  	  R# )r+   Nr,   )r.   r/   r0   r   r:   )r'   r4   r
   s   &  r   Ú
_strip_idsr@   X   sX   € Ø×#Ñ#Ö%ˆÜ˜'¤4×(Ò(ÙÛˆEÜ˜%¤×&Ô&Ø—	‘	˜$ Ô%Ø—	‘	˜,¨Ö-ó ó &r   c          
      ó|   € V ^8„  d   QhR\         R\        RRR\         \        \         3,          R,          R\         /# )r	   r'   r(   Úasset_managerr   Úasset_previewsNr   r   )r   s   "r   r   r   b   sO   € ÷ ñ ¬ð ´sð È>ð ÔkoÔpsÔuyÐpyÕkzð  ~Bõ  lBð ô  NRñ r   c                 óš   aa€ \         P                  ! V 4      pSP                  '       g   V# T;'       g    / o\        VVVV3R  l4       V# )c                 óH   <€ SP                  WSP                  V 4      R 7      # ))Úpreview_ref)Úregister_executed_outputr   )r   ÚjobrB   r;   s   &&€€r   Ú<lambda>Ú+register_executed_outputs.<locals>.<lambda>k   s"   ø€ ˜-×@Ñ@ÀÐX`×XdÑXdÐeiÓXjÐ@Ôkr   )ÚcopyÚdeepcopyÚenabledr6   )r'   r(   rB   rC   Úenrichedr;   s   &&f& @r   Úregister_executed_outputsrO   b   sG   ù€ Ü�}Š}˜YÓ'€HØ× × Ð Øˆà×#Ð# €HÜØØÝkôð
 €Or   c          	      ó\   € V ^8„  d   QhR\         R,          R\        RRR\         R,          /# )r	   Ú
ui_wrapperNr(   rB   r   r   r   )r   s   "r   r   r   p   s4   € ÷ ñ ¬¨t­ð ¼Sð ÐQ_ð ÔdhÐkoÕdoñ r   c                 óú   € V f   R # \         P                  ! V 4      pVP                  R4      p\        V\        4      '       g   V# \        V4       VP                  '       g   V# \        WAVP                  4       V# )NÚoutput)	rK   rL   r   r/   r   r@   rM   r6   Úregister_cached_output)rQ   r(   rB   rN   r'   s   &&&  r   Úregister_cached_outputsrU   p   sg   € ØÒÙä�}Š}˜ZÓ(€HØ—‘˜XÓ&€IÜ�i¤×&Ò&ØˆÜˆyÔà× × Ð Øˆä�Y¨×(LÑ(LÔMØ€Or   c                óX   € V ^8„  d   QhRRR\         R\        RRR\         R\        R	R
RR/# )r	   Úserverr   Únode_idÚmetaÚcachedr   Ú	prompt_idÚ
ui_outputsrB   r   r   N)r   r   )r   s   "r   r   r   �   sV   € ÷ ñ Ð0ð ¼3ð Ädð ÐT`ð Ômpð ô  Cð ð  Tbð ð  gkñ r   c                 ó   € W9   d   R # \        VP                  WF4      pVe	   W'R&   WuV&   V P                  f   R # Ve   VP                  R4      MR pV P	                  RRVRVR,          RVRV/V P                  4       R # )NrY   rS   ÚexecutedÚnodeÚdisplay_noder[   )rU   ÚuiÚ	client_idr   Ú	send_sync)	rW   rX   rY   rZ   r[   r\   rB   rN   rS   s	   &&&&&&&  r   Úemit_cached_outputrd   �   sŒ   € ØÔÙÜ& v§y¡y°)ÓK€HØÒð  �ÑØ&�7ÑØ×ÑÒÙØ'/Ò';ˆX�\‰\˜(Ô#À€FØ
×ÑØØ	�˜.¨$¨~Õ*>ÀÈ&ÐR]Ð_hÐiØ×Ñör   )N)Ú__doc__rK   r2   r   Útypingr   r   Úapp.assets.managerr   Úapp.assets.services.schemasr   Úcomfy_execution.server_protocolr   Ú	executionr   r%   r6   r=   r@   rO   rU   rd   © r   r   Ú<module>rl      sK   ðñó Û Û 	ß *çÝ/Ý;Ý?Ý$õõ.rõ2õ&.÷õ÷"r   