@scenario-labs/sdk 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (588) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/LICENSE +201 -0
  3. package/README.md +358 -0
  4. package/api-promise.d.mts +2 -0
  5. package/api-promise.d.mts.map +1 -0
  6. package/api-promise.d.ts +2 -0
  7. package/api-promise.d.ts.map +1 -0
  8. package/api-promise.js +6 -0
  9. package/api-promise.js.map +1 -0
  10. package/api-promise.mjs +2 -0
  11. package/api-promise.mjs.map +1 -0
  12. package/client.d.mts +208 -0
  13. package/client.d.mts.map +1 -0
  14. package/client.d.ts +208 -0
  15. package/client.d.ts.map +1 -0
  16. package/client.js +492 -0
  17. package/client.js.map +1 -0
  18. package/client.mjs +488 -0
  19. package/client.mjs.map +1 -0
  20. package/core/api-promise.d.mts +46 -0
  21. package/core/api-promise.d.mts.map +1 -0
  22. package/core/api-promise.d.ts +46 -0
  23. package/core/api-promise.d.ts.map +1 -0
  24. package/core/api-promise.js +74 -0
  25. package/core/api-promise.js.map +1 -0
  26. package/core/api-promise.mjs +70 -0
  27. package/core/api-promise.mjs.map +1 -0
  28. package/core/error.d.mts +46 -0
  29. package/core/error.d.mts.map +1 -0
  30. package/core/error.d.ts +46 -0
  31. package/core/error.d.ts.map +1 -0
  32. package/core/error.js +113 -0
  33. package/core/error.js.map +1 -0
  34. package/core/error.mjs +97 -0
  35. package/core/error.mjs.map +1 -0
  36. package/core/resource.d.mts +6 -0
  37. package/core/resource.d.mts.map +1 -0
  38. package/core/resource.d.ts +6 -0
  39. package/core/resource.d.ts.map +1 -0
  40. package/core/resource.js +11 -0
  41. package/core/resource.js.map +1 -0
  42. package/core/resource.mjs +7 -0
  43. package/core/resource.mjs.map +1 -0
  44. package/core/uploads.d.mts +3 -0
  45. package/core/uploads.d.mts.map +1 -0
  46. package/core/uploads.d.ts +3 -0
  47. package/core/uploads.d.ts.map +1 -0
  48. package/core/uploads.js +6 -0
  49. package/core/uploads.js.map +1 -0
  50. package/core/uploads.mjs +2 -0
  51. package/core/uploads.mjs.map +1 -0
  52. package/error.d.mts +2 -0
  53. package/error.d.mts.map +1 -0
  54. package/error.d.ts +2 -0
  55. package/error.d.ts.map +1 -0
  56. package/error.js +6 -0
  57. package/error.js.map +1 -0
  58. package/error.mjs +2 -0
  59. package/error.mjs.map +1 -0
  60. package/index.d.mts +6 -0
  61. package/index.d.mts.map +1 -0
  62. package/index.d.ts +6 -0
  63. package/index.d.ts.map +1 -0
  64. package/index.js +30 -0
  65. package/index.js.map +1 -0
  66. package/index.mjs +7 -0
  67. package/index.mjs.map +1 -0
  68. package/internal/builtin-types.d.mts +73 -0
  69. package/internal/builtin-types.d.mts.map +1 -0
  70. package/internal/builtin-types.d.ts +73 -0
  71. package/internal/builtin-types.d.ts.map +1 -0
  72. package/internal/builtin-types.js +4 -0
  73. package/internal/builtin-types.js.map +1 -0
  74. package/internal/builtin-types.mjs +3 -0
  75. package/internal/builtin-types.mjs.map +1 -0
  76. package/internal/detect-platform.d.mts +15 -0
  77. package/internal/detect-platform.d.mts.map +1 -0
  78. package/internal/detect-platform.d.ts +15 -0
  79. package/internal/detect-platform.d.ts.map +1 -0
  80. package/internal/detect-platform.js +162 -0
  81. package/internal/detect-platform.js.map +1 -0
  82. package/internal/detect-platform.mjs +157 -0
  83. package/internal/detect-platform.mjs.map +1 -0
  84. package/internal/errors.d.mts +3 -0
  85. package/internal/errors.d.mts.map +1 -0
  86. package/internal/errors.d.ts +3 -0
  87. package/internal/errors.d.ts.map +1 -0
  88. package/internal/errors.js +41 -0
  89. package/internal/errors.js.map +1 -0
  90. package/internal/errors.mjs +36 -0
  91. package/internal/errors.mjs.map +1 -0
  92. package/internal/headers.d.mts +20 -0
  93. package/internal/headers.d.mts.map +1 -0
  94. package/internal/headers.d.ts +20 -0
  95. package/internal/headers.d.ts.map +1 -0
  96. package/internal/headers.js +79 -0
  97. package/internal/headers.js.map +1 -0
  98. package/internal/headers.mjs +74 -0
  99. package/internal/headers.mjs.map +1 -0
  100. package/internal/parse.d.mts +12 -0
  101. package/internal/parse.d.mts.map +1 -0
  102. package/internal/parse.d.ts +12 -0
  103. package/internal/parse.d.ts.map +1 -0
  104. package/internal/parse.js +40 -0
  105. package/internal/parse.js.map +1 -0
  106. package/internal/parse.mjs +37 -0
  107. package/internal/parse.mjs.map +1 -0
  108. package/internal/qs/formats.d.mts +7 -0
  109. package/internal/qs/formats.d.mts.map +1 -0
  110. package/internal/qs/formats.d.ts +7 -0
  111. package/internal/qs/formats.d.ts.map +1 -0
  112. package/internal/qs/formats.js +13 -0
  113. package/internal/qs/formats.js.map +1 -0
  114. package/internal/qs/formats.mjs +9 -0
  115. package/internal/qs/formats.mjs.map +1 -0
  116. package/internal/qs/index.d.mts +10 -0
  117. package/internal/qs/index.d.mts.map +1 -0
  118. package/internal/qs/index.d.ts +10 -0
  119. package/internal/qs/index.d.ts.map +1 -0
  120. package/internal/qs/index.js +14 -0
  121. package/internal/qs/index.js.map +1 -0
  122. package/internal/qs/index.mjs +10 -0
  123. package/internal/qs/index.mjs.map +1 -0
  124. package/internal/qs/stringify.d.mts +3 -0
  125. package/internal/qs/stringify.d.mts.map +1 -0
  126. package/internal/qs/stringify.d.ts +3 -0
  127. package/internal/qs/stringify.d.ts.map +1 -0
  128. package/internal/qs/stringify.js +277 -0
  129. package/internal/qs/stringify.js.map +1 -0
  130. package/internal/qs/stringify.mjs +274 -0
  131. package/internal/qs/stringify.mjs.map +1 -0
  132. package/internal/qs/types.d.mts +57 -0
  133. package/internal/qs/types.d.mts.map +1 -0
  134. package/internal/qs/types.d.ts +57 -0
  135. package/internal/qs/types.d.ts.map +1 -0
  136. package/internal/qs/types.js +3 -0
  137. package/internal/qs/types.js.map +1 -0
  138. package/internal/qs/types.mjs +2 -0
  139. package/internal/qs/types.mjs.map +1 -0
  140. package/internal/qs/utils.d.mts +15 -0
  141. package/internal/qs/utils.d.mts.map +1 -0
  142. package/internal/qs/utils.d.ts +15 -0
  143. package/internal/qs/utils.d.ts.map +1 -0
  144. package/internal/qs/utils.js +230 -0
  145. package/internal/qs/utils.js.map +1 -0
  146. package/internal/qs/utils.mjs +217 -0
  147. package/internal/qs/utils.mjs.map +1 -0
  148. package/internal/request-options.d.mts +75 -0
  149. package/internal/request-options.d.mts.map +1 -0
  150. package/internal/request-options.d.ts +75 -0
  151. package/internal/request-options.d.ts.map +1 -0
  152. package/internal/request-options.js +14 -0
  153. package/internal/request-options.js.map +1 -0
  154. package/internal/request-options.mjs +10 -0
  155. package/internal/request-options.mjs.map +1 -0
  156. package/internal/shim-types.d.mts +17 -0
  157. package/internal/shim-types.d.mts.map +1 -0
  158. package/internal/shim-types.d.ts +17 -0
  159. package/internal/shim-types.d.ts.map +1 -0
  160. package/internal/shim-types.js +4 -0
  161. package/internal/shim-types.js.map +1 -0
  162. package/internal/shim-types.mjs +3 -0
  163. package/internal/shim-types.mjs.map +1 -0
  164. package/internal/shims.d.mts +20 -0
  165. package/internal/shims.d.mts.map +1 -0
  166. package/internal/shims.d.ts +20 -0
  167. package/internal/shims.d.ts.map +1 -0
  168. package/internal/shims.js +92 -0
  169. package/internal/shims.js.map +1 -0
  170. package/internal/shims.mjs +85 -0
  171. package/internal/shims.mjs.map +1 -0
  172. package/internal/to-file.d.mts +45 -0
  173. package/internal/to-file.d.mts.map +1 -0
  174. package/internal/to-file.d.ts +45 -0
  175. package/internal/to-file.d.ts.map +1 -0
  176. package/internal/to-file.js +91 -0
  177. package/internal/to-file.js.map +1 -0
  178. package/internal/to-file.mjs +88 -0
  179. package/internal/to-file.mjs.map +1 -0
  180. package/internal/tslib.js +81 -0
  181. package/internal/tslib.mjs +17 -0
  182. package/internal/types.d.mts +69 -0
  183. package/internal/types.d.mts.map +1 -0
  184. package/internal/types.d.ts +69 -0
  185. package/internal/types.d.ts.map +1 -0
  186. package/internal/types.js +4 -0
  187. package/internal/types.js.map +1 -0
  188. package/internal/types.mjs +3 -0
  189. package/internal/types.mjs.map +1 -0
  190. package/internal/uploads.d.mts +42 -0
  191. package/internal/uploads.d.mts.map +1 -0
  192. package/internal/uploads.d.ts +42 -0
  193. package/internal/uploads.d.ts.map +1 -0
  194. package/internal/uploads.js +141 -0
  195. package/internal/uploads.js.map +1 -0
  196. package/internal/uploads.mjs +131 -0
  197. package/internal/uploads.mjs.map +1 -0
  198. package/internal/utils/base64.d.mts +3 -0
  199. package/internal/utils/base64.d.mts.map +1 -0
  200. package/internal/utils/base64.d.ts +3 -0
  201. package/internal/utils/base64.d.ts.map +1 -0
  202. package/internal/utils/base64.js +38 -0
  203. package/internal/utils/base64.js.map +1 -0
  204. package/internal/utils/base64.mjs +33 -0
  205. package/internal/utils/base64.mjs.map +1 -0
  206. package/internal/utils/bytes.d.mts +4 -0
  207. package/internal/utils/bytes.d.mts.map +1 -0
  208. package/internal/utils/bytes.d.ts +4 -0
  209. package/internal/utils/bytes.d.ts.map +1 -0
  210. package/internal/utils/bytes.js +31 -0
  211. package/internal/utils/bytes.js.map +1 -0
  212. package/internal/utils/bytes.mjs +26 -0
  213. package/internal/utils/bytes.mjs.map +1 -0
  214. package/internal/utils/env.d.mts +9 -0
  215. package/internal/utils/env.d.mts.map +1 -0
  216. package/internal/utils/env.d.ts +9 -0
  217. package/internal/utils/env.d.ts.map +1 -0
  218. package/internal/utils/env.js +22 -0
  219. package/internal/utils/env.js.map +1 -0
  220. package/internal/utils/env.mjs +18 -0
  221. package/internal/utils/env.mjs.map +1 -0
  222. package/internal/utils/log.d.mts +37 -0
  223. package/internal/utils/log.d.mts.map +1 -0
  224. package/internal/utils/log.d.ts +37 -0
  225. package/internal/utils/log.d.ts.map +1 -0
  226. package/internal/utils/log.js +85 -0
  227. package/internal/utils/log.js.map +1 -0
  228. package/internal/utils/log.mjs +79 -0
  229. package/internal/utils/log.mjs.map +1 -0
  230. package/internal/utils/path.d.mts +15 -0
  231. package/internal/utils/path.d.mts.map +1 -0
  232. package/internal/utils/path.d.ts +15 -0
  233. package/internal/utils/path.d.ts.map +1 -0
  234. package/internal/utils/path.js +79 -0
  235. package/internal/utils/path.js.map +1 -0
  236. package/internal/utils/path.mjs +74 -0
  237. package/internal/utils/path.mjs.map +1 -0
  238. package/internal/utils/query.d.mts +2 -0
  239. package/internal/utils/query.d.mts.map +1 -0
  240. package/internal/utils/query.d.ts +2 -0
  241. package/internal/utils/query.d.ts.map +1 -0
  242. package/internal/utils/query.js +10 -0
  243. package/internal/utils/query.js.map +1 -0
  244. package/internal/utils/query.mjs +6 -0
  245. package/internal/utils/query.mjs.map +1 -0
  246. package/internal/utils/sleep.d.mts +2 -0
  247. package/internal/utils/sleep.d.mts.map +1 -0
  248. package/internal/utils/sleep.d.ts +2 -0
  249. package/internal/utils/sleep.d.ts.map +1 -0
  250. package/internal/utils/sleep.js +7 -0
  251. package/internal/utils/sleep.js.map +1 -0
  252. package/internal/utils/sleep.mjs +3 -0
  253. package/internal/utils/sleep.mjs.map +1 -0
  254. package/internal/utils/uuid.d.mts +5 -0
  255. package/internal/utils/uuid.d.mts.map +1 -0
  256. package/internal/utils/uuid.d.ts +5 -0
  257. package/internal/utils/uuid.d.ts.map +1 -0
  258. package/internal/utils/uuid.js +19 -0
  259. package/internal/utils/uuid.js.map +1 -0
  260. package/internal/utils/uuid.mjs +15 -0
  261. package/internal/utils/uuid.mjs.map +1 -0
  262. package/internal/utils/values.d.mts +18 -0
  263. package/internal/utils/values.d.mts.map +1 -0
  264. package/internal/utils/values.d.ts +18 -0
  265. package/internal/utils/values.d.ts.map +1 -0
  266. package/internal/utils/values.js +112 -0
  267. package/internal/utils/values.js.map +1 -0
  268. package/internal/utils/values.mjs +94 -0
  269. package/internal/utils/values.mjs.map +1 -0
  270. package/internal/utils.d.mts +8 -0
  271. package/internal/utils.d.mts.map +1 -0
  272. package/internal/utils.d.ts +8 -0
  273. package/internal/utils.d.ts.map +1 -0
  274. package/internal/utils.js +12 -0
  275. package/internal/utils.js.map +1 -0
  276. package/internal/utils.mjs +9 -0
  277. package/internal/utils.mjs.map +1 -0
  278. package/package.json +143 -0
  279. package/resource.d.mts +2 -0
  280. package/resource.d.mts.map +1 -0
  281. package/resource.d.ts +2 -0
  282. package/resource.d.ts.map +1 -0
  283. package/resource.js +6 -0
  284. package/resource.js.map +1 -0
  285. package/resource.mjs +2 -0
  286. package/resource.mjs.map +1 -0
  287. package/resources/assets/assets.d.mts +6397 -0
  288. package/resources/assets/assets.d.mts.map +1 -0
  289. package/resources/assets/assets.d.ts +6397 -0
  290. package/resources/assets/assets.d.ts.map +1 -0
  291. package/resources/assets/assets.js +98 -0
  292. package/resources/assets/assets.js.map +1 -0
  293. package/resources/assets/assets.mjs +93 -0
  294. package/resources/assets/assets.mjs.map +1 -0
  295. package/resources/assets/download.d.mts +87 -0
  296. package/resources/assets/download.d.mts.map +1 -0
  297. package/resources/assets/download.d.ts +87 -0
  298. package/resources/assets/download.d.ts.map +1 -0
  299. package/resources/assets/download.js +28 -0
  300. package/resources/assets/download.js.map +1 -0
  301. package/resources/assets/download.mjs +24 -0
  302. package/resources/assets/download.mjs.map +1 -0
  303. package/resources/assets/index.d.mts +4 -0
  304. package/resources/assets/index.d.mts.map +1 -0
  305. package/resources/assets/index.d.ts +4 -0
  306. package/resources/assets/index.d.ts.map +1 -0
  307. package/resources/assets/index.js +11 -0
  308. package/resources/assets/index.js.map +1 -0
  309. package/resources/assets/index.mjs +5 -0
  310. package/resources/assets/index.mjs.map +1 -0
  311. package/resources/assets/public.d.mts +1535 -0
  312. package/resources/assets/public.d.mts.map +1 -0
  313. package/resources/assets/public.d.ts +1535 -0
  314. package/resources/assets/public.d.ts.map +1 -0
  315. package/resources/assets/public.js +28 -0
  316. package/resources/assets/public.js.map +1 -0
  317. package/resources/assets/public.mjs +24 -0
  318. package/resources/assets/public.mjs.map +1 -0
  319. package/resources/assets.d.mts +2 -0
  320. package/resources/assets.d.mts.map +1 -0
  321. package/resources/assets.d.ts +2 -0
  322. package/resources/assets.d.ts.map +1 -0
  323. package/resources/assets.js +6 -0
  324. package/resources/assets.js.map +1 -0
  325. package/resources/assets.mjs +3 -0
  326. package/resources/assets.mjs.map +1 -0
  327. package/resources/collections/assets.d.mts +119 -0
  328. package/resources/collections/assets.d.mts.map +1 -0
  329. package/resources/collections/assets.d.ts +119 -0
  330. package/resources/collections/assets.d.ts.map +1 -0
  331. package/resources/collections/assets.js +22 -0
  332. package/resources/collections/assets.js.map +1 -0
  333. package/resources/collections/assets.mjs +18 -0
  334. package/resources/collections/assets.mjs.map +1 -0
  335. package/resources/collections/collections.d.mts +250 -0
  336. package/resources/collections/collections.d.mts.map +1 -0
  337. package/resources/collections/collections.d.ts +250 -0
  338. package/resources/collections/collections.d.ts.map +1 -0
  339. package/resources/collections/collections.js +52 -0
  340. package/resources/collections/collections.js.map +1 -0
  341. package/resources/collections/collections.mjs +47 -0
  342. package/resources/collections/collections.mjs.map +1 -0
  343. package/resources/collections/index.d.mts +4 -0
  344. package/resources/collections/index.d.mts.map +1 -0
  345. package/resources/collections/index.d.ts +4 -0
  346. package/resources/collections/index.d.ts.map +1 -0
  347. package/resources/collections/index.js +11 -0
  348. package/resources/collections/index.js.map +1 -0
  349. package/resources/collections/index.mjs +5 -0
  350. package/resources/collections/index.mjs.map +1 -0
  351. package/resources/collections/models.d.mts +119 -0
  352. package/resources/collections/models.d.mts.map +1 -0
  353. package/resources/collections/models.d.ts +119 -0
  354. package/resources/collections/models.d.ts.map +1 -0
  355. package/resources/collections/models.js +22 -0
  356. package/resources/collections/models.js.map +1 -0
  357. package/resources/collections/models.mjs +18 -0
  358. package/resources/collections/models.mjs.map +1 -0
  359. package/resources/collections.d.mts +2 -0
  360. package/resources/collections.d.mts.map +1 -0
  361. package/resources/collections.d.ts +2 -0
  362. package/resources/collections.d.ts.map +1 -0
  363. package/resources/collections.js +6 -0
  364. package/resources/collections.js.map +1 -0
  365. package/resources/collections.mjs +3 -0
  366. package/resources/collections.mjs.map +1 -0
  367. package/resources/generate.d.mts +3804 -0
  368. package/resources/generate.d.mts.map +1 -0
  369. package/resources/generate.d.ts +3804 -0
  370. package/resources/generate.d.ts.map +1 -0
  371. package/resources/generate.js +70 -0
  372. package/resources/generate.js.map +1 -0
  373. package/resources/generate.mjs +66 -0
  374. package/resources/generate.mjs.map +1 -0
  375. package/resources/index.d.mts +12 -0
  376. package/resources/index.d.mts.map +1 -0
  377. package/resources/index.d.ts +12 -0
  378. package/resources/index.d.ts.map +1 -0
  379. package/resources/index.js +27 -0
  380. package/resources/index.js.map +1 -0
  381. package/resources/index.mjs +13 -0
  382. package/resources/index.mjs.map +1 -0
  383. package/resources/jobs.d.mts +1191 -0
  384. package/resources/jobs.d.mts.map +1 -0
  385. package/resources/jobs.d.ts +1191 -0
  386. package/resources/jobs.d.ts.map +1 -0
  387. package/resources/jobs.js +31 -0
  388. package/resources/jobs.js.map +1 -0
  389. package/resources/jobs.mjs +27 -0
  390. package/resources/jobs.mjs.map +1 -0
  391. package/resources/models/description.d.mts +490 -0
  392. package/resources/models/description.d.mts.map +1 -0
  393. package/resources/models/description.d.ts +490 -0
  394. package/resources/models/description.d.ts.map +1 -0
  395. package/resources/models/description.js +27 -0
  396. package/resources/models/description.js.map +1 -0
  397. package/resources/models/description.mjs +23 -0
  398. package/resources/models/description.mjs.map +1 -0
  399. package/resources/models/examples.d.mts +2819 -0
  400. package/resources/models/examples.d.mts.map +1 -0
  401. package/resources/models/examples.d.ts +2819 -0
  402. package/resources/models/examples.d.ts.map +1 -0
  403. package/resources/models/examples.js +27 -0
  404. package/resources/models/examples.js.map +1 -0
  405. package/resources/models/examples.mjs +23 -0
  406. package/resources/models/examples.mjs.map +1 -0
  407. package/resources/models/index.d.mts +6 -0
  408. package/resources/models/index.d.mts.map +1 -0
  409. package/resources/models/index.d.ts +6 -0
  410. package/resources/models/index.d.ts.map +1 -0
  411. package/resources/models/index.js +15 -0
  412. package/resources/models/index.js.map +1 -0
  413. package/resources/models/index.mjs +7 -0
  414. package/resources/models/index.mjs.map +1 -0
  415. package/resources/models/models.d.mts +6676 -0
  416. package/resources/models/models.d.mts.map +1 -0
  417. package/resources/models/models.d.ts +6676 -0
  418. package/resources/models/models.d.ts.map +1 -0
  419. package/resources/models/models.js +107 -0
  420. package/resources/models/models.js.map +1 -0
  421. package/resources/models/models.mjs +102 -0
  422. package/resources/models/models.mjs.map +1 -0
  423. package/resources/models/train.d.mts +2334 -0
  424. package/resources/models/train.d.mts.map +1 -0
  425. package/resources/models/train.d.ts +2334 -0
  426. package/resources/models/train.d.ts.map +1 -0
  427. package/resources/models/train.js +27 -0
  428. package/resources/models/train.js.map +1 -0
  429. package/resources/models/train.mjs +23 -0
  430. package/resources/models/train.mjs.map +1 -0
  431. package/resources/models/training-images.d.mts +214 -0
  432. package/resources/models/training-images.d.mts.map +1 -0
  433. package/resources/models/training-images.d.ts +214 -0
  434. package/resources/models/training-images.d.ts.map +1 -0
  435. package/resources/models/training-images.js +46 -0
  436. package/resources/models/training-images.js.map +1 -0
  437. package/resources/models/training-images.mjs +42 -0
  438. package/resources/models/training-images.mjs.map +1 -0
  439. package/resources/models.d.mts +2 -0
  440. package/resources/models.d.mts.map +1 -0
  441. package/resources/models.d.ts +2 -0
  442. package/resources/models.d.ts.map +1 -0
  443. package/resources/models.js +6 -0
  444. package/resources/models.js.map +1 -0
  445. package/resources/models.mjs +3 -0
  446. package/resources/models.mjs.map +1 -0
  447. package/resources/oscu.d.mts +25 -0
  448. package/resources/oscu.d.mts.map +1 -0
  449. package/resources/oscu.d.ts +25 -0
  450. package/resources/oscu.d.ts.map +1 -0
  451. package/resources/oscu.js +16 -0
  452. package/resources/oscu.js.map +1 -0
  453. package/resources/oscu.mjs +12 -0
  454. package/resources/oscu.mjs.map +1 -0
  455. package/resources/search.d.mts +595 -0
  456. package/resources/search.d.mts.map +1 -0
  457. package/resources/search.d.ts +595 -0
  458. package/resources/search.d.ts.map +1 -0
  459. package/resources/search.js +29 -0
  460. package/resources/search.js.map +1 -0
  461. package/resources/search.mjs +25 -0
  462. package/resources/search.mjs.map +1 -0
  463. package/resources/tags.d.mts +55 -0
  464. package/resources/tags.d.mts.map +1 -0
  465. package/resources/tags.d.ts +55 -0
  466. package/resources/tags.d.ts.map +1 -0
  467. package/resources/tags.js +15 -0
  468. package/resources/tags.js.map +1 -0
  469. package/resources/tags.mjs +11 -0
  470. package/resources/tags.mjs.map +1 -0
  471. package/resources/uploads.d.mts +250 -0
  472. package/resources/uploads.d.mts.map +1 -0
  473. package/resources/uploads.d.ts +250 -0
  474. package/resources/uploads.d.ts.map +1 -0
  475. package/resources/uploads.js +29 -0
  476. package/resources/uploads.js.map +1 -0
  477. package/resources/uploads.mjs +25 -0
  478. package/resources/uploads.mjs.map +1 -0
  479. package/resources/usages.d.mts +760 -0
  480. package/resources/usages.d.mts.map +1 -0
  481. package/resources/usages.d.ts +760 -0
  482. package/resources/usages.d.ts.map +1 -0
  483. package/resources/usages.js +17 -0
  484. package/resources/usages.js.map +1 -0
  485. package/resources/usages.mjs +13 -0
  486. package/resources/usages.mjs.map +1 -0
  487. package/resources/workflows.d.mts +4539 -0
  488. package/resources/workflows.d.mts.map +1 -0
  489. package/resources/workflows.d.ts +4539 -0
  490. package/resources/workflows.d.ts.map +1 -0
  491. package/resources/workflows.js +64 -0
  492. package/resources/workflows.js.map +1 -0
  493. package/resources/workflows.mjs +60 -0
  494. package/resources/workflows.mjs.map +1 -0
  495. package/resources.d.mts +2 -0
  496. package/resources.d.mts.map +1 -0
  497. package/resources.d.ts +2 -0
  498. package/resources.d.ts.map +1 -0
  499. package/resources.js +5 -0
  500. package/resources.js.map +1 -0
  501. package/resources.mjs +2 -0
  502. package/resources.mjs.map +1 -0
  503. package/src/api-promise.ts +2 -0
  504. package/src/client.ts +999 -0
  505. package/src/core/README.md +3 -0
  506. package/src/core/api-promise.ts +92 -0
  507. package/src/core/error.ts +130 -0
  508. package/src/core/resource.ts +11 -0
  509. package/src/core/uploads.ts +2 -0
  510. package/src/error.ts +2 -0
  511. package/src/index.ts +22 -0
  512. package/src/internal/README.md +3 -0
  513. package/src/internal/builtin-types.ts +93 -0
  514. package/src/internal/detect-platform.ts +196 -0
  515. package/src/internal/errors.ts +33 -0
  516. package/src/internal/headers.ts +97 -0
  517. package/src/internal/parse.ts +56 -0
  518. package/src/internal/qs/LICENSE.md +13 -0
  519. package/src/internal/qs/README.md +3 -0
  520. package/src/internal/qs/formats.ts +10 -0
  521. package/src/internal/qs/index.ts +13 -0
  522. package/src/internal/qs/stringify.ts +385 -0
  523. package/src/internal/qs/types.ts +71 -0
  524. package/src/internal/qs/utils.ts +265 -0
  525. package/src/internal/request-options.ts +91 -0
  526. package/src/internal/shim-types.ts +26 -0
  527. package/src/internal/shims.ts +107 -0
  528. package/src/internal/to-file.ts +154 -0
  529. package/src/internal/types.ts +95 -0
  530. package/src/internal/uploads.ts +187 -0
  531. package/src/internal/utils/base64.ts +40 -0
  532. package/src/internal/utils/bytes.ts +32 -0
  533. package/src/internal/utils/env.ts +18 -0
  534. package/src/internal/utils/log.ts +126 -0
  535. package/src/internal/utils/path.ts +88 -0
  536. package/src/internal/utils/query.ts +7 -0
  537. package/src/internal/utils/sleep.ts +3 -0
  538. package/src/internal/utils/uuid.ts +17 -0
  539. package/src/internal/utils/values.ts +105 -0
  540. package/src/internal/utils.ts +9 -0
  541. package/src/lib/.keep +4 -0
  542. package/src/resource.ts +2 -0
  543. package/src/resources/assets/assets.ts +9939 -0
  544. package/src/resources/assets/download.ts +138 -0
  545. package/src/resources/assets/index.ts +41 -0
  546. package/src/resources/assets/public.ts +2329 -0
  547. package/src/resources/assets.ts +3 -0
  548. package/src/resources/collections/assets.ts +163 -0
  549. package/src/resources/collections/collections.ts +357 -0
  550. package/src/resources/collections/index.ts +27 -0
  551. package/src/resources/collections/models.ts +163 -0
  552. package/src/resources/collections.ts +3 -0
  553. package/src/resources/generate.ts +5478 -0
  554. package/src/resources/index.ts +122 -0
  555. package/src/resources/jobs.ts +1712 -0
  556. package/src/resources/models/description.ts +800 -0
  557. package/src/resources/models/examples.ts +4125 -0
  558. package/src/resources/models/index.ts +58 -0
  559. package/src/resources/models/models.ts +8619 -0
  560. package/src/resources/models/train.ts +3034 -0
  561. package/src/resources/models/training-images.ts +304 -0
  562. package/src/resources/models.ts +3 -0
  563. package/src/resources/oscu.ts +35 -0
  564. package/src/resources/search.ts +731 -0
  565. package/src/resources/tags.ts +69 -0
  566. package/src/resources/uploads.ts +369 -0
  567. package/src/resources/usages.ts +1242 -0
  568. package/src/resources/workflows.ts +6019 -0
  569. package/src/resources.ts +1 -0
  570. package/src/tsconfig.json +11 -0
  571. package/src/uploads.ts +2 -0
  572. package/src/version.ts +1 -0
  573. package/uploads.d.mts +2 -0
  574. package/uploads.d.mts.map +1 -0
  575. package/uploads.d.ts +2 -0
  576. package/uploads.d.ts.map +1 -0
  577. package/uploads.js +6 -0
  578. package/uploads.js.map +1 -0
  579. package/uploads.mjs +2 -0
  580. package/uploads.mjs.map +1 -0
  581. package/version.d.mts +2 -0
  582. package/version.d.mts.map +1 -0
  583. package/version.d.ts +2 -0
  584. package/version.d.ts.map +1 -0
  585. package/version.js +5 -0
  586. package/version.js.map +1 -0
  587. package/version.mjs +2 -0
  588. package/version.mjs.map +1 -0
