
    +j                     l   S SK r S SKJr  S SKrS SKJr  S SKJrJrJ	r	  S SK
JrJrJrJrJrJrJrJrJrJrJrJrJrJrJrJr  S SKJrJrJrJrJ r J!r!J"r"J#r#J$r$  SSS	S
S.r%Sr&Sr' " S S\RP                  5      r) " S S\RP                  5      r* " S S\RP                  5      r+ " S S\5      r,S\,4S jr-g)    N)BytesIO)override)IOComfyExtensionInput)CreateVideoRequestCreateVideoRequestSourceCreateVideoResponseImageAsyncTaskResponseImageDownloadResponseImageEnhanceRequestImageStatusResponseOutputInformationVideo
ResolutionVideoAcceptResponseVideoCompleteUploadRequestVideoCompleteUploadRequestPartVideoCompleteUploadResponseVideoEnhancementFilterVideoFrameInterpolationFilterVideoStatusResponse)	ApiEndpointdownload_url_to_image_tensordownload_url_to_video_outputget_fs_object_sizeget_number_of_imagespoll_opsync_opupload_images_to_comfyapi validate_container_format_is_mp4ast-2zslf-1slc-1zslp-2.5)Astra 2Starlight (Astra) FastStarlight (Astra) CreativeStarlight Precise 2.5i(#  i  c                       \ rS rSr\S 5       r\           SS\S\R                  S\S\S\	S\
S	\
S
\	S\S\S\S\	S\	S\R                  4S jj5       rSrg)TopazImageEnhance1   c                 V   [         R                  " SSSS[         R                  R                  SS/S9[         R                  R                  S5      [         R
                  R                  S	S
SSS
S9[         R                  R                  S/ SQS
S
S9[         R                  R                  SS
S
SS
S9[         R                  R                  SSSSS[         R                  R                  S
SS
S9	[         R                  R                  SSSSS[         R                  R                  S
SS
S9	[         R                  R                  SSS
SS
S9[         R                  R                  SS S S!S"[         R                  R                  S
S#S
S9	[         R                  R                  S$S S S!S"[         R                  R                  S
S%S
S9	[         R                  R                  S&S'S"S(S"[         R                  R                  S
S)9[         R                  R                  S*S
S
S+S
S9[         R                  R                  S,S
S
S-S
S9/[         R                  R                  5       /[         R                  R                  [         R                  R                  [         R                  R                   /S
S.9$ )/Nr(   zTopaz Image Enhancezpartner/image/Topazz2Industry-standard upscaling and image enhancement.model	ReimagineoptionsimagepromptT z5Optional text prompt for creative upscaling guidance.)	multilinedefaulttooltipoptionalsubject_detection)All
Foreground
Background)r.   r5   advancedface_enhancementz-Enhance faces (if present) during processing.)r3   r5   r4   r:   face_enhancement_creativity              ?{Gz?z.Set the creativity level for face enhancement.)r3   minmaxstepdisplay_moder5   r4   r:   face_enhancement_strengthzAControls how sharp enhanced faces are relative to the background.crop_to_fillFzBy default, the image is letterboxed when the output aspect ratio differs. Enable to crop the image to fill the output dimensions.output_widthr   i }     zmZero value means to calculate automatically (usually it will be original size or output_height if specified).output_heightzJZero value means to output in the same height as original or output width.
creativity   	   )r3   r@   rA   rB   rC   r5   face_preservationz#Preserve subjects' facial identity.color_preservationzPreserve the original colors.)node_iddisplay_namecategorydescriptioninputsoutputshiddenis_api_node)r   SchemaCombor   ImageStringBooleanFloatNumberDisplaynumberIntsliderOutputHiddenauth_token_comfy_orgapi_key_comfy_org	unique_idclss    ;/home/wildlama/comfy/ComfyUI/comfy_api_nodes/nodes_topaz.pydefine_schemaTopazImageEnhance.define_schema2   s   yy'.*Lw>w'		"S!    '?!!	   

  & !K! !  1!#!1!1!8!8!L!  
 /!#!1!1!8!8!_!  
 

  "!!N! !  "!#!1!1!8!8! L!  
 #!#!1!1!8!8!h!  
  !#!1!1!8!8!   

  ' !A! !  

  ( !;! ! wbH ! 		..		++		##
 aq
 q	
    r+   r/   r0   r6   r;   r<   rD   rE   rF   rH   rI   rL   rM   returnc                   #    [        U5      S:w  a  [        S5      e[        XSSSS9I S h  vN n[        U [	        SSS9[
        [        UUUUUUUU	(       a  U	OS U
(       a  U
OS U[        U5      R                  5       [        U5      R                  5       US	   S
S9SS9I S h  vN n[        U [	        SUR                   3S9[        S S S SSS9I S h  vN   [        U [	        SUR                   3S9[        SS9I S h  vN n[        R                  " [        UR                   5      I S h  vN 5      $  GN N Nf N< N7f)NrG   z"Only one input image is supported.z	image/pngi   )
max_images	mime_typetotal_pixelsz'/proxy/topaz/image/v1/enhance-gen/asyncPOSTpathmethodr   png)r+   r0   r6   r;   r<   rD   rE   rF   rH   rI   rL   rM   
source_urloutput_formatzmultipart/form-data)response_modeldatacontent_typez/proxy/topaz/image/v1/status/rr   c                     U R                   $ Nstatusxs    rg   <lambda>+TopazImageEnhance.execute.<locals>.<lambda>       qxxrj   c                     [        U SS5      $ Nprogressr   getattrr   s    rg   r   r          J)Brj   c                      U R                   S-  $ )N{Gz?)creditsr   s    rg   r   r      s    aii$&6rj   g       @<   )poll_endpointrw   status_extractorprogress_extractorprice_extractorpoll_intervalestimated_durationz/proxy/topaz/image/v1/download/F)rw   monitor_progress)r   
ValueErrorr   r   r   r   r   strlowerr   
process_idr   r   r   
NodeOutputr   download_url)rf   r+   r/   r0   r6   r;   r<   rD   rE   rF   rH   rI   rL   rM   r   initial_responseresultss                    rg   executeTopazImageEnhance.execute   sj    "  &!+ABB61+
 
 ")FvV1$"3!1,G*C)-9\t/<m$%"%&7"8">">"@#&'9#:#@#@#B'?#  /)"
 
. %-JK[KfKfJg+hi./B6!	
 		
 		
  >?O?Z?Z>[\]0"	
 
 }}#?@T@T#UUVVW

.		

 VsX   *ED9A7E$D<%2ED>+EE ,E0E1	E<E>E EE N)r1   r7   Tr>   g?Fr   r   rJ   TT)__name__
__module____qualname____firstlineno__classmethodrh   r   r   rX   boolfloatintr   r   r   __static_attributes__r   rj   rg   r(   r(   1   s    r
 r
h 
 !&!%-0+.""&#'=W=W {{=W 	=W
 =W =W &+=W $)=W =W =W =W =W  =W !=W 
=W =Wrj   r(   c                       \ rS rSr\S 5       r\        SS\R                  S\S\	S\	S\	S\S	\	S
\
S\
S\S\S\	S\R                  4S jj5       rSrg)TopazVideoEnhance   c                    [         R                  " SSSS[         R                  R                  S5      [         R                  R                  SSS9[         R
                  R                  S	/ S
QS9[         R
                  R                  SSS/S9[         R
                  R                  S/ SQSSSSS9[         R                  R                  SSSS9[         R
                  R                  SS/SSSS9[         R                  R                  SSSS[         R                  R                  SSSS9[         R                  R                  SS S!S"[         R                  R                  S#SS$9[         R                  R                  S%SS&SSS'9[         R                  R                  S(S)S*S+S*[         R                  R                  S,SSS-9	[         R
                  R                  S./ S/QS0S1SSS9/[         R                  R                  5       /[         R                  R                  [         R                  R                  [         R                  R                  /SSS29	$ )3Nr   zTopaz Video Enhance (Legacy)partner/video/TopazLBreathe new life into video with powerful upscaling and recovery technology.videoupscaler_enabledT)r3   upscaler_model)r$   r%   r&   r-   upscaler_resolutionFullHD (1080p)
4K (2160p)upscaler_creativitylowmiddlehighr   z>Creativity level (applies only to Starlight (Astra) Creative).)r.   r3   r4   r5   r:   interpolation_enabledF)r3   r5   interpolation_modelapo-8)r.   r3   r5   r:   interpolation_slowmorG      vSlow-motion factor applied to the input video. For example, 2 makes the output twice as slow and doubles the duration.)r3   r@   rA   rC   r4   r5   r:   interpolation_frame_rater         Output frame rate.)r3   r@   rA   rC   r4   r5   interpolation_duplicate7Analyze the input for duplicate frames and remove them.)r3   r4   r5   r:   !interpolation_duplicate_thresholdr?   MbP?皙?+Detection sensitivity for duplicate frames.)r3   r@   rA   rB   rC   r4   r5   r:   dynamic_compression_levelLowMidHighr   
CQP level.)	rN   rO   rP   rQ   rR   rS   rT   rU   is_deprecated)r   rV   Videor   rZ   rW   r^   r\   r]   r[   r`   ra   rb   rc   rd   re   s    rg   rh   TopazVideoEnhance.define_schema   s?   yy'7*fw'

  !3T B$   4?OQ]>^_)5!\!!   

  !8%RV W4wiQXcgrvw*!#!1!1!8!8^!!  
 .!#!1!1!8!80!   

  -!U!! !  7 !#!1!1!8!8I!!  
 /2!(!!  yDL ! 		..		++		##
 gT
 T	
rj   r   r   r   r   r   r   r   r   r   r   r   r   rk   c                   #    USL a  USL a  [        S5      e[        U5        UR                  5       u  p[        UR	                  5       5      nUR                  5       nUR                  5       nUnUnUn/ nU(       a  SU;   a  SnSnOSnSnX-  nX:  a'  Un[        UU-  5      nUU:  a  Un[        UU-  5      nO&Un[        UU-  5      nUU:  a  Un[        UU-  5      nUS-  S	:w  a  US
-  nUS-  S	:w  a  US
-  nUR                  [        [        U   [        U   S:X  a  UOS [        U   S:X  a  SOS S95        U(       a  U	nUR                  [        UUU	U
US95        [        U [        SSS9[        [        [        S[!        U5      [        U5      UR#                  5       U[%        XS9S9U['        [%        UUS9USSUS9S9SSS9I S h  vN n[        U [        SUR(                   S3SS9[*        SSS 9I S h  vN n[-        UR.                  5      S
:  a  [1        S!5      e[2        R4                  " S"S#0S$9 IS h  vN n[7        U[8        5      (       aX  UR;                  S	5        UR=                  UR.                  S	   USS%9 IS h  vN nUR>                  S&   nS S S 5      IS h  vN   Of[@        RB                  " US'5       nUR=                  UR.                  S	   USS%9 IS h  vN nUR>                  S&   nS S S 5      IS h  vN   S S S 5        S S S 5      IS h  vN   [        U [        SUR(                   S(3SS9[D        [G        [I        S
WS)9/S*9S+S,S9I S h  vN   [K        U [        SUR(                   S-3S.9[L        S/ S0 S1 S2S39I S h  vN n[N        RP                  " [S        URT                  RV                  5      I S h  vN 5      $  GN GN GN GNR GN6! , IS h  vN  (       d  f       N= f GN N! , IS h  vN  (       d  f       GN= f! , (       d  f       GN= f GN! , IS h  vN  (       d  f       GN$= f N N N7f)4NFFThere is nothing to do: both upscaling and interpolation are disabled.1080p8    p        r   rG   r"   Tr+   rI   isOptimizedModer+   slowmofps	duplicateduplicate_threshold/proxy/topaz/video/rp   rq   mp4widthheight	containersizeduration
frameCount	frameRate
resolutionAACCopyr   r   
audioCodecaudioTransferdynamicCompressionLevelsourcefiltersoutputCreating taskTask createdrw   rx   
wait_labelfinal_label_on_success/acceptPATCHPreparing uploadUpload startedrw   r   r   XLarge files are not currently supported. Please open an issue in the ComfyUI repository.Content-Type	video/mp4headersrx   raise_for_statusEtagrb/complete-uploadpartNumeTaguploadResultsFinalizing uploadUpload completed/statusrz   c                     U R                   $ r|   r}   r   s    rg   r   +TopazVideoEnhance.execute.<locals>.<lambda>  r   rj   c                     [        U SS5      $ r   r   r   s    rg   r   r    r   rj   c                     U R                   (       a:  U R                   R                  S   (       a  U R                   R                  S   S-  $ S $ Nr   r   	estimatescostr   s    rg   r   r    <    Q[[UVU`U`UeUefgUhq{{'7'7':T'A'rnr'rrj         $@rw   r   r   r   r   ),r   r    get_dimensionsr   get_frame_rateget_durationget_stream_sourceappendr   UPSCALER_MODELS_MAPr   r   r   r
   r   r	   r   get_frame_countr   r   	requestIdr   lenurlsNotImplementedErroraiohttpClientSession
isinstancer   seekputr  builtinsopenr   r   r   r   r   r   r   r   downloadurl) rf   r   r   r   r   r   r   r   r   r   r   r   r   	src_width
src_heightsrc_frame_rateduration_secsrc_video_streamtarget_widthtarget_heighttarget_frame_rater   target_pixel_pmax_long_sidearinitial_res
upload_ressessionresupload_etag
video_filefinal_responses                                    rg   r   TopazVideoEnhance.executeA  s      u$)>%)Geff(/ % 4 4 6	U1134))+ 224 "*--!% $!% $'B& ."=2#56-/#0L$'r(9$:M  . #L2$5 6 =0$1M#&}r'9#:La1$!q A%"NN&-n=7J>7Z^e7e 3ko-@-PT[-[Tae ! 8NN--/05(I $26B.#/#+,<= .$446,)	M  -)]S/$"(,E$ '#1/
 
2 #*;+@+@*AI /)#3	
 	

 z!#%j  ((.+1NOOSZ*G44 %%a(";;zq'9@Pcg;hhlo"%++f"5K ihh ]]#3T:j&{{:??1+=Jae{ffjm&)kk&&9  gf ; PO *;+@+@*AAQR 7+2 !( +#5!
 	
 	
$  '2;3H3H2IQR./Bs 
 
 }}#?@W@W@[@[#\\]]W
2	
 P ihhh  gfff ;: POOO	
$
 ]sF  GQO.Q=O>AQ OQA	P4OP4O%!P4,O"-P4	#P,O?
-P0P PPPP4Q#P1$?Q#Q$2QQ6QQ	QQQP4"P4%O<	+O.,O<	8P4?PPP
PPP
P.	)P41Q4Q:P=;Q	QQQr   N)r   Fr   rG   r   Fr?   r   )r   r   r   r   r   rh   r   r   r   r   r   r   r   r   r   r   r   rj   rg   r   r      s    U
 U
n  $)&+#*$%(*(-37).S^{{S^ S^ 	S^
 !S^ !S^  $S^ !S^ "S^ #&S^ "&S^ ,1S^ $'S^ 
S^ S^rj   r   c                   z    \ rS rSr\S 5       r\ SS\R                  S\S\S\	S\
R                  4
S jj5       rS	rg
)TopazVideoEnhanceV2i  c                    [         R                  " SSSS[         R                  R                  S5      [         R                  R                  S[         R                  R                  S[         R                  R                  SS	S
/S9[         R                  R                  SSSSS[         R                  R                  SS9[         R                  R                  SSSS[         S3S9[         R                  R                  SSSSS[         R                  R                  SSS9[         R                  R                  SSSSS[         R                  R                  SSS9/5      [         R                  R                  S[         R                  R                  SS	S
/S9/5      [         R                  R                  S [         R                  R                  SS	S
/S9[         R                  R                  S/ S!QS"SS#9/5      [         R                  R                  S$[         R                  R                  SS	S
/S9/5      [         R                  R                  S%/ 5      /S9[         R                  R                  S&[         R                  R                  S%/ 5      [         R                  R                  S'[         R                  R                  S(S)S*S+[         R                  R                  S,S-9[         R                  R                  S.S/S/S0[         R                  R                  S1SS29[         R                  R                  S3S4S5SS69[         R                  R                  S7SS8SS8[         R                  R                  S9SS9/5      /S9[         R                  R                  S:/ S;QS<S=SS>9/[         R                  R                  5       /[         R                   R"                  [         R                   R$                  [         R                   R&                  /S[         R(                  " [         R*                  " / S?QS@9SASB9SC9	$ )DNrG  zTopaz Video Enhancer   r   r   r   r#   r   r   r   r-   rI   g      ?r=   r>   r   z!Creative strength of the upscale.)r3   r@   rA   rB   rC   r4   r0   Tr1   zEOptional descriptive (not instructive) scene prompt.Capping input at z  frames (~15s @ 30fps) when set.)r2   r3   r4   sharpr?   zXPre-enhance sharpness: 0.0=Gaussian blur, 0.5=passthrough (default), 1.0=USM sharpening.)r3   r@   rA   rB   rC   r4   r:   realismzJPulls output toward photographic realism.Leave at 0 for the model default.r$   r%   r   r   )r.   r3   r4   r&   Disabledr   r   r   r   r   r   r   )r3   r@   rA   rC   r4   r   rG   r   r   )r3   r@   rA   rC   r4   r:   r   Fr   )r3   r4   r:   r   r   r   r   r   r   r   )r.   r3   r4   r5   )r   z"upscaler_model.upscaler_resolutionr   )widgetsu  
                (
                  $model := $lookup(widgets, "upscaler_model");
                  $res := $lookup(widgets, "upscaler_model.upscaler_resolution");
                  $interp := $lookup(widgets, "interpolation_model");
                  $is4k := $contains($res, "4k");
                  $hasInterp := $interp != "disabled";
                  $rates := {
                    "starlight (astra) fast":     {"hd": 0.43, "uhd": 0.85},
                    "starlight precise 2.5":      {"hd": 0.70, "uhd": 1.54},
                    "astra 2":                    {"hd": 1.72, "uhd": 2.85},
                    "starlight (astra) creative": {"hd": 2.25, "uhd": 3.99}
                  };
                  $surcharge := $is4k ? 0.28 : 0.14;
                  $entry := $lookup($rates, $model);
                  $base := $is4k ? $entry.uhd : $entry.hd;
                  $hi := $base + ($hasInterp ? $surcharge : 0);
                  $model = "disabled"
                    ? {"type":"text","text":"Interpolation only"}
                    : ($hasInterp
                        ? {"type":"text","text":"~" & $string($base) & "–" & $string($hi) & " credits/src frame"}
                        : {"type":"text","text":"~" & $string($base) & " credits/src frame"})
                )
                )
depends_onexpr)	rN   rO   rP   rQ   rR   rS   rT   rU   price_badge)r   rV   r   r   DynamicComboOptionrW   r[   r\   r_   rY   AST2_MAX_FRAMES_WITH_PROMPTr^   r]   rZ   r`   ra   rb   rc   rd   
PriceBadgePriceBadgeDependsre   s    rg   rh   !TopazVideoEnhanceV2.define_schema  s   yy).*fw'%%$..% "/DO_amNn o "$0,/(+(+),131A1A1H1H,O !/ !" !#		$,.2,.-88S7TTt-v	 !0 !" !#$+,/(+(+)-131A1A1H1H-h-1 !/ 
!" !#$-,/(+(+)-131A1A1H1H-H-1 !/ 
!";(+X ..4XX^^,AL\^jKk^ln ..8 "/DO_amNn o "$0,E,1,O	 !/ !" ..3XX^^,AL\^jKk^lm ..z2>CB & EL %%)..z2>..# "$>,.(*(+131A1A1H1H,@ !- !" !#$:,-()(*131A1A1H1H-n-1 !- 	!" !#

 0 0$=,1,e-1	 !1 !" !#$G,0(-(+).131A1A1H1H,Y-1 !/ 	!"3#&) & ,Z /2!(!  k|| ! 		..		++		##
 // 9 
Wj
 j	
rj   r   r   r   r   rk   c                 V
  #    US   nUS   nUS:X  a  US:X  a  [        S5      e[        U5        UR                  5       u  px[        UR	                  5       5      n	UR                  5       n
UR                  5       nUnUnU	n/ nUS:w  Ga{  SUS   ;   a  SnSnOS	nS
nXx-  nXx:  a'  Un[        UU-  5      nUU:  a  Un[        UU-  5      nO&Un[        UU-  5      nUU:  a  Un[        UU-  5      nUS-  S:w  a  US-  nUS-  S:w  a  US-  n[        U   nUS:X  a  UR                  [        UUS   SS95        OUS:X  a  UR                  5       nUS   =(       d    SR                  5       nU(       a   U[        :  a  [        S[         SU S35      eU[        :  a  [        S[         SU S35      eUS   nUR                  [        UUS   U=(       d    S US   US:  a  UOS S95        OUR                  [        US95        US:w  a-  US   nUR                  [        UUS    US   US!   US"   S#95        [        U [!        S$S%S&9["        [%        ['        S'[)        U5      [        U
5      UR                  5       U	[+        XxS(9S)9U[-        [+        XS(9US*S+US,9S-9S.S/S09I S h  vN n[        U [!        S$UR.                   S13S2S&9[0        S3S4S59I S h  vN n[3        UR4                  5      S:  a  [7        S65      e[8        R:                  " S7S80S99 IS h  vN n[=        U[>        5      (       aX  URA                  S5        URC                  UR4                  S   USS:9 IS h  vN nURD                  S;   nS S S 5      IS h  vN   Of[F        RH                  " US<5       nURC                  UR4                  S   USS:9 IS h  vN nURD                  S;   nS S S 5      IS h  vN   S S S 5        S S S 5      IS h  vN   [        U [!        S$UR.                   S=3S2S&9[J        [M        [O        SWS>9/S?9S@SAS09I S h  vN   [Q        U [!        S$UR.                   SB3SC9[R        SD SE SF SGSH9I S h  vN n[T        RV                  " [Y        URZ                  R\                  5      I S h  vN 5      $  GN GN GN GNR GN6! , IS h  vN  (       d  f       N= f GN N! , IS h  vN  (       d  f       GN= f! , (       d  f       GN= f GN! , IS h  vN  (       d  f       GN$= f N N N7f)INr   r   rK  r   r   r   r   r   r   r   r   r   rG   r"   rI   Tr   r!   r0   r1   z$Astra 2 with a prompt is limited to z( input frames (~15s @ 30fps); video has z'. Clear the prompt or shorten the clip.zAstra 2 is limited to z input frames; video has .rJ  rI  )r+   rI   r0   rI  rJ  )r+   r   r   r   r   r   r   rp   rq   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r  r  r  r	  r
  r  r  r  r  r  r  rz   c                     U R                   $ r|   r}   r   s    rg   r   -TopazVideoEnhanceV2.execute.<locals>.<lambda>(  r   rj   c                     [        U SS5      $ r   r   r   s    rg   r   rY  )  r   rj   c                     U R                   (       a:  U R                   R                  S   (       a  U R                   R                  S   S-  $ S $ r  r  r   s    rg   r   rY  *  r  rj   r  r  )/r   r    r  r   r   r!  r"  r$  r#  r   r%  striprR  AST2_MAX_FRAMESr   r   r   r
   r   r	   r   r   r   r&  r   r'  r(  r)  r*  r+  r,  r   r-  r.  r  r/  r0  r   r   r   r   r   r   r   r   r1  r2  )rf   r   r   r   r   upscaler_choiceinterpolation_choicer3  r4  r5  r6  r7  r8  r9  r:  r   r;  r<  r=  model_idn_framesast2_promptrJ  r>  r?  r@  rA  rB  rC  rD  s                                 rg   r   TopazVideoEnhanceV2.execute  s     ))9:23HIj(-AZ-Oeff(/ % 4 4 6	U1134))+ 224 "*j(.)>??!% $!% $'B& ."=2#56-/#0L$'r(9$:M  . #L2$5 6 =0$1M#&}r'9#:La1$!q A%"*?;H7"*&#1,#?(, W$ 002-h7=2DDF8.I#I$>?Z>[ \55=J>eg  o-$'=o=NNghpgqqr%stt(3*&#1,#? + 3t,W5,3aKT 5HEF:- 34N ONN-../EF+,FG12KL(;<_(` $26B.#/#+,<= .$446,)	M  -)S/$"(,E$ '#1/
 
2 #*;+@+@*AI /)#3	
 	

 z!#%j  ((.+1NOOSZ*G44 %%a(";;zq'9@Pcg;hhlo"%++f"5K ihh ]]#3T:j&{{:??1+=Jae{ffjm&)kk&&9  gf ; PO *;+@+@*AAQR 7+2 !( +#5!
 	
 	
$  '2;3H3H2IQR./Bs 
 
 }}#?@W@W@[@[#\\]]W
2	
 P ihhh  gfff ;: POOO	
$
 ]sF  J T)"R*#.T)R-AT)R0T)A	T!R3"T%R95T R6T#S3 S
S3SS3S S3$T,T)7T8?T)7T#82T)*T%+6T)!T'"	T)-T)0T)3T6T9S	?S S	TS3S3S0S!S0+S33
T	=TT)T TT 	T)%T)'T)r   N)r   )r   r   r   r   r   rh   r   r   dictr   r   r   r   r   r   rj   rg   rG  rG    sv    k
 k
Z  */e^{{e^ e^ "	e^
 $'e^ 
e^ e^rj   rG  c                   L    \ rS rSr\S\\\R                        4S j5       r	Sr
g)TopazExtensioni0  rk   c                 ,   #    [         [        [        /$ 7fr|   )r(   r   rG  )selfs    rg   get_node_listTopazExtension.get_node_list1  s      
 	
s   r   N)r   r   r   r   r   listtyper   	ComfyNoderi  r   r   rj   rg   rf  rf  0  s)    
T$r||*<%= 
 
rj   rf  rk   c                     #    [        5       $ 7fr|   )rf  r   rj   rg   comfy_entrypointro  :  s     s   ).r/  ior   r*  typing_extensionsr   comfy_api.latestr   r   r   comfy_api_nodes.apis.topazr   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   comfy_api_nodes.utilr   r   r   r   r   r   r   r   r    r$  r]  rR  rm  r(   r   rG  rf  ro  r   rj   rg   <module>ru     s       & 6 6    $
 
 
 %")&	  ! tW tWnm^ m^`U^",, U^p

^ 
 rj   