o
    i=                     @  s  d dl mZ d dlmZ d dlmZmZmZmZm	Z	 d dl
mZmZmZ G dd deeZG dd deeZG d	d
 d
eeZG dd deeZG dd deeZG dd deeZG dd deeZG dd deeZG dd deeZG dd deeZG dd deeZG dd deeZG dd deeZG dd  d eeZG d!d" d"eeZG d#d$ d$eeZG d%d& d&eZG d'd( d(eZ G d)d* d*eZ!G d+d, d,eZ"G d-d. d.eZ#G d/d0 d0eZ$G d1d2 d2eZ%G d3d4 d4eZ&G d5d6 d6eZ'G d7d8 d8eZ(G d9d: d:eZ)G d;d< d<eZ*G d=d> d>eZ+G d?d@ d@eZ,G dAdB dBeZ-G dCdD dDeZ.G dEdF dFeZ/G dGdH dHeZ0G dIdJ dJeZ1G dKdL dLeZ2G dMdN dNeZ3G dOdP dPeZ4G dQdR dReZ5G dSdT dTeZ6G dUdV dVeZ7dWS )X    )annotations)Enum)OptionalListDictAnyUnion)	BaseModelField	RootModelc                   @     e Zd ZdZdZdZdZdS )TripoModelVersionzv3.0-20250812zv2.5-20250123zv2.0-20240919zv1.4-20240625N)__name__
__module____qualname__v3_0_20250812v2_5_20250123v2_0_20240919v1_4_20240625 r   r   8/mnt/c/Users/fbmor/ComfyUI/comfy_api_nodes/apis/tripo.pyr      
    r   c                   @     e Zd ZdZdZdS )TripoGeometryQualitystandarddetailedNr   r   r   r   r   r   r   r   r   r          r   c                   @  r   )TripoTextureQualityr   r   Nr   r   r   r   r   r      r   r   c                   @  0   e Zd ZdZdZdZdZdZdZdZ	dZ
