
    3j>?                        S SK Jr  S SKJr  S SKJrJrJr   " S S\\5      r	 " S S\\5      r
 " S S	\\5      r " S
 S\\5      r " S S\\5      r " S S\\5      r " S S\\5      r " S S\\5      r " S S\\5      r " S S\\5      r " S S\\5      r " S S\\5      r " S S\\5      r " S S\\5      r " S  S!\5      r " S" S#\5      r " S$ S%\5      r " S& S'\5      r " S( S)\5      r " S* S+\5      r " S, S-\5      r " S. S/\5      r " S0 S1\5      r " S2 S3\5      r  " S4 S5\5      r! " S6 S7\5      r" " S8 S9\5      r# " S: S;\5      r$ " S< S=\5      r% " S> S?\5      r& " S@ SA\&5      r' " SB SC\&5      r( " SD SE\&5      r) " SF SG\5      r* " SH SI\5      r+ " SJ SK\5      r, " SL SM\5      r- " SN SO\5      r.gP)Q    )Enum)Any)	BaseModelField	RootModelc                   (    \ rS rSrSrSrSrSrSrSr	g)	TripoModelVersion   zv3.1-20260211zv3.0-20250812zv2.5-20250123zv2.0-20240919zv1.4-20240625 N)
__name__
__module____qualname____firstlineno__v3_1_20260211v3_0_20250812v2_5_20250123v2_0_20240919v1_4_20240625__static_attributes__r       :/home/wildlama/comfy/ComfyUI/comfy_api_nodes/apis/tripo.pyr	   r	      s    #M#M#M#M#Mr   r	   c                       \ rS rSrSrSrSrg)TripoGeometryQuality   standarddetailedr   Nr   r   r   r   r   r   r   r   r   r   r   r          HHr   r   c                       \ rS rSrSrSrSrg)TripoTextureQuality   r   r   r   Nr   r   r   r   r    r       r   r   r    c                   8    \ rS rSrSrSrSrSrSrSr	Sr
S	rS
rSrg)
TripoStyle   zperson:person2cartoonzanimal:venomzobject:clayzobject:steampunkzobject:christmaszobject:barbiegoldancient_bronzeNoner   N)r   r   r   r   PERSON_TO_CARTOONANIMAL_VENOMOBJECT_CLAYOBJECT_STEAMPUNKOBJECT_CHRISTMASOBJECT_BARBIEGOLDANCIENT_BRONZENONEr   r   r   r   r#   r#      s2    /!LK))#MD%NDr   r#   c                   <    \ rS rSrSrSrSrSrSrSr	Sr
S	rS
rSrSrg)TripoTaskType%   text_to_modelimage_to_modelmultiview_to_modeltexture_modelrefine_modelanimate_prerigcheckanimate_riganimate_retargetstylize_modelconvert_modelr   N)r   r   r   r   TEXT_TO_MODELIMAGE_TO_MODELMULTIVIEW_TO_MODELTEXTURE_MODELREFINE_MODELANIMATE_PRERIGCHECKANIMATE_RIGANIMATE_RETARGETSTYLIZE_MODELCONVERT_MODELr   r   r   r   r2   r2   %   s7    #M%N-#M!L/K)#M#Mr   r2   c                       \ rS rSrSrSrSrg)TripoTextureAlignment2   original_imagegeometryr   N)r   r   r   r   ORIGINAL_IMAGEGEOMETRYr   r   r   r   rI   rI   2   s    %NHr   rI   c                       \ rS rSrSrSrSrg)TripoOrientation7   align_imagedefaultr   N)r   r   r   r   ALIGN_IMAGEDEFAULTr   r   r   r   rP   rP   7   s    KGr   rP   c                       \ rS rSrSrSrSrg)TripoOutFormat<   glbfbxr   N)r   r   r   r   GLBFBXr   r   r   r   rW   rW   <   s    
C
Cr   rW   c                       \ rS rSrSrSrSrg)	TripoSpecA   mixamotripor   N)r   r   r   r   MIXAMOTRIPOr   r   r   r   r^   r^   A   s    FEr   r^   c                   T    \ rS rSrSrSrSrSrSrSr	Sr
S	rS
rSrSrSrSrSrSrSrSrg)TripoAnimationF   zpreset:idlezpreset:walkz
preset:runzpreset:divezpreset:climbzpreset:jumpzpreset:slashzpreset:shootzpreset:hurtzpreset:fallzpreset:turnzpreset:quadruped:walkzpreset:hexapod:walkzpreset:octopod:walkzpreset:serpentine:marchzpreset:aquatic:marchr   N)r   r   r   r   IDLEWALKRUNDIVECLIMBJUMPSLASHSHOOTHURTFALLTURNQUADRUPED_WALKHEXAPOD_WALKOCTOPOD_WALKSERPENTINE_MARCHAQUATIC_MARCHr   r   r   r   re   re   F   sS    DD
CDEDEEDDD,N(L(L0*Mr   re   c                   ,    \ rS rSrSrSrSrSrSrSr	Sr
g	)
TripoConvertFormatY   GLTFUSDZr\   OBJSTL3MFr   N)r   r   r   r   rz   r{   r\   r|   r}   _3MFr   r   r   r   rx   rx   Y   s     DD
C
C
CDr   rx   c                   8    \ rS rSrSrSrSrSrSrSr	Sr
S	rS
rSrg)TripoTextureFormatb   BMPDPXHDRJPEGOPEN_EXRPNGTARGATIFFWEBPr   N)r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   b   s/    
C
C
CDH
CEDDr   r   c                   4    \ rS rSrSrSrSrSrSrSr	Sr
S	rS
rg)TripoTaskStatusn   queuedrunningsuccessfailed	cancelledunknownbannedexpiredr   N)r   r   r   r   QUEUEDRUNNINGSUCCESSFAILED	CANCELLEDUNKNOWNBANNEDEXPIREDr   r   r   r   r   r   n   s*    FGGFIGFGr   r   c                        \ rS rSrSrSrSrSrg)TripoFbxPresety   blenderr`   3dsmaxr   N)r   r   r   r   BLENDERrb   _3DSMAXr   r   r   r   r   r   y   s    GFGr   r   c                   >    \ rS rSr% \" SSS9r\S-  \S'   \\S'   Srg)TripoFileTokenReference   NThe type of the referencedescriptiontype
file_tokenr   	r   r   r   r   r   r   str__annotations__r   r   r   r   r   r      s    T/JKD#*KOr   r   c                   >    \ rS rSr% \" SSS9r\S-  \S'   \\S'   Srg)TripoUrlReference   Nr   r   r   urlr   r   r   r   r   r   r      s    T/JKD#*K	Hr   r   c                   *    \ rS rSr% \\S'   \\S'   Srg)TripoObjectStorage   bucketkeyr   N)r   r   r   r   r   r   r   r   r   r   r   r      s    K	Hr   r   c                   *    \ rS rSr% \\S'   \\S'   Srg)TripoObjectReference   r   objectr   N)r   r   r   r   r   r   r   r   r   r   r   r   r      s    
Ir   r   c                       \ rS rSrSrg)TripoFileEmptyReference   r   N)r   r   r   r   r   r   r   r   r   r      s    r   r   c                   2    \ rS rSr% \\-  \-  \-  \S'   Sr	g)TripoFileReference   rootr   N)
r   r   r   r   r   r   r   r   r   r   r   r   r   r   r      s    
!$5
58L
LOf
ffr   r   c                      \ rS rSr% \" \R                  SS9r\\S'   \" SSSS9r	\
\S	'   \" S
SSS9r\
S
-  \S'   \R                  r\S
-  \S'   \" S
SS9r\S
-  \S'   \" SSS9r\S
-  \S'   \" SSS9r\S
-  \S'   \" S
SS9r\S
-  \S'   \" S
SS9r\S
-  \S'   \" S
SS9r\S
-  \S'   \R0                  r\S
-  \S'   \R0                  r\S
-  \S'   S
r\S
-  \S'   \" SSS9r\S
-  \S '   \" SS!S9r\S
-  \S"'   S#r g
)$TripoTextToModelRequest   Type of taskr   r   .z0The text prompt describing the model to generate   )r   
max_lengthpromptNzThe negative text promptnegative_promptmodel_version.The number of faces to limit the generation to
face_limitT/Whether to apply texture to the generated modeltexture+Whether to apply PBR to the generated modelpbrzThe seed for the text
image_seedThe seed for the model
model_seedThe seed for the texturetexture_seedtexture_qualitygeometry_qualitystyleFWhether to auto-size the model	auto_size,Whether to apply quad to the generated modelquadr   )!r   r   r   r   r   r2   r>   r   r   r   r   r   r	   r   r   r   intr   boolr   r   r   r   r    r   r   r   r   r   r#   r   r   r   r   r   r   r   r      sI    ; ;XD-X)[hlmFCm"':Tae"fOS4Zf.?.M.MM$t+M"45efJd
f 3deGTD[eT/\]C]"45LMJd
M"45MNJd
N$T7QRL#*R2E2N2NO(4/N4H4Q4Q*T1Q#E:#"56VWItd{We1_`D$+`r   r   c                      \ rS rSr% \" \R                  SS9r\\S'   \" SSS9r	\
\S'   \" SS	S9r\S-  \S
'   \" SSS9r\S-  \S'   \" SSS9r\S-  \S'   \" SSS9r\S-  \S'   \" SSS9r\S-  \S'   \" SSS9r\S-  \S'   \R*                  r\S-  \S'   \R*                  r\S-  \S'   \" \R4                  SS9r\S-  \S'   \" SSS9r\S-  \S'   \" SSS9r\S-  \S'   \R@                  r!\S-  \S'   \" SS S9r"\S-  \S!'   S"r#g)#TripoImageToModelRequest   r   r   r   .z(The file reference to convert to a modelfileN'The model version to use for generationr   r   r   Tr   r   r   r   r   r   r   r   r   r   The texture alignment methodtexture_alignmentz)The style to apply to the generated modelr   Fr   r   orientationr   r   r   )$r   r   r   r   r   r2   r?   r   r   r   r   r   r	   r   r   r   r   r   r   r   r    r   r   r   r   rI   rM   r   r   r#   r   rP   rU   r   r   r   r   r   r   r   r      s^    < <.YD-Y$S6`aD
a.3DFo.pM$t+p"45efJd
f 3deGTD[eT/\]C]"45MNJd
N$T7QRL#*R2E2N2NO(4/N4H4Q4Q*T1Q6;,,:X7,t3   %T7bcE:c"56VWItd{W+;+C+CK!D(Ce1_`D$+`r   r   c                      \ rS rSr% \R
                  r\\S'   \" SSS9r	\
\   \S'   \" SSS9r\S-  \S	'   \" S
SS9r\S-  \S'   \" SSS9r\S-  \S'   \" SSS9r\S-  \S'   \" SSS9r\S-  \S'   \" SSS9r\S-  \S'   \" SSS9r\S-  \S'   \R.                  r\S-  \S'   \R.                  r\S-  \S'   \R8                  r\S-  \S'   \" S
SS9r\S-  \S'   \" \R@                  SS9r!\S-  \S'   \" S
SS9r"\S-  \S '   S!r#g)"TripoMultiviewToModelRequest   r   .z)The file references to convert to a modelr   filesNr   r   Fz&Whether to use orthographic projectionorthographic_projectionr   r   Tr   r   r   r   r   r   r   r   r   r   r   r   r   zThe orientation for the modelr   r   r   r   )$r   r   r   r   r2   r@   r   r   r   r   listr   r   r	   r   r   r   r   r   r   r   r   r    r   r   r   r   rI   rM   r   r   rP   rU   r   r   r   r   r   r   r   r      sV   '::D-:&+C=h&iE4"#i.3DFo.pM$t+p+0Dl+mTD[m"45efJd
f 3deGTD[eT/\]C]"45MNJd
N$T7QRL#*R2E2N2NO(4/N4H4Q4Q*T1Q6K6Z6Z,t3Z"56VWItd{W+01A1I1IWv+wK!D(we1_`D$+`r   r   c                   4    \ rS rSr% \" SSS9r\S-  \S'   Srg)TripoTexturePrompt   Nz$Text guidance for texture generationr   textr   )	r   r   r   r   r   r   r   r   r   r   r   r   r   r      s    T/UVD#*Vr   r   c                   @   \ rS rSr% \" \R                  SS9r\\S'   \" SSS9r	\
\S'   \" SS	S9r\S
-  \S'   \" SSS9r\S
-  \S'   \" S
SS9r\S
-  \S'   \" S
SS9r\S
-  \S'   \" S
SS9r\S
-  \S'   \" \R(                  SS9r\S
-  \S'   \" S
SS9r\S
-  \S'   Srg
)TripoTextureModelRequest   r   r   r   .!The task ID of the original modeloriginal_model_task_idTz%Whether to apply texture to the modelNr   z!Whether to apply PBR to the modelr   r   r   r   r   zThe quality of the texturer   r   r   z}Optional guidance for texturing. Required in practice for imported models, which carry no source image to infer texture from.texture_promptr   )r   r   r   r   r   r2   rA   r   r   r   r   r   r   r   r   r   r   r   r    rI   rM   r   r   r   r   r   r   r   r   r      s     ; ;XD-X"'9\"]C] 3Z[GTD[[T/RSCS"45MNJd
N$T7QRL#*R27Jf2gO(4/g6;,,:X7,t3  16=1N&- r   r   c                   Z    \ rS rSr% \" \R                  SS9r\\S'   \" SSS9r	\
\S'   Srg	)
TripoRefineModelRequest   r   r   r   .zThe task ID of the draft modeldraft_model_task_idr   N)r   r   r   r   r   r2   rB   r   r   r   r   r   r   r   r   r   r      s,     : :WD-W$S6VWWr   r   c                       \ rS rSr% \" \R                  SS9r\\S'   \" SSS9r	\
\S'   \" \R                  SS9r\S	-  \S
'   \" \R                  SS9r\S	-  \S'   Srg	)TripoAnimateRigRequest   r   r   r   .r   r   The output formatN
out_formatzThe specification for riggingspecr   )r   r   r   r   r   r2   rD   r   r   r   r   rW   r[   r  r^   rc   r  r   r   r   r   r   r      sd     9 9~VD-V"'9\"]C](-n.@.@Na(bJ%b"9??@_`D)d
`r   r   c                       \ rS rSr% \" \R                  SS9r\\S'   \" SSS9r	\
\S'   \" SSS9r\\S	'   \" \R                  S
S9r\S-  \S'   \" SSS9r\S-  \S'   Srg)TripoAnimateRetargetRequest   r   r   r   .r   r   zThe animation to apply	animationr  Nr  TzWhether to bake the animationbake_animationr   )r   r   r   r   r   r2   rE   r   r   r   r   r  re   rW   r[   r  r  r   r   r   r   r   r  r     sq     > >N[D-["'9\"]C] %c7O PI~P(-n.@.@Na(bJ%b"':Y"ZND4KZr   r  c                      \ rS rSr% \" \R                  SS9r\\S'   \" SSS9r	\
\S'   \" SSS9r\\S	'   \" S
SS9r\S
-  \S'   \" S
SS9r\S
-  \S'   \" S
SS9r\S
-  \S'   \" S
SS9r\S
-  \S'   \" S
SS9r\S
-  \S'   \" S
SS9r\S
-  \S'   \" \R.                  SS9r\S
-  \S'   \" S
SS9r\S
-  \S'   \" S
SS9r\S
-  \S'   \" S
SS9r\S
-  \S'   \" S
SS9r\S
-  \S '   \" S
S!S9r\S
-  \S"'   \" S
S#S9r\\   S
-  \S$'   \" S
S%S9r \!S
-  \S&'   \" S
S'S9r"\S
-  \S('   \" S
S)S9r#\$S
-  \S*'   \" S
S+S9r%\S
-  \S,'   S-r&g
).TripoConvertModelRequest   r   r   r   .zThe format to convert toformatr   r   Nz"Whether to apply quad to the modelr   zWhether to force symmetryforce_symmetryz.The number of faces to limit the conversion tor   z*Whether to flatten the bottom of the modelflatten_bottomz'The threshold for flattening the bottomflatten_bottom_thresholdzThe size of the texturetexture_sizezThe format of the texturetexture_formatz%Whether to pivot to the center bottompivot_to_center_bottomzThe scale factor for the modelscale_factorzWhether to include animationswith_animationzWhether to pack the UVspack_uvzWhether to bake the modelbakez!The names of the parts to include
part_nameszThe preset for the FBX export
fbx_presetz#Whether to export the vertex colorsexport_vertex_colorszThe orientation for the exportexport_orientationzWhether to animate in placeanimate_in_placer   )'r   r   r   r   r   r2   rG   r   r   r  rx   r   r   r   r   r  r   r   r  r  floatr  r   r   r  r  r  r  r  r  r  r   r  r   r  r  rP   r  r   r   r   r   r
  r
     s    ; ;XD-X!&s8R!SFS"'9\"]C]d0TUD$+U"':U"VND4KV"45efJd
f"':f"gND4Kg-24En-oedlo$T7PQL#*Q056H6M6M[v0wN&-w*/Bi*jD4Kj!&t9Y!ZL%$,Z"':Y"ZND4KZ 3LMGTD[Md0KLD$+L#(;^#_JS	D _(-d@_(`J%`(-d@e(f$+f27Jj2k(4/k$)$<Y$ZdTkZr   r
  c                   F   \ rS rSr% Sr\" S5      r\\S'   \" SSS9r	\
S-  \S'   \" SS	S
SS9r\
S-  \S'   \" SSS9r\S-  \S'   \" SSS9r\S-  \S'   \" SSS9r\
S-  \S'   \" SSS9r\S-  \S'   \" SSS9r\S-  \S'   \" SSS9r\S-  \S'   \" SSS9r\S-  \S'   Srg)TripoP1CommonRequesti  z4Fields supported by Tripo P1 across all input types.zP1-20260311r   Nz#Random seed for geometry generationr   r   0   i N  zTarget face count (48-20000))geler   r   z+Enable texturing; pbr=True forces this truer   z3Enable PBR maps; when true, texture is also enabledr   z"Random seed for texture generationr   z"standard" or "detailed"r   zScale to real-world metersr   zOnly "geometry" is supportedcompressz'Perform UV unwrapping during generation	export_uvr   )r   r   r   r   __doc__r   r   r   r   r   r   r   r   r   r   r   r   r   r"  r#  r   r   r   r   r  r    s    >}-M3-"45Z[Jd
["4B5FdeJd
e 3`aGTD[aT/deCe$T7[\L#*\"':T"UOS4ZU"45QRItd{R 3QRHcDjR"45^_Itd{_r   r  c                   n    \ rS rSr% Sr\\S'   \" SSS9r\\S'   \" SS	S9r	\S-  \S
'   Sr
\S-  \S'   Srg)TripoP1TextToModelRequesti#  r4   r   .r   )r   r   N   r   r   r   )r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r&  r&  #  s@    D#-FC-"'"=OS4Z=!Jd
!r   r&  c                   ~    \ rS rSr% Sr\\S'   \\S'   Sr\	S-  \S'   \
" SSS9r\S-  \S	'   \
" SS
S9r\S-  \S'   Srg)TripoP1ImageToModelRequesti*  r5   r   r   Nenable_image_autofixz"original_image" or "geometry"r   r   z."default" or "align_image"; needs texture=truer   r   )r   r   r   r   r   r   r   r   r*  r   r   r   r   r   r   r   r   r)  r)  *  sN     D# 
(,$+,$)$<\$]sTz]#D6fgKtgr   r)  c                   `    \ rS rSr% SrSr\\S'   \\	   \S'   Sr
\S-  \S'   Sr\S-  \S'   S	rg)
TripoP1MultiviewToModelRequesti2  zP1 multiview generation.

Tripo requires `files` to be exactly four entries in [front, left, back, right] order with `{}`
(TripoFileEmptyReference) for omitted slots; front is required and at least two images total must be provided.
r6   r   r   Nr   r   r   )r   r   r   r   r$  r   r   r   r   r   r   r   r   r   r   r   r,  r,  2  s<     %D#$"##$(sTz("Kt"r   r,  c                   J    \ rS rSr% Sr\" SSS9r\\S'   \" SSS9r	\\S'   S	r
g
)TripoImportModelRequesti?  a  Request for the comfy-api composite import endpoint (/proxy/tripo/v2/openapi/import).

