
    +j                      *    S r SSKrSSKrS\S\4S jrg)z2Enrich executed-node output entries with asset id.    N	output_uireturnc           
      >   SSK Jn  UR                  (       d  U $ SSKnSSKJnJn  0 nU R                  5        GH  u  pg[        U[        5      (       d  XuU'   M!  / nU GH  n	[        U	[        5      (       a  SU	;  d  SU	;  a  UR                  U	5        M8   UR                  U	S   5      n
U
c  UR                  U	5        Mc  [        R                  R                  U
5      n[        R                  R                  [        R                  R!                  XR#                  S5      =(       d    SU	S   5      5      n [        R                  R%                  X/5      U:w  a  ['        S	5      e [        R                  R-                  U5      (       d  UR                  U	5        GMC  U" UU	S   U	S   /S9n[        U	5      n	UR.                  R0                  U	S'   UR                  U	5        GM     XU'   GM     U$ ! [&         a<    [(        R*                  " S
U	R#                  S5      5        UR                  U	5         GM  f = f! U a)    [(        R*                  " SU	R#                  S5      5         N[2         a(    [(        R*                  " SU	R#                  S5      SS9   Nf = f)aJ  Register file-type output entries as assets and inject their ``id``.

Runs at output-processing time, once per produced output, when
--enable-assets is set. Returns a new dict; entries without a resolvable
on-disk file path are left unchanged. Errors are caught per-entry so a
failure never blocks execution or the other entries.
r   )argsN)register_file_in_placeDependencyMissingErrorfilenametype	subfolder zescapes basez0Asset enrichment skipped (path escapes base): %s)abs_pathnametagsidz3Asset enrichment skipped (blake3 not available): %sz/Failed to enrich output entry with asset id: %sT)exc_info)comfy.cli_argsr   enable_assetsfolder_pathsapp.assets.services.ingestr   r   items
isinstancelistdictappendget_directory_by_typeospathabspathjoinget
commonpath
ValueErrorloggingwarningisfilerefr   	Exception)r   r   r   r   r   enrichedkeyentriesnew_entriesentrybasebase_absr   results                 @/home/wildlama/comfy/ComfyUI/comfy_execution/asset_enrichment.pyenrich_output_with_assetsr1      sJ    $YH!)'4((#SMEeT**j.EW\I\""5) y#99%-H<&&u-77??4077??277<<))KBXB^\^`efp`q+rsww))8*>?8K(88 L ww~~h//&&u-
 0%z*- U$jjmmd
 u%K L $W *X O3 " OO$VX]XaXablXmn&&u-& * n UW\W`W`akWlm y QSXS\S\]gShswxysJ   (H= A7H=8/G4'6H= 3H=4AH:5H=9H::H==,J+.JJ)__doc__r#   r   r   r1        r0   <module>r5      s!    8  	< <$ <r4   