d	Zd
S )
TripoStylezperson:person2cartoonzanimal:venomzobject:clayzobject:steampunkzobject:christmaszobject:barbiegoldancient_bronzeNoneN)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    c                   @  s4   e Zd ZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdS )TripoTaskTypetext_to_modelimage_to_modelmultiview_to_modeltexture_modelrefine_modelanimate_prerigcheckanimate_riganimate_retargetstylize_modelconvert_modelN)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   r.   #   s    r.   c                   @  r   )TripoTextureAlignmentoriginal_imagegeometryN)r   r   r   ORIGINAL_IMAGEGEOMETRYr   r   r   r   rC   /   r   rC   c                   @  r   )TripoOrientationalign_imagedefaultN)r   r   r   ALIGN_IMAGEDEFAULTr   r   r   r   rH   3   r   rH   c                   @  r   )TripoOutFormatglbfbxN)r   r   r   GLBFBXr   r   r   r   rM   7   r   rM   c                   @  r   )TripoTopologybipquadN)r   r   r   BIPQUADr   r   r   r   rR   ;   r   rR   c                   @  r   )	TripoSpecmixamotripoN)r   r   r   MIXAMOTRIPOr   r   r   r   rW   ?   r   rW   c                   @  sL   e Zd ZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZdZdZdZdZdZdS )TripoAnimationz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:marchN)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   r\   C   s"    r\   c                   @  r   )TripoStylizeStylelegovoxelvoronoi	minecraftN)r   r   r   LEGOVOXELVORONOI	MINECRAFTr   r   r   r   rm   U   r   rm   c                   @  s$   e Zd ZdZdZdZdZdZdZdS )TripoConvertFormatGLTFUSDZrQ   OBJSTL3MFN)	r   r   r   rw   rx   rQ   ry   rz   _3MFr   r   r   r   rv   [   s    rv   c                   @  r   )TripoTextureFormatBMPDPXHDRJPEGOPEN_EXRPNGTARGATIFFWEBPN)r   r   r   r~   r   r   r   r   r   r   r   r   r   r   r   r   r}   c   r-   r}   c                   @  s,   e Zd ZdZdZdZdZdZdZdZ	dZ
d	S )
TripoTaskStatusqueuedrunningsuccessfailed	cancelledunknownbannedexpiredN)r   r   r   QUEUEDRUNNINGSUCCESSFAILED	CANCELLEDUNKNOWNBANNEDEXPIREDr   r   r   r   r   n   s    r   c                   @  s   e Zd ZdZdZdZdS )TripoFbxPresetblenderrX   3dsmaxN)r   r   r   BLENDERrZ   _3DSMAXr   r   r   r   r   x   s    r   c                   @  *   e Zd ZU edddZded< ded< dS )TripoFileTokenReferenceNThe type of the referencedescriptionOptional[str]typestr
file_tokenr   r   r   r
   r   __annotations__r   r   r   r   r   }      
 r   c                   @  r   )TripoUrlReferenceNr   r   r   r   r   urlr   r   r   r   r   r      r   r   c                   @  s   e Zd ZU ded< ded< dS )TripoObjectStorager   bucketkeyNr   r   r   r   r   r   r   r   r         
 r   c                   @  s   e Zd ZU ded< ded< dS )TripoObjectReferencer   r   r   objectNr   r   r   r   r   r      r   r   c                   @  s   e Zd ZdS )TripoFileEmptyReferenceN)r   r   r   r   r   r   r   r      s    r   c                   @     e Zd ZU ded< dS )TripoFileReferencez`Union[TripoFileTokenReference, TripoUrlReference, TripoObjectReference, TripoFileEmptyReference]rootNr   r   r   r   r   r         
 r   c                   @  s"   e Zd ZU edddZded< dS )TripoGetStsTokenRequest.zThe format of the imager   r   formatN)r   r   r   r
   r   r   r   r   r   r   r      s   
 r   c                   @  s&  e Zd ZU eejddZded< eddddZd	ed
< eddddZ	ded< e
jZded< edddZded< edddZded< edddZded< edddZded< edddZded< edddZded< ejZd ed!< ejZd"ed#< dZd$ed%< ed&d'dZded(< ed&d)dZded*< dS )+TripoTextToModelRequestType of taskr   r.   r   .z0The text prompt describing the model to generatei   )r   
max_lengthr   promptNzThe negative text promptr   negative_promptOptional[TripoModelVersion]model_version.The number of faces to limit the generation toOptional[int]
face_limitT/Whether to apply texture to the generated modelOptional[bool]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Optional[TripoTextureQuality]texture_qualityOptional[TripoGeometryQuality]geometry_qualityOptional[TripoStyle]styleFWhether to auto-size the model	auto_size,Whether to apply quad to the generated modelrT   )r   r   r   r
   r.   r9   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   rT   r   r   r   r   r      s    
 r   c                   @  s,  e Zd ZU eejddZded< edddZded< ed	d
dZ	ded< ed	ddZ
ded< edddZded< edddZded< ed	ddZded< ed	ddZded< ejZded< ejZded< eejddZded < ed	d!dZd"ed#< ed$d%dZded&< ejZd'ed(< ed$d)dZded*< d	S )+TripoImageToModelRequestr   r   r.   r   .z(The file reference to convert to a modelr   fileN'The model version to use for generationr   r   r   r   r   Tr   r   r   r   r   r   r   r   r   r   r   r   r   The texture alignment methodOptional[TripoTextureAlignment]texture_alignmentz)The style to apply to the generated modelr   r   Fr   r   Optional[TripoOrientation]orientationr   rT   )r   r   r   r
   r.   r:   r   r   r   r   r   r   r   r   r   r   r   r   r   r   rC   rF   r   r   r   rH   rL   r   rT   r   r   r   r   r      s    
 r   c                   @  s$  e Zd ZU ejZded< edddZded< edd	dZ	d
ed< edddZ
ded< edddZded< edddZded< edddZded< edddZded< edddZded< ejZded< ejZded< ejZd ed!< edd"dZded#< eejd$dZd%ed&< edd'dZded(< dS ))TripoMultiviewToModelRequestr.   r   .z)The file references to convert to a modelr   zList[TripoFileReference]filesNr   r   r   Fz&Whether to use orthographic projectionr   orthographic_projectionr   r   r   Tr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   zThe orientation for the modelr   r   r   rT   )r   r   r   r.   r;   r   r   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   rC   rF   r   r   rH   rL   r   rT   r   r   r   r   r      s    
 r   c                   @  s   e Zd ZU eejddZded< edddZded< ed	d
dZ	ded< ed	ddZ
ded< edddZded< edddZded< edddZded< eejddZded< dS )TripoTextureModelRequestr   r   r.   r   .!The task ID of the original modelr   original_model_task_idTz%Whether to apply texture to the modelr   r   z!Whether to apply PBR to the modelr   Nr   r   r   r   r   zThe quality of the texturer   r   r   r   r   )r   r   r   r
   r.   r<   r   r   r   r   r   r   r   r   rC   rF   r   r   r   r   r   r      s   
 r   c                   @  8   e Zd ZU eejddZded< edddZded< d	S )
TripoRefineModelRequestr   r   r.   r   .zThe task ID of the draft modelr   draft_model_task_idN)	r   r   r   r
   r.   r=   r   r   r   r   r   r   r   r         
 r   c                   @  r   )
TripoAnimatePrerigcheckRequestr   r   r.   r   .r   r   r   N)	r   r   r   r
   r.   r>   r   r   r   r   r   r   r   r      r   r   c                   @  sd   e Zd ZU eejddZded< edddZded< ee	j
d	dZd
ed< eejddZded< dS )TripoAnimateRigRequestr   r   r.   r   .r   r   r   The output formatOptional[TripoOutFormat]
out_formatzThe specification for riggingzOptional[TripoSpec]specN)r   r   r   r
   r.   r?   r   r   r   rM   rP   r   rW   r[   r   r   r   r   r   r      s
   
 r   c                   @  sv   e Zd ZU eejddZded< edddZded< edd	dZ	d
ed< ee
jddZded< edddZded< dS )TripoAnimateRetargetRequestr   r   r.   r   .r   r   r   zThe animation to applyr\   	animationr   r   r   TzWhether to bake the animationr   bake_animationN)r   r   r   r
   r.   r@   r   r   r   r   rM   rP   r   r   r   r   r   r   r      s   
 r   c                   @  s`   e Zd ZU eejddZded< edddZded< edd	dZ	d