The model file is uploaded to ComfyUI API storage first; the backend downloads it from
`url`, re-uploads it to Tripo's storage and creates the import_model task server-side.
.z2ComfyUI API storage download URL of the model filer   r   z)File format: "glb", "fbx", "obj" or "stl"r  r   N)r   r   r   r   r$  r   r   r   r   r  r   r   r   r   r.  r.  ?  s-     S&Z[C[)TUFCUr   r.  c                       \ rS rSr% \" SSS9r\S-  \S'   \" SSS9r\S-  \S'   \" SSS9r	\S-  \S	'   \" SS
S9r
\S-  \S'   \" SSS9r\S-  \S'   Srg)TripoTaskOutputiJ  NzURL to the modelr   modelzURL to the base model
base_modelzURL to the PBR model	pbr_modelzURL to the rendered imagerendered_imagezWhether the model is riggableriggabler   )r   r   r   r   r   r1  r   r   r2  r3  r4  r5  r   r   r   r   r   r0  r0  J  sp    d0BCE3:C"45LMJd
M!$4JKIsTzK!&t9T!UNC$JU!$4STHdTkTr   r0  c                   L   \ rS rSr% \" SSS9r\\S'   \" SSS9r\S-  \S'   \" SS	S9r	\
S-  \S
'   \" SSS9r\\\4   S-  \S'   \" SSS9r\S-  \S'   \" SSSSS9r\S-  \S'   \" SSS9r\S-  \S'   \" SSS9r\S-  \S'   \" SSS9r\S-  \S'   \" S5      r\S-  \S'   Srg)	TripoTaskiR  .zThe task IDr   task_idNzThe type of taskr   zThe status of the taskstatusz!The input parameters for the taskinputzThe output of the taskoutputzThe progress of the taskr   d   )r   r   r!  progresszThe creation time of the taskcreate_timez$The estimated time left for the taskrunning_left_timezThe position in the queuequeue_positionconsumed_creditr   )r   r   r   r   r   r8  r   r   r   r9  r   r:  dictr   r;  r0  r=  r   r>  r?  r@  rA  r   r   r   r   r7  r7  R  s    -8GS8T/ABD#*B%*4=U%VFOd"V#(;^#_E4S>D _%*4=U%VFOd"V 3MRSX[\HcDj\#D6UVKtV$)$<b$csTzc!&t9T!UNC$JU"'+OS4Z-r   r7  c                   F    \ rS rSr% \" SSS9r\\S'   \" SSS9r\	\S'   S	r
g
)TripoTaskResponsei_  r   zThe response coder   code.zThe task datadatar   N)r   r   r   r   r   rE  r   r   rF  r7  r   r   r   r   rD  rD  _  s%    a%89D#9C_=D)=r   rD  c                   ^    \ rS rSr% \" SSS9r\\S'   \" SSS9r\	\S'   \" SSS9r
\	\S	'   S
rg)TripoErrorResponseid  .zThe error coder   rE  zThe error messagemessagez#The suggestion for fixing the error
suggestionr   N)r   r   r   r   r   rE  r   r   rI  r   rJ  r   r   r   r   rH  rH  d  s8    c'78D#8*=>GS>C-RSJSr   rH  N)/enumr   typingr   pydanticr   r   r   r   r	   r   r    r#   r2   rI   rP   rW   r^   re   rx   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r
  r  r&  r)  r,  r.  r0  r7  rD  rH  r   r   r   <module>rN     s     0 0$T $3 
#t 
	d 	
$C 
$C 
sD 
S$ 
T 
+S$ +&d 	d 	c4 S$ i 
	 
 
9 
	i 	g gai a$ay a(a9 a$W Wy $Xi X
aY a[) [[y [.`9 `" 4 "h!5 h
#%9 
#Vi VUi U
.	 
.>	 >
T Tr   