
    3j                         S SK Jr  S SKJr  S SKrS SKrS SKJrJ	r	  S SK
r
 " S S\	R                  5      r " S S\	R                  5      r " S	 S
\5      rS\4S jrg)    )override)CallableN)ComfyExtensionioc            
           \ rS rSr\S\R                  4S j5       r\SS.S\S\S\S\R                  4S	 jj5       r
S
rg)EmptyChromaRadianceLatentImage   returnc                 j   [         R                  " SS[         R                  R                  SSS[        R
                  SS9[         R                  R                  SSS[        R
                  SS9[         R                  R                  SS	S	S
S9/[         R                  " 5       R                  5       /S9$ )Nr   zmodel/latent/chroma radiancewidthi      )iddefaultminmaxstepheight
batch_size   i   )r   r   r   r   )node_idcategoryinputsoutputs)r   SchemaIntInputnodesMAX_RESOLUTIONLatentOutputclss    B/home/wildlama/comfy/ComfyUI/comfy_extras/nodes_chroma_radiance.pydefine_schema,EmptyChromaRadianceLatentImage.define_schema   s    yy4325CWCW^`a$BEDXDX_abaQDI
 YY['')*	
 		
    r   )r   r   r   r   c                    [         R                  " USX!4[        R                  R	                  5       S9n[
        R                  " SU05      $ )N   )devicesamples)torchzeroscomfymodel_managementintermediate_devicer   
NodeOutput)r"   r   r   r   latents        r#   execute&EmptyChromaRadianceLatentImage.execute   s<    j!V;EDZDZDnDnDpq}}i/00r&    N)__name__
__module____qualname____firstlineno__classmethodr   r   r$   intr0   r2   __static_attributes__r4   r&   r#   r   r      sV    

bii 

 

 AB 1s 1C 1S 1r}} 1 1r&   r   c                       \ rS rSr\S\R                  4S j5       r\S\R                  R                  S\
S\S\S\S	\
S\R                  4S
 j5       rSrg)ChromaRadianceOptions   r
   c                    [         R                  " SSS[         R                  R                  SS9[         R                  R                  SSSS	9[         R
                  R                  S
SSSSSS9[         R
                  R                  SSSSSSS9[         R                  R                  SSSSSS9[         R                  R                  SSSSS9/[         R                  R                  5       /S9$ )Nr=   zmodel/patch/chroma radiancez>Allows setting advanced options for the Chroma Radiance model.model)r   preserve_wrapperTzqWhen enabled, will delegate to an existing model function wrapper if it exists. Generally should be left enabled.)r   r   tooltipstart_sigmag      ?g        z1First sigma that these options will be in effect.)r   r   r   r   rB   advanced	end_sigmaz0Last sigma that these options will be in effect.nerf_tile_sizezAllows overriding the default NeRF tile size. -1 means use the default (32). 0 means use non-tiling mode (may require a lot of VRAM).)r   r   r   rB   rD   force_sequential_txt_idsFzForce usage of sequential text token IDs instead of zeroes. Should be used for checkpoints from 2026-05-22 to 2026-06-01 that are trained in this way but do not contain the __sequential__ key in the state dict.)r   r   rB   rD   )r   r   descriptionr   r   )r   r   Modelr   BooleanFloatr   r    r!   s    r#   r$   #ChromaRadianceOptions.define_schema    s   yy+2X'*

  )  P ! 
 $O!   "N!   ' d!   

  1! q!	 ! =$J XX__&'S*
 *	
r&   r@   rA   rC   rE   rF   rH   c                l  ^^^^^	 0 m	US:  a  UT	S'   U(       a  ST	S'   T	(       d  [         R                  " U5      $ UR                  R                  S5      mS[        S[
        S[        R                  4UUUU	U4S	 jjnUR                  5       nUR                  U5        [         R                  " U5      $ )
Nr   rF   Tuse_sequential_txt_idsmodel_function_wrapperapply_modelargsr
   c                   > US   R                  5       nUS   R                  5       R                  5       R                  5       R	                  5       nTUs=::  a  T	::  a:  O  O7UR                  S0 5      R                  5       nTR                  5       US'   XBS'   T(       a  T(       d  U " US   US   40 UD6$ T" XSU0-  5      $ )Nctimesteptransformer_optionschroma_radiance_optionsinput)copyr   detachcpuitemget)
rQ   rR   rT   sigmarV   rE   old_wrapperrA   radiance_optionsrC   s
        r#   rP   =ChromaRadianceOptions.execute.<locals>.model_function_wrappere   s    S	 A$((*113779>>@EE0[0&'ee,A2&F&K&K&M#AQAVAVAX#$=>+>'($"4=$z2BHaHH{C8O<<r&   )
r   r0   model_optionsr]   r   dictr+   Tensorcloneset_model_unet_function_wrapper)
r"   r@   rA   rC   rE   rF   rH   rP   r_   r`   s
     ```   @@r#   r2   ChromaRadianceOptions.executeN   s     Q1?-.#9=56==''))--.FG		= 		= 		= 		= 		= --.DE}}U##r&   r4   N)r5   r6   r7   r8   r9   r   r   r$   rJ   Typeboolfloatr:   r0   r2   r;   r4   r&   r#   r=   r=      s    +
bii +
 +
Z #$ xx}}#$ 	#$
 #$ #$ #$ #'#$ 
#$ #$r&   r=   c                   L    \ rS rSr\S\\\R                        4S j5       r	Sr
g)ChromaRadianceExtensionu   r
   c                 "   #    [         [        /$ 7fN)r   r=   )selfs    r#   get_node_list%ChromaRadianceExtension.get_node_listv   s      +!
 	
s   r4   N)r5   r6   r7   r8   r   listtyper   	ComfyNoderq   r;   r4   r&   r#   rl   rl   u   s)    
T$r||*<%= 
 
r&   rl   r
   c                     #    [        5       $ 7fro   )rl   r4   r&   r#   comfy_entrypointrw   ~   s     "$$s   )typing_extensionsr   typingr   r+   comfy.model_managementr-   comfy_api.latestr   r   r   ru   r   r=   rl   rw   r4   r&   r#   <module>r|      sS    &    / 1R\\ 1(S$BLL S$l
n 
% 7 %r&   