ed< edddZ
ded< dS )TripoStylizeModelRequestr   r   r.   r   .zThe style to apply to the modelrm   r   r   r   r   P   zThe block size for stylizationr   
block_sizeN)r   r   r   r
   r.   rA   r   r   r   r   r   r   r   r   r   r      s
   
 r   c                   @  s  e Zd ZU eejddZded< edddZded< edd	dZ	d
ed< edddZ
ded< edddZded< edddZded< edddZded< edddZded< edddZded< eejddZded< edddZded < edd!dZded"< edd#dZded$< edd%dZded&< edd'dZded(< edd)dZd*ed+< edd,dZd-ed.< edd/dZded0< edd1dZd2ed3< edd4dZded5< dS )6TripoConvertModelRequestr   r   r.   r   .zThe format to convert torv   r   r   r   r   Nz"Whether to apply quad to the modelr   rT   zWhether to force symmetryforce_symmetryz.The number of faces to limit the conversion tor   r   z*Whether to flatten the bottom of the modelflatten_bottomz'The threshold for flattening the bottomzOptional[float]flatten_bottom_thresholdzThe size of the texturetexture_sizezThe format of the texturezOptional[TripoTextureFormat]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 includezOptional[List[str]]
part_nameszThe preset for the FBX exportzOptional[TripoFbxPreset]
fbx_presetz#Whether to export the vertex colorsexport_vertex_colorszThe orientation for the exportr   export_orientationzWhether to animate in placeanimate_in_place)r   r   r   r
   r.   rB   r   r   r   r   rT   r   r   r   r   r   r}   r   r   r   r   r   r   r   r   r   r  r  r  r   r   r   r   r      s*   
 r   c                   @  r   )TripoTaskRequesta  Union[TripoTextToModelRequest, TripoImageToModelRequest, TripoMultiviewToModelRequest, TripoTextureModelRequest, TripoRefineModelRequest, TripoAnimatePrerigcheckRequest, TripoAnimateRigRequest, TripoAnimateRetargetRequest, TripoStylizeModelRequest, TripoConvertModelRequest]r   Nr   r   r   r   r   r    r   r  c                   @  sr   e Zd ZU edddZded< edddZded< edddZded	< edd
dZded< edddZ	ded< dS )TripoTaskOutputNzURL to the modelr   r   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 riggabler   riggable)
r   r   r   r
   r  r   r  r  r	  r
  r   r   r   r   r    s   
 r  c                   @  s   e Zd ZU edddZded< edddZded	< edd
dZded< edddZded< edddZ	ded< edddddZ
ded< edddZded< edddZded< edddZded< dS )	TripoTask.zThe task IDr   r   task_idNzThe type of taskr   r   zThe status of the taskzOptional[TripoTaskStatus]statusz!The input parameters for the taskzOptional[Dict[str, Any]]inputzThe output of the taskzOptional[TripoTaskOutput]outputzThe progress of the taskr   d   )r   geler   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)r   r   r   r
   r  r   r   r  r  r  r  r  r  r  r   r   r   r   r    s   
 r  c                   @  6   e Zd ZU edddZded< edddZded	< d
S )TripoTaskResponser   The response coder   intcode.zThe task datar  dataNr   r   r   r
   r  r   r  r   r   r   r   r  %     
 r  c                   @  r  )TripoGeneralResponser   r  r   r  r  .zThe task ID datazDict[str, str]r  Nr  r   r   r   r   r  )  r  r  c                   @  s6   e Zd ZU edddZded< edddZded< dS )	TripoBalanceData.zThe account balancer   floatbalancezThe frozen balancefrozenN)r   r   r   r
   r"  r   r#  r   r   r   r   r   -  r  r   c                   @  r  )TripoBalanceResponser   r  r   r  r  .zThe balance datar   r  Nr  r   r   r   r   r$  1  r  r$  c                   @  sJ   e Zd ZU edddZded< edddZded< edd	dZded
< dS )TripoErrorResponse.zThe error coder   r  r  zThe error messager   messagez#The suggestion for fixing the error
suggestionN)r   r   r   r
   r  r   r&  r'  r   r   r   r   r%  5  s   
 r%  N)8
__future__r   enumr   typingr   r   r   r   r   pydanticr	   r
   r   r   r   r   r   r    r.   rC   rH   rM   rR   rW   r\   rm   rv   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%  r   r   r   r   <module>   sZ    

