@@ -1061,60 +1061,113 @@ const apiNodeCosts: Record<string, { displayPrice: string | PricingFunction }> =
1061
1061
// Tripo nodes - using actual node names from ComfyUI
1062
1062
TripoTextToModelNode : {
1063
1063
displayPrice : ( node : LGraphNode ) : string => {
1064
- const modelWidget = node . widgets ?. find (
1065
- ( w ) => w . name === 'model' || w . name === 'model_version'
1064
+ const quadWidget = node . widgets ?. find (
1065
+ ( w ) => w . name === 'quad'
1066
+ ) as IComboWidget
1067
+ const styleWidget = node . widgets ?. find (
1068
+ ( w ) => w . name === 'style'
1069
+ ) as IComboWidget
1070
+ const textureWidget = node . widgets ?. find (
1071
+ ( w ) => w . name === 'texture'
1066
1072
) as IComboWidget
1067
1073
const textureQualityWidget = node . widgets ?. find (
1068
1074
( w ) => w . name === 'texture_quality'
1069
1075
) as IComboWidget
1070
1076
1071
- if ( ! modelWidget )
1072
- return '$0.2-0.3/Run (varies with model & texture quality)'
1073
-
1074
- const model = String ( modelWidget . value )
1075
- const textureQuality = String ( textureQualityWidget ?. value || 'standard' )
1076
-
1077
- // V2.5 pricing
1078
- if ( model . includes ( 'v2.5' ) || model . includes ( '2.5' ) ) {
1079
- return textureQuality . includes ( 'detailed' ) ? '$0.3/Run' : '$0.2/Run'
1080
- }
1081
- // V2.0 pricing
1082
- else if ( model . includes ( 'v2.0' ) || model . includes ( '2.0' ) ) {
1083
- return textureQuality . includes ( 'detailed' ) ? '$0.3/Run' : '$0.2/Run'
1084
- }
1085
- // V1.4 or legacy pricing
1086
- else {
1087
- return '$0.2/Run'
1077
+ if ( ! quadWidget || ! styleWidget || ! textureWidget )
1078
+ return '$0.1-0.4/Run (varies with quad, style, texture & quality)'
1079
+
1080
+ const quad = String ( quadWidget . value ) . toLowerCase ( ) === 'true'
1081
+ const style = String ( styleWidget . value ) . toLowerCase ( )
1082
+ const texture = String ( textureWidget . value ) . toLowerCase ( ) === 'true'
1083
+ const textureQuality = String (
1084
+ textureQualityWidget ?. value || 'standard'
1085
+ ) . toLowerCase ( )
1086
+
1087
+ // Pricing logic based on CSV data
1088
+ if ( style . includes ( 'none' ) ) {
1089
+ if ( ! quad ) {
1090
+ if ( ! texture ) return '$0.10/Run'
1091
+ else return '$0.15/Run'
1092
+ } else {
1093
+ if ( textureQuality . includes ( 'detailed' ) ) {
1094
+ if ( ! texture ) return '$0.30/Run'
1095
+ else return '$0.35/Run'
1096
+ } else {
1097
+ if ( ! texture ) return '$0.20/Run'
1098
+ else return '$0.25/Run'
1099
+ }
1100
+ }
1101
+ } else {
1102
+ // any style
1103
+ if ( ! quad ) {
1104
+ if ( ! texture ) return '$0.15/Run'
1105
+ else return '$0.20/Run'
1106
+ } else {
1107
+ if ( textureQuality . includes ( 'detailed' ) ) {
1108
+ if ( ! texture ) return '$0.35/Run'
1109
+ else return '$0.40/Run'
1110
+ } else {
1111
+ if ( ! texture ) return '$0.25/Run'
1112
+ else return '$0.30/Run'
1113
+ }
1114
+ }
1088
1115
}
1089
1116
}
1090
1117
} ,
1091
1118
TripoImageToModelNode : {
1092
1119
displayPrice : ( node : LGraphNode ) : string => {
1093
- const modelWidget = node . widgets ?. find (
1094
- ( w ) => w . name === 'model' || w . name === 'model_version'
1120
+ const quadWidget = node . widgets ?. find (
1121
+ ( w ) => w . name === 'quad'
1122
+ ) as IComboWidget
1123
+ const styleWidget = node . widgets ?. find (
1124
+ ( w ) => w . name === 'style'
1125
+ ) as IComboWidget
1126
+ const textureWidget = node . widgets ?. find (
1127
+ ( w ) => w . name === 'texture'
1095
1128
) as IComboWidget
1096
1129
const textureQualityWidget = node . widgets ?. find (
1097
1130
( w ) => w . name === 'texture_quality'
1098
1131
) as IComboWidget
1099
1132
1100
- if ( ! modelWidget )
1101
- return '$0.3-0.4/Run (varies with model & texture quality)'
1102
-
1103
- const model = String ( modelWidget . value )
1104
- const textureQuality = String ( textureQualityWidget ?. value || 'standard' )
1105
-
1106
- // V2.5 and V2.0 have same pricing structure
1107
- if (
1108
- model . includes ( 'v2.5' ) ||
1109
- model . includes ( '2.5' ) ||
1110
- model . includes ( 'v2.0' ) ||
1111
- model . includes ( '2.0' )
1112
- ) {
1113
- return textureQuality . includes ( 'detailed' ) ? '$0.4/Run' : '$0.3/Run'
1114
- }
1115
- // V1.4 or legacy pricing (image_to_model is always $0.3)
1116
- else {
1117
- return '$0.3/Run'
1133
+ if ( ! quadWidget || ! styleWidget || ! textureWidget )
1134
+ return '$0.2-0.5/Run (varies with quad, style, texture & quality)'
1135
+
1136
+ const quad = String ( quadWidget . value ) . toLowerCase ( ) === 'true'
1137
+ const style = String ( styleWidget . value ) . toLowerCase ( )
1138
+ const texture = String ( textureWidget . value ) . toLowerCase ( ) === 'true'
1139
+ const textureQuality = String (
1140
+ textureQualityWidget ?. value || 'standard'
1141
+ ) . toLowerCase ( )
1142
+
1143
+ // Pricing logic based on CSV data for Image to Model
1144
+ if ( style . includes ( 'none' ) ) {
1145
+ if ( ! quad ) {
1146
+ if ( ! texture ) return '$0.20/Run'
1147
+ else return '$0.25/Run'
1148
+ } else {
1149
+ if ( textureQuality . includes ( 'detailed' ) ) {
1150
+ if ( ! texture ) return '$0.40/Run'
1151
+ else return '$0.45/Run'
1152
+ } else {
1153
+ if ( ! texture ) return '$0.30/Run'
1154
+ else return '$0.35/Run'
1155
+ }
1156
+ }
1157
+ } else {
1158
+ // any style
1159
+ if ( ! quad ) {
1160
+ if ( ! texture ) return '$0.25/Run'
1161
+ else return '$0.30/Run'
1162
+ } else {
1163
+ if ( textureQuality . includes ( 'detailed' ) ) {
1164
+ if ( ! texture ) return '$0.45/Run'
1165
+ else return '$0.50/Run'
1166
+ } else {
1167
+ if ( ! texture ) return '$0.35/Run'
1168
+ else return '$0.40/Run'
1169
+ }
1170
+ }
1118
1171
}
1119
1172
}
1120
1173
} ,
0 commit comments