@@ -0,0 +1,3804 @@
1
+ import { APIResource } from "../core/resource.mjs";
2
+ import { APIPromise } from "../core/api-promise.mjs";
3
+ import { RequestOptions } from "../internal/request-options.mjs";
4
+ export declare class Generate extends APIResource {
5
+ /**
6
+ * Caption image(s)
7
+ */
8
+ caption(params: GenerateCaptionParams, options?: RequestOptions): APIPromise<GenerateCaptionResponse>;
9
+ /**
10
+ * Describe the style of the given images or models.
11
+ */
12
+ describeStyle(params: GenerateDescribeStyleParams, options?: RequestOptions): APIPromise<GenerateDescribeStyleResponse>;
13
+ /**
14
+ * Advanced precision in image generation by transforming visual data from input
15
+ * images into mode maps.
16
+ */
17
+ detect(params: GenerateDetectParams, options?: RequestOptions): APIPromise<JobAndAssetAndBilling>;
18
+ /**
19
+ * Get embeddings from text
20
+ */
21
+ embed(params: GenerateEmbedParams, options?: RequestOptions): APIPromise<GenerateEmbedResponse>;
22
+ /**
23
+ * Patch an asset with an image.
24
+ */
25
+ patch(params: GeneratePatchParams, options?: RequestOptions): APIPromise<JobAndAssetAndBilling>;
26
+ /**
27
+ * Generate with any model (Image, Video, Audio, 3d).
28
+ *
29
+ * You can retrieve the model inputs from the `GET /models/{modelId}` endpoint.
30
+ *
31
+ * **Note**: This endpoint is not available yet for SD1.5, SDXL and Flux.1 based
32
+ * models. For these models, use the `POST /generate/{inferenceType}` endpoint. Ex:
33
+ * `POST /generate/txt2img`
34
+ */
35
+ runModel(modelID: string, params: GenerateRunModelParams, options?: RequestOptions): APIPromise<GenerateRunModelResponse>;
36
+ /**
37
+ * Translate text from one language to english.
38
+ */
39
+ translate(params: GenerateTranslateParams, options?: RequestOptions): APIPromise<GenerateTranslateResponse>;
40
+ }
41
+ export interface JobAndAssetAndBilling {
42
+ asset: JobAndAssetAndBilling.Asset;
43
+ job: JobAndAssetAndBilling.Job;
44
+ /**
45
+ * The Creative Units cost for the request billed
46
+ */
47
+ creativeUnitsCost?: number;
48
+ /**
49
+ * The Creative Units discount for the request billed
50
+ */
51
+ creativeUnitsDiscount?: number;
52
+ }
53
+ export declare namespace JobAndAssetAndBilling {
54
+ interface Asset {
55
+ /**
56
+ * The asset ID (example: "asset_GTrL3mq4SXWyMxkOHRxlpw")
57
+ */
58
+ id: string;
59
+ /**
60
+ * The author user ID (example: "dcf121faaa1a0a0bbbd9ca1b73d62aea")
61
+ */
62
+ authorId: string;
63
+ /**
64
+ * A list of CollectionId this asset belongs to
65
+ */
66
+ collectionIds: Array<string>;
67
+ /**
68
+ * The asset creation date as an ISO string (example: "2023-02-03T11:19:41.579Z")
69
+ */
70
+ createdAt: string;
71
+ /**
72
+ * List of edit capabilities
73
+ */
74
+ editCapabilities: Array<'DETECTION' | 'GENERATIVE_FILL' | 'PIXELATE' | 'PROMPT_EDITING' | 'REFINE' | 'REFRAME' | 'REMOVE_BACKGROUND' | 'SEGMENTATION' | 'UPSCALE' | 'UPSCALE_360' | 'VECTORIZATION'>;
75
+ /**
76
+ * The kind of asset
77
+ */
78
+ kind: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'video';
79
+ /**
80
+ * Metadata of the asset with some additional information
81
+ */
82
+ metadata: Asset.Metadata;
83
+ /**
84
+ * The mime type of the asset (example: "image/png")
85
+ */
86
+ mimeType: string;
87
+ /**
88
+ * The owner (project) ID (example: "proj_23tlk332lkht3kl2" or
89
+ * "team_dlkhgs23tlk3hlkth32lkht3kl2" for old teams)
90
+ */
91
+ ownerId: string;
92
+ /**
93
+ * The privacy of the asset
94
+ */
95
+ privacy: 'private' | 'public' | 'unlisted';
96
+ /**
97
+ * The properties of the asset, content may depend on the kind of asset returned
98
+ */
99
+ properties: Asset.Properties;
100
+ /**
101
+ * source of the asset
102
+ */
103
+ source: '3d23d' | '3d23d:texture' | '3d:texture' | '3d:texture:albedo' | '3d:texture:metallic' | '3d:texture:mtl' | '3d:texture:normal' | '3d:texture:roughness' | 'audio2audio' | 'background-removal' | 'canvas' | 'canvas-drawing' | 'canvas-export' | 'detection' | 'generative-fill' | 'image-prompt-editing' | 'img23d' | 'img2img' | 'img2video' | 'inference-control-net' | 'inference-control-net-img' | 'inference-control-net-inpainting' | 'inference-control-net-inpainting-ip-adapter' | 'inference-control-net-ip-adapter' | 'inference-control-net-reference' | 'inference-control-net-texture' | 'inference-img' | 'inference-img-ip-adapter' | 'inference-img-texture' | 'inference-in-paint' | 'inference-in-paint-ip-adapter' | 'inference-reference' | 'inference-reference-texture' | 'inference-txt' | 'inference-txt-ip-adapter' | 'inference-txt-texture' | 'patch' | 'pixelization' | 'reframe' | 'restyle' | 'segment' | 'segmentation-image' | 'segmentation-mask' | 'skybox-3d' | 'skybox-base-360' | 'skybox-hdri' | 'texture' | 'texture:albedo' | 'texture:ao' | 'texture:edge' | 'texture:height' | 'texture:metallic' | 'texture:normal' | 'texture:smoothness' | 'txt23d' | 'txt2audio' | 'txt2img' | 'txt2video' | 'unknown' | 'uploaded' | 'uploaded-3d' | 'uploaded-audio' | 'uploaded-avatar' | 'uploaded-video' | 'upscale' | 'upscale-skybox' | 'upscale-texture' | 'upscale-video' | 'vectorization' | 'video2img' | 'video2video';
104
+ /**
105
+ * The actual status
106
+ */
107
+ status: 'error' | 'pending' | 'success';
108
+ /**
109
+ * The associated tags (example: ["sci-fi", "landscape"])
110
+ */
111
+ tags: Array<string>;
112
+ /**
113
+ * The asset last update date as an ISO string (example:
114
+ * "2023-02-03T11:19:41.579Z")
115
+ */
116
+ updatedAt: string;
117
+ /**
118
+ * Signed URL to get the asset content
119
+ */
120
+ url: string;
121
+ /**
122
+ * Automatic captioning of the asset
123
+ */
124
+ automaticCaptioning?: string;
125
+ /**
126
+ * The description, it will contain in priority:
127
+ *
128
+ * - the manual description
129
+ * - the advanced captioning when the asset is used in training flow
130
+ * - the automatic captioning
131
+ */
132
+ description?: string;
133
+ /**
134
+ * The embedding of the asset when requested.
135
+ *
136
+ * Only available when an asset can be embedded (ie: not Detection maps)
137
+ */
138
+ embedding?: Array<number>;
139
+ /**
140
+ * The video asset's first frame.
141
+ *
142
+ * Contains the assetId and the url of the first frame.
143
+ */
144
+ firstFrame?: Asset.FirstFrame;
145
+ /**
146
+ * Whether the asset is hidden.
147
+ */
148
+ isHidden?: boolean;
149
+ /**
150
+ * The video asset's last frame.
151
+ *
152
+ * Contains the assetId and the url of the last frame.
153
+ */
154
+ lastFrame?: Asset.LastFrame;
155
+ /**
156
+ * The NSFW labels
157
+ */
158
+ nsfw?: Array<string>;
159
+ /**
160
+ * The original file url.
161
+ *
162
+ * Contains the url of the original file. without any conversion. Only available
163
+ * for some specific video, audio and threeD assets. Is only specified if the given
164
+ * asset data has been replaced with a new file during the creation of the asset.
165
+ */
166
+ originalFileUrl?: string;
167
+ /**
168
+ * The output index of the asset within a job This index is an positive integer
169
+ * that starts at 0 It is used to differentiate between multiple outputs of the
170
+ * same job If the job has only one output, this index is 0
171
+ */
172
+ outputIndex?: number;
173
+ /**
174
+ * The asset's preview.
175
+ *
176
+ * Contains the assetId and the url of the preview.
177
+ */
178
+ preview?: Asset.Preview;
179
+ /**
180
+ * The asset's thumbnail.
181
+ *
182
+ * Contains the assetId and the url of the thumbnail.
183
+ */
184
+ thumbnail?: Asset.Thumbnail;
185
+ }
186
+ namespace Asset {
187
+ /**
188
+ * Metadata of the asset with some additional information
189
+ */
190
+ interface Metadata {
191
+ kind: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'video';
192
+ /**
193
+ * The type of the asset. Ex: 'inference-txt2img' will represent an asset generated
194
+ * from a text to image model
195
+ */
196
+ type: '3d-texture' | '3d-texture-albedo' | '3d-texture-metallic' | '3d-texture-mtl' | '3d-texture-normal' | '3d-texture-roughness' | '3d23d' | '3d23d-texture' | 'audio2audio' | 'background-removal' | 'canvas' | 'canvas-drawing' | 'canvas-export' | 'detection' | 'generative-fill' | 'image-prompt-editing' | 'img23d' | 'img2img' | 'img2video' | 'inference-controlnet' | 'inference-controlnet-img2img' | 'inference-controlnet-inpaint' | 'inference-controlnet-inpaint-ip-adapter' | 'inference-controlnet-ip-adapter' | 'inference-controlnet-reference' | 'inference-controlnet-texture' | 'inference-img2img' | 'inference-img2img-ip-adapter' | 'inference-img2img-texture' | 'inference-inpaint' | 'inference-inpaint-ip-adapter' | 'inference-reference' | 'inference-reference-texture' | 'inference-txt2img' | 'inference-txt2img-ip-adapter' | 'inference-txt2img-texture' | 'patch' | 'pixelization' | 'reframe' | 'restyle' | 'segment' | 'segmentation-image' | 'segmentation-mask' | 'skybox-3d' | 'skybox-base-360' | 'skybox-hdri' | 'texture' | 'texture-albedo' | 'texture-ao' | 'texture-edge' | 'texture-height' | 'texture-metallic' | 'texture-normal' | 'texture-smoothness' | 'txt23d' | 'txt2audio' | 'txt2img' | 'txt2video' | 'unknown' | 'uploaded' | 'uploaded-3d' | 'uploaded-audio' | 'uploaded-avatar' | 'uploaded-video' | 'upscale' | 'upscale-skybox' | 'upscale-texture' | 'upscale-video' | 'vectorization' | 'video2img' | 'video2video';
197
+ /**
198
+ * How angular is the surface? 0 is like a sphere, 1 is like a mechanical object
199
+ */
200
+ angular?: number;
201
+ /**
202
+ * The optional aspect ratio given for the generation, only applicable for some
203
+ * models
204
+ */
205
+ aspectRatio?: string;
206
+ /**
207
+ * Int to set between 0 and 255 for the opacity of the background in the result
208
+ * images.
209
+ */
210
+ backgroundOpacity?: number;
211
+ /**
212
+ * The baseModelId that maybe changed at inference time
213
+ */
214
+ baseModelId?: string;
215
+ /**
216
+ * A bounding box around the object of interest, in the format [x1, y1, x2, y2].
217
+ */
218
+ bbox?: Array<unknown>;
219
+ /**
220
+ * Remove small dark spots (i.e. “pepper”) and connect small bright cracks.
221
+ */
222
+ betterQuality?: boolean;
223
+ /**
224
+ * The control image already processed by canny detector. Must reference an
225
+ * existing AssetId.
226
+ */
227
+ cannyStructureImage?: string;
228
+ /**
229
+ * Activate clustering.
230
+ */
231
+ clustering?: boolean;
232
+ /**
233
+ * Ensure upscaled tile have the same color histogram as original tile.
234
+ */
235
+ colorCorrection?: boolean;
236
+ colorMode?: string;
237
+ colorPrecision?: number;
238
+ /**
239
+ * Flux Kontext LoRA to style the image. For Flux Kontext Prompt Editing.
240
+ */
241
+ concepts?: Array<Metadata.Concept>;
242
+ contours?: Array<Array<Array<Array<number>>>>;
243
+ /**
244
+ * End step for control.
245
+ */
246
+ controlEnd?: number;
247
+ /**
248
+ * The date when the asset was copied to a project
249
+ */
250
+ copiedAt?: string;
251
+ cornerThreshold?: number;
252
+ /**
253
+ * Allow the generation of "hallucinations" during the upscale process, which adds
254
+ * additional details and deviates from the original image. Default: optimized for
255
+ * your preset and style.
256
+ */
257
+ creativity?: number;
258
+ /**
259
+ * Amount of decay in creativity over the upscale process. The lowest the value,
260
+ * the less the creativity will be preserved over the upscale process.
261
+ */
262
+ creativityDecay?: number;
263
+ /**
264
+ * If true, use the default parameters
265
+ */
266
+ defaultParameters?: boolean;
267
+ /**
268
+ * The depth fidelity if a depth image provided
269
+ */
270
+ depthFidelity?: number;
271
+ /**
272
+ * The control image processed by depth estimator. Must reference an existing
273
+ * AssetId.
274
+ */
275
+ depthImage?: string;
276
+ /**
277
+ * Amount of details to remove or add
278
+ */
279
+ detailsLevel?: number;
280
+ /**
281
+ * The number of pixels to dilate the result masks.
282
+ */
283
+ dilate?: number;
284
+ /**
285
+ * Contrast factor for Grayscale detector
286
+ */
287
+ factor?: number;
288
+ filterSpeckle?: number;
289
+ /**
290
+ * Determine the scale at which the upscale process works.
291
+ *
292
+ * - With a small value, the upscale works at the largest scale, resulting in fewer
293
+ * added details and more coherent images. Ideal for portraits, for example.
294
+ * - With a large value, the upscale works at the smallest scale, resulting in more
295
+ * added details and more hallucinations. Ideal for landscapes, for example.
296
+ *
297
+ * (info): A small value is slower and more expensive to run.
298
+ */
299
+ fractality?: number;
300
+ /**
301
+ * Apply extra control to the Skybox 360 geometry. The higher the value, the more
302
+ * the 360 geometry will influence the generated skybox image.
303
+ *
304
+ * Use with caution. Default is adapted to the other parameters.
305
+ */
306
+ geometryEnforcement?: number;
307
+ /**
308
+ * The guidance used to generate this asset
309
+ */
310
+ guidance?: number;
311
+ halfMode?: boolean;
312
+ hdr?: number;
313
+ height?: number;
314
+ /**
315
+ * High threshold for Canny detector
316
+ */
317
+ highThreshold?: number;
318
+ /**
319
+ * (deprecated) Horizontal expansion ratio.
320
+ */
321
+ horizontalExpansionRatio?: number;
322
+ /**
323
+ * The input image to process. Must reference an existing AssetId or be a data URL.
324
+ */
325
+ image?: string;
326
+ /**
327
+ * Strengthen the similarity to the original image during the upscale. Default:
328
+ * optimized for your preset and style.
329
+ */
330
+ imageFidelity?: number;
331
+ /**
332
+ * Preserve the seamless properties of skybox or texture images. Input has to be of
333
+ * same type (seamless).
334
+ */
335
+ imageType?: 'seamfull' | 'skybox' | 'texture';
336
+ /**
337
+ * The id of the Inference describing how this image was generated
338
+ */
339
+ inferenceId?: string;
340
+ /**
341
+ * When set to `high`, allows to better preserve details from the input images in
342
+ * the output. This is especially useful when using images that contain elements
343
+ * like faces or logos that require accurate preservation in the generated image.
344
+ *
345
+ * You can provide multiple input images that will all be preserved with high
346
+ * fidelity, but keep in mind that the first image will be preserved with richer
347
+ * textures and finer details, so if you include elements such as faces, consider
348
+ * placing them in the first image.
349
+ *
350
+ * Only available for the `gpt-image-1` model.
351
+ */
352
+ inputFidelity?: 'high' | 'low';
353
+ /**
354
+ * Location of the input image in the output.
355
+ */
356
+ inputLocation?: 'bottom' | 'left' | 'middle' | 'right' | 'top';
357
+ /**
358
+ * To invert the relief
359
+ */
360
+ invert?: boolean;
361
+ /**
362
+ * How polished is the surface? 0 is like a rough surface, 1 is like a mirror
363
+ */
364
+ keypointThreshold?: number;
365
+ layerDifference?: number;
366
+ lengthThreshold?: number;
367
+ /**
368
+ * The ISO timestamp when the lock on the canvas will expire
369
+ */
370
+ lockExpiresAt?: string;
371
+ /**
372
+ * Low threshold for Canny detector
373
+ */
374
+ lowThreshold?: number;
375
+ /**
376
+ * The mask used for the asset generation or editing
377
+ */
378
+ mask?: string;
379
+ maxIterations?: number;
380
+ /**
381
+ * Maximum threshold for Grayscale conversion
382
+ */
383
+ maxThreshold?: number;
384
+ /**
385
+ * Minimum threshold for Grayscale conversion
386
+ */
387
+ minThreshold?: number;
388
+ /**
389
+ * Modality to detect
390
+ */
391
+ modality?: 'canny' | 'depth' | 'grayscale' | 'lineart_anime' | 'mlsd' | 'normal' | 'pose' | 'scribble' | 'segmentation' | 'sketch';
392
+ mode?: string;
393
+ /**
394
+ * The modelId used to generate this asset
395
+ */
396
+ modelId?: string;
397
+ /**
398
+ * The type of the generator used
399
+ */
400
+ modelType?: 'custom' | 'flux.1' | 'flux.1-composition' | 'flux.1-kontext-dev' | 'flux.1-kontext-lora' | 'flux.1-krea-dev' | 'flux.1-krea-lora' | 'flux.1-lora' | 'flux.1-pro' | 'flux.1.1-pro-ultra' | 'flux1.1-pro' | 'gpt-image-1' | 'sd-1_5' | 'sd-1_5-composition' | 'sd-1_5-lora' | 'sd-xl' | 'sd-xl-composition' | 'sd-xl-lora';
401
+ name?: string;
402
+ nbMasks?: number;
403
+ /**
404
+ * The negative prompt used to generate this asset
405
+ */
406
+ negativePrompt?: string;
407
+ /**
408
+ * Controls the influence of the negative prompt. Default 0 means the negative
409
+ * prompt has no effect. Higher values increase negative prompt influence. Must
410
+ * be > 0 if negativePrompt is provided.
411
+ */
412
+ negativePromptStrength?: number;
413
+ /**
414
+ * The number of denoising steps for each image generation.
415
+ */
416
+ numInferenceSteps?: number;
417
+ /**
418
+ * The number of outputs to generate.
419
+ */
420
+ numOutputs?: number;
421
+ originalAssetId?: string;
422
+ outputIndex?: number;
423
+ /**
424
+ * Overlap percentage for the output image.
425
+ */
426
+ overlapPercentage?: number;
427
+ /**
428
+ * Override the embeddings of the model. Only your prompt and negativePrompt will
429
+ * be used. Use with caution.
430
+ */
431
+ overrideEmbeddings?: boolean;
432
+ parentId?: string;
433
+ parentJobId?: string;
434
+ pathPrecision?: number;
435
+ /**
436
+ * List of points (label, x, y) in the image where label = 0 for background and 1
437
+ * for object.
438
+ */
439
+ points?: Array<Array<unknown>>;
440
+ /**
441
+ * How polished is the surface? 0 is like a rough surface, 1 is like a mirror
442
+ */
443
+ polished?: number;
444
+ preset?: string;
445
+ progressPercent?: number;
446
+ /**
447
+ * The prompt that guided the asset generation or editing
448
+ */
449
+ prompt?: string;
450
+ /**
451
+ * Increase the fidelity to the prompt during upscale. Default: optimized for your
452
+ * preset and style.
453
+ */
454
+ promptFidelity?: number;
455
+ /**
456
+ * How raised is the surface? 0 is flat like water, 1 is like a very rough rock
457
+ */
458
+ raised?: number;
459
+ /**
460
+ * The reference images used for the asset generation or editing
461
+ */
462
+ referenceImages?: Array<string>;
463
+ /**
464
+ * Additional refinement steps before scaling.
465
+ *
466
+ * If scalingFactor == 1, the refinement process will be applied (1 +
467
+ * refinementSteps) times. If scalingFactor > 1, the refinement process will be
468
+ * applied refinementSteps times.
469
+ */
470
+ refinementSteps?: number;
471
+ /**
472
+ * Remove background for Grayscale detector
473
+ */
474
+ removeBackground?: boolean;
475
+ /**
476
+ * Size proportion of the input image in the output.
477
+ */
478
+ resizeOption?: number;
479
+ /**
480
+ * Boolean to output the contours.
481
+ */
482
+ resultContours?: boolean;
483
+ /**
484
+ * Boolean to able output the cut out object.
485
+ */
486
+ resultImage?: boolean;
487
+ /**
488
+ * Boolean to able return the masks (binary image) in the response.
489
+ */
490
+ resultMask?: boolean;
491
+ rootParentId?: string;
492
+ /**
493
+ * Save a flipbook of the texture. Deactivated when the input texture is larger
494
+ * than 2048x2048px
495
+ */
496
+ saveFlipbook?: boolean;
497
+ /**
498
+ * Scaling factor (when `targetWidth` not specified)
499
+ */
500
+ scalingFactor?: number;
501
+ /**
502
+ * The scheduler used to generate this asset
503
+ */
504
+ scheduler?: string;
505
+ /**
506
+ * The seed used to generate this asset
507
+ */
508
+ seed?: string;
509
+ /**
510
+ * Sharpen tiles.
511
+ */
512
+ sharpen?: boolean;
513
+ /**
514
+ * How shiny is the surface? 0 is like a matte surface, 1 is like a diamond
515
+ */
516
+ shiny?: number;
517
+ size?: number;
518
+ /**
519
+ * Activate sketch detection instead of canny.
520
+ */
521
+ sketch?: boolean;
522
+ sourceProjectId?: string;
523
+ spliceThreshold?: number;
524
+ /**
525
+ * The strength
526
+ *
527
+ * Only available for the `flux-kontext` LoRA model.
528
+ */
529
+ strength?: number;
530
+ /**
531
+ * Strength for the input image structure preservation
532
+ */
533
+ structureFidelity?: number;
534
+ /**
535
+ * The control image for structure. A canny detector will be applied to this image.
536
+ * Must reference an existing AssetId.
537
+ */
538
+ structureImage?: string;
539
+ style?: '3d-cartoon' | '3d-rendered' | 'anime' | 'cartoon' | 'cinematic' | 'claymation' | 'cloud-skydome' | 'comic' | 'cyberpunk' | 'enchanted' | 'fantasy' | 'ink' | 'manga' | 'manga-color' | 'minimalist' | 'neon-tron' | 'oil-painting' | 'pastel' | 'photo' | 'photography' | 'psychedelic' | 'retro-fantasy' | 'scifi-concept-art' | 'space' | 'standard' | 'whimsical';
540
+ /**
541
+ * The higher the value the more it will look like the style image(s)
542
+ */
543
+ styleFidelity?: number;
544
+ /**
545
+ * List of style images. Most of the time, only one image is enough. It must be
546
+ * existing AssetIds.
547
+ */
548
+ styleImages?: Array<string>;
549
+ /**
550
+ * Condition the influence of the style image(s). The higher the value, the more
551
+ * the style images will influence the upscaled image.
552
+ */
553
+ styleImagesFidelity?: number;
554
+ /**
555
+ * The target height of the output image.
556
+ */
557
+ targetHeight?: number;
558
+ /**
559
+ * Target width for the upscaled image, take priority over scaling factor
560
+ */
561
+ targetWidth?: number;
562
+ /**
563
+ * A textual description / keywords describing the object of interest.
564
+ */
565
+ text?: string;
566
+ /**
567
+ * The asset to convert in texture maps. Must reference an existing AssetId.
568
+ */
569
+ texture?: string;
570
+ /**
571
+ * The thumbnail of the canvas
572
+ */
573
+ thumbnail?: Metadata.Thumbnail;
574
+ /**
575
+ * If set to true, during the upscaling process, the model will match tiles of the
576
+ * source image with tiles of the style image(s). This will result in a more
577
+ * coherent restyle. Works best with style images that have a similar composition.
578
+ */
579
+ tileStyle?: boolean;
580
+ trainingImage?: boolean;
581
+ /**
582
+ * (deprecated) Vertical expansion ratio.
583
+ */
584
+ verticalExpansionRatio?: number;
585
+ /**
586
+ * The width of the rendered image.
587
+ */
588
+ width?: number;
589
+ }
590
+ namespace Metadata {
591
+ interface Concept {
592
+ /**
593
+ * The model ID (example: "model_eyVcnFJcR92BxBkz7N6g5w")
594
+ */
595
+ modelId: string;
596
+ /**
597
+ * The scale of the model (example: 1.0) For Flux Kontext Prompt Editing, the scale
598
+ * is between 0 and 2.
599
+ */
600
+ scale: number;
601
+ /**
602
+ * The epoch of the model (example: "000001") Only available for Flux Lora Trained
603
+ * models
604
+ */
605
+ modelEpoch?: string;
606
+ }
607
+ /**
608
+ * The thumbnail of the canvas
609
+ */
610
+ interface Thumbnail {
611
+ /**
612
+ * The AssetId of the image used as a thumbnail for the canvas (example:
613
+ * "asset_GTrL3mq4SXWyMxkOHRxlpw")
614
+ */
615
+ assetId: string;
616
+ /**
617
+ * The url of the image used as a thumbnail for the canvas
618
+ */
619
+ url: string;
620
+ }
621
+ }
622
+ /**
623
+ * The properties of the asset, content may depend on the kind of asset returned
624
+ */
625
+ interface Properties {
626
+ size: number;
627
+ /**
628
+ * Number of animation frames if animations exist
629
+ */
630
+ animationFrameCount?: number;
631
+ /**
632
+ * Bitrate of the media in bits per second
633
+ */
634
+ bitrate?: number;
635
+ /**
636
+ * Number of bones if skeleton exists
637
+ */
638
+ boneCount?: number;
639
+ /**
640
+ * Number of channels of the audio
641
+ */
642
+ channels?: number;
643
+ /**
644
+ * Classification of the audio
645
+ */
646
+ classification?: 'effect' | 'interview' | 'music' | 'other' | 'sound' | 'speech' | 'text' | 'unknown';
647
+ /**
648
+ * Codec name of the media
649
+ */
650
+ codecName?: string;
651
+ /**
652
+ * Description of the audio
653
+ */
654
+ description?: string;
655
+ /**
656
+ * Bounding box dimensions [width, height, depth]
657
+ */
658
+ dimensions?: Array<unknown>;
659
+ /**
660
+ * Duration of the media in seconds
661
+ */
662
+ duration?: number;
663
+ /**
664
+ * Number of faces/triangles in the mesh
665
+ */
666
+ faceCount?: number;
667
+ /**
668
+ * Format of the mesh file (e.g. 'glb', etc.)
669
+ */
670
+ format?: string;
671
+ /**
672
+ * Frame rate of the video in frames per second
673
+ */
674
+ frameRate?: number;
675
+ /**
676
+ * Whether the mesh has animations
677
+ */
678
+ hasAnimations?: boolean;
679
+ /**
680
+ * Whether the mesh has normal vectors
681
+ */
682
+ hasNormals?: boolean;
683
+ /**
684
+ * Whether the mesh has bones/skeleton
685
+ */
686
+ hasSkeleton?: boolean;
687
+ /**
688
+ * Whether the mesh has UV coordinates
689
+ */
690
+ hasUVs?: boolean;
691
+ height?: number;
692
+ /**
693
+ * Number of frames in the video
694
+ */
695
+ nbFrames?: number;
696
+ /**
697
+ * Sample rate of the media in Hz
698
+ */
699
+ sampleRate?: number;
700
+ /**
701
+ * Transcription of the audio
702
+ */
703
+ transcription?: Properties.Transcription;
704
+ /**
705
+ * Number of vertices in the mesh
706
+ */
707
+ vertexCount?: number;
708
+ width?: number;
709
+ }
710
+ namespace Properties {
711
+ /**
712
+ * Transcription of the audio
713
+ */
714
+ interface Transcription {
715
+ text: string;
716
+ }
717
+ }
718
+ /**
719
+ * The video asset's first frame.
720
+ *
721
+ * Contains the assetId and the url of the first frame.
722
+ */
723
+ interface FirstFrame {
724
+ assetId: string;
725
+ url: string;
726
+ }
727
+ /**
728
+ * The video asset's last frame.
729
+ *
730
+ * Contains the assetId and the url of the last frame.
731
+ */
732
+ interface LastFrame {
733
+ assetId: string;
734
+ url: string;
735
+ }
736
+ /**
737
+ * The asset's preview.
738
+ *
739
+ * Contains the assetId and the url of the preview.
740
+ */
741
+ interface Preview {
742
+ assetId: string;
743
+ url: string;
744
+ }
745
+ /**
746
+ * The asset's thumbnail.
747
+ *
748
+ * Contains the assetId and the url of the thumbnail.
749
+ */
750
+ interface Thumbnail {
751
+ assetId: string;
752
+ url: string;
753
+ }
754
+ }
755
+ interface Job {
756
+ /**
757
+ * The job creation date as an ISO string (example: "2023-02-03T11:19:41.579Z")
758
+ */
759
+ createdAt: string;
760
+ /**
761
+ * The job ID (example: "job_ocZCnG1Df35XRL1QyCZSRxAG8")
762
+ */
763
+ jobId: string;
764
+ /**
765
+ * The type of job
766
+ */
767
+ jobType: 'assets-download' | 'canvas-export' | 'caption' | 'caption-llava' | 'custom' | 'describe-style' | 'detection' | 'embed' | 'flux' | 'flux-model-training' | 'generate-prompt' | 'image-generation' | 'image-prompt-editing' | 'inference' | 'mesh-preview-rendering' | 'model-download' | 'model-import' | 'model-training' | 'openai-image-generation' | 'patch-image' | 'pixelate' | 'reframe' | 'remove-background' | 'repaint' | 'restyle' | 'segment' | 'skybox-3d' | 'skybox-base-360' | 'skybox-hdri' | 'skybox-upscale-360' | 'texture' | 'translate' | 'upload' | 'upscale' | 'upscale-skybox' | 'upscale-texture' | 'vectorize' | 'workflow';
768
+ /**
769
+ * Metadata of the job with some additional information
770
+ */
771
+ metadata: Job.Metadata;
772
+ /**
773
+ * Progress of the job (between 0 and 1)
774
+ */
775
+ progress: number;
776
+ /**
777
+ * The current status of the job
778
+ */
779
+ status: 'canceled' | 'failure' | 'finalizing' | 'in-progress' | 'pending' | 'queued' | 'success' | 'warming-up';
780
+ /**
781
+ * The history of the different statuses the job went through with the ISO string
782
+ * date of when the job reached each statuses.
783
+ */
784
+ statusHistory: Array<Job.StatusHistory>;
785
+ /**
786
+ * The job last update date as an ISO string (example: "2023-02-03T11:19:41.579Z")
787
+ */
788
+ updatedAt: string;
789
+ /**
790
+ * The author user ID (example: "dcf121faaa1a0a0bbbd9ca1b73d62aea")
791
+ */
792
+ authorId?: string;
793
+ /**
794
+ * The billing of the job
795
+ */
796
+ billing?: Job.Billing;
797
+ /**
798
+ * The owner ID (example: "team_U3Qmc8PCdWXwAQJ4Dvw4tV6D")
799
+ */
800
+ ownerId?: string;
801
+ }
802
+ namespace Job {
803
+ /**
804
+ * Metadata of the job with some additional information
805
+ */
806
+ interface Metadata {
807
+ /**
808
+ * List of produced assets for this job
809
+ */
810
+ assetIds?: Array<string>;
811
+ /**
812
+ * The flow of the job. Only available for workflow jobs.
813
+ */
814
+ flow?: Array<Metadata.Flow>;
815
+ /**
816
+ * The inputs for the job
817
+ */
818
+ input?: unknown;
819
+ /**
820
+ * The output of the job
821
+ */
822
+ output?: unknown;
823
+ /**
824
+ * The workflow ID of the job if job is part of a workflow.
825
+ */
826
+ workflowId?: string;
827
+ /**
828
+ * The workflow job ID of the job if job is part of a workflow job.
829
+ */
830
+ workflowJobId?: string;
831
+ }
832
+ namespace Metadata {
833
+ interface Flow {
834
+ /**
835
+ * The id of the node.
836
+ */
837
+ id: string;
838
+ /**
839
+ * The status of the node. Only available for WorkflowJob nodes.
840
+ */
841
+ status: 'failure' | 'pending' | 'processing' | 'skipped' | 'success';
842
+ /**
843
+ * The type of the job for the node.
844
+ */
845
+ type: 'custom-model' | 'generate-prompt' | 'logic' | 'remove-background' | 'transform' | 'user-approval' | 'workflow';
846
+ /**
847
+ * List of produced assets for this node.
848
+ */
849
+ assets?: Array<Flow.Asset>;
850
+ /**
851
+ * The nodes that this node depends on. Only available for nodes that have
852
+ * dependencies. Mainly used for user approval nodes.
853
+ */
854
+ dependsOn?: Array<string>;
855
+ /**
856
+ * The inputs of the node.
857
+ */
858
+ inputs?: Array<Flow.Input>;
859
+ /**
860
+ * If the flow is part of a WorkflowJob, this is the jobId for the node. jobId is
861
+ * only available for nodes started. A node "Pending" for a running workflow job is
862
+ * not started.
863
+ */
864
+ jobId?: string;
865
+ /**
866
+ * The logic of the node. Only available for logic nodes.
867
+ */
868
+ logic?: Flow.Logic;
869
+ /**
870
+ * The type of the logic for the node. Only available for logic nodes.
871
+ */
872
+ logicType?: 'if-else';
873
+ /**
874
+ * The model id for the node. Mainly used for custom model tasks.
875
+ */
876
+ modelId?: string;
877
+ /**
878
+ * The workflow id for the node. Mainly used for workflow tasks.
879
+ */
880
+ workflowId?: string;
881
+ }
882
+ namespace Flow {
883
+ interface Asset {
884
+ assetId: string;
885
+ url: string;
886
+ }
887
+ /**
888
+ * This is used to run the flow.
889
+ */
890
+ interface Input {
891
+ /**
892
+ * The name that must be user to call the model through the API
893
+ */
894
+ name: string;
895
+ /**
896
+ * The data type of the input
897
+ */
898
+ type: 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array';
899
+ /**
900
+ * The allowed values for the input. For \`string\` or \`number\` types, creates a
901
+ * single-select dropdown. For \`string_array\` type, creates a multi-select
902
+ * dropdown.
903
+ */
904
+ allowedValues?: Array<unknown>;
905
+ /**
906
+ * Specifies the background behavior for the input. Only available for \`file\` and
907
+ * \`file_array\` input types with kind \`image\`.
908
+ */
909
+ backgroundBehavior?: 'opaque' | 'transparent';
910
+ /**
911
+ * Whether the input is a color or not. Only available for \`string\` input type.
912
+ */
913
+ color?: boolean;
914
+ /**
915
+ * Whether this input affects the model's cost calculation
916
+ */
917
+ costImpact?: boolean;
918
+ /**
919
+ * Help text displayed in the UI to provide additional information about the input
920
+ */
921
+ description?: string;
922
+ /**
923
+ * Used to visually group inputs together in the UI. Inputs with the same group
924
+ * value appear consecutively in the UI.
925
+ */
926
+ group?: string;
927
+ /**
928
+ * Hint text displayed in the UI as a tooltip to guide the user
929
+ */
930
+ hint?: string;
931
+ /**
932
+ * The list of inputs which form an object within a container array. All inputs are
933
+ * the same as the current object. This is only available for type inputs_array
934
+ * inputs.
935
+ */
936
+ inputs?: Array<unknown>;
937
+ /**
938
+ * The asset kind of the input. Only taken into account for \`file\` and
939
+ * \`file_array\` input types.
940
+ */
941
+ kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'video';
942
+ /**
943
+ * The label displayed in the UI for this input
944
+ */
945
+ label?: string;
946
+ /**
947
+ * The name of the file input field to use as the mask source
948
+ */
949
+ maskFrom?: string;
950
+ /**
951
+ * The maximum allowed value. Only available for \`number\` and \`array\` input
952
+ * types.
953
+ */
954
+ max?: number;
955
+ /**
956
+ * The maximum allowed length for \`string\` inputs. Also applies to each item in
957
+ * \`string_array\`.
958
+ */
959
+ maxLength?: number;
960
+ /**
961
+ * The minimum allowed value. Only available for \`number\` and array input types.
962
+ */
963
+ min?: number;
964
+ /**
965
+ * The minimum allowed length for string inputs. Also applies to each item in
966
+ * \`string_array\`.
967
+ */
968
+ minLength?: number;
969
+ /**
970
+ * The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only
971
+ * available for \`model_array\` input type.
972
+ */
973
+ modelTypes?: Array<'custom' | 'flux.1' | 'flux.1-composition' | 'flux.1-kontext-dev' | 'flux.1-kontext-lora' | 'flux.1-krea-dev' | 'flux.1-krea-lora' | 'flux.1-lora' | 'flux.1-pro' | 'flux.1.1-pro-ultra' | 'flux1.1-pro' | 'gpt-image-1' | 'sd-1_5' | 'sd-1_5-composition' | 'sd-1_5-lora' | 'sd-xl' | 'sd-xl-composition' | 'sd-xl-lora'>;
974
+ /**
975
+ * Whether this input represents a parent asset to assign to the produced assets.
976
+ * Only available for \`file\` and \`file_array\` input types.
977
+ *
978
+ * For \`file_array\`, the parent asset is the first item in the array.
979
+ */
980
+ parent?: boolean;
981
+ /**
982
+ * Placeholder text for the input. Only available for 'string' input type.
983
+ */
984
+ placeholder?: string;
985
+ /**
986
+ * Whether the input is a prompt. When true, displays as a text area with prompt
987
+ * spark feature. Only available for \`string\` input type.
988
+ */
989
+ prompt?: boolean;
990
+ /**
991
+ * Whether the input is used with prompt spark. Only available for \`string\` input
992
+ * type.
993
+ */
994
+ promptSpark?: boolean;
995
+ /**
996
+ * The reference to another input or output of the same workflow. Must have at
997
+ * least one of node or conditional.
998
+ */
999
+ ref?: Input.Ref;
1000
+ /**
1001
+ * Set of rules that describes when this input is required:
1002
+ *
1003
+ * - \`always\`: Input is always required
1004
+ * - \`ifNotDefined\`: Input is required when another specified input is not
1005
+ * defined
1006
+ * - \`ifDefined\`: Input is required when another specified input is defined
1007
+ * - \`conditionalValues\`: Input is required when another input has a specific
1008
+ * value
1009
+ *
1010
+ * By default, the input is not required.
1011
+ */
1012
+ required?: Input.Required;
1013
+ /**
1014
+ * The step increment for numeric inputs. Only available for \`number\` input type.
1015
+ */
1016
+ step?: number;
1017
+ }
1018
+ namespace Input {
1019
+ /**
1020
+ * The reference to another input or output of the same workflow. Must have at
1021
+ * least one of node or conditional.
1022
+ */
1023
+ interface Ref {
1024
+ /**
1025
+ * The conditional nodes to reference. If the conditional nodes are successful, the
1026
+ * node will be successful. If the conditional nodes are skipped, the node will be
1027
+ * skipped. Contains an array of node ids used to check the status of the nodes.
1028
+ */
1029
+ conditional?: Array<string>;
1030
+ /**
1031
+ * This is the desired node output value if ref is an if/else node.
1032
+ */
1033
+ equal?: string;
1034
+ /**
1035
+ * The name of the input or output to reference. If the type is 'workflow', the
1036
+ * name is the name of the input of the workflow is required If the type is 'node',
1037
+ * the name is not mandatory, except if you want all outputs of the node. To get
1038
+ * all outputs of a node, you can use the name 'all'.
1039
+ */
1040
+ name?: string;
1041
+ /**
1042
+ * The node id or 'workflow' if the source is a workflow input.
1043
+ */
1044
+ node?: string;
1045
+ }
1046
+ /**
1047
+ * Set of rules that describes when this input is required:
1048
+ *
1049
+ * - \`always\`: Input is always required
1050
+ * - \`ifNotDefined\`: Input is required when another specified input is not
1051
+ * defined
1052
+ * - \`ifDefined\`: Input is required when another specified input is defined
1053
+ * - \`conditionalValues\`: Input is required when another input has a specific
1054
+ * value
1055
+ *
1056
+ * By default, the input is not required.
1057
+ */
1058
+ interface Required {
1059
+ /**
1060
+ * Whether the input is always required
1061
+ */
1062
+ always?: boolean;
1063
+ /**
1064
+ * Makes this input required when another input has a specific value:
1065
+ *
1066
+ * - Key: name of the input to check
1067
+ * - Value: operation and allowed values that trigger the requirement
1068
+ */
1069
+ conditionalValues?: unknown;
1070
+ /**
1071
+ * Makes this input required when another input is defined:
1072
+ *
1073
+ * - Key: name of the input that must be defined
1074
+ * - Value: message to display when this input is required
1075
+ */
1076
+ ifDefined?: unknown;
1077
+ /**
1078
+ * Makes this input required when another input is not defined:
1079
+ *
1080
+ * - Key: name of the input that must be undefined
1081
+ * - Value: message to display when this input is required
1082
+ */
1083
+ ifNotDefined?: unknown;
1084
+ }
1085
+ }
1086
+ /**
1087
+ * The logic of the node. Only available for logic nodes.
1088
+ */
1089
+ interface Logic {
1090
+ /**
1091
+ * The cases of the logic. Only available for if/else nodes.
1092
+ */
1093
+ cases?: Array<Logic.Case>;
1094
+ /**
1095
+ * The default case of the logic. Contains the id/output of the node to execute if
1096
+ * no case is matched. Only available for if/else nodes.
1097
+ */
1098
+ default?: string;
1099
+ /**
1100
+ * The transform of the logic. Only available for transform nodes.
1101
+ */
1102
+ transform?: string;
1103
+ }
1104
+ namespace Logic {
1105
+ interface Case {
1106
+ condition: string;
1107
+ value: string;
1108
+ }
1109
+ }
1110
+ }
1111
+ }
1112
+ interface StatusHistory {
1113
+ date: string;
1114
+ status: 'canceled' | 'failure' | 'finalizing' | 'in-progress' | 'pending' | 'queued' | 'success' | 'warming-up';
1115
+ }
1116
+ /**
1117
+ * The billing of the job
1118
+ */
1119
+ interface Billing {
1120
+ cuCost: number;
1121
+ cuDiscount: number;
1122
+ }
1123
+ }
1124
+ }
1125
+ export interface JobAndBilling {
1126
+ /**
1127
+ * The Creative Units cost for the request billed
1128
+ */
1129
+ creativeUnitsCost?: number;
1130
+ /**
1131
+ * The Creative Units discount for the request billed
1132
+ */
1133
+ creativeUnitsDiscount?: number;
1134
+ job?: JobAndBilling.Job;
1135
+ }
1136
+ export declare namespace JobAndBilling {
1137
+ interface Job {
1138
+ /**
1139
+ * The job creation date as an ISO string (example: "2023-02-03T11:19:41.579Z")
1140
+ */
1141
+ createdAt: string;
1142
+ /**
1143
+ * The job ID (example: "job_ocZCnG1Df35XRL1QyCZSRxAG8")
1144
+ */
1145
+ jobId: string;
1146
+ /**
1147
+ * The type of job
1148
+ */
1149
+ jobType: 'assets-download' | 'canvas-export' | 'caption' | 'caption-llava' | 'custom' | 'describe-style' | 'detection' | 'embed' | 'flux' | 'flux-model-training' | 'generate-prompt' | 'image-generation' | 'image-prompt-editing' | 'inference' | 'mesh-preview-rendering' | 'model-download' | 'model-import' | 'model-training' | 'openai-image-generation' | 'patch-image' | 'pixelate' | 'reframe' | 'remove-background' | 'repaint' | 'restyle' | 'segment' | 'skybox-3d' | 'skybox-base-360' | 'skybox-hdri' | 'skybox-upscale-360' | 'texture' | 'translate' | 'upload' | 'upscale' | 'upscale-skybox' | 'upscale-texture' | 'vectorize' | 'workflow';
1150
+ /**
1151
+ * Metadata of the job with some additional information
1152
+ */
1153
+ metadata: Job.Metadata;
1154
+ /**
1155
+ * Progress of the job (between 0 and 1)
1156
+ */
1157
+ progress: number;
1158
+ /**
1159
+ * The current status of the job
1160
+ */
1161
+ status: 'canceled' | 'failure' | 'finalizing' | 'in-progress' | 'pending' | 'queued' | 'success' | 'warming-up';
1162
+ /**
1163
+ * The history of the different statuses the job went through with the ISO string
1164
+ * date of when the job reached each statuses.
1165
+ */
1166
+ statusHistory: Array<Job.StatusHistory>;
1167
+ /**
1168
+ * The job last update date as an ISO string (example: "2023-02-03T11:19:41.579Z")
1169
+ */
1170
+ updatedAt: string;
1171
+ /**
1172
+ * The author user ID (example: "dcf121faaa1a0a0bbbd9ca1b73d62aea")
1173
+ */
1174
+ authorId?: string;
1175
+ /**
1176
+ * The billing of the job
1177
+ */
1178
+ billing?: Job.Billing;
1179
+ /**
1180
+ * The owner ID (example: "team_U3Qmc8PCdWXwAQJ4Dvw4tV6D")
1181
+ */
1182
+ ownerId?: string;
1183
+ }
1184
+ namespace Job {
1185
+ /**
1186
+ * Metadata of the job with some additional information
1187
+ */
1188
+ interface Metadata {
1189
+ /**
1190
+ * List of produced assets for this job
1191
+ */
1192
+ assetIds?: Array<string>;
1193
+ /**
1194
+ * The flow of the job. Only available for workflow jobs.
1195
+ */
1196
+ flow?: Array<Metadata.Flow>;
1197
+ /**
1198
+ * The inputs for the job
1199
+ */
1200
+ input?: unknown;
1201
+ /**
1202
+ * The output of the job
1203
+ */
1204
+ output?: unknown;
1205
+ /**
1206
+ * The workflow ID of the job if job is part of a workflow.
1207
+ */
1208
+ workflowId?: string;
1209
+ /**
1210
+ * The workflow job ID of the job if job is part of a workflow job.
1211
+ */
1212
+ workflowJobId?: string;
1213
+ }
1214
+ namespace Metadata {
1215
+ interface Flow {
1216
+ /**
1217
+ * The id of the node.
1218
+ */
1219
+ id: string;
1220
+ /**
1221
+ * The status of the node. Only available for WorkflowJob nodes.
1222
+ */
1223
+ status: 'failure' | 'pending' | 'processing' | 'skipped' | 'success';
1224
+ /**
1225
+ * The type of the job for the node.
1226
+ */
1227
+ type: 'custom-model' | 'generate-prompt' | 'logic' | 'remove-background' | 'transform' | 'user-approval' | 'workflow';
1228
+ /**
1229
+ * List of produced assets for this node.
1230
+ */
1231
+ assets?: Array<Flow.Asset>;
1232
+ /**
1233
+ * The nodes that this node depends on. Only available for nodes that have
1234
+ * dependencies. Mainly used for user approval nodes.
1235
+ */
1236
+ dependsOn?: Array<string>;
1237
+ /**
1238
+ * The inputs of the node.
1239
+ */
1240
+ inputs?: Array<Flow.Input>;
1241
+ /**
1242
+ * If the flow is part of a WorkflowJob, this is the jobId for the node. jobId is
1243
+ * only available for nodes started. A node "Pending" for a running workflow job is
1244
+ * not started.
1245
+ */
1246
+ jobId?: string;
1247
+ /**
1248
+ * The logic of the node. Only available for logic nodes.
1249
+ */
1250
+ logic?: Flow.Logic;
1251
+ /**
1252
+ * The type of the logic for the node. Only available for logic nodes.
1253
+ */
1254
+ logicType?: 'if-else';
1255
+ /**
1256
+ * The model id for the node. Mainly used for custom model tasks.
1257
+ */
1258
+ modelId?: string;
1259
+ /**
1260
+ * The workflow id for the node. Mainly used for workflow tasks.
1261
+ */
1262
+ workflowId?: string;
1263
+ }
1264
+ namespace Flow {
1265
+ interface Asset {
1266
+ assetId: string;
1267
+ url: string;
1268
+ }
1269
+ /**
1270
+ * This is used to run the flow.
1271
+ */
1272
+ interface Input {
1273
+ /**
1274
+ * The name that must be user to call the model through the API
1275
+ */
1276
+ name: string;
1277
+ /**
1278
+ * The data type of the input
1279
+ */
1280
+ type: 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array';
1281
+ /**
1282
+ * The allowed values for the input. For \`string\` or \`number\` types, creates a
1283
+ * single-select dropdown. For \`string_array\` type, creates a multi-select
1284
+ * dropdown.
1285
+ */
1286
+ allowedValues?: Array<unknown>;
1287
+ /**
1288
+ * Specifies the background behavior for the input. Only available for \`file\` and
1289
+ * \`file_array\` input types with kind \`image\`.
1290
+ */
1291
+ backgroundBehavior?: 'opaque' | 'transparent';
1292
+ /**
1293
+ * Whether the input is a color or not. Only available for \`string\` input type.
1294
+ */
1295
+ color?: boolean;
1296
+ /**
1297
+ * Whether this input affects the model's cost calculation
1298
+ */
1299
+ costImpact?: boolean;
1300
+ /**
1301
+ * Help text displayed in the UI to provide additional information about the input
1302
+ */
1303
+ description?: string;
1304
+ /**
1305
+ * Used to visually group inputs together in the UI. Inputs with the same group
1306
+ * value appear consecutively in the UI.
1307
+ */
1308
+ group?: string;
1309
+ /**
1310
+ * Hint text displayed in the UI as a tooltip to guide the user
1311
+ */
1312
+ hint?: string;
1313
+ /**
1314
+ * The list of inputs which form an object within a container array. All inputs are
1315
+ * the same as the current object. This is only available for type inputs_array
1316
+ * inputs.
1317
+ */
1318
+ inputs?: Array<unknown>;
1319
+ /**
1320
+ * The asset kind of the input. Only taken into account for \`file\` and
1321
+ * \`file_array\` input types.
1322
+ */
1323
+ kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'video';
1324
+ /**
1325
+ * The label displayed in the UI for this input
1326
+ */
1327
+ label?: string;
1328
+ /**
1329
+ * The name of the file input field to use as the mask source
1330
+ */
1331
+ maskFrom?: string;
1332
+ /**
1333
+ * The maximum allowed value. Only available for \`number\` and \`array\` input
1334
+ * types.
1335
+ */
1336
+ max?: number;
1337
+ /**
1338
+ * The maximum allowed length for \`string\` inputs. Also applies to each item in
1339
+ * \`string_array\`.
1340
+ */
1341
+ maxLength?: number;
1342
+ /**
1343
+ * The minimum allowed value. Only available for \`number\` and array input types.
1344
+ */
1345
+ min?: number;
1346
+ /**
1347
+ * The minimum allowed length for string inputs. Also applies to each item in
1348
+ * \`string_array\`.
1349
+ */
1350
+ minLength?: number;
1351
+ /**
1352
+ * The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only
1353
+ * available for \`model_array\` input type.
1354
+ */
1355
+ modelTypes?: Array<'custom' | 'flux.1' | 'flux.1-composition' | 'flux.1-kontext-dev' | 'flux.1-kontext-lora' | 'flux.1-krea-dev' | 'flux.1-krea-lora' | 'flux.1-lora' | 'flux.1-pro' | 'flux.1.1-pro-ultra' | 'flux1.1-pro' | 'gpt-image-1' | 'sd-1_5' | 'sd-1_5-composition' | 'sd-1_5-lora' | 'sd-xl' | 'sd-xl-composition' | 'sd-xl-lora'>;
1356
+ /**
1357
+ * Whether this input represents a parent asset to assign to the produced assets.
1358
+ * Only available for \`file\` and \`file_array\` input types.
1359
+ *
1360
+ * For \`file_array\`, the parent asset is the first item in the array.
1361
+ */
1362
+ parent?: boolean;
1363
+ /**
1364
+ * Placeholder text for the input. Only available for 'string' input type.
1365
+ */
1366
+ placeholder?: string;
1367
+ /**
1368
+ * Whether the input is a prompt. When true, displays as a text area with prompt
1369
+ * spark feature. Only available for \`string\` input type.
1370
+ */
1371
+ prompt?: boolean;
1372
+ /**
1373
+ * Whether the input is used with prompt spark. Only available for \`string\` input
1374
+ * type.
1375
+ */
1376
+ promptSpark?: boolean;
1377
+ /**
1378
+ * The reference to another input or output of the same workflow. Must have at
1379
+ * least one of node or conditional.
1380
+ */
1381
+ ref?: Input.Ref;
1382
+ /**
1383
+ * Set of rules that describes when this input is required:
1384
+ *
1385
+ * - \`always\`: Input is always required
1386
+ * - \`ifNotDefined\`: Input is required when another specified input is not
1387
+ * defined
1388
+ * - \`ifDefined\`: Input is required when another specified input is defined
1389
+ * - \`conditionalValues\`: Input is required when another input has a specific
1390
+ * value
1391
+ *
1392
+ * By default, the input is not required.
1393
+ */
1394
+ required?: Input.Required;
1395
+ /**
1396
+ * The step increment for numeric inputs. Only available for \`number\` input type.
1397
+ */
1398
+ step?: number;
1399
+ }
1400
+ namespace Input {
1401
+ /**
1402
+ * The reference to another input or output of the same workflow. Must have at
1403
+ * least one of node or conditional.
1404
+ */
1405
+ interface Ref {
1406
+ /**
1407
+ * The conditional nodes to reference. If the conditional nodes are successful, the
1408
+ * node will be successful. If the conditional nodes are skipped, the node will be
1409
+ * skipped. Contains an array of node ids used to check the status of the nodes.
1410
+ */
1411
+ conditional?: Array<string>;
1412
+ /**
1413
+ * This is the desired node output value if ref is an if/else node.
1414
+ */
1415
+ equal?: string;
1416
+ /**
1417
+ * The name of the input or output to reference. If the type is 'workflow', the
1418
+ * name is the name of the input of the workflow is required If the type is 'node',
1419
+ * the name is not mandatory, except if you want all outputs of the node. To get
1420
+ * all outputs of a node, you can use the name 'all'.
1421
+ */
1422
+ name?: string;
1423
+ /**
1424
+ * The node id or 'workflow' if the source is a workflow input.
1425
+ */
1426
+ node?: string;
1427
+ }
1428
+ /**
1429
+ * Set of rules that describes when this input is required:
1430
+ *
1431
+ * - \`always\`: Input is always required
1432
+ * - \`ifNotDefined\`: Input is required when another specified input is not
1433
+ * defined
1434
+ * - \`ifDefined\`: Input is required when another specified input is defined
1435
+ * - \`conditionalValues\`: Input is required when another input has a specific
1436
+ * value
1437
+ *
1438
+ * By default, the input is not required.
1439
+ */
1440
+ interface Required {
1441
+ /**
1442
+ * Whether the input is always required
1443
+ */
1444
+ always?: boolean;
1445
+ /**
1446
+ * Makes this input required when another input has a specific value:
1447
+ *
1448
+ * - Key: name of the input to check
1449
+ * - Value: operation and allowed values that trigger the requirement
1450
+ */
1451
+ conditionalValues?: unknown;
1452
+ /**
1453
+ * Makes this input required when another input is defined:
1454
+ *
1455
+ * - Key: name of the input that must be defined
1456
+ * - Value: message to display when this input is required
1457
+ */
1458
+ ifDefined?: unknown;
1459
+ /**
1460
+ * Makes this input required when another input is not defined:
1461
+ *
1462
+ * - Key: name of the input that must be undefined
1463
+ * - Value: message to display when this input is required
1464
+ */
1465
+ ifNotDefined?: unknown;
1466
+ }
1467
+ }
1468
+ /**
1469
+ * The logic of the node. Only available for logic nodes.
1470
+ */
1471
+ interface Logic {
1472
+ /**
1473
+ * The cases of the logic. Only available for if/else nodes.
1474
+ */
1475
+ cases?: Array<Logic.Case>;
1476
+ /**
1477
+ * The default case of the logic. Contains the id/output of the node to execute if
1478
+ * no case is matched. Only available for if/else nodes.
1479
+ */
1480
+ default?: string;
1481
+ /**
1482
+ * The transform of the logic. Only available for transform nodes.
1483
+ */
1484
+ transform?: string;
1485
+ }
1486
+ namespace Logic {
1487
+ interface Case {
1488
+ condition: string;
1489
+ value: string;
1490
+ }
1491
+ }
1492
+ }
1493
+ }
1494
+ interface StatusHistory {
1495
+ date: string;
1496
+ status: 'canceled' | 'failure' | 'finalizing' | 'in-progress' | 'pending' | 'queued' | 'success' | 'warming-up';
1497
+ }
1498
+ /**
1499
+ * The billing of the job
1500
+ */
1501
+ interface Billing {
1502
+ cuCost: number;
1503
+ cuDiscount: number;
1504
+ }
1505
+ }
1506
+ }
1507
+ export interface GenerateCaptionResponse {
1508
+ /**
1509
+ * The captions for each image.
1510
+ */
1511
+ captions: Array<string>;
1512
+ job: GenerateCaptionResponse.Job;
1513
+ /**
1514
+ * The Creative Units cost for the request billed
1515
+ */
1516
+ creativeUnitsCost?: number;
1517
+ /**
1518
+ * The Creative Units discount for the request billed
1519
+ */
1520
+ creativeUnitsDiscount?: number;
1521
+ /**
1522
+ * The details level used to generate the captions.
1523
+ *
1524
+ * When a modelId is provided and examples are available, the details level is
1525
+ * ignored.
1526
+ */
1527
+ detailsLevel?: 'action' | 'action+style';
1528
+ }
1529
+ export declare namespace GenerateCaptionResponse {
1530
+ interface Job {
1531
+ /**
1532
+ * The job creation date as an ISO string (example: "2023-02-03T11:19:41.579Z")
1533
+ */
1534
+ createdAt: string;
1535
+ /**
1536
+ * The job ID (example: "job_ocZCnG1Df35XRL1QyCZSRxAG8")
1537
+ */
1538
+ jobId: string;
1539
+ /**
1540
+ * The type of job
1541
+ */
1542
+ jobType: 'assets-download' | 'canvas-export' | 'caption' | 'caption-llava' | 'custom' | 'describe-style' | 'detection' | 'embed' | 'flux' | 'flux-model-training' | 'generate-prompt' | 'image-generation' | 'image-prompt-editing' | 'inference' | 'mesh-preview-rendering' | 'model-download' | 'model-import' | 'model-training' | 'openai-image-generation' | 'patch-image' | 'pixelate' | 'reframe' | 'remove-background' | 'repaint' | 'restyle' | 'segment' | 'skybox-3d' | 'skybox-base-360' | 'skybox-hdri' | 'skybox-upscale-360' | 'texture' | 'translate' | 'upload' | 'upscale' | 'upscale-skybox' | 'upscale-texture' | 'vectorize' | 'workflow';
1543
+ /**
1544
+ * Metadata of the job with some additional information
1545
+ */
1546
+ metadata: Job.Metadata;
1547
+ /**
1548
+ * Progress of the job (between 0 and 1)
1549
+ */
1550
+ progress: number;
1551
+ /**
1552
+ * The current status of the job
1553
+ */
1554
+ status: 'canceled' | 'failure' | 'finalizing' | 'in-progress' | 'pending' | 'queued' | 'success' | 'warming-up';
1555
+ /**
1556
+ * The history of the different statuses the job went through with the ISO string
1557
+ * date of when the job reached each statuses.
1558
+ */
1559
+ statusHistory: Array<Job.StatusHistory>;
1560
+ /**
1561
+ * The job last update date as an ISO string (example: "2023-02-03T11:19:41.579Z")
1562
+ */
1563
+ updatedAt: string;
1564
+ /**
1565
+ * The author user ID (example: "dcf121faaa1a0a0bbbd9ca1b73d62aea")
1566
+ */
1567
+ authorId?: string;
1568
+ /**
1569
+ * The billing of the job
1570
+ */
1571
+ billing?: Job.Billing;
1572
+ /**
1573
+ * The owner ID (example: "team_U3Qmc8PCdWXwAQJ4Dvw4tV6D")
1574
+ */
1575
+ ownerId?: string;
1576
+ }
1577
+ namespace Job {
1578
+ /**
1579
+ * Metadata of the job with some additional information
1580
+ */
1581
+ interface Metadata {
1582
+ /**
1583
+ * List of produced assets for this job
1584
+ */
1585
+ assetIds?: Array<string>;
1586
+ /**
1587
+ * The flow of the job. Only available for workflow jobs.
1588
+ */
1589
+ flow?: Array<Metadata.Flow>;
1590
+ /**
1591
+ * The inputs for the job
1592
+ */
1593
+ input?: unknown;
1594
+ /**
1595
+ * The output of the job
1596
+ */
1597
+ output?: unknown;
1598
+ /**
1599
+ * The workflow ID of the job if job is part of a workflow.
1600
+ */
1601
+ workflowId?: string;
1602
+ /**
1603
+ * The workflow job ID of the job if job is part of a workflow job.
1604
+ */
1605
+ workflowJobId?: string;
1606
+ }
1607
+ namespace Metadata {
1608
+ interface Flow {
1609
+ /**
1610
+ * The id of the node.
1611
+ */
1612
+ id: string;
1613
+ /**
1614
+ * The status of the node. Only available for WorkflowJob nodes.
1615
+ */
1616
+ status: 'failure' | 'pending' | 'processing' | 'skipped' | 'success';
1617
+ /**
1618
+ * The type of the job for the node.
1619
+ */
1620
+ type: 'custom-model' | 'generate-prompt' | 'logic' | 'remove-background' | 'transform' | 'user-approval' | 'workflow';
1621
+ /**
1622
+ * List of produced assets for this node.
1623
+ */
1624
+ assets?: Array<Flow.Asset>;
1625
+ /**
1626
+ * The nodes that this node depends on. Only available for nodes that have
1627
+ * dependencies. Mainly used for user approval nodes.
1628
+ */
1629
+ dependsOn?: Array<string>;
1630
+ /**
1631
+ * The inputs of the node.
1632
+ */
1633
+ inputs?: Array<Flow.Input>;
1634
+ /**
1635
+ * If the flow is part of a WorkflowJob, this is the jobId for the node. jobId is
1636
+ * only available for nodes started. A node "Pending" for a running workflow job is
1637
+ * not started.
1638
+ */
1639
+ jobId?: string;
1640
+ /**
1641
+ * The logic of the node. Only available for logic nodes.
1642
+ */
1643
+ logic?: Flow.Logic;
1644
+ /**
1645
+ * The type of the logic for the node. Only available for logic nodes.
1646
+ */
1647
+ logicType?: 'if-else';
1648
+ /**
1649
+ * The model id for the node. Mainly used for custom model tasks.
1650
+ */
1651
+ modelId?: string;
1652
+ /**
1653
+ * The workflow id for the node. Mainly used for workflow tasks.
1654
+ */
1655
+ workflowId?: string;
1656
+ }
1657
+ namespace Flow {
1658
+ interface Asset {
1659
+ assetId: string;
1660
+ url: string;
1661
+ }
1662
+ /**
1663
+ * This is used to run the flow.
1664
+ */
1665
+ interface Input {
1666
+ /**
1667
+ * The name that must be user to call the model through the API
1668
+ */
1669
+ name: string;
1670
+ /**
1671
+ * The data type of the input
1672
+ */
1673
+ type: 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array';
1674
+ /**
1675
+ * The allowed values for the input. For \`string\` or \`number\` types, creates a
1676
+ * single-select dropdown. For \`string_array\` type, creates a multi-select
1677
+ * dropdown.
1678
+ */
1679
+ allowedValues?: Array<unknown>;
1680
+ /**
1681
+ * Specifies the background behavior for the input. Only available for \`file\` and
1682
+ * \`file_array\` input types with kind \`image\`.
1683
+ */
1684
+ backgroundBehavior?: 'opaque' | 'transparent';
1685
+ /**
1686
+ * Whether the input is a color or not. Only available for \`string\` input type.
1687
+ */
1688
+ color?: boolean;
1689
+ /**
1690
+ * Whether this input affects the model's cost calculation
1691
+ */
1692
+ costImpact?: boolean;
1693
+ /**
1694
+ * Help text displayed in the UI to provide additional information about the input
1695
+ */
1696
+ description?: string;
1697
+ /**
1698
+ * Used to visually group inputs together in the UI. Inputs with the same group
1699
+ * value appear consecutively in the UI.
1700
+ */
1701
+ group?: string;
1702
+ /**
1703
+ * Hint text displayed in the UI as a tooltip to guide the user
1704
+ */
1705
+ hint?: string;
1706
+ /**
1707
+ * The list of inputs which form an object within a container array. All inputs are
1708
+ * the same as the current object. This is only available for type inputs_array
1709
+ * inputs.
1710
+ */
1711
+ inputs?: Array<unknown>;
1712
+ /**
1713
+ * The asset kind of the input. Only taken into account for \`file\` and
1714
+ * \`file_array\` input types.
1715
+ */
1716
+ kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'video';
1717
+ /**
1718
+ * The label displayed in the UI for this input
1719
+ */
1720
+ label?: string;
1721
+ /**
1722
+ * The name of the file input field to use as the mask source
1723
+ */
1724
+ maskFrom?: string;
1725
+ /**
1726
+ * The maximum allowed value. Only available for \`number\` and \`array\` input
1727
+ * types.
1728
+ */
1729
+ max?: number;
1730
+ /**
1731
+ * The maximum allowed length for \`string\` inputs. Also applies to each item in
1732
+ * \`string_array\`.
1733
+ */
1734
+ maxLength?: number;
1735
+ /**
1736
+ * The minimum allowed value. Only available for \`number\` and array input types.
1737
+ */
1738
+ min?: number;
1739
+ /**
1740
+ * The minimum allowed length for string inputs. Also applies to each item in
1741
+ * \`string_array\`.
1742
+ */
1743
+ minLength?: number;
1744
+ /**
1745
+ * The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only
1746
+ * available for \`model_array\` input type.
1747
+ */
1748
+ modelTypes?: Array<'custom' | 'flux.1' | 'flux.1-composition' | 'flux.1-kontext-dev' | 'flux.1-kontext-lora' | 'flux.1-krea-dev' | 'flux.1-krea-lora' | 'flux.1-lora' | 'flux.1-pro' | 'flux.1.1-pro-ultra' | 'flux1.1-pro' | 'gpt-image-1' | 'sd-1_5' | 'sd-1_5-composition' | 'sd-1_5-lora' | 'sd-xl' | 'sd-xl-composition' | 'sd-xl-lora'>;
1749
+ /**
1750
+ * Whether this input represents a parent asset to assign to the produced assets.
1751
+ * Only available for \`file\` and \`file_array\` input types.
1752
+ *
1753
+ * For \`file_array\`, the parent asset is the first item in the array.
1754
+ */
1755
+ parent?: boolean;
1756
+ /**
1757
+ * Placeholder text for the input. Only available for 'string' input type.
1758
+ */
1759
+ placeholder?: string;
1760
+ /**
1761
+ * Whether the input is a prompt. When true, displays as a text area with prompt
1762
+ * spark feature. Only available for \`string\` input type.
1763
+ */
1764
+ prompt?: boolean;
1765
+ /**
1766
+ * Whether the input is used with prompt spark. Only available for \`string\` input
1767
+ * type.
1768
+ */
1769
+ promptSpark?: boolean;
1770
+ /**
1771
+ * The reference to another input or output of the same workflow. Must have at
1772
+ * least one of node or conditional.
1773
+ */
1774
+ ref?: Input.Ref;
1775
+ /**
1776
+ * Set of rules that describes when this input is required:
1777
+ *
1778
+ * - \`always\`: Input is always required
1779
+ * - \`ifNotDefined\`: Input is required when another specified input is not
1780
+ * defined
1781
+ * - \`ifDefined\`: Input is required when another specified input is defined
1782
+ * - \`conditionalValues\`: Input is required when another input has a specific
1783
+ * value
1784
+ *
1785
+ * By default, the input is not required.
1786
+ */
1787
+ required?: Input.Required;
1788
+ /**
1789
+ * The step increment for numeric inputs. Only available for \`number\` input type.
1790
+ */
1791
+ step?: number;
1792
+ }
1793
+ namespace Input {
1794
+ /**
1795
+ * The reference to another input or output of the same workflow. Must have at
1796
+ * least one of node or conditional.
1797
+ */
1798
+ interface Ref {
1799
+ /**
1800
+ * The conditional nodes to reference. If the conditional nodes are successful, the
1801
+ * node will be successful. If the conditional nodes are skipped, the node will be
1802
+ * skipped. Contains an array of node ids used to check the status of the nodes.
1803
+ */
1804
+ conditional?: Array<string>;
1805
+ /**
1806
+ * This is the desired node output value if ref is an if/else node.
1807
+ */
1808
+ equal?: string;
1809
+ /**
1810
+ * The name of the input or output to reference. If the type is 'workflow', the
1811
+ * name is the name of the input of the workflow is required If the type is 'node',
1812
+ * the name is not mandatory, except if you want all outputs of the node. To get
1813
+ * all outputs of a node, you can use the name 'all'.
1814
+ */
1815
+ name?: string;
1816
+ /**
1817
+ * The node id or 'workflow' if the source is a workflow input.
1818
+ */
1819
+ node?: string;
1820
+ }
1821
+ /**
1822
+ * Set of rules that describes when this input is required:
1823
+ *
1824
+ * - \`always\`: Input is always required
1825
+ * - \`ifNotDefined\`: Input is required when another specified input is not
1826
+ * defined
1827
+ * - \`ifDefined\`: Input is required when another specified input is defined
1828
+ * - \`conditionalValues\`: Input is required when another input has a specific
1829
+ * value
1830
+ *
1831
+ * By default, the input is not required.
1832
+ */
1833
+ interface Required {
1834
+ /**
1835
+ * Whether the input is always required
1836
+ */
1837
+ always?: boolean;
1838
+ /**
1839
+ * Makes this input required when another input has a specific value:
1840
+ *
1841
+ * - Key: name of the input to check
1842
+ * - Value: operation and allowed values that trigger the requirement
1843
+ */
1844
+ conditionalValues?: unknown;
1845
+ /**
1846
+ * Makes this input required when another input is defined:
1847
+ *
1848
+ * - Key: name of the input that must be defined
1849
+ * - Value: message to display when this input is required
1850
+ */
1851
+ ifDefined?: unknown;
1852
+ /**
1853
+ * Makes this input required when another input is not defined:
1854
+ *
1855
+ * - Key: name of the input that must be undefined
1856
+ * - Value: message to display when this input is required
1857
+ */
1858
+ ifNotDefined?: unknown;
1859
+ }
1860
+ }
1861
+ /**
1862
+ * The logic of the node. Only available for logic nodes.
1863
+ */
1864
+ interface Logic {
1865
+ /**
1866
+ * The cases of the logic. Only available for if/else nodes.
1867
+ */
1868
+ cases?: Array<Logic.Case>;
1869
+ /**
1870
+ * The default case of the logic. Contains the id/output of the node to execute if
1871
+ * no case is matched. Only available for if/else nodes.
1872
+ */
1873
+ default?: string;
1874
+ /**
1875
+ * The transform of the logic. Only available for transform nodes.
1876
+ */
1877
+ transform?: string;
1878
+ }
1879
+ namespace Logic {
1880
+ interface Case {
1881
+ condition: string;
1882
+ value: string;
1883
+ }
1884
+ }
1885
+ }
1886
+ }
1887
+ interface StatusHistory {
1888
+ date: string;
1889
+ status: 'canceled' | 'failure' | 'finalizing' | 'in-progress' | 'pending' | 'queued' | 'success' | 'warming-up';
1890
+ }
1891
+ /**
1892
+ * The billing of the job
1893
+ */
1894
+ interface Billing {
1895
+ cuCost: number;
1896
+ cuDiscount: number;
1897
+ }
1898
+ }
1899
+ }
1900
+ export interface GenerateDescribeStyleResponse {
1901
+ /**
1902
+ * The style of the given images.
1903
+ */
1904
+ description: string;
1905
+ job: GenerateDescribeStyleResponse.Job;
1906
+ /**
1907
+ * A short synthesis that describes the given asset(s) or asset(s) model.
1908
+ */
1909
+ synthesis: string;
1910
+ /**
1911
+ * The Creative Units cost for the request billed
1912
+ */
1913
+ creativeUnitsCost?: number;
1914
+ /**
1915
+ * The Creative Units discount for the request billed
1916
+ */
1917
+ creativeUnitsDiscount?: number;
1918
+ }
1919
+ export declare namespace GenerateDescribeStyleResponse {
1920
+ interface Job {
1921
+ /**
1922
+ * The job creation date as an ISO string (example: "2023-02-03T11:19:41.579Z")
1923
+ */
1924
+ createdAt: string;
1925
+ /**
1926
+ * The job ID (example: "job_ocZCnG1Df35XRL1QyCZSRxAG8")
1927
+ */
1928
+ jobId: string;
1929
+ /**
1930
+ * The type of job
1931
+ */
1932
+ jobType: 'assets-download' | 'canvas-export' | 'caption' | 'caption-llava' | 'custom' | 'describe-style' | 'detection' | 'embed' | 'flux' | 'flux-model-training' | 'generate-prompt' | 'image-generation' | 'image-prompt-editing' | 'inference' | 'mesh-preview-rendering' | 'model-download' | 'model-import' | 'model-training' | 'openai-image-generation' | 'patch-image' | 'pixelate' | 'reframe' | 'remove-background' | 'repaint' | 'restyle' | 'segment' | 'skybox-3d' | 'skybox-base-360' | 'skybox-hdri' | 'skybox-upscale-360' | 'texture' | 'translate' | 'upload' | 'upscale' | 'upscale-skybox' | 'upscale-texture' | 'vectorize' | 'workflow';
1933
+ /**
1934
+ * Metadata of the job with some additional information
1935
+ */
1936
+ metadata: Job.Metadata;
1937
+ /**
1938
+ * Progress of the job (between 0 and 1)
1939
+ */
1940
+ progress: number;
1941
+ /**
1942
+ * The current status of the job
1943
+ */
1944
+ status: 'canceled' | 'failure' | 'finalizing' | 'in-progress' | 'pending' | 'queued' | 'success' | 'warming-up';
1945
+ /**
1946
+ * The history of the different statuses the job went through with the ISO string
1947
+ * date of when the job reached each statuses.
1948
+ */
1949
+ statusHistory: Array<Job.StatusHistory>;
1950
+ /**
1951
+ * The job last update date as an ISO string (example: "2023-02-03T11:19:41.579Z")
1952
+ */
1953
+ updatedAt: string;
1954
+ /**
1955
+ * The author user ID (example: "dcf121faaa1a0a0bbbd9ca1b73d62aea")
1956
+ */
1957
+ authorId?: string;
1958
+ /**
1959
+ * The billing of the job
1960
+ */
1961
+ billing?: Job.Billing;
1962
+ /**
1963
+ * The owner ID (example: "team_U3Qmc8PCdWXwAQJ4Dvw4tV6D")
1964
+ */
1965
+ ownerId?: string;
1966
+ }
1967
+ namespace Job {
1968
+ /**
1969
+ * Metadata of the job with some additional information
1970
+ */
1971
+ interface Metadata {
1972
+ /**
1973
+ * List of produced assets for this job
1974
+ */
1975
+ assetIds?: Array<string>;
1976
+ /**
1977
+ * The flow of the job. Only available for workflow jobs.
1978
+ */
1979
+ flow?: Array<Metadata.Flow>;
1980
+ /**
1981
+ * The inputs for the job
1982
+ */
1983
+ input?: unknown;
1984
+ /**
1985
+ * The output of the job
1986
+ */
1987
+ output?: unknown;
1988
+ /**
1989
+ * The workflow ID of the job if job is part of a workflow.
1990
+ */
1991
+ workflowId?: string;
1992
+ /**
1993
+ * The workflow job ID of the job if job is part of a workflow job.
1994
+ */
1995
+ workflowJobId?: string;
1996
+ }
1997
+ namespace Metadata {
1998
+ interface Flow {
1999
+ /**
2000
+ * The id of the node.
2001
+ */
2002
+ id: string;
2003
+ /**
2004
+ * The status of the node. Only available for WorkflowJob nodes.
2005
+ */
2006
+ status: 'failure' | 'pending' | 'processing' | 'skipped' | 'success';
2007
+ /**
2008
+ * The type of the job for the node.
2009
+ */
2010
+ type: 'custom-model' | 'generate-prompt' | 'logic' | 'remove-background' | 'transform' | 'user-approval' | 'workflow';
2011
+ /**
2012
+ * List of produced assets for this node.
2013
+ */
2014
+ assets?: Array<Flow.Asset>;
2015
+ /**
2016
+ * The nodes that this node depends on. Only available for nodes that have
2017
+ * dependencies. Mainly used for user approval nodes.
2018
+ */
2019
+ dependsOn?: Array<string>;
2020
+ /**
2021
+ * The inputs of the node.
2022
+ */
2023
+ inputs?: Array<Flow.Input>;
2024
+ /**
2025
+ * If the flow is part of a WorkflowJob, this is the jobId for the node. jobId is
2026
+ * only available for nodes started. A node "Pending" for a running workflow job is
2027
+ * not started.
2028
+ */
2029
+ jobId?: string;
2030
+ /**
2031
+ * The logic of the node. Only available for logic nodes.
2032
+ */
2033
+ logic?: Flow.Logic;
2034
+ /**
2035
+ * The type of the logic for the node. Only available for logic nodes.
2036
+ */
2037
+ logicType?: 'if-else';
2038
+ /**
2039
+ * The model id for the node. Mainly used for custom model tasks.
2040
+ */
2041
+ modelId?: string;
2042
+ /**
2043
+ * The workflow id for the node. Mainly used for workflow tasks.
2044
+ */
2045
+ workflowId?: string;
2046
+ }
2047
+ namespace Flow {
2048
+ interface Asset {
2049
+ assetId: string;
2050
+ url: string;
2051
+ }
2052
+ /**
2053
+ * This is used to run the flow.
2054
+ */
2055
+ interface Input {
2056
+ /**
2057
+ * The name that must be user to call the model through the API
2058
+ */
2059
+ name: string;
2060
+ /**
2061
+ * The data type of the input
2062
+ */
2063
+ type: 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array';
2064
+ /**
2065
+ * The allowed values for the input. For \`string\` or \`number\` types, creates a
2066
+ * single-select dropdown. For \`string_array\` type, creates a multi-select
2067
+ * dropdown.
2068
+ */
2069
+ allowedValues?: Array<unknown>;
2070
+ /**
2071
+ * Specifies the background behavior for the input. Only available for \`file\` and
2072
+ * \`file_array\` input types with kind \`image\`.
2073
+ */
2074
+ backgroundBehavior?: 'opaque' | 'transparent';
2075
+ /**
2076
+ * Whether the input is a color or not. Only available for \`string\` input type.
2077
+ */
2078
+ color?: boolean;
2079
+ /**
2080
+ * Whether this input affects the model's cost calculation
2081
+ */
2082
+ costImpact?: boolean;
2083
+ /**
2084
+ * Help text displayed in the UI to provide additional information about the input
2085
+ */
2086
+ description?: string;
2087
+ /**
2088
+ * Used to visually group inputs together in the UI. Inputs with the same group
2089
+ * value appear consecutively in the UI.
2090
+ */
2091
+ group?: string;
2092
+ /**
2093
+ * Hint text displayed in the UI as a tooltip to guide the user
2094
+ */
2095
+ hint?: string;
2096
+ /**
2097
+ * The list of inputs which form an object within a container array. All inputs are
2098
+ * the same as the current object. This is only available for type inputs_array
2099
+ * inputs.
2100
+ */
2101
+ inputs?: Array<unknown>;
2102
+ /**
2103
+ * The asset kind of the input. Only taken into account for \`file\` and
2104
+ * \`file_array\` input types.
2105
+ */
2106
+ kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'video';
2107
+ /**
2108
+ * The label displayed in the UI for this input
2109
+ */
2110
+ label?: string;
2111
+ /**
2112
+ * The name of the file input field to use as the mask source
2113
+ */
2114
+ maskFrom?: string;
2115
+ /**
2116
+ * The maximum allowed value. Only available for \`number\` and \`array\` input
2117
+ * types.
2118
+ */
2119
+ max?: number;
2120
+ /**
2121
+ * The maximum allowed length for \`string\` inputs. Also applies to each item in
2122
+ * \`string_array\`.
2123
+ */
2124
+ maxLength?: number;
2125
+ /**
2126
+ * The minimum allowed value. Only available for \`number\` and array input types.
2127
+ */
2128
+ min?: number;
2129
+ /**
2130
+ * The minimum allowed length for string inputs. Also applies to each item in
2131
+ * \`string_array\`.
2132
+ */
2133
+ minLength?: number;
2134
+ /**
2135
+ * The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only
2136
+ * available for \`model_array\` input type.
2137
+ */
2138
+ modelTypes?: Array<'custom' | 'flux.1' | 'flux.1-composition' | 'flux.1-kontext-dev' | 'flux.1-kontext-lora' | 'flux.1-krea-dev' | 'flux.1-krea-lora' | 'flux.1-lora' | 'flux.1-pro' | 'flux.1.1-pro-ultra' | 'flux1.1-pro' | 'gpt-image-1' | 'sd-1_5' | 'sd-1_5-composition' | 'sd-1_5-lora' | 'sd-xl' | 'sd-xl-composition' | 'sd-xl-lora'>;
2139
+ /**
2140
+ * Whether this input represents a parent asset to assign to the produced assets.
2141
+ * Only available for \`file\` and \`file_array\` input types.
2142
+ *
2143
+ * For \`file_array\`, the parent asset is the first item in the array.
2144
+ */
2145
+ parent?: boolean;
2146
+ /**
2147
+ * Placeholder text for the input. Only available for 'string' input type.
2148
+ */
2149
+ placeholder?: string;
2150
+ /**
2151
+ * Whether the input is a prompt. When true, displays as a text area with prompt
2152
+ * spark feature. Only available for \`string\` input type.
2153
+ */
2154
+ prompt?: boolean;
2155
+ /**
2156
+ * Whether the input is used with prompt spark. Only available for \`string\` input
2157
+ * type.
2158
+ */
2159
+ promptSpark?: boolean;
2160
+ /**
2161
+ * The reference to another input or output of the same workflow. Must have at
2162
+ * least one of node or conditional.
2163
+ */
2164
+ ref?: Input.Ref;
2165
+ /**
2166
+ * Set of rules that describes when this input is required:
2167
+ *
2168
+ * - \`always\`: Input is always required
2169
+ * - \`ifNotDefined\`: Input is required when another specified input is not
2170
+ * defined
2171
+ * - \`ifDefined\`: Input is required when another specified input is defined
2172
+ * - \`conditionalValues\`: Input is required when another input has a specific
2173
+ * value
2174
+ *
2175
+ * By default, the input is not required.
2176
+ */
2177
+ required?: Input.Required;
2178
+ /**
2179
+ * The step increment for numeric inputs. Only available for \`number\` input type.
2180
+ */
2181
+ step?: number;
2182
+ }
2183
+ namespace Input {
2184
+ /**
2185
+ * The reference to another input or output of the same workflow. Must have at
2186
+ * least one of node or conditional.
2187
+ */
2188
+ interface Ref {
2189
+ /**
2190
+ * The conditional nodes to reference. If the conditional nodes are successful, the
2191
+ * node will be successful. If the conditional nodes are skipped, the node will be
2192
+ * skipped. Contains an array of node ids used to check the status of the nodes.
2193
+ */
2194
+ conditional?: Array<string>;
2195
+ /**
2196
+ * This is the desired node output value if ref is an if/else node.
2197
+ */
2198
+ equal?: string;
2199
+ /**
2200
+ * The name of the input or output to reference. If the type is 'workflow', the
2201
+ * name is the name of the input of the workflow is required If the type is 'node',
2202
+ * the name is not mandatory, except if you want all outputs of the node. To get
2203
+ * all outputs of a node, you can use the name 'all'.
2204
+ */
2205
+ name?: string;
2206
+ /**
2207
+ * The node id or 'workflow' if the source is a workflow input.
2208
+ */
2209
+ node?: string;
2210
+ }
2211
+ /**
2212
+ * Set of rules that describes when this input is required:
2213
+ *
2214
+ * - \`always\`: Input is always required
2215
+ * - \`ifNotDefined\`: Input is required when another specified input is not
2216
+ * defined
2217
+ * - \`ifDefined\`: Input is required when another specified input is defined
2218
+ * - \`conditionalValues\`: Input is required when another input has a specific
2219
+ * value
2220
+ *
2221
+ * By default, the input is not required.
2222
+ */
2223
+ interface Required {
2224
+ /**
2225
+ * Whether the input is always required
2226
+ */
2227
+ always?: boolean;
2228
+ /**
2229
+ * Makes this input required when another input has a specific value:
2230
+ *
2231
+ * - Key: name of the input to check
2232
+ * - Value: operation and allowed values that trigger the requirement
2233
+ */
2234
+ conditionalValues?: unknown;
2235
+ /**
2236
+ * Makes this input required when another input is defined:
2237
+ *
2238
+ * - Key: name of the input that must be defined
2239
+ * - Value: message to display when this input is required
2240
+ */
2241
+ ifDefined?: unknown;
2242
+ /**
2243
+ * Makes this input required when another input is not defined:
2244
+ *
2245
+ * - Key: name of the input that must be undefined
2246
+ * - Value: message to display when this input is required
2247
+ */
2248
+ ifNotDefined?: unknown;
2249
+ }
2250
+ }
2251
+ /**
2252
+ * The logic of the node. Only available for logic nodes.
2253
+ */
2254
+ interface Logic {
2255
+ /**
2256
+ * The cases of the logic. Only available for if/else nodes.
2257
+ */
2258
+ cases?: Array<Logic.Case>;
2259
+ /**
2260
+ * The default case of the logic. Contains the id/output of the node to execute if
2261
+ * no case is matched. Only available for if/else nodes.
2262
+ */
2263
+ default?: string;
2264
+ /**
2265
+ * The transform of the logic. Only available for transform nodes.
2266
+ */
2267
+ transform?: string;
2268
+ }
2269
+ namespace Logic {
2270
+ interface Case {
2271
+ condition: string;
2272
+ value: string;
2273
+ }
2274
+ }
2275
+ }
2276
+ }
2277
+ interface StatusHistory {
2278
+ date: string;
2279
+ status: 'canceled' | 'failure' | 'finalizing' | 'in-progress' | 'pending' | 'queued' | 'success' | 'warming-up';
2280
+ }
2281
+ /**
2282
+ * The billing of the job
2283
+ */
2284
+ interface Billing {
2285
+ cuCost: number;
2286
+ cuDiscount: number;
2287
+ }
2288
+ }
2289
+ }
2290
+ export interface GenerateEmbedResponse {
2291
+ /**
2292
+ * The embedding
2293
+ *
2294
+ * A 1_024 dimension vector
2295
+ */
2296
+ embedding: Array<number>;
2297
+ job: GenerateEmbedResponse.Job;
2298
+ /**
2299
+ * The Creative Units cost for the request billed
2300
+ */
2301
+ creativeUnitsCost?: number;
2302
+ /**
2303
+ * The Creative Units discount for the request billed
2304
+ */
2305
+ creativeUnitsDiscount?: number;
2306
+ }
2307
+ export declare namespace GenerateEmbedResponse {
2308
+ interface Job {
2309
+ /**
2310
+ * The job creation date as an ISO string (example: "2023-02-03T11:19:41.579Z")
2311
+ */
2312
+ createdAt: string;
2313
+ /**
2314
+ * The job ID (example: "job_ocZCnG1Df35XRL1QyCZSRxAG8")
2315
+ */
2316
+ jobId: string;
2317
+ /**
2318
+ * The type of job
2319
+ */
2320
+ jobType: 'assets-download' | 'canvas-export' | 'caption' | 'caption-llava' | 'custom' | 'describe-style' | 'detection' | 'embed' | 'flux' | 'flux-model-training' | 'generate-prompt' | 'image-generation' | 'image-prompt-editing' | 'inference' | 'mesh-preview-rendering' | 'model-download' | 'model-import' | 'model-training' | 'openai-image-generation' | 'patch-image' | 'pixelate' | 'reframe' | 'remove-background' | 'repaint' | 'restyle' | 'segment' | 'skybox-3d' | 'skybox-base-360' | 'skybox-hdri' | 'skybox-upscale-360' | 'texture' | 'translate' | 'upload' | 'upscale' | 'upscale-skybox' | 'upscale-texture' | 'vectorize' | 'workflow';
2321
+ /**
2322
+ * Metadata of the job with some additional information
2323
+ */
2324
+ metadata: Job.Metadata;
2325
+ /**
2326
+ * Progress of the job (between 0 and 1)
2327
+ */
2328
+ progress: number;
2329
+ /**
2330
+ * The current status of the job
2331
+ */
2332
+ status: 'canceled' | 'failure' | 'finalizing' | 'in-progress' | 'pending' | 'queued' | 'success' | 'warming-up';
2333
+ /**
2334
+ * The history of the different statuses the job went through with the ISO string
2335
+ * date of when the job reached each statuses.
2336
+ */
2337
+ statusHistory: Array<Job.StatusHistory>;
2338
+ /**
2339
+ * The job last update date as an ISO string (example: "2023-02-03T11:19:41.579Z")
2340
+ */
2341
+ updatedAt: string;
2342
+ /**
2343
+ * The author user ID (example: "dcf121faaa1a0a0bbbd9ca1b73d62aea")
2344
+ */
2345
+ authorId?: string;
2346
+ /**
2347
+ * The billing of the job
2348
+ */
2349
+ billing?: Job.Billing;
2350
+ /**
2351
+ * The owner ID (example: "team_U3Qmc8PCdWXwAQJ4Dvw4tV6D")
2352
+ */
2353
+ ownerId?: string;
2354
+ }
2355
+ namespace Job {
2356
+ /**
2357
+ * Metadata of the job with some additional information
2358
+ */
2359
+ interface Metadata {
2360
+ /**
2361
+ * List of produced assets for this job
2362
+ */
2363
+ assetIds?: Array<string>;
2364
+ /**
2365
+ * The flow of the job. Only available for workflow jobs.
2366
+ */
2367
+ flow?: Array<Metadata.Flow>;
2368
+ /**
2369
+ * The inputs for the job
2370
+ */
2371
+ input?: unknown;
2372
+ /**
2373
+ * The output of the job
2374
+ */
2375
+ output?: unknown;
2376
+ /**
2377
+ * The workflow ID of the job if job is part of a workflow.
2378
+ */
2379
+ workflowId?: string;
2380
+ /**
2381
+ * The workflow job ID of the job if job is part of a workflow job.
2382
+ */
2383
+ workflowJobId?: string;
2384
+ }
2385
+ namespace Metadata {
2386
+ interface Flow {
2387
+ /**
2388
+ * The id of the node.
2389
+ */
2390
+ id: string;
2391
+ /**
2392
+ * The status of the node. Only available for WorkflowJob nodes.
2393
+ */
2394
+ status: 'failure' | 'pending' | 'processing' | 'skipped' | 'success';
2395
+ /**
2396
+ * The type of the job for the node.
2397
+ */
2398
+ type: 'custom-model' | 'generate-prompt' | 'logic' | 'remove-background' | 'transform' | 'user-approval' | 'workflow';
2399
+ /**
2400
+ * List of produced assets for this node.
2401
+ */
2402
+ assets?: Array<Flow.Asset>;
2403
+ /**
2404
+ * The nodes that this node depends on. Only available for nodes that have
2405
+ * dependencies. Mainly used for user approval nodes.
2406
+ */
2407
+ dependsOn?: Array<string>;
2408
+ /**
2409
+ * The inputs of the node.
2410
+ */
2411
+ inputs?: Array<Flow.Input>;
2412
+ /**
2413
+ * If the flow is part of a WorkflowJob, this is the jobId for the node. jobId is
2414
+ * only available for nodes started. A node "Pending" for a running workflow job is
2415
+ * not started.
2416
+ */
2417
+ jobId?: string;
2418
+ /**
2419
+ * The logic of the node. Only available for logic nodes.
2420
+ */
2421
+ logic?: Flow.Logic;
2422
+ /**
2423
+ * The type of the logic for the node. Only available for logic nodes.
2424
+ */
2425
+ logicType?: 'if-else';
2426
+ /**
2427
+ * The model id for the node. Mainly used for custom model tasks.
2428
+ */
2429
+ modelId?: string;
2430
+ /**
2431
+ * The workflow id for the node. Mainly used for workflow tasks.
2432
+ */
2433
+ workflowId?: string;
2434
+ }
2435
+ namespace Flow {
2436
+ interface Asset {
2437
+ assetId: string;
2438
+ url: string;
2439
+ }
2440
+ /**
2441
+ * This is used to run the flow.
2442
+ */
2443
+ interface Input {
2444
+ /**
2445
+ * The name that must be user to call the model through the API
2446
+ */
2447
+ name: string;
2448
+ /**
2449
+ * The data type of the input
2450
+ */
2451
+ type: 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array';
2452
+ /**
2453
+ * The allowed values for the input. For \`string\` or \`number\` types, creates a
2454
+ * single-select dropdown. For \`string_array\` type, creates a multi-select
2455
+ * dropdown.
2456
+ */
2457
+ allowedValues?: Array<unknown>;
2458
+ /**
2459
+ * Specifies the background behavior for the input. Only available for \`file\` and
2460
+ * \`file_array\` input types with kind \`image\`.
2461
+ */
2462
+ backgroundBehavior?: 'opaque' | 'transparent';
2463
+ /**
2464
+ * Whether the input is a color or not. Only available for \`string\` input type.
2465
+ */
2466
+ color?: boolean;
2467
+ /**
2468
+ * Whether this input affects the model's cost calculation
2469
+ */
2470
+ costImpact?: boolean;
2471
+ /**
2472
+ * Help text displayed in the UI to provide additional information about the input
2473
+ */
2474
+ description?: string;
2475
+ /**
2476
+ * Used to visually group inputs together in the UI. Inputs with the same group
2477
+ * value appear consecutively in the UI.
2478
+ */
2479
+ group?: string;
2480
+ /**
2481
+ * Hint text displayed in the UI as a tooltip to guide the user
2482
+ */
2483
+ hint?: string;
2484
+ /**
2485
+ * The list of inputs which form an object within a container array. All inputs are
2486
+ * the same as the current object. This is only available for type inputs_array
2487
+ * inputs.
2488
+ */
2489
+ inputs?: Array<unknown>;
2490
+ /**
2491
+ * The asset kind of the input. Only taken into account for \`file\` and
2492
+ * \`file_array\` input types.
2493
+ */
2494
+ kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'video';
2495
+ /**
2496
+ * The label displayed in the UI for this input
2497
+ */
2498
+ label?: string;
2499
+ /**
2500
+ * The name of the file input field to use as the mask source
2501
+ */
2502
+ maskFrom?: string;
2503
+ /**
2504
+ * The maximum allowed value. Only available for \`number\` and \`array\` input
2505
+ * types.
2506
+ */
2507
+ max?: number;
2508
+ /**
2509
+ * The maximum allowed length for \`string\` inputs. Also applies to each item in
2510
+ * \`string_array\`.
2511
+ */
2512
+ maxLength?: number;
2513
+ /**
2514
+ * The minimum allowed value. Only available for \`number\` and array input types.
2515
+ */
2516
+ min?: number;
2517
+ /**
2518
+ * The minimum allowed length for string inputs. Also applies to each item in
2519
+ * \`string_array\`.
2520
+ */
2521
+ minLength?: number;
2522
+ /**
2523
+ * The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only
2524
+ * available for \`model_array\` input type.
2525
+ */
2526
+ modelTypes?: Array<'custom' | 'flux.1' | 'flux.1-composition' | 'flux.1-kontext-dev' | 'flux.1-kontext-lora' | 'flux.1-krea-dev' | 'flux.1-krea-lora' | 'flux.1-lora' | 'flux.1-pro' | 'flux.1.1-pro-ultra' | 'flux1.1-pro' | 'gpt-image-1' | 'sd-1_5' | 'sd-1_5-composition' | 'sd-1_5-lora' | 'sd-xl' | 'sd-xl-composition' | 'sd-xl-lora'>;
2527
+ /**
2528
+ * Whether this input represents a parent asset to assign to the produced assets.
2529
+ * Only available for \`file\` and \`file_array\` input types.
2530
+ *
2531
+ * For \`file_array\`, the parent asset is the first item in the array.
2532
+ */
2533
+ parent?: boolean;
2534
+ /**
2535
+ * Placeholder text for the input. Only available for 'string' input type.
2536
+ */
2537
+ placeholder?: string;
2538
+ /**
2539
+ * Whether the input is a prompt. When true, displays as a text area with prompt
2540
+ * spark feature. Only available for \`string\` input type.
2541
+ */
2542
+ prompt?: boolean;
2543
+ /**
2544
+ * Whether the input is used with prompt spark. Only available for \`string\` input
2545
+ * type.
2546
+ */
2547
+ promptSpark?: boolean;
2548
+ /**
2549
+ * The reference to another input or output of the same workflow. Must have at
2550
+ * least one of node or conditional.
2551
+ */
2552
+ ref?: Input.Ref;
2553
+ /**
2554
+ * Set of rules that describes when this input is required:
2555
+ *
2556
+ * - \`always\`: Input is always required
2557
+ * - \`ifNotDefined\`: Input is required when another specified input is not
2558
+ * defined
2559
+ * - \`ifDefined\`: Input is required when another specified input is defined
2560
+ * - \`conditionalValues\`: Input is required when another input has a specific
2561
+ * value
2562
+ *
2563
+ * By default, the input is not required.
2564
+ */
2565
+ required?: Input.Required;
2566
+ /**
2567
+ * The step increment for numeric inputs. Only available for \`number\` input type.
2568
+ */
2569
+ step?: number;
2570
+ }
2571
+ namespace Input {
2572
+ /**
2573
+ * The reference to another input or output of the same workflow. Must have at
2574
+ * least one of node or conditional.
2575
+ */
2576
+ interface Ref {
2577
+ /**
2578
+ * The conditional nodes to reference. If the conditional nodes are successful, the
2579
+ * node will be successful. If the conditional nodes are skipped, the node will be
2580
+ * skipped. Contains an array of node ids used to check the status of the nodes.
2581
+ */
2582
+ conditional?: Array<string>;
2583
+ /**
2584
+ * This is the desired node output value if ref is an if/else node.
2585
+ */
2586
+ equal?: string;
2587
+ /**
2588
+ * The name of the input or output to reference. If the type is 'workflow', the
2589
+ * name is the name of the input of the workflow is required If the type is 'node',
2590
+ * the name is not mandatory, except if you want all outputs of the node. To get
2591
+ * all outputs of a node, you can use the name 'all'.
2592
+ */
2593
+ name?: string;
2594
+ /**
2595
+ * The node id or 'workflow' if the source is a workflow input.
2596
+ */
2597
+ node?: string;
2598
+ }
2599
+ /**
2600
+ * Set of rules that describes when this input is required:
2601
+ *
2602
+ * - \`always\`: Input is always required
2603
+ * - \`ifNotDefined\`: Input is required when another specified input is not
2604
+ * defined
2605
+ * - \`ifDefined\`: Input is required when another specified input is defined
2606
+ * - \`conditionalValues\`: Input is required when another input has a specific
2607
+ * value
2608
+ *
2609
+ * By default, the input is not required.
2610
+ */
2611
+ interface Required {
2612
+ /**
2613
+ * Whether the input is always required
2614
+ */
2615
+ always?: boolean;
2616
+ /**
2617
+ * Makes this input required when another input has a specific value:
2618
+ *
2619
+ * - Key: name of the input to check
2620
+ * - Value: operation and allowed values that trigger the requirement
2621
+ */
2622
+ conditionalValues?: unknown;
2623
+ /**
2624
+ * Makes this input required when another input is defined:
2625
+ *
2626
+ * - Key: name of the input that must be defined
2627
+ * - Value: message to display when this input is required
2628
+ */
2629
+ ifDefined?: unknown;
2630
+ /**
2631
+ * Makes this input required when another input is not defined:
2632
+ *
2633
+ * - Key: name of the input that must be undefined
2634
+ * - Value: message to display when this input is required
2635
+ */
2636
+ ifNotDefined?: unknown;
2637
+ }
2638
+ }
2639
+ /**
2640
+ * The logic of the node. Only available for logic nodes.
2641
+ */
2642
+ interface Logic {
2643
+ /**
2644
+ * The cases of the logic. Only available for if/else nodes.
2645
+ */
2646
+ cases?: Array<Logic.Case>;
2647
+ /**
2648
+ * The default case of the logic. Contains the id/output of the node to execute if
2649
+ * no case is matched. Only available for if/else nodes.
2650
+ */
2651
+ default?: string;
2652
+ /**
2653
+ * The transform of the logic. Only available for transform nodes.
2654
+ */
2655
+ transform?: string;
2656
+ }
2657
+ namespace Logic {
2658
+ interface Case {
2659
+ condition: string;
2660
+ value: string;
2661
+ }
2662
+ }
2663
+ }
2664
+ }
2665
+ interface StatusHistory {
2666
+ date: string;
2667
+ status: 'canceled' | 'failure' | 'finalizing' | 'in-progress' | 'pending' | 'queued' | 'success' | 'warming-up';
2668
+ }
2669
+ /**
2670
+ * The billing of the job
2671
+ */
2672
+ interface Billing {
2673
+ cuCost: number;
2674
+ cuDiscount: number;
2675
+ }
2676
+ }
2677
+ }
2678
+ export interface GenerateRunModelResponse {
2679
+ job: GenerateRunModelResponse.Job;
2680
+ /**
2681
+ * The Creative Units cost for the request billed
2682
+ */
2683
+ creativeUnitsCost?: number;
2684
+ /**
2685
+ * The Creative Units discount for the request billed
2686
+ */
2687
+ creativeUnitsDiscount?: number;
2688
+ }
2689
+ export declare namespace GenerateRunModelResponse {
2690
+ interface Job {
2691
+ /**
2692
+ * The job creation date as an ISO string (example: "2023-02-03T11:19:41.579Z")
2693
+ */
2694
+ createdAt: string;
2695
+ /**
2696
+ * The job ID (example: "job_ocZCnG1Df35XRL1QyCZSRxAG8")
2697
+ */
2698
+ jobId: string;
2699
+ /**
2700
+ * The type of job
2701
+ */
2702
+ jobType: 'assets-download' | 'canvas-export' | 'caption' | 'caption-llava' | 'custom' | 'describe-style' | 'detection' | 'embed' | 'flux' | 'flux-model-training' | 'generate-prompt' | 'image-generation' | 'image-prompt-editing' | 'inference' | 'mesh-preview-rendering' | 'model-download' | 'model-import' | 'model-training' | 'openai-image-generation' | 'patch-image' | 'pixelate' | 'reframe' | 'remove-background' | 'repaint' | 'restyle' | 'segment' | 'skybox-3d' | 'skybox-base-360' | 'skybox-hdri' | 'skybox-upscale-360' | 'texture' | 'translate' | 'upload' | 'upscale' | 'upscale-skybox' | 'upscale-texture' | 'vectorize' | 'workflow';
2703
+ /**
2704
+ * Metadata of the job with some additional information
2705
+ */
2706
+ metadata: Job.Metadata;
2707
+ /**
2708
+ * Progress of the job (between 0 and 1)
2709
+ */
2710
+ progress: number;
2711
+ /**
2712
+ * The current status of the job
2713
+ */
2714
+ status: 'canceled' | 'failure' | 'finalizing' | 'in-progress' | 'pending' | 'queued' | 'success' | 'warming-up';
2715
+ /**
2716
+ * The history of the different statuses the job went through with the ISO string
2717
+ * date of when the job reached each statuses.
2718
+ */
2719
+ statusHistory: Array<Job.StatusHistory>;
2720
+ /**
2721
+ * The job last update date as an ISO string (example: "2023-02-03T11:19:41.579Z")
2722
+ */
2723
+ updatedAt: string;
2724
+ /**
2725
+ * The author user ID (example: "dcf121faaa1a0a0bbbd9ca1b73d62aea")
2726
+ */
2727
+ authorId?: string;
2728
+ /**
2729
+ * The billing of the job
2730
+ */
2731
+ billing?: Job.Billing;
2732
+ /**
2733
+ * The owner ID (example: "team_U3Qmc8PCdWXwAQJ4Dvw4tV6D")
2734
+ */
2735
+ ownerId?: string;
2736
+ }
2737
+ namespace Job {
2738
+ /**
2739
+ * Metadata of the job with some additional information
2740
+ */
2741
+ interface Metadata {
2742
+ /**
2743
+ * List of produced assets for this job
2744
+ */
2745
+ assetIds?: Array<string>;
2746
+ /**
2747
+ * The flow of the job. Only available for workflow jobs.
2748
+ */
2749
+ flow?: Array<Metadata.Flow>;
2750
+ /**
2751
+ * The inputs for the job
2752
+ */
2753
+ input?: unknown;
2754
+ /**
2755
+ * The output of the job
2756
+ */
2757
+ output?: unknown;
2758
+ /**
2759
+ * The workflow ID of the job if job is part of a workflow.
2760
+ */
2761
+ workflowId?: string;
2762
+ /**
2763
+ * The workflow job ID of the job if job is part of a workflow job.
2764
+ */
2765
+ workflowJobId?: string;
2766
+ }
2767
+ namespace Metadata {
2768
+ interface Flow {
2769
+ /**
2770
+ * The id of the node.
2771
+ */
2772
+ id: string;
2773
+ /**
2774
+ * The status of the node. Only available for WorkflowJob nodes.
2775
+ */
2776
+ status: 'failure' | 'pending' | 'processing' | 'skipped' | 'success';
2777
+ /**
2778
+ * The type of the job for the node.
2779
+ */
2780
+ type: 'custom-model' | 'generate-prompt' | 'logic' | 'remove-background' | 'transform' | 'user-approval' | 'workflow';
2781
+ /**
2782
+ * List of produced assets for this node.
2783
+ */
2784
+ assets?: Array<Flow.Asset>;
2785
+ /**
2786
+ * The nodes that this node depends on. Only available for nodes that have
2787
+ * dependencies. Mainly used for user approval nodes.
2788
+ */
2789
+ dependsOn?: Array<string>;
2790
+ /**
2791
+ * The inputs of the node.
2792
+ */
2793
+ inputs?: Array<Flow.Input>;
2794
+ /**
2795
+ * If the flow is part of a WorkflowJob, this is the jobId for the node. jobId is
2796
+ * only available for nodes started. A node "Pending" for a running workflow job is
2797
+ * not started.
2798
+ */
2799
+ jobId?: string;
2800
+ /**
2801
+ * The logic of the node. Only available for logic nodes.
2802
+ */
2803
+ logic?: Flow.Logic;
2804
+ /**
2805
+ * The type of the logic for the node. Only available for logic nodes.
2806
+ */
2807
+ logicType?: 'if-else';
2808
+ /**
2809
+ * The model id for the node. Mainly used for custom model tasks.
2810
+ */
2811
+ modelId?: string;
2812
+ /**
2813
+ * The workflow id for the node. Mainly used for workflow tasks.
2814
+ */
2815
+ workflowId?: string;
2816
+ }
2817
+ namespace Flow {
2818
+ interface Asset {
2819
+ assetId: string;
2820
+ url: string;
2821
+ }
2822
+ /**
2823
+ * This is used to run the flow.
2824
+ */
2825
+ interface Input {
2826
+ /**
2827
+ * The name that must be user to call the model through the API
2828
+ */
2829
+ name: string;
2830
+ /**
2831
+ * The data type of the input
2832
+ */
2833
+ type: 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array';
2834
+ /**
2835
+ * The allowed values for the input. For \`string\` or \`number\` types, creates a
2836
+ * single-select dropdown. For \`string_array\` type, creates a multi-select
2837
+ * dropdown.
2838
+ */
2839
+ allowedValues?: Array<unknown>;
2840
+ /**
2841
+ * Specifies the background behavior for the input. Only available for \`file\` and
2842
+ * \`file_array\` input types with kind \`image\`.
2843
+ */
2844
+ backgroundBehavior?: 'opaque' | 'transparent';
2845
+ /**
2846
+ * Whether the input is a color or not. Only available for \`string\` input type.
2847
+ */
2848
+ color?: boolean;
2849
+ /**
2850
+ * Whether this input affects the model's cost calculation
2851
+ */
2852
+ costImpact?: boolean;
2853
+ /**
2854
+ * Help text displayed in the UI to provide additional information about the input
2855
+ */
2856
+ description?: string;
2857
+ /**
2858
+ * Used to visually group inputs together in the UI. Inputs with the same group
2859
+ * value appear consecutively in the UI.
2860
+ */
2861
+ group?: string;
2862
+ /**
2863
+ * Hint text displayed in the UI as a tooltip to guide the user
2864
+ */
2865
+ hint?: string;
2866
+ /**
2867
+ * The list of inputs which form an object within a container array. All inputs are
2868
+ * the same as the current object. This is only available for type inputs_array
2869
+ * inputs.
2870
+ */
2871
+ inputs?: Array<unknown>;
2872
+ /**
2873
+ * The asset kind of the input. Only taken into account for \`file\` and
2874
+ * \`file_array\` input types.
2875
+ */
2876
+ kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'video';
2877
+ /**
2878
+ * The label displayed in the UI for this input
2879
+ */
2880
+ label?: string;
2881
+ /**
2882
+ * The name of the file input field to use as the mask source
2883
+ */
2884
+ maskFrom?: string;
2885
+ /**
2886
+ * The maximum allowed value. Only available for \`number\` and \`array\` input
2887
+ * types.
2888
+ */
2889
+ max?: number;
2890
+ /**
2891
+ * The maximum allowed length for \`string\` inputs. Also applies to each item in
2892
+ * \`string_array\`.
2893
+ */
2894
+ maxLength?: number;
2895
+ /**
2896
+ * The minimum allowed value. Only available for \`number\` and array input types.
2897
+ */
2898
+ min?: number;
2899
+ /**
2900
+ * The minimum allowed length for string inputs. Also applies to each item in
2901
+ * \`string_array\`.
2902
+ */
2903
+ minLength?: number;
2904
+ /**
2905
+ * The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only
2906
+ * available for \`model_array\` input type.
2907
+ */
2908
+ modelTypes?: Array<'custom' | 'flux.1' | 'flux.1-composition' | 'flux.1-kontext-dev' | 'flux.1-kontext-lora' | 'flux.1-krea-dev' | 'flux.1-krea-lora' | 'flux.1-lora' | 'flux.1-pro' | 'flux.1.1-pro-ultra' | 'flux1.1-pro' | 'gpt-image-1' | 'sd-1_5' | 'sd-1_5-composition' | 'sd-1_5-lora' | 'sd-xl' | 'sd-xl-composition' | 'sd-xl-lora'>;
2909
+ /**
2910
+ * Whether this input represents a parent asset to assign to the produced assets.
2911
+ * Only available for \`file\` and \`file_array\` input types.
2912
+ *
2913
+ * For \`file_array\`, the parent asset is the first item in the array.
2914
+ */
2915
+ parent?: boolean;
2916
+ /**
2917
+ * Placeholder text for the input. Only available for 'string' input type.
2918
+ */
2919
+ placeholder?: string;
2920
+ /**
2921
+ * Whether the input is a prompt. When true, displays as a text area with prompt
2922
+ * spark feature. Only available for \`string\` input type.
2923
+ */
2924
+ prompt?: boolean;
2925
+ /**
2926
+ * Whether the input is used with prompt spark. Only available for \`string\` input
2927
+ * type.
2928
+ */
2929
+ promptSpark?: boolean;
2930
+ /**
2931
+ * The reference to another input or output of the same workflow. Must have at
2932
+ * least one of node or conditional.
2933
+ */
2934
+ ref?: Input.Ref;
2935
+ /**
2936
+ * Set of rules that describes when this input is required:
2937
+ *
2938
+ * - \`always\`: Input is always required
2939
+ * - \`ifNotDefined\`: Input is required when another specified input is not
2940
+ * defined
2941
+ * - \`ifDefined\`: Input is required when another specified input is defined
2942
+ * - \`conditionalValues\`: Input is required when another input has a specific
2943
+ * value
2944
+ *
2945
+ * By default, the input is not required.
2946
+ */
2947
+ required?: Input.Required;
2948
+ /**
2949
+ * The step increment for numeric inputs. Only available for \`number\` input type.
2950
+ */
2951
+ step?: number;
2952
+ }
2953
+ namespace Input {
2954
+ /**
2955
+ * The reference to another input or output of the same workflow. Must have at
2956
+ * least one of node or conditional.
2957
+ */
2958
+ interface Ref {
2959
+ /**
2960
+ * The conditional nodes to reference. If the conditional nodes are successful, the
2961
+ * node will be successful. If the conditional nodes are skipped, the node will be
2962
+ * skipped. Contains an array of node ids used to check the status of the nodes.
2963
+ */
2964
+ conditional?: Array<string>;
2965
+ /**
2966
+ * This is the desired node output value if ref is an if/else node.
2967
+ */
2968
+ equal?: string;
2969
+ /**
2970
+ * The name of the input or output to reference. If the type is 'workflow', the
2971
+ * name is the name of the input of the workflow is required If the type is 'node',
2972
+ * the name is not mandatory, except if you want all outputs of the node. To get
2973
+ * all outputs of a node, you can use the name 'all'.
2974
+ */
2975
+ name?: string;
2976
+ /**
2977
+ * The node id or 'workflow' if the source is a workflow input.
2978
+ */
2979
+ node?: string;
2980
+ }
2981
+ /**
2982
+ * Set of rules that describes when this input is required:
2983
+ *
2984
+ * - \`always\`: Input is always required
2985
+ * - \`ifNotDefined\`: Input is required when another specified input is not
2986
+ * defined
2987
+ * - \`ifDefined\`: Input is required when another specified input is defined
2988
+ * - \`conditionalValues\`: Input is required when another input has a specific
2989
+ * value
2990
+ *
2991
+ * By default, the input is not required.
2992
+ */
2993
+ interface Required {
2994
+ /**
2995
+ * Whether the input is always required
2996
+ */
2997
+ always?: boolean;
2998
+ /**
2999
+ * Makes this input required when another input has a specific value:
3000
+ *
3001
+ * - Key: name of the input to check
3002
+ * - Value: operation and allowed values that trigger the requirement
3003
+ */
3004
+ conditionalValues?: unknown;
3005
+ /**
3006
+ * Makes this input required when another input is defined:
3007
+ *
3008
+ * - Key: name of the input that must be defined
3009
+ * - Value: message to display when this input is required
3010
+ */
3011
+ ifDefined?: unknown;
3012
+ /**
3013
+ * Makes this input required when another input is not defined:
3014
+ *
3015
+ * - Key: name of the input that must be undefined
3016
+ * - Value: message to display when this input is required
3017
+ */
3018
+ ifNotDefined?: unknown;
3019
+ }
3020
+ }
3021
+ /**
3022
+ * The logic of the node. Only available for logic nodes.
3023
+ */
3024
+ interface Logic {
3025
+ /**
3026
+ * The cases of the logic. Only available for if/else nodes.
3027
+ */
3028
+ cases?: Array<Logic.Case>;
3029
+ /**
3030
+ * The default case of the logic. Contains the id/output of the node to execute if
3031
+ * no case is matched. Only available for if/else nodes.
3032
+ */
3033
+ default?: string;
3034
+ /**
3035
+ * The transform of the logic. Only available for transform nodes.
3036
+ */
3037
+ transform?: string;
3038
+ }
3039
+ namespace Logic {
3040
+ interface Case {
3041
+ condition: string;
3042
+ value: string;
3043
+ }
3044
+ }
3045
+ }
3046
+ }
3047
+ interface StatusHistory {
3048
+ date: string;
3049
+ status: 'canceled' | 'failure' | 'finalizing' | 'in-progress' | 'pending' | 'queued' | 'success' | 'warming-up';
3050
+ }
3051
+ /**
3052
+ * The billing of the job
3053
+ */
3054
+ interface Billing {
3055
+ cuCost: number;
3056
+ cuDiscount: number;
3057
+ }
3058
+ }
3059
+ }
3060
+ export interface GenerateTranslateResponse {
3061
+ /**
3062
+ * Detected language of the input.
3063
+ */
3064
+ detectedLanguage: string;
3065
+ job: GenerateTranslateResponse.Job;
3066
+ /**
3067
+ * The translated prompt.
3068
+ */
3069
+ translation: string;
3070
+ /**
3071
+ * The Creative Units cost for the request billed
3072
+ */
3073
+ creativeUnitsCost?: number;
3074
+ /**
3075
+ * The Creative Units discount for the request billed
3076
+ */
3077
+ creativeUnitsDiscount?: number;
3078
+ }
3079
+ export declare namespace GenerateTranslateResponse {
3080
+ interface Job {
3081
+ /**
3082
+ * The job creation date as an ISO string (example: "2023-02-03T11:19:41.579Z")
3083
+ */
3084
+ createdAt: string;
3085
+ /**
3086
+ * The job ID (example: "job_ocZCnG1Df35XRL1QyCZSRxAG8")
3087
+ */
3088
+ jobId: string;
3089
+ /**
3090
+ * The type of job
3091
+ */
3092
+ jobType: 'assets-download' | 'canvas-export' | 'caption' | 'caption-llava' | 'custom' | 'describe-style' | 'detection' | 'embed' | 'flux' | 'flux-model-training' | 'generate-prompt' | 'image-generation' | 'image-prompt-editing' | 'inference' | 'mesh-preview-rendering' | 'model-download' | 'model-import' | 'model-training' | 'openai-image-generation' | 'patch-image' | 'pixelate' | 'reframe' | 'remove-background' | 'repaint' | 'restyle' | 'segment' | 'skybox-3d' | 'skybox-base-360' | 'skybox-hdri' | 'skybox-upscale-360' | 'texture' | 'translate' | 'upload' | 'upscale' | 'upscale-skybox' | 'upscale-texture' | 'vectorize' | 'workflow';
3093
+ /**
3094
+ * Metadata of the job with some additional information
3095
+ */
3096
+ metadata: Job.Metadata;
3097
+ /**
3098
+ * Progress of the job (between 0 and 1)
3099
+ */
3100
+ progress: number;
3101
+ /**
3102
+ * The current status of the job
3103
+ */
3104
+ status: 'canceled' | 'failure' | 'finalizing' | 'in-progress' | 'pending' | 'queued' | 'success' | 'warming-up';
3105
+ /**
3106
+ * The history of the different statuses the job went through with the ISO string
3107
+ * date of when the job reached each statuses.
3108
+ */
3109
+ statusHistory: Array<Job.StatusHistory>;
3110
+ /**
3111
+ * The job last update date as an ISO string (example: "2023-02-03T11:19:41.579Z")
3112
+ */
3113
+ updatedAt: string;
3114
+ /**
3115
+ * The author user ID (example: "dcf121faaa1a0a0bbbd9ca1b73d62aea")
3116
+ */
3117
+ authorId?: string;
3118
+ /**
3119
+ * The billing of the job
3120
+ */
3121
+ billing?: Job.Billing;
3122
+ /**
3123
+ * The owner ID (example: "team_U3Qmc8PCdWXwAQJ4Dvw4tV6D")
3124
+ */
3125
+ ownerId?: string;
3126
+ }
3127
+ namespace Job {
3128
+ /**
3129
+ * Metadata of the job with some additional information
3130
+ */
3131
+ interface Metadata {
3132
+ /**
3133
+ * List of produced assets for this job
3134
+ */
3135
+ assetIds?: Array<string>;
3136
+ /**
3137
+ * The flow of the job. Only available for workflow jobs.
3138
+ */
3139
+ flow?: Array<Metadata.Flow>;
3140
+ /**
3141
+ * The inputs for the job
3142
+ */
3143
+ input?: unknown;
3144
+ /**
3145
+ * The output of the job
3146
+ */
3147
+ output?: unknown;
3148
+ /**
3149
+ * The workflow ID of the job if job is part of a workflow.
3150
+ */
3151
+ workflowId?: string;
3152
+ /**
3153
+ * The workflow job ID of the job if job is part of a workflow job.
3154
+ */
3155
+ workflowJobId?: string;
3156
+ }
3157
+ namespace Metadata {
3158
+ interface Flow {
3159
+ /**
3160
+ * The id of the node.
3161
+ */
3162
+ id: string;
3163
+ /**
3164
+ * The status of the node. Only available for WorkflowJob nodes.
3165
+ */
3166
+ status: 'failure' | 'pending' | 'processing' | 'skipped' | 'success';
3167
+ /**
3168
+ * The type of the job for the node.
3169
+ */
3170
+ type: 'custom-model' | 'generate-prompt' | 'logic' | 'remove-background' | 'transform' | 'user-approval' | 'workflow';
3171
+ /**
3172
+ * List of produced assets for this node.
3173
+ */
3174
+ assets?: Array<Flow.Asset>;
3175
+ /**
3176
+ * The nodes that this node depends on. Only available for nodes that have
3177
+ * dependencies. Mainly used for user approval nodes.
3178
+ */
3179
+ dependsOn?: Array<string>;
3180
+ /**
3181
+ * The inputs of the node.
3182
+ */
3183
+ inputs?: Array<Flow.Input>;
3184
+ /**
3185
+ * If the flow is part of a WorkflowJob, this is the jobId for the node. jobId is
3186
+ * only available for nodes started. A node "Pending" for a running workflow job is
3187
+ * not started.
3188
+ */
3189
+ jobId?: string;
3190
+ /**
3191
+ * The logic of the node. Only available for logic nodes.
3192
+ */
3193
+ logic?: Flow.Logic;
3194
+ /**
3195
+ * The type of the logic for the node. Only available for logic nodes.
3196
+ */
3197
+ logicType?: 'if-else';
3198
+ /**
3199
+ * The model id for the node. Mainly used for custom model tasks.
3200
+ */
3201
+ modelId?: string;
3202
+ /**
3203
+ * The workflow id for the node. Mainly used for workflow tasks.
3204
+ */
3205
+ workflowId?: string;
3206
+ }
3207
+ namespace Flow {
3208
+ interface Asset {
3209
+ assetId: string;
3210
+ url: string;
3211
+ }
3212
+ /**
3213
+ * This is used to run the flow.
3214
+ */
3215
+ interface Input {
3216
+ /**
3217
+ * The name that must be user to call the model through the API
3218
+ */
3219
+ name: string;
3220
+ /**
3221
+ * The data type of the input
3222
+ */
3223
+ type: 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array';
3224
+ /**
3225
+ * The allowed values for the input. For \`string\` or \`number\` types, creates a
3226
+ * single-select dropdown. For \`string_array\` type, creates a multi-select
3227
+ * dropdown.
3228
+ */
3229
+ allowedValues?: Array<unknown>;
3230
+ /**
3231
+ * Specifies the background behavior for the input. Only available for \`file\` and
3232
+ * \`file_array\` input types with kind \`image\`.
3233
+ */
3234
+ backgroundBehavior?: 'opaque' | 'transparent';
3235
+ /**
3236
+ * Whether the input is a color or not. Only available for \`string\` input type.
3237
+ */
3238
+ color?: boolean;
3239
+ /**
3240
+ * Whether this input affects the model's cost calculation
3241
+ */
3242
+ costImpact?: boolean;
3243
+ /**
3244
+ * Help text displayed in the UI to provide additional information about the input
3245
+ */
3246
+ description?: string;
3247
+ /**
3248
+ * Used to visually group inputs together in the UI. Inputs with the same group
3249
+ * value appear consecutively in the UI.
3250
+ */
3251
+ group?: string;
3252
+ /**
3253
+ * Hint text displayed in the UI as a tooltip to guide the user
3254
+ */
3255
+ hint?: string;
3256
+ /**
3257
+ * The list of inputs which form an object within a container array. All inputs are
3258
+ * the same as the current object. This is only available for type inputs_array
3259
+ * inputs.
3260
+ */
3261
+ inputs?: Array<unknown>;
3262
+ /**
3263
+ * The asset kind of the input. Only taken into account for \`file\` and
3264
+ * \`file_array\` input types.
3265
+ */
3266
+ kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'video';
3267
+ /**
3268
+ * The label displayed in the UI for this input
3269
+ */
3270
+ label?: string;
3271
+ /**
3272
+ * The name of the file input field to use as the mask source
3273
+ */
3274
+ maskFrom?: string;
3275
+ /**
3276
+ * The maximum allowed value. Only available for \`number\` and \`array\` input
3277
+ * types.
3278
+ */
3279
+ max?: number;
3280
+ /**
3281
+ * The maximum allowed length for \`string\` inputs. Also applies to each item in
3282
+ * \`string_array\`.
3283
+ */
3284
+ maxLength?: number;
3285
+ /**
3286
+ * The minimum allowed value. Only available for \`number\` and array input types.
3287
+ */
3288
+ min?: number;
3289
+ /**
3290
+ * The minimum allowed length for string inputs. Also applies to each item in
3291
+ * \`string_array\`.
3292
+ */
3293
+ minLength?: number;
3294
+ /**
3295
+ * The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only
3296
+ * available for \`model_array\` input type.
3297
+ */
3298
+ modelTypes?: Array<'custom' | 'flux.1' | 'flux.1-composition' | 'flux.1-kontext-dev' | 'flux.1-kontext-lora' | 'flux.1-krea-dev' | 'flux.1-krea-lora' | 'flux.1-lora' | 'flux.1-pro' | 'flux.1.1-pro-ultra' | 'flux1.1-pro' | 'gpt-image-1' | 'sd-1_5' | 'sd-1_5-composition' | 'sd-1_5-lora' | 'sd-xl' | 'sd-xl-composition' | 'sd-xl-lora'>;
3299
+ /**
3300
+ * Whether this input represents a parent asset to assign to the produced assets.
3301
+ * Only available for \`file\` and \`file_array\` input types.
3302
+ *
3303
+ * For \`file_array\`, the parent asset is the first item in the array.
3304
+ */
3305
+ parent?: boolean;
3306
+ /**
3307
+ * Placeholder text for the input. Only available for 'string' input type.
3308
+ */
3309
+ placeholder?: string;
3310
+ /**
3311
+ * Whether the input is a prompt. When true, displays as a text area with prompt
3312
+ * spark feature. Only available for \`string\` input type.
3313
+ */
3314
+ prompt?: boolean;
3315
+ /**
3316
+ * Whether the input is used with prompt spark. Only available for \`string\` input
3317
+ * type.
3318
+ */
3319
+ promptSpark?: boolean;
3320
+ /**
3321
+ * The reference to another input or output of the same workflow. Must have at
3322
+ * least one of node or conditional.
3323
+ */
3324
+ ref?: Input.Ref;
3325
+ /**
3326
+ * Set of rules that describes when this input is required:
3327
+ *
3328
+ * - \`always\`: Input is always required
3329
+ * - \`ifNotDefined\`: Input is required when another specified input is not
3330
+ * defined
3331
+ * - \`ifDefined\`: Input is required when another specified input is defined
3332
+ * - \`conditionalValues\`: Input is required when another input has a specific
3333
+ * value
3334
+ *
3335
+ * By default, the input is not required.
3336
+ */
3337
+ required?: Input.Required;
3338
+ /**
3339
+ * The step increment for numeric inputs. Only available for \`number\` input type.
3340
+ */
3341
+ step?: number;
3342
+ }
3343
+ namespace Input {
3344
+ /**
3345
+ * The reference to another input or output of the same workflow. Must have at
3346
+ * least one of node or conditional.
3347
+ */
3348
+ interface Ref {
3349
+ /**
3350
+ * The conditional nodes to reference. If the conditional nodes are successful, the
3351
+ * node will be successful. If the conditional nodes are skipped, the node will be
3352
+ * skipped. Contains an array of node ids used to check the status of the nodes.
3353
+ */
3354
+ conditional?: Array<string>;
3355
+ /**
3356
+ * This is the desired node output value if ref is an if/else node.
3357
+ */
3358
+ equal?: string;
3359
+ /**
3360
+ * The name of the input or output to reference. If the type is 'workflow', the
3361
+ * name is the name of the input of the workflow is required If the type is 'node',
3362
+ * the name is not mandatory, except if you want all outputs of the node. To get
3363
+ * all outputs of a node, you can use the name 'all'.
3364
+ */
3365
+ name?: string;
3366
+ /**
3367
+ * The node id or 'workflow' if the source is a workflow input.
3368
+ */
3369
+ node?: string;
3370
+ }
3371
+ /**
3372
+ * Set of rules that describes when this input is required:
3373
+ *
3374
+ * - \`always\`: Input is always required
3375
+ * - \`ifNotDefined\`: Input is required when another specified input is not
3376
+ * defined
3377
+ * - \`ifDefined\`: Input is required when another specified input is defined
3378
+ * - \`conditionalValues\`: Input is required when another input has a specific
3379
+ * value
3380
+ *
3381
+ * By default, the input is not required.
3382
+ */
3383
+ interface Required {
3384
+ /**
3385
+ * Whether the input is always required
3386
+ */
3387
+ always?: boolean;
3388
+ /**
3389
+ * Makes this input required when another input has a specific value:
3390
+ *
3391
+ * - Key: name of the input to check
3392
+ * - Value: operation and allowed values that trigger the requirement
3393
+ */
3394
+ conditionalValues?: unknown;
3395
+ /**
3396
+ * Makes this input required when another input is defined:
3397
+ *
3398
+ * - Key: name of the input that must be defined
3399
+ * - Value: message to display when this input is required
3400
+ */
3401
+ ifDefined?: unknown;
3402
+ /**
3403
+ * Makes this input required when another input is not defined:
3404
+ *
3405
+ * - Key: name of the input that must be undefined
3406
+ * - Value: message to display when this input is required
3407
+ */
3408
+ ifNotDefined?: unknown;
3409
+ }
3410
+ }
3411
+ /**
3412
+ * The logic of the node. Only available for logic nodes.
3413
+ */
3414
+ interface Logic {
3415
+ /**
3416
+ * The cases of the logic. Only available for if/else nodes.
3417
+ */
3418
+ cases?: Array<Logic.Case>;
3419
+ /**
3420
+ * The default case of the logic. Contains the id/output of the node to execute if
3421
+ * no case is matched. Only available for if/else nodes.
3422
+ */
3423
+ default?: string;
3424
+ /**
3425
+ * The transform of the logic. Only available for transform nodes.
3426
+ */
3427
+ transform?: string;
3428
+ }
3429
+ namespace Logic {
3430
+ interface Case {
3431
+ condition: string;
3432
+ value: string;
3433
+ }
3434
+ }
3435
+ }
3436
+ }
3437
+ interface StatusHistory {
3438
+ date: string;
3439
+ status: 'canceled' | 'failure' | 'finalizing' | 'in-progress' | 'pending' | 'queued' | 'success' | 'warming-up';
3440
+ }
3441
+ /**
3442
+ * The billing of the job
3443
+ */
3444
+ interface Billing {
3445
+ cuCost: number;
3446
+ cuDiscount: number;
3447
+ }
3448
+ }
3449
+ }
3450
+ export interface GenerateCaptionParams {
3451
+ /**
3452
+ * Body param: List of images used to generate captions. Results are returned in
3453
+ * the same order as the given images.
3454
+ *
3455
+ * Images are set a data URLs (example:
3456
+ * \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVQYV2NgYAAAAAMAAWgmWQ0AAAAASUVORK5CYII=\")
3457
+ * or the asset IDs (example: \"asset_GTrL3mq4SXWyMxkOHRxlpw\").
3458
+ *
3459
+ * Notes:
3460
+ *
3461
+ * - if both `modelId` and `images` are provided, `modelId`'s examples and training
3462
+ * images will be used to influence the caption structure of the images
3463
+ * - if only `images` are provided, the captions will be conditioned by the
3464
+ * `detailsLevel` parameter
3465
+ * - Replaces `assetIds` parameter
3466
+ * - if you want to caption multiple images at a time, please prefer using asset
3467
+ * ids instead of data url
3468
+ */
3469
+ images: Array<string>;
3470
+ /**
3471
+ * Query param
3472
+ */
3473
+ dryRun?: string;
3474
+ /**
3475
+ * Body param: The assetIds to generate captions. Results are returned in the same
3476
+ * order as the given assetIds. Deprecated, use `images` parameter instead.
3477
+ */
3478
+ assetIds?: Array<string>;
3479
+ /**
3480
+ * Body param: The details level used to generate the captions.
3481
+ *
3482
+ * When a modelId is provided and examples are available, the details level is
3483
+ * ignored.
3484
+ */
3485
+ detailsLevel?: 'action' | 'action+style';
3486
+ /**
3487
+ * Body param: Whether we try to ensure IP removal for new prompt generation.
3488
+ */
3489
+ ensureIPCleared?: boolean;
3490
+ /**
3491
+ * Body param: When provided, the model will follow the model's training images and
3492
+ * examples' prompt to generate the captions.
3493
+ */
3494
+ modelId?: string;
3495
+ /**
3496
+ * Body param: If specified, the API will make a best effort to produce the same
3497
+ * results, such that repeated requests with the same `seed` and parameters should
3498
+ * return the same outputs. Must be used along with the same parameters including
3499
+ * prompt, model's state, etc..
3500
+ */
3501
+ seed?: number;
3502
+ /**
3503
+ * Body param: The sampling temperature to use. Higher values like `0.8` will make
3504
+ * the output more random, while lower values like `0.2` will make it more focused
3505
+ * and deterministic.
3506
+ *
3507
+ * We generally recommend altering this or `topP` but not both.
3508
+ */
3509
+ temperature?: number;
3510
+ /**
3511
+ * Body param: An alternative to sampling with temperature, called nucleus
3512
+ * sampling, where the model considers the results of the tokens with top_p
3513
+ * probability mass. So `0.1` means only the tokens comprising the top `10%`
3514
+ * probability mass are considered.
3515
+ *
3516
+ * We generally recommend altering this or `temperature` but not both.
3517
+ */
3518
+ topP?: number;
3519
+ /**
3520
+ * Body param: Optional list of words sequences that should not be present in the
3521
+ * generated prompts.
3522
+ */
3523
+ unwantedSequences?: Array<string>;
3524
+ }
3525
+ export interface GenerateDescribeStyleParams {
3526
+ /**
3527
+ * Query param
3528
+ */
3529
+ dryRun?: string;
3530
+ /**
3531
+ * Body param: The asset ids used to condition the generation.
3532
+ */
3533
+ assetIds?: Array<string>;
3534
+ /**
3535
+ * Body param: Whether we try to ensure IP removal for new prompt generation.
3536
+ */
3537
+ ensureIPCleared?: boolean;
3538
+ /**
3539
+ * Body param: List of images used to condition the generation.
3540
+ *
3541
+ * Images are set a data URLs (example:
3542
+ * \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVQYV2NgYAAAAAMAAWgmWQ0AAAAASUVORK5CYII=\")
3543
+ * or the asset IDs (example: \"asset_GTrL3mq4SXWyMxkOHRxlpw\").
3544
+ *
3545
+ * Notes:
3546
+ *
3547
+ * - in `contextual` mode, images condition prompt generation by using their actual
3548
+ * descriptions as context
3549
+ * - in all other modes, it supersedes the `modelId` parameter when provided.
3550
+ */
3551
+ images?: Array<string>;
3552
+ /**
3553
+ * Body param: The modelId used to condition the generation.
3554
+ *
3555
+ * When provided, the generation will take into account model's training images,
3556
+ * examples.
3557
+ *
3558
+ * In `contextual` mode, the modelId is used to retrieve additional context from
3559
+ * the model such as its type and capabilities.
3560
+ */
3561
+ modelId?: string;
3562
+ /**
3563
+ * Body param: If specified, the API will make a best effort to produce the same
3564
+ * results, such that repeated requests with the same `seed` and parameters should
3565
+ * return the same outputs. Must be used along with the same parameters including
3566
+ * prompt, model's state, etc..
3567
+ */
3568
+ seed?: number;
3569
+ /**
3570
+ * Body param: The sampling temperature to use. Higher values like `0.8` will make
3571
+ * the output more random, while lower values like `0.2` will make it more focused
3572
+ * and deterministic.
3573
+ *
3574
+ * We generally recommend altering this or `topP` but not both.
3575
+ */
3576
+ temperature?: number;
3577
+ /**
3578
+ * Body param: An alternative to sampling with temperature, called nucleus
3579
+ * sampling, where the model considers the results of the tokens with top_p
3580
+ * probability mass. So `0.1` means only the tokens comprising the top `10%`
3581
+ * probability mass are considered.
3582
+ *
3583
+ * We generally recommend altering this or `temperature` but not both.
3584
+ */
3585
+ topP?: number;
3586
+ /**
3587
+ * Body param: Optional list of words sequences that should not be present in the
3588
+ * generated prompts.
3589
+ */
3590
+ unwantedSequences?: Array<string>;
3591
+ }
3592
+ export interface GenerateDetectParams {
3593
+ /**
3594
+ * Body param: The image to be used to detect. Must reference an existing AssetId
3595
+ * or be a data URL.
3596
+ */
3597
+ image: string;
3598
+ /**
3599
+ * Body param: Modality to detect
3600
+ */
3601
+ modality: 'canny' | 'depth' | 'grayscale' | 'lineart_anime' | 'mlsd' | 'normal' | 'pose' | 'scribble' | 'segmentation' | 'sketch';
3602
+ /**
3603
+ * Query param
3604
+ */
3605
+ dryRun?: string;
3606
+ /**
3607
+ * Query param: If set to true, returns the original asset without transformation
3608
+ */
3609
+ originalAssets?: string;
3610
+ /**
3611
+ * Body param: Contrast factor for Grayscale detector
3612
+ */
3613
+ factor?: number;
3614
+ /**
3615
+ * Body param: High threshold for Canny detector
3616
+ */
3617
+ highThreshold?: number;
3618
+ /**
3619
+ * Body param: How polished is the surface? 0 is like a rough surface, 1 is like a
3620
+ * mirror
3621
+ */
3622
+ keypointThreshold?: number;
3623
+ /**
3624
+ * Body param: Low threshold for Canny detector
3625
+ */
3626
+ lowThreshold?: number;
3627
+ /**
3628
+ * Body param: Maximum threshold for Grayscale conversion
3629
+ */
3630
+ maxThreshold?: number;
3631
+ /**
3632
+ * Body param: Minimum threshold for Grayscale conversion
3633
+ */
3634
+ minThreshold?: number;
3635
+ /**
3636
+ * Body param: Remove background for Grayscale detector
3637
+ */
3638
+ removeBackground?: boolean;
3639
+ }
3640
+ export interface GenerateEmbedParams {
3641
+ /**
3642
+ * Body param: The text to embed. Must be a non-empty string.
3643
+ */
3644
+ text: string;
3645
+ /**
3646
+ * Query param
3647
+ */
3648
+ dryRun?: string;
3649
+ /**
3650
+ * Query param: If set to true, returns the original asset without transformation
3651
+ */
3652
+ originalAssets?: string;
3653
+ }
3654
+ export interface GeneratePatchParams {
3655
+ /**
3656
+ * Body param: The input image as a data URL (example:
3657
+ * "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVQYV2NgYAAAAAMAAWgmWQ0AAAAASUVORK5CYII=")
3658
+ * or the asset ID (example: "asset_GTrL3mq4SXWyMxkOHRxlpw")
3659
+ */
3660
+ image: string;
3661
+ /**
3662
+ * Query param
3663
+ */
3664
+ dryRun?: string;
3665
+ /**
3666
+ * Query param: If set to true, returns the original asset without transformation
3667
+ */
3668
+ originalAssets?: string;
3669
+ /**
3670
+ * Body param: Whether to allow the merged image to extend the size of the original
3671
+ * (when x or y are negative or merged image is bigger)
3672
+ */
3673
+ allowOverflow?: boolean;
3674
+ /**
3675
+ * Body param: The background color as an hexadecimal code (ex: "#FFFFFF"), an html
3676
+ * color (ex: "red") or "transparent" if "format" is "png". Default to "white"
3677
+ */
3678
+ backgroundColor?: string;
3679
+ /**
3680
+ * Body param: The crop operation to apply to the image. Applied before any
3681
+ * operation. For the backgroundColor: rgba, hex or named color are supported.
3682
+ */
3683
+ crop?: GeneratePatchParams.Crop;
3684
+ /**
3685
+ * Body param: The output format. Default to "png"
3686
+ */
3687
+ format?: 'jpeg' | 'png';
3688
+ /**
3689
+ * Body param: The image to be merged.
3690
+ */
3691
+ patch?: GeneratePatchParams.Patch;
3692
+ /**
3693
+ * Body param: The position of the image to be merged.
3694
+ */
3695
+ position?: GeneratePatchParams.Position;
3696
+ }
3697
+ export declare namespace GeneratePatchParams {
3698
+ /**
3699
+ * The crop operation to apply to the image. Applied before any operation. For the
3700
+ * backgroundColor: rgba, hex or named color are supported.
3701
+ */
3702
+ interface Crop {
3703
+ height: number;
3704
+ left: number;
3705
+ top: number;
3706
+ width: number;
3707
+ backgroundColor?: string;
3708
+ }
3709
+ /**
3710
+ * The image to be merged.
3711
+ */
3712
+ interface Patch {
3713
+ /**
3714
+ * The source of the image to be merged, as a data URL (example:
3715
+ * "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVQYV2NgYAAAAAMAAWgmWQ0AAAAASUVORK5CYII=")
3716
+ * or the asset ID (example: "asset_GTrL3mq4SXWyMxkOHRxlpw")
3717
+ */
3718
+ image: string;
3719
+ /**
3720
+ * The mode of merging the images: `override` or `erase`.
3721
+ */
3722
+ mode: 'erase' | 'override';
3723
+ }
3724
+ /**
3725
+ * The position of the image to be merged.
3726
+ */
3727
+ interface Position {
3728
+ /**
3729
+ * The X position of the image to be merged, in pixels.
3730
+ */
3731
+ x: number;
3732
+ /**
3733
+ * The Y position of the image to be merged, in pixels.
3734
+ */
3735
+ y: number;
3736
+ }
3737
+ }
3738
+ export interface GenerateRunModelParams {
3739
+ /**
3740
+ * Body param: The request body for the custom generation must be retrieve from GET
3741
+ * /models/{modelId} inputs fields
3742
+ */
3743
+ body: unknown;
3744
+ /**
3745
+ * Query param
3746
+ */
3747
+ dryRun?: string;
3748
+ }
3749
+ export interface GenerateTranslateParams {
3750
+ /**
3751
+ * Body param: The prompt to translate.
3752
+ */
3753
+ prompt: string;
3754
+ /**
3755
+ * Query param
3756
+ */
3757
+ dryRun?: string;
3758
+ /**
3759
+ * Body param: Whether we try to ensure IP removal for new prompt generation.
3760
+ */
3761
+ ensureIPCleared?: boolean;
3762
+ /**
3763
+ * Body param: List of images used to condition the generation.
3764
+ *
3765
+ * Images are set a data URLs (example:
3766
+ * \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVQYV2NgYAAAAAMAAWgmWQ0AAAAASUVORK5CYII=\")
3767
+ * or the asset IDs (example: \"asset_GTrL3mq4SXWyMxkOHRxlpw\").
3768
+ *
3769
+ * Notes:
3770
+ *
3771
+ * - in `contextual` mode, images condition prompt generation by using their actual
3772
+ * descriptions as context
3773
+ * - in all other modes, it supersedes the `modelId` parameter when provided.
3774
+ */
3775
+ images?: Array<string>;
3776
+ /**
3777
+ * Body param: If specified, the API will make a best effort to produce the same
3778
+ * results, such that repeated requests with the same `seed` and parameters should
3779
+ * return the same outputs. Must be used along with the same parameters including
3780
+ * prompt, model's state, etc..
3781
+ */
3782
+ seed?: number;
3783
+ /**
3784
+ * Body param: The sampling temperature to use. Higher values like `0.8` will make
3785
+ * the output more random, while lower values like `0.2` will make it more focused
3786
+ * and deterministic.
3787
+ *
3788
+ * We generally recommend altering this or `topP` but not both.
3789
+ */
3790
+ temperature?: number;
3791
+ /**
3792
+ * Body param: An alternative to sampling with temperature, called nucleus
3793
+ * sampling, where the model considers the results of the tokens with top_p
3794
+ * probability mass. So `0.1` means only the tokens comprising the top `10%`
3795
+ * probability mass are considered.
3796
+ *
3797
+ * We generally recommend altering this or `temperature` but not both.
3798
+ */
3799
+ topP?: number;
3800
+ }
3801
+ export declare namespace Generate {
3802
+ export { type JobAndAssetAndBilling as JobAndAssetAndBilling, type JobAndBilling as JobAndBilling, type GenerateCaptionResponse as GenerateCaptionResponse, type GenerateDescribeStyleResponse as GenerateDescribeStyleResponse, type GenerateEmbedResponse as GenerateEmbedResponse, type GenerateRunModelResponse as GenerateRunModelResponse, type GenerateTranslateResponse as GenerateTranslateResponse, type GenerateCaptionParams as GenerateCaptionParams, type GenerateDescribeStyleParams as GenerateDescribeStyleParams, type GenerateDetectParams as GenerateDetectParams, type GenerateEmbedParams as GenerateEmbedParams, type GeneratePatchParams as GeneratePatchParams, type GenerateRunModelParams as GenerateRunModelParams, type GenerateTranslateParams as GenerateTranslateParams, };
3803
+ }
3804
+ //# sourceMappingURL=generate.d.mts.map