@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.
- package/CHANGELOG.md +33 -0
- package/LICENSE +201 -0
- package/README.md +358 -0
- package/api-promise.d.mts +2 -0
- package/api-promise.d.mts.map +1 -0
- package/api-promise.d.ts +2 -0
- package/api-promise.d.ts.map +1 -0
- package/api-promise.js +6 -0
- package/api-promise.js.map +1 -0
- package/api-promise.mjs +2 -0
- package/api-promise.mjs.map +1 -0
- package/client.d.mts +208 -0
- package/client.d.mts.map +1 -0
- package/client.d.ts +208 -0
- package/client.d.ts.map +1 -0
- package/client.js +492 -0
- package/client.js.map +1 -0
- package/client.mjs +488 -0
- package/client.mjs.map +1 -0
- package/core/api-promise.d.mts +46 -0
- package/core/api-promise.d.mts.map +1 -0
- package/core/api-promise.d.ts +46 -0
- package/core/api-promise.d.ts.map +1 -0
- package/core/api-promise.js +74 -0
- package/core/api-promise.js.map +1 -0
- package/core/api-promise.mjs +70 -0
- package/core/api-promise.mjs.map +1 -0
- package/core/error.d.mts +46 -0
- package/core/error.d.mts.map +1 -0
- package/core/error.d.ts +46 -0
- package/core/error.d.ts.map +1 -0
- package/core/error.js +113 -0
- package/core/error.js.map +1 -0
- package/core/error.mjs +97 -0
- package/core/error.mjs.map +1 -0
- package/core/resource.d.mts +6 -0
- package/core/resource.d.mts.map +1 -0
- package/core/resource.d.ts +6 -0
- package/core/resource.d.ts.map +1 -0
- package/core/resource.js +11 -0
- package/core/resource.js.map +1 -0
- package/core/resource.mjs +7 -0
- package/core/resource.mjs.map +1 -0
- package/core/uploads.d.mts +3 -0
- package/core/uploads.d.mts.map +1 -0
- package/core/uploads.d.ts +3 -0
- package/core/uploads.d.ts.map +1 -0
- package/core/uploads.js +6 -0
- package/core/uploads.js.map +1 -0
- package/core/uploads.mjs +2 -0
- package/core/uploads.mjs.map +1 -0
- package/error.d.mts +2 -0
- package/error.d.mts.map +1 -0
- package/error.d.ts +2 -0
- package/error.d.ts.map +1 -0
- package/error.js +6 -0
- package/error.js.map +1 -0
- package/error.mjs +2 -0
- package/error.mjs.map +1 -0
- package/index.d.mts +6 -0
- package/index.d.mts.map +1 -0
- package/index.d.ts +6 -0
- package/index.d.ts.map +1 -0
- package/index.js +30 -0
- package/index.js.map +1 -0
- package/index.mjs +7 -0
- package/index.mjs.map +1 -0
- package/internal/builtin-types.d.mts +73 -0
- package/internal/builtin-types.d.mts.map +1 -0
- package/internal/builtin-types.d.ts +73 -0
- package/internal/builtin-types.d.ts.map +1 -0
- package/internal/builtin-types.js +4 -0
- package/internal/builtin-types.js.map +1 -0
- package/internal/builtin-types.mjs +3 -0
- package/internal/builtin-types.mjs.map +1 -0
- package/internal/detect-platform.d.mts +15 -0
- package/internal/detect-platform.d.mts.map +1 -0
- package/internal/detect-platform.d.ts +15 -0
- package/internal/detect-platform.d.ts.map +1 -0
- package/internal/detect-platform.js +162 -0
- package/internal/detect-platform.js.map +1 -0
- package/internal/detect-platform.mjs +157 -0
- package/internal/detect-platform.mjs.map +1 -0
- package/internal/errors.d.mts +3 -0
- package/internal/errors.d.mts.map +1 -0
- package/internal/errors.d.ts +3 -0
- package/internal/errors.d.ts.map +1 -0
- package/internal/errors.js +41 -0
- package/internal/errors.js.map +1 -0
- package/internal/errors.mjs +36 -0
- package/internal/errors.mjs.map +1 -0
- package/internal/headers.d.mts +20 -0
- package/internal/headers.d.mts.map +1 -0
- package/internal/headers.d.ts +20 -0
- package/internal/headers.d.ts.map +1 -0
- package/internal/headers.js +79 -0
- package/internal/headers.js.map +1 -0
- package/internal/headers.mjs +74 -0
- package/internal/headers.mjs.map +1 -0
- package/internal/parse.d.mts +12 -0
- package/internal/parse.d.mts.map +1 -0
- package/internal/parse.d.ts +12 -0
- package/internal/parse.d.ts.map +1 -0
- package/internal/parse.js +40 -0
- package/internal/parse.js.map +1 -0
- package/internal/parse.mjs +37 -0
- package/internal/parse.mjs.map +1 -0
- package/internal/qs/formats.d.mts +7 -0
- package/internal/qs/formats.d.mts.map +1 -0
- package/internal/qs/formats.d.ts +7 -0
- package/internal/qs/formats.d.ts.map +1 -0
- package/internal/qs/formats.js +13 -0
- package/internal/qs/formats.js.map +1 -0
- package/internal/qs/formats.mjs +9 -0
- package/internal/qs/formats.mjs.map +1 -0
- package/internal/qs/index.d.mts +10 -0
- package/internal/qs/index.d.mts.map +1 -0
- package/internal/qs/index.d.ts +10 -0
- package/internal/qs/index.d.ts.map +1 -0
- package/internal/qs/index.js +14 -0
- package/internal/qs/index.js.map +1 -0
- package/internal/qs/index.mjs +10 -0
- package/internal/qs/index.mjs.map +1 -0
- package/internal/qs/stringify.d.mts +3 -0
- package/internal/qs/stringify.d.mts.map +1 -0
- package/internal/qs/stringify.d.ts +3 -0
- package/internal/qs/stringify.d.ts.map +1 -0
- package/internal/qs/stringify.js +277 -0
- package/internal/qs/stringify.js.map +1 -0
- package/internal/qs/stringify.mjs +274 -0
- package/internal/qs/stringify.mjs.map +1 -0
- package/internal/qs/types.d.mts +57 -0
- package/internal/qs/types.d.mts.map +1 -0
- package/internal/qs/types.d.ts +57 -0
- package/internal/qs/types.d.ts.map +1 -0
- package/internal/qs/types.js +3 -0
- package/internal/qs/types.js.map +1 -0
- package/internal/qs/types.mjs +2 -0
- package/internal/qs/types.mjs.map +1 -0
- package/internal/qs/utils.d.mts +15 -0
- package/internal/qs/utils.d.mts.map +1 -0
- package/internal/qs/utils.d.ts +15 -0
- package/internal/qs/utils.d.ts.map +1 -0
- package/internal/qs/utils.js +230 -0
- package/internal/qs/utils.js.map +1 -0
- package/internal/qs/utils.mjs +217 -0
- package/internal/qs/utils.mjs.map +1 -0
- package/internal/request-options.d.mts +75 -0
- package/internal/request-options.d.mts.map +1 -0
- package/internal/request-options.d.ts +75 -0
- package/internal/request-options.d.ts.map +1 -0
- package/internal/request-options.js +14 -0
- package/internal/request-options.js.map +1 -0
- package/internal/request-options.mjs +10 -0
- package/internal/request-options.mjs.map +1 -0
- package/internal/shim-types.d.mts +17 -0
- package/internal/shim-types.d.mts.map +1 -0
- package/internal/shim-types.d.ts +17 -0
- package/internal/shim-types.d.ts.map +1 -0
- package/internal/shim-types.js +4 -0
- package/internal/shim-types.js.map +1 -0
- package/internal/shim-types.mjs +3 -0
- package/internal/shim-types.mjs.map +1 -0
- package/internal/shims.d.mts +20 -0
- package/internal/shims.d.mts.map +1 -0
- package/internal/shims.d.ts +20 -0
- package/internal/shims.d.ts.map +1 -0
- package/internal/shims.js +92 -0
- package/internal/shims.js.map +1 -0
- package/internal/shims.mjs +85 -0
- package/internal/shims.mjs.map +1 -0
- package/internal/to-file.d.mts +45 -0
- package/internal/to-file.d.mts.map +1 -0
- package/internal/to-file.d.ts +45 -0
- package/internal/to-file.d.ts.map +1 -0
- package/internal/to-file.js +91 -0
- package/internal/to-file.js.map +1 -0
- package/internal/to-file.mjs +88 -0
- package/internal/to-file.mjs.map +1 -0
- package/internal/tslib.js +81 -0
- package/internal/tslib.mjs +17 -0
- package/internal/types.d.mts +69 -0
- package/internal/types.d.mts.map +1 -0
- package/internal/types.d.ts +69 -0
- package/internal/types.d.ts.map +1 -0
- package/internal/types.js +4 -0
- package/internal/types.js.map +1 -0
- package/internal/types.mjs +3 -0
- package/internal/types.mjs.map +1 -0
- package/internal/uploads.d.mts +42 -0
- package/internal/uploads.d.mts.map +1 -0
- package/internal/uploads.d.ts +42 -0
- package/internal/uploads.d.ts.map +1 -0
- package/internal/uploads.js +141 -0
- package/internal/uploads.js.map +1 -0
- package/internal/uploads.mjs +131 -0
- package/internal/uploads.mjs.map +1 -0
- package/internal/utils/base64.d.mts +3 -0
- package/internal/utils/base64.d.mts.map +1 -0
- package/internal/utils/base64.d.ts +3 -0
- package/internal/utils/base64.d.ts.map +1 -0
- package/internal/utils/base64.js +38 -0
- package/internal/utils/base64.js.map +1 -0
- package/internal/utils/base64.mjs +33 -0
- package/internal/utils/base64.mjs.map +1 -0
- package/internal/utils/bytes.d.mts +4 -0
- package/internal/utils/bytes.d.mts.map +1 -0
- package/internal/utils/bytes.d.ts +4 -0
- package/internal/utils/bytes.d.ts.map +1 -0
- package/internal/utils/bytes.js +31 -0
- package/internal/utils/bytes.js.map +1 -0
- package/internal/utils/bytes.mjs +26 -0
- package/internal/utils/bytes.mjs.map +1 -0
- package/internal/utils/env.d.mts +9 -0
- package/internal/utils/env.d.mts.map +1 -0
- package/internal/utils/env.d.ts +9 -0
- package/internal/utils/env.d.ts.map +1 -0
- package/internal/utils/env.js +22 -0
- package/internal/utils/env.js.map +1 -0
- package/internal/utils/env.mjs +18 -0
- package/internal/utils/env.mjs.map +1 -0
- package/internal/utils/log.d.mts +37 -0
- package/internal/utils/log.d.mts.map +1 -0
- package/internal/utils/log.d.ts +37 -0
- package/internal/utils/log.d.ts.map +1 -0
- package/internal/utils/log.js +85 -0
- package/internal/utils/log.js.map +1 -0
- package/internal/utils/log.mjs +79 -0
- package/internal/utils/log.mjs.map +1 -0
- package/internal/utils/path.d.mts +15 -0
- package/internal/utils/path.d.mts.map +1 -0
- package/internal/utils/path.d.ts +15 -0
- package/internal/utils/path.d.ts.map +1 -0
- package/internal/utils/path.js +79 -0
- package/internal/utils/path.js.map +1 -0
- package/internal/utils/path.mjs +74 -0
- package/internal/utils/path.mjs.map +1 -0
- package/internal/utils/query.d.mts +2 -0
- package/internal/utils/query.d.mts.map +1 -0
- package/internal/utils/query.d.ts +2 -0
- package/internal/utils/query.d.ts.map +1 -0
- package/internal/utils/query.js +10 -0
- package/internal/utils/query.js.map +1 -0
- package/internal/utils/query.mjs +6 -0
- package/internal/utils/query.mjs.map +1 -0
- package/internal/utils/sleep.d.mts +2 -0
- package/internal/utils/sleep.d.mts.map +1 -0
- package/internal/utils/sleep.d.ts +2 -0
- package/internal/utils/sleep.d.ts.map +1 -0
- package/internal/utils/sleep.js +7 -0
- package/internal/utils/sleep.js.map +1 -0
- package/internal/utils/sleep.mjs +3 -0
- package/internal/utils/sleep.mjs.map +1 -0
- package/internal/utils/uuid.d.mts +5 -0
- package/internal/utils/uuid.d.mts.map +1 -0
- package/internal/utils/uuid.d.ts +5 -0
- package/internal/utils/uuid.d.ts.map +1 -0
- package/internal/utils/uuid.js +19 -0
- package/internal/utils/uuid.js.map +1 -0
- package/internal/utils/uuid.mjs +15 -0
- package/internal/utils/uuid.mjs.map +1 -0
- package/internal/utils/values.d.mts +18 -0
- package/internal/utils/values.d.mts.map +1 -0
- package/internal/utils/values.d.ts +18 -0
- package/internal/utils/values.d.ts.map +1 -0
- package/internal/utils/values.js +112 -0
- package/internal/utils/values.js.map +1 -0
- package/internal/utils/values.mjs +94 -0
- package/internal/utils/values.mjs.map +1 -0
- package/internal/utils.d.mts +8 -0
- package/internal/utils.d.mts.map +1 -0
- package/internal/utils.d.ts +8 -0
- package/internal/utils.d.ts.map +1 -0
- package/internal/utils.js +12 -0
- package/internal/utils.js.map +1 -0
- package/internal/utils.mjs +9 -0
- package/internal/utils.mjs.map +1 -0
- package/package.json +143 -0
- package/resource.d.mts +2 -0
- package/resource.d.mts.map +1 -0
- package/resource.d.ts +2 -0
- package/resource.d.ts.map +1 -0
- package/resource.js +6 -0
- package/resource.js.map +1 -0
- package/resource.mjs +2 -0
- package/resource.mjs.map +1 -0
- package/resources/assets/assets.d.mts +6397 -0
- package/resources/assets/assets.d.mts.map +1 -0
- package/resources/assets/assets.d.ts +6397 -0
- package/resources/assets/assets.d.ts.map +1 -0
- package/resources/assets/assets.js +98 -0
- package/resources/assets/assets.js.map +1 -0
- package/resources/assets/assets.mjs +93 -0
- package/resources/assets/assets.mjs.map +1 -0
- package/resources/assets/download.d.mts +87 -0
- package/resources/assets/download.d.mts.map +1 -0
- package/resources/assets/download.d.ts +87 -0
- package/resources/assets/download.d.ts.map +1 -0
- package/resources/assets/download.js +28 -0
- package/resources/assets/download.js.map +1 -0
- package/resources/assets/download.mjs +24 -0
- package/resources/assets/download.mjs.map +1 -0
- package/resources/assets/index.d.mts +4 -0
- package/resources/assets/index.d.mts.map +1 -0
- package/resources/assets/index.d.ts +4 -0
- package/resources/assets/index.d.ts.map +1 -0
- package/resources/assets/index.js +11 -0
- package/resources/assets/index.js.map +1 -0
- package/resources/assets/index.mjs +5 -0
- package/resources/assets/index.mjs.map +1 -0
- package/resources/assets/public.d.mts +1535 -0
- package/resources/assets/public.d.mts.map +1 -0
- package/resources/assets/public.d.ts +1535 -0
- package/resources/assets/public.d.ts.map +1 -0
- package/resources/assets/public.js +28 -0
- package/resources/assets/public.js.map +1 -0
- package/resources/assets/public.mjs +24 -0
- package/resources/assets/public.mjs.map +1 -0
- package/resources/assets.d.mts +2 -0
- package/resources/assets.d.mts.map +1 -0
- package/resources/assets.d.ts +2 -0
- package/resources/assets.d.ts.map +1 -0
- package/resources/assets.js +6 -0
- package/resources/assets.js.map +1 -0
- package/resources/assets.mjs +3 -0
- package/resources/assets.mjs.map +1 -0
- package/resources/collections/assets.d.mts +119 -0
- package/resources/collections/assets.d.mts.map +1 -0
- package/resources/collections/assets.d.ts +119 -0
- package/resources/collections/assets.d.ts.map +1 -0
- package/resources/collections/assets.js +22 -0
- package/resources/collections/assets.js.map +1 -0
- package/resources/collections/assets.mjs +18 -0
- package/resources/collections/assets.mjs.map +1 -0
- package/resources/collections/collections.d.mts +250 -0
- package/resources/collections/collections.d.mts.map +1 -0
- package/resources/collections/collections.d.ts +250 -0
- package/resources/collections/collections.d.ts.map +1 -0
- package/resources/collections/collections.js +52 -0
- package/resources/collections/collections.js.map +1 -0
- package/resources/collections/collections.mjs +47 -0
- package/resources/collections/collections.mjs.map +1 -0
- package/resources/collections/index.d.mts +4 -0
- package/resources/collections/index.d.mts.map +1 -0
- package/resources/collections/index.d.ts +4 -0
- package/resources/collections/index.d.ts.map +1 -0
- package/resources/collections/index.js +11 -0
- package/resources/collections/index.js.map +1 -0
- package/resources/collections/index.mjs +5 -0
- package/resources/collections/index.mjs.map +1 -0
- package/resources/collections/models.d.mts +119 -0
- package/resources/collections/models.d.mts.map +1 -0
- package/resources/collections/models.d.ts +119 -0
- package/resources/collections/models.d.ts.map +1 -0
- package/resources/collections/models.js +22 -0
- package/resources/collections/models.js.map +1 -0
- package/resources/collections/models.mjs +18 -0
- package/resources/collections/models.mjs.map +1 -0
- package/resources/collections.d.mts +2 -0
- package/resources/collections.d.mts.map +1 -0
- package/resources/collections.d.ts +2 -0
- package/resources/collections.d.ts.map +1 -0
- package/resources/collections.js +6 -0
- package/resources/collections.js.map +1 -0
- package/resources/collections.mjs +3 -0
- package/resources/collections.mjs.map +1 -0
- package/resources/generate.d.mts +3804 -0
- package/resources/generate.d.mts.map +1 -0
- package/resources/generate.d.ts +3804 -0
- package/resources/generate.d.ts.map +1 -0
- package/resources/generate.js +70 -0
- package/resources/generate.js.map +1 -0
- package/resources/generate.mjs +66 -0
- package/resources/generate.mjs.map +1 -0
- package/resources/index.d.mts +12 -0
- package/resources/index.d.mts.map +1 -0
- package/resources/index.d.ts +12 -0
- package/resources/index.d.ts.map +1 -0
- package/resources/index.js +27 -0
- package/resources/index.js.map +1 -0
- package/resources/index.mjs +13 -0
- package/resources/index.mjs.map +1 -0
- package/resources/jobs.d.mts +1191 -0
- package/resources/jobs.d.mts.map +1 -0
- package/resources/jobs.d.ts +1191 -0
- package/resources/jobs.d.ts.map +1 -0
- package/resources/jobs.js +31 -0
- package/resources/jobs.js.map +1 -0
- package/resources/jobs.mjs +27 -0
- package/resources/jobs.mjs.map +1 -0
- package/resources/models/description.d.mts +490 -0
- package/resources/models/description.d.mts.map +1 -0
- package/resources/models/description.d.ts +490 -0
- package/resources/models/description.d.ts.map +1 -0
- package/resources/models/description.js +27 -0
- package/resources/models/description.js.map +1 -0
- package/resources/models/description.mjs +23 -0
- package/resources/models/description.mjs.map +1 -0
- package/resources/models/examples.d.mts +2819 -0
- package/resources/models/examples.d.mts.map +1 -0
- package/resources/models/examples.d.ts +2819 -0
- package/resources/models/examples.d.ts.map +1 -0
- package/resources/models/examples.js +27 -0
- package/resources/models/examples.js.map +1 -0
- package/resources/models/examples.mjs +23 -0
- package/resources/models/examples.mjs.map +1 -0
- package/resources/models/index.d.mts +6 -0
- package/resources/models/index.d.mts.map +1 -0
- package/resources/models/index.d.ts +6 -0
- package/resources/models/index.d.ts.map +1 -0
- package/resources/models/index.js +15 -0
- package/resources/models/index.js.map +1 -0
- package/resources/models/index.mjs +7 -0
- package/resources/models/index.mjs.map +1 -0
- package/resources/models/models.d.mts +6676 -0
- package/resources/models/models.d.mts.map +1 -0
- package/resources/models/models.d.ts +6676 -0
- package/resources/models/models.d.ts.map +1 -0
- package/resources/models/models.js +107 -0
- package/resources/models/models.js.map +1 -0
- package/resources/models/models.mjs +102 -0
- package/resources/models/models.mjs.map +1 -0
- package/resources/models/train.d.mts +2334 -0
- package/resources/models/train.d.mts.map +1 -0
- package/resources/models/train.d.ts +2334 -0
- package/resources/models/train.d.ts.map +1 -0
- package/resources/models/train.js +27 -0
- package/resources/models/train.js.map +1 -0
- package/resources/models/train.mjs +23 -0
- package/resources/models/train.mjs.map +1 -0
- package/resources/models/training-images.d.mts +214 -0
- package/resources/models/training-images.d.mts.map +1 -0
- package/resources/models/training-images.d.ts +214 -0
- package/resources/models/training-images.d.ts.map +1 -0
- package/resources/models/training-images.js +46 -0
- package/resources/models/training-images.js.map +1 -0
- package/resources/models/training-images.mjs +42 -0
- package/resources/models/training-images.mjs.map +1 -0
- package/resources/models.d.mts +2 -0
- package/resources/models.d.mts.map +1 -0
- package/resources/models.d.ts +2 -0
- package/resources/models.d.ts.map +1 -0
- package/resources/models.js +6 -0
- package/resources/models.js.map +1 -0
- package/resources/models.mjs +3 -0
- package/resources/models.mjs.map +1 -0
- package/resources/oscu.d.mts +25 -0
- package/resources/oscu.d.mts.map +1 -0
- package/resources/oscu.d.ts +25 -0
- package/resources/oscu.d.ts.map +1 -0
- package/resources/oscu.js +16 -0
- package/resources/oscu.js.map +1 -0
- package/resources/oscu.mjs +12 -0
- package/resources/oscu.mjs.map +1 -0
- package/resources/search.d.mts +595 -0
- package/resources/search.d.mts.map +1 -0
- package/resources/search.d.ts +595 -0
- package/resources/search.d.ts.map +1 -0
- package/resources/search.js +29 -0
- package/resources/search.js.map +1 -0
- package/resources/search.mjs +25 -0
- package/resources/search.mjs.map +1 -0
- package/resources/tags.d.mts +55 -0
- package/resources/tags.d.mts.map +1 -0
- package/resources/tags.d.ts +55 -0
- package/resources/tags.d.ts.map +1 -0
- package/resources/tags.js +15 -0
- package/resources/tags.js.map +1 -0
- package/resources/tags.mjs +11 -0
- package/resources/tags.mjs.map +1 -0
- package/resources/uploads.d.mts +250 -0
- package/resources/uploads.d.mts.map +1 -0
- package/resources/uploads.d.ts +250 -0
- package/resources/uploads.d.ts.map +1 -0
- package/resources/uploads.js +29 -0
- package/resources/uploads.js.map +1 -0
- package/resources/uploads.mjs +25 -0
- package/resources/uploads.mjs.map +1 -0
- package/resources/usages.d.mts +760 -0
- package/resources/usages.d.mts.map +1 -0
- package/resources/usages.d.ts +760 -0
- package/resources/usages.d.ts.map +1 -0
- package/resources/usages.js +17 -0
- package/resources/usages.js.map +1 -0
- package/resources/usages.mjs +13 -0
- package/resources/usages.mjs.map +1 -0
- package/resources/workflows.d.mts +4539 -0
- package/resources/workflows.d.mts.map +1 -0
- package/resources/workflows.d.ts +4539 -0
- package/resources/workflows.d.ts.map +1 -0
- package/resources/workflows.js +64 -0
- package/resources/workflows.js.map +1 -0
- package/resources/workflows.mjs +60 -0
- package/resources/workflows.mjs.map +1 -0
- package/resources.d.mts +2 -0
- package/resources.d.mts.map +1 -0
- package/resources.d.ts +2 -0
- package/resources.d.ts.map +1 -0
- package/resources.js +5 -0
- package/resources.js.map +1 -0
- package/resources.mjs +2 -0
- package/resources.mjs.map +1 -0
- package/src/api-promise.ts +2 -0
- package/src/client.ts +999 -0
- package/src/core/README.md +3 -0
- package/src/core/api-promise.ts +92 -0
- package/src/core/error.ts +130 -0
- package/src/core/resource.ts +11 -0
- package/src/core/uploads.ts +2 -0
- package/src/error.ts +2 -0
- package/src/index.ts +22 -0
- package/src/internal/README.md +3 -0
- package/src/internal/builtin-types.ts +93 -0
- package/src/internal/detect-platform.ts +196 -0
- package/src/internal/errors.ts +33 -0
- package/src/internal/headers.ts +97 -0
- package/src/internal/parse.ts +56 -0
- package/src/internal/qs/LICENSE.md +13 -0
- package/src/internal/qs/README.md +3 -0
- package/src/internal/qs/formats.ts +10 -0
- package/src/internal/qs/index.ts +13 -0
- package/src/internal/qs/stringify.ts +385 -0
- package/src/internal/qs/types.ts +71 -0
- package/src/internal/qs/utils.ts +265 -0
- package/src/internal/request-options.ts +91 -0
- package/src/internal/shim-types.ts +26 -0
- package/src/internal/shims.ts +107 -0
- package/src/internal/to-file.ts +154 -0
- package/src/internal/types.ts +95 -0
- package/src/internal/uploads.ts +187 -0
- package/src/internal/utils/base64.ts +40 -0
- package/src/internal/utils/bytes.ts +32 -0
- package/src/internal/utils/env.ts +18 -0
- package/src/internal/utils/log.ts +126 -0
- package/src/internal/utils/path.ts +88 -0
- package/src/internal/utils/query.ts +7 -0
- package/src/internal/utils/sleep.ts +3 -0
- package/src/internal/utils/uuid.ts +17 -0
- package/src/internal/utils/values.ts +105 -0
- package/src/internal/utils.ts +9 -0
- package/src/lib/.keep +4 -0
- package/src/resource.ts +2 -0
- package/src/resources/assets/assets.ts +9939 -0
- package/src/resources/assets/download.ts +138 -0
- package/src/resources/assets/index.ts +41 -0
- package/src/resources/assets/public.ts +2329 -0
- package/src/resources/assets.ts +3 -0
- package/src/resources/collections/assets.ts +163 -0
- package/src/resources/collections/collections.ts +357 -0
- package/src/resources/collections/index.ts +27 -0
- package/src/resources/collections/models.ts +163 -0
- package/src/resources/collections.ts +3 -0
- package/src/resources/generate.ts +5478 -0
- package/src/resources/index.ts +122 -0
- package/src/resources/jobs.ts +1712 -0
- package/src/resources/models/description.ts +800 -0
- package/src/resources/models/examples.ts +4125 -0
- package/src/resources/models/index.ts +58 -0
- package/src/resources/models/models.ts +8619 -0
- package/src/resources/models/train.ts +3034 -0
- package/src/resources/models/training-images.ts +304 -0
- package/src/resources/models.ts +3 -0
- package/src/resources/oscu.ts +35 -0
- package/src/resources/search.ts +731 -0
- package/src/resources/tags.ts +69 -0
- package/src/resources/uploads.ts +369 -0
- package/src/resources/usages.ts +1242 -0
- package/src/resources/workflows.ts +6019 -0
- package/src/resources.ts +1 -0
- package/src/tsconfig.json +11 -0
- package/src/uploads.ts +2 -0
- package/src/version.ts +1 -0
- package/uploads.d.mts +2 -0
- package/uploads.d.mts.map +1 -0
- package/uploads.d.ts +2 -0
- package/uploads.d.ts.map +1 -0
- package/uploads.js +6 -0
- package/uploads.js.map +1 -0
- package/uploads.mjs +2 -0
- package/uploads.mjs.map +1 -0
- package/version.d.mts +2 -0
- package/version.d.mts.map +1 -0
- package/version.d.ts +2 -0
- package/version.d.ts.map +1 -0
- package/version.js +5 -0
- package/version.js.map +1 -0
- package/version.mjs +2 -0
- package/version.mjs.map +1 -0
|
@@ -0,0 +1,4539 @@
|
|
|
1
|
+
import { APIResource } from "../core/resource.js";
|
|
2
|
+
import { APIPromise } from "../core/api-promise.js";
|
|
3
|
+
import { RequestOptions } from "../internal/request-options.js";
|
|
4
|
+
export declare class Workflows extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* Create workflow
|
|
7
|
+
*/
|
|
8
|
+
create(body: WorkflowCreateParams, options?: RequestOptions): APIPromise<WorkflowCreateResponse>;
|
|
9
|
+
/**
|
|
10
|
+
* Get workflow by ID
|
|
11
|
+
*/
|
|
12
|
+
retrieve(workflowID: string, options?: RequestOptions): APIPromise<WorkflowRetrieveResponse>;
|
|
13
|
+
/**
|
|
14
|
+
* Update workflow
|
|
15
|
+
*/
|
|
16
|
+
update(workflowID: string, body: WorkflowUpdateParams, options?: RequestOptions): APIPromise<WorkflowUpdateResponse>;
|
|
17
|
+
/**
|
|
18
|
+
* List workflows
|
|
19
|
+
*/
|
|
20
|
+
list(query?: WorkflowListParams | null | undefined, options?: RequestOptions): APIPromise<WorkflowListResponse>;
|
|
21
|
+
/**
|
|
22
|
+
* Delete workflow
|
|
23
|
+
*/
|
|
24
|
+
delete(workflowID: string, options?: RequestOptions): APIPromise<unknown>;
|
|
25
|
+
/**
|
|
26
|
+
* Approve a user approval node in a workflow
|
|
27
|
+
*/
|
|
28
|
+
approveUser(workflowID: string, body: WorkflowApproveUserParams, options?: RequestOptions): APIPromise<WorkflowApproveUserResponse>;
|
|
29
|
+
/**
|
|
30
|
+
* Get all unique tags from workflows in a project (all privacy levels). Optionally
|
|
31
|
+
* filter by status.
|
|
32
|
+
*/
|
|
33
|
+
getTags(query?: WorkflowGetTagsParams | null | undefined, options?: RequestOptions): APIPromise<WorkflowGetTagsResponse>;
|
|
34
|
+
/**
|
|
35
|
+
* Run a workflow
|
|
36
|
+
*/
|
|
37
|
+
run(workflowID: string, params: WorkflowRunParams, options?: RequestOptions): APIPromise<WorkflowRunResponse>;
|
|
38
|
+
}
|
|
39
|
+
export interface WorkflowCreateResponse {
|
|
40
|
+
workflow: WorkflowCreateResponse.Workflow;
|
|
41
|
+
}
|
|
42
|
+
export declare namespace WorkflowCreateResponse {
|
|
43
|
+
interface Workflow {
|
|
44
|
+
id: string;
|
|
45
|
+
authorId: string;
|
|
46
|
+
/**
|
|
47
|
+
* ISO string
|
|
48
|
+
*/
|
|
49
|
+
createdAt: string;
|
|
50
|
+
/**
|
|
51
|
+
* The description of the workflow.
|
|
52
|
+
*/
|
|
53
|
+
description: string;
|
|
54
|
+
/**
|
|
55
|
+
* The UI data about the workflow. This is managed by scenario webapp.
|
|
56
|
+
*/
|
|
57
|
+
editorInfo: unknown;
|
|
58
|
+
/**
|
|
59
|
+
* The flow of the workflow.
|
|
60
|
+
*/
|
|
61
|
+
flow: Array<Workflow.Flow>;
|
|
62
|
+
/**
|
|
63
|
+
* The inputs of the workflow.
|
|
64
|
+
*/
|
|
65
|
+
inputs: Array<Workflow.Input>;
|
|
66
|
+
name: string;
|
|
67
|
+
ownerId: string;
|
|
68
|
+
privacy: 'private' | 'public' | 'unlisted';
|
|
69
|
+
status: 'deleted' | 'draft' | 'ready';
|
|
70
|
+
/**
|
|
71
|
+
* The tag set of the workflow.
|
|
72
|
+
*/
|
|
73
|
+
tagSet: Array<string>;
|
|
74
|
+
/**
|
|
75
|
+
* ISO string
|
|
76
|
+
*/
|
|
77
|
+
updatedAt: string;
|
|
78
|
+
/**
|
|
79
|
+
* A representation of an asset after being processed by the workflow
|
|
80
|
+
*/
|
|
81
|
+
after?: Workflow.After;
|
|
82
|
+
/**
|
|
83
|
+
* A representation of an asset before being processed by the workflow
|
|
84
|
+
*/
|
|
85
|
+
before?: Workflow.Before;
|
|
86
|
+
outputAssetKinds?: Array<'3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'video'>;
|
|
87
|
+
shortDescription?: string;
|
|
88
|
+
/**
|
|
89
|
+
* Currently the thumbnail is identical to the after asset.
|
|
90
|
+
*/
|
|
91
|
+
thumbnail?: Workflow.Thumbnail;
|
|
92
|
+
/**
|
|
93
|
+
* The UI configuration for the workflow. This is managed by scenario webapp.
|
|
94
|
+
*/
|
|
95
|
+
uiConfig?: Workflow.UiConfig;
|
|
96
|
+
}
|
|
97
|
+
namespace Workflow {
|
|
98
|
+
interface Flow {
|
|
99
|
+
/**
|
|
100
|
+
* The id of the node.
|
|
101
|
+
*/
|
|
102
|
+
id: string;
|
|
103
|
+
/**
|
|
104
|
+
* The type of the job for the node.
|
|
105
|
+
*/
|
|
106
|
+
type: 'custom-model' | 'generate-prompt' | 'logic' | 'remove-background' | 'transform' | 'user-approval' | 'workflow';
|
|
107
|
+
/**
|
|
108
|
+
* The nodes that this node depends on. Only available for nodes that have
|
|
109
|
+
* dependencies. Mainly used for user approval nodes.
|
|
110
|
+
*/
|
|
111
|
+
dependsOn?: Array<string>;
|
|
112
|
+
/**
|
|
113
|
+
* The inputs of the node.
|
|
114
|
+
*/
|
|
115
|
+
inputs?: Array<Flow.Input>;
|
|
116
|
+
/**
|
|
117
|
+
* The logic of the node. Only available for logic nodes.
|
|
118
|
+
*/
|
|
119
|
+
logic?: Flow.Logic;
|
|
120
|
+
/**
|
|
121
|
+
* The type of the logic for the node. Only available for logic nodes.
|
|
122
|
+
*/
|
|
123
|
+
logicType?: 'if-else';
|
|
124
|
+
/**
|
|
125
|
+
* The model id for the node. Mainly used for custom model tasks.
|
|
126
|
+
*/
|
|
127
|
+
modelId?: string;
|
|
128
|
+
/**
|
|
129
|
+
* The workflow id for the node. Mainly used for workflow tasks.
|
|
130
|
+
*/
|
|
131
|
+
workflowId?: string;
|
|
132
|
+
}
|
|
133
|
+
namespace Flow {
|
|
134
|
+
/**
|
|
135
|
+
* This is used to run the flow.
|
|
136
|
+
*/
|
|
137
|
+
interface Input {
|
|
138
|
+
/**
|
|
139
|
+
* The name that must be user to call the model through the API
|
|
140
|
+
*/
|
|
141
|
+
name: string;
|
|
142
|
+
/**
|
|
143
|
+
* The data type of the input
|
|
144
|
+
*/
|
|
145
|
+
type: 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array';
|
|
146
|
+
/**
|
|
147
|
+
* The allowed values for the input. For \`string\` or \`number\` types, creates a
|
|
148
|
+
* single-select dropdown. For \`string_array\` type, creates a multi-select
|
|
149
|
+
* dropdown.
|
|
150
|
+
*/
|
|
151
|
+
allowedValues?: Array<unknown>;
|
|
152
|
+
/**
|
|
153
|
+
* Specifies the background behavior for the input. Only available for \`file\` and
|
|
154
|
+
* \`file_array\` input types with kind \`image\`.
|
|
155
|
+
*/
|
|
156
|
+
backgroundBehavior?: 'opaque' | 'transparent';
|
|
157
|
+
/**
|
|
158
|
+
* Whether the input is a color or not. Only available for \`string\` input type.
|
|
159
|
+
*/
|
|
160
|
+
color?: boolean;
|
|
161
|
+
/**
|
|
162
|
+
* Whether this input affects the model's cost calculation
|
|
163
|
+
*/
|
|
164
|
+
costImpact?: boolean;
|
|
165
|
+
/**
|
|
166
|
+
* Help text displayed in the UI to provide additional information about the input
|
|
167
|
+
*/
|
|
168
|
+
description?: string;
|
|
169
|
+
/**
|
|
170
|
+
* Used to visually group inputs together in the UI. Inputs with the same group
|
|
171
|
+
* value appear consecutively in the UI.
|
|
172
|
+
*/
|
|
173
|
+
group?: string;
|
|
174
|
+
/**
|
|
175
|
+
* Hint text displayed in the UI as a tooltip to guide the user
|
|
176
|
+
*/
|
|
177
|
+
hint?: string;
|
|
178
|
+
/**
|
|
179
|
+
* The list of inputs which form an object within a container array. All inputs are
|
|
180
|
+
* the same as the current object. This is only available for type inputs_array
|
|
181
|
+
* inputs.
|
|
182
|
+
*/
|
|
183
|
+
inputs?: Array<unknown>;
|
|
184
|
+
/**
|
|
185
|
+
* The asset kind of the input. Only taken into account for \`file\` and
|
|
186
|
+
* \`file_array\` input types.
|
|
187
|
+
*/
|
|
188
|
+
kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'video';
|
|
189
|
+
/**
|
|
190
|
+
* The label displayed in the UI for this input
|
|
191
|
+
*/
|
|
192
|
+
label?: string;
|
|
193
|
+
/**
|
|
194
|
+
* The name of the file input field to use as the mask source
|
|
195
|
+
*/
|
|
196
|
+
maskFrom?: string;
|
|
197
|
+
/**
|
|
198
|
+
* The maximum allowed value. Only available for \`number\` and \`array\` input
|
|
199
|
+
* types.
|
|
200
|
+
*/
|
|
201
|
+
max?: number;
|
|
202
|
+
/**
|
|
203
|
+
* The maximum allowed length for \`string\` inputs. Also applies to each item in
|
|
204
|
+
* \`string_array\`.
|
|
205
|
+
*/
|
|
206
|
+
maxLength?: number;
|
|
207
|
+
/**
|
|
208
|
+
* The minimum allowed value. Only available for \`number\` and array input types.
|
|
209
|
+
*/
|
|
210
|
+
min?: number;
|
|
211
|
+
/**
|
|
212
|
+
* The minimum allowed length for string inputs. Also applies to each item in
|
|
213
|
+
* \`string_array\`.
|
|
214
|
+
*/
|
|
215
|
+
minLength?: number;
|
|
216
|
+
/**
|
|
217
|
+
* The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only
|
|
218
|
+
* available for \`model_array\` input type.
|
|
219
|
+
*/
|
|
220
|
+
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'>;
|
|
221
|
+
/**
|
|
222
|
+
* Whether this input represents a parent asset to assign to the produced assets.
|
|
223
|
+
* Only available for \`file\` and \`file_array\` input types.
|
|
224
|
+
*
|
|
225
|
+
* For \`file_array\`, the parent asset is the first item in the array.
|
|
226
|
+
*/
|
|
227
|
+
parent?: boolean;
|
|
228
|
+
/**
|
|
229
|
+
* Placeholder text for the input. Only available for 'string' input type.
|
|
230
|
+
*/
|
|
231
|
+
placeholder?: string;
|
|
232
|
+
/**
|
|
233
|
+
* Whether the input is a prompt. When true, displays as a text area with prompt
|
|
234
|
+
* spark feature. Only available for \`string\` input type.
|
|
235
|
+
*/
|
|
236
|
+
prompt?: boolean;
|
|
237
|
+
/**
|
|
238
|
+
* Whether the input is used with prompt spark. Only available for \`string\` input
|
|
239
|
+
* type.
|
|
240
|
+
*/
|
|
241
|
+
promptSpark?: boolean;
|
|
242
|
+
/**
|
|
243
|
+
* The reference to another input or output of the same workflow. Must have at
|
|
244
|
+
* least one of node or conditional.
|
|
245
|
+
*/
|
|
246
|
+
ref?: Input.Ref;
|
|
247
|
+
/**
|
|
248
|
+
* Set of rules that describes when this input is required:
|
|
249
|
+
*
|
|
250
|
+
* - \`always\`: Input is always required
|
|
251
|
+
* - \`ifNotDefined\`: Input is required when another specified input is not
|
|
252
|
+
* defined
|
|
253
|
+
* - \`ifDefined\`: Input is required when another specified input is defined
|
|
254
|
+
* - \`conditionalValues\`: Input is required when another input has a specific
|
|
255
|
+
* value
|
|
256
|
+
*
|
|
257
|
+
* By default, the input is not required.
|
|
258
|
+
*/
|
|
259
|
+
required?: Input.Required;
|
|
260
|
+
/**
|
|
261
|
+
* The step increment for numeric inputs. Only available for \`number\` input type.
|
|
262
|
+
*/
|
|
263
|
+
step?: number;
|
|
264
|
+
}
|
|
265
|
+
namespace Input {
|
|
266
|
+
/**
|
|
267
|
+
* The reference to another input or output of the same workflow. Must have at
|
|
268
|
+
* least one of node or conditional.
|
|
269
|
+
*/
|
|
270
|
+
interface Ref {
|
|
271
|
+
/**
|
|
272
|
+
* The conditional nodes to reference. If the conditional nodes are successful, the
|
|
273
|
+
* node will be successful. If the conditional nodes are skipped, the node will be
|
|
274
|
+
* skipped. Contains an array of node ids used to check the status of the nodes.
|
|
275
|
+
*/
|
|
276
|
+
conditional?: Array<string>;
|
|
277
|
+
/**
|
|
278
|
+
* This is the desired node output value if ref is an if/else node.
|
|
279
|
+
*/
|
|
280
|
+
equal?: string;
|
|
281
|
+
/**
|
|
282
|
+
* The name of the input or output to reference. If the type is 'workflow', the
|
|
283
|
+
* name is the name of the input of the workflow is required If the type is 'node',
|
|
284
|
+
* the name is not mandatory, except if you want all outputs of the node. To get
|
|
285
|
+
* all outputs of a node, you can use the name 'all'.
|
|
286
|
+
*/
|
|
287
|
+
name?: string;
|
|
288
|
+
/**
|
|
289
|
+
* The node id or 'workflow' if the source is a workflow input.
|
|
290
|
+
*/
|
|
291
|
+
node?: string;
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* Set of rules that describes when this input is required:
|
|
295
|
+
*
|
|
296
|
+
* - \`always\`: Input is always required
|
|
297
|
+
* - \`ifNotDefined\`: Input is required when another specified input is not
|
|
298
|
+
* defined
|
|
299
|
+
* - \`ifDefined\`: Input is required when another specified input is defined
|
|
300
|
+
* - \`conditionalValues\`: Input is required when another input has a specific
|
|
301
|
+
* value
|
|
302
|
+
*
|
|
303
|
+
* By default, the input is not required.
|
|
304
|
+
*/
|
|
305
|
+
interface Required {
|
|
306
|
+
/**
|
|
307
|
+
* Whether the input is always required
|
|
308
|
+
*/
|
|
309
|
+
always?: boolean;
|
|
310
|
+
/**
|
|
311
|
+
* Makes this input required when another input has a specific value:
|
|
312
|
+
*
|
|
313
|
+
* - Key: name of the input to check
|
|
314
|
+
* - Value: operation and allowed values that trigger the requirement
|
|
315
|
+
*/
|
|
316
|
+
conditionalValues?: unknown;
|
|
317
|
+
/**
|
|
318
|
+
* Makes this input required when another input is defined:
|
|
319
|
+
*
|
|
320
|
+
* - Key: name of the input that must be defined
|
|
321
|
+
* - Value: message to display when this input is required
|
|
322
|
+
*/
|
|
323
|
+
ifDefined?: unknown;
|
|
324
|
+
/**
|
|
325
|
+
* Makes this input required when another input is not defined:
|
|
326
|
+
*
|
|
327
|
+
* - Key: name of the input that must be undefined
|
|
328
|
+
* - Value: message to display when this input is required
|
|
329
|
+
*/
|
|
330
|
+
ifNotDefined?: unknown;
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* The logic of the node. Only available for logic nodes.
|
|
335
|
+
*/
|
|
336
|
+
interface Logic {
|
|
337
|
+
/**
|
|
338
|
+
* The cases of the logic. Only available for if/else nodes.
|
|
339
|
+
*/
|
|
340
|
+
cases?: Array<Logic.Case>;
|
|
341
|
+
/**
|
|
342
|
+
* The default case of the logic. Contains the id/output of the node to execute if
|
|
343
|
+
* no case is matched. Only available for if/else nodes.
|
|
344
|
+
*/
|
|
345
|
+
default?: string;
|
|
346
|
+
/**
|
|
347
|
+
* The transform of the logic. Only available for transform nodes.
|
|
348
|
+
*/
|
|
349
|
+
transform?: string;
|
|
350
|
+
}
|
|
351
|
+
namespace Logic {
|
|
352
|
+
interface Case {
|
|
353
|
+
condition: string;
|
|
354
|
+
value: string;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
/**
|
|
359
|
+
* Defines the input parameters for a model. Use this to understand the available
|
|
360
|
+
* input parameters for a given `modelId` when calling
|
|
361
|
+
* `POST /generate/custom/{modelId}`. See {@link
|
|
362
|
+
* https://docs.scenario.com/docs/video-generation} for examples.
|
|
363
|
+
*/
|
|
364
|
+
interface Input {
|
|
365
|
+
/**
|
|
366
|
+
* The name that must be user to call the model through the API
|
|
367
|
+
*/
|
|
368
|
+
name: string;
|
|
369
|
+
/**
|
|
370
|
+
* The data type of the input
|
|
371
|
+
*/
|
|
372
|
+
type: 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array';
|
|
373
|
+
/**
|
|
374
|
+
* The allowed values for the input. For \`string\` or \`number\` types, creates a
|
|
375
|
+
* single-select dropdown. For \`string_array\` type, creates a multi-select
|
|
376
|
+
* dropdown.
|
|
377
|
+
*/
|
|
378
|
+
allowedValues?: Array<unknown>;
|
|
379
|
+
/**
|
|
380
|
+
* Specifies the background behavior for the input. Only available for \`file\` and
|
|
381
|
+
* \`file_array\` input types with kind \`image\`.
|
|
382
|
+
*/
|
|
383
|
+
backgroundBehavior?: 'opaque' | 'transparent';
|
|
384
|
+
/**
|
|
385
|
+
* Whether the input is a color or not. Only available for \`string\` input type.
|
|
386
|
+
*/
|
|
387
|
+
color?: boolean;
|
|
388
|
+
/**
|
|
389
|
+
* Whether this input affects the model's cost calculation
|
|
390
|
+
*/
|
|
391
|
+
costImpact?: boolean;
|
|
392
|
+
/**
|
|
393
|
+
* Help text displayed in the UI to provide additional information about the input
|
|
394
|
+
*/
|
|
395
|
+
description?: string;
|
|
396
|
+
/**
|
|
397
|
+
* Used to visually group inputs together in the UI. Inputs with the same group
|
|
398
|
+
* value appear consecutively in the UI.
|
|
399
|
+
*/
|
|
400
|
+
group?: string;
|
|
401
|
+
/**
|
|
402
|
+
* Hint text displayed in the UI as a tooltip to guide the user
|
|
403
|
+
*/
|
|
404
|
+
hint?: string;
|
|
405
|
+
/**
|
|
406
|
+
* The list of inputs which form an object within a container array. All inputs are
|
|
407
|
+
* the same as the current object. This is only available for type inputs_array
|
|
408
|
+
* inputs.
|
|
409
|
+
*/
|
|
410
|
+
inputs?: Array<unknown>;
|
|
411
|
+
/**
|
|
412
|
+
* The asset kind of the input. Only taken into account for \`file\` and
|
|
413
|
+
* \`file_array\` input types.
|
|
414
|
+
*/
|
|
415
|
+
kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'video';
|
|
416
|
+
/**
|
|
417
|
+
* The label displayed in the UI for this input
|
|
418
|
+
*/
|
|
419
|
+
label?: string;
|
|
420
|
+
/**
|
|
421
|
+
* The name of the file input field to use as the mask source
|
|
422
|
+
*/
|
|
423
|
+
maskFrom?: string;
|
|
424
|
+
/**
|
|
425
|
+
* The maximum allowed value. Only available for \`number\` and \`array\` input
|
|
426
|
+
* types.
|
|
427
|
+
*/
|
|
428
|
+
max?: number;
|
|
429
|
+
/**
|
|
430
|
+
* The maximum allowed length for \`string\` inputs. Also applies to each item in
|
|
431
|
+
* \`string_array\`.
|
|
432
|
+
*/
|
|
433
|
+
maxLength?: number;
|
|
434
|
+
/**
|
|
435
|
+
* The minimum allowed value. Only available for \`number\` and array input types.
|
|
436
|
+
*/
|
|
437
|
+
min?: number;
|
|
438
|
+
/**
|
|
439
|
+
* The minimum allowed length for string inputs. Also applies to each item in
|
|
440
|
+
* \`string_array\`.
|
|
441
|
+
*/
|
|
442
|
+
minLength?: number;
|
|
443
|
+
/**
|
|
444
|
+
* The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only
|
|
445
|
+
* available for \`model_array\` input type.
|
|
446
|
+
*/
|
|
447
|
+
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'>;
|
|
448
|
+
/**
|
|
449
|
+
* Whether this input represents a parent asset to assign to the produced assets.
|
|
450
|
+
* Only available for \`file\` and \`file_array\` input types.
|
|
451
|
+
*
|
|
452
|
+
* For \`file_array\`, the parent asset is the first item in the array.
|
|
453
|
+
*/
|
|
454
|
+
parent?: boolean;
|
|
455
|
+
/**
|
|
456
|
+
* Placeholder text for the input. Only available for 'string' input type.
|
|
457
|
+
*/
|
|
458
|
+
placeholder?: string;
|
|
459
|
+
/**
|
|
460
|
+
* Whether the input is a prompt. When true, displays as a text area with prompt
|
|
461
|
+
* spark feature. Only available for \`string\` input type.
|
|
462
|
+
*/
|
|
463
|
+
prompt?: boolean;
|
|
464
|
+
/**
|
|
465
|
+
* Whether the input is used with prompt spark. Only available for \`string\` input
|
|
466
|
+
* type.
|
|
467
|
+
*/
|
|
468
|
+
promptSpark?: boolean;
|
|
469
|
+
/**
|
|
470
|
+
* Set of rules that describes when this input is required:
|
|
471
|
+
*
|
|
472
|
+
* - \`always\`: Input is always required
|
|
473
|
+
* - \`ifNotDefined\`: Input is required when another specified input is not
|
|
474
|
+
* defined
|
|
475
|
+
* - \`ifDefined\`: Input is required when another specified input is defined
|
|
476
|
+
* - \`conditionalValues\`: Input is required when another input has a specific
|
|
477
|
+
* value
|
|
478
|
+
*
|
|
479
|
+
* By default, the input is not required.
|
|
480
|
+
*/
|
|
481
|
+
required?: Input.Required;
|
|
482
|
+
/**
|
|
483
|
+
* The step increment for numeric inputs. Only available for \`number\` input type.
|
|
484
|
+
*/
|
|
485
|
+
step?: number;
|
|
486
|
+
}
|
|
487
|
+
namespace Input {
|
|
488
|
+
/**
|
|
489
|
+
* Set of rules that describes when this input is required:
|
|
490
|
+
*
|
|
491
|
+
* - \`always\`: Input is always required
|
|
492
|
+
* - \`ifNotDefined\`: Input is required when another specified input is not
|
|
493
|
+
* defined
|
|
494
|
+
* - \`ifDefined\`: Input is required when another specified input is defined
|
|
495
|
+
* - \`conditionalValues\`: Input is required when another input has a specific
|
|
496
|
+
* value
|
|
497
|
+
*
|
|
498
|
+
* By default, the input is not required.
|
|
499
|
+
*/
|
|
500
|
+
interface Required {
|
|
501
|
+
/**
|
|
502
|
+
* Whether the input is always required
|
|
503
|
+
*/
|
|
504
|
+
always?: boolean;
|
|
505
|
+
/**
|
|
506
|
+
* Makes this input required when another input has a specific value:
|
|
507
|
+
*
|
|
508
|
+
* - Key: name of the input to check
|
|
509
|
+
* - Value: operation and allowed values that trigger the requirement
|
|
510
|
+
*/
|
|
511
|
+
conditionalValues?: unknown;
|
|
512
|
+
/**
|
|
513
|
+
* Makes this input required when another input is defined:
|
|
514
|
+
*
|
|
515
|
+
* - Key: name of the input that must be defined
|
|
516
|
+
* - Value: message to display when this input is required
|
|
517
|
+
*/
|
|
518
|
+
ifDefined?: unknown;
|
|
519
|
+
/**
|
|
520
|
+
* Makes this input required when another input is not defined:
|
|
521
|
+
*
|
|
522
|
+
* - Key: name of the input that must be undefined
|
|
523
|
+
* - Value: message to display when this input is required
|
|
524
|
+
*/
|
|
525
|
+
ifNotDefined?: unknown;
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
/**
|
|
529
|
+
* A representation of an asset after being processed by the workflow
|
|
530
|
+
*/
|
|
531
|
+
interface After {
|
|
532
|
+
/**
|
|
533
|
+
* The AssetId of the image used as a thumbnail for your model (example:
|
|
534
|
+
* "asset_GTrL3mq4SXWyMxkOHRxlpw")
|
|
535
|
+
*/
|
|
536
|
+
assetId: string;
|
|
537
|
+
/**
|
|
538
|
+
* The url of the image used as a thumbnail for your model
|
|
539
|
+
*/
|
|
540
|
+
url: string;
|
|
541
|
+
}
|
|
542
|
+
/**
|
|
543
|
+
* A representation of an asset before being processed by the workflow
|
|
544
|
+
*/
|
|
545
|
+
interface Before {
|
|
546
|
+
/**
|
|
547
|
+
* The AssetId of the image used as a thumbnail for your model (example:
|
|
548
|
+
* "asset_GTrL3mq4SXWyMxkOHRxlpw")
|
|
549
|
+
*/
|
|
550
|
+
assetId: string;
|
|
551
|
+
/**
|
|
552
|
+
* The url of the image used as a thumbnail for your model
|
|
553
|
+
*/
|
|
554
|
+
url: string;
|
|
555
|
+
}
|
|
556
|
+
/**
|
|
557
|
+
* Currently the thumbnail is identical to the after asset.
|
|
558
|
+
*/
|
|
559
|
+
interface Thumbnail {
|
|
560
|
+
assetId: string;
|
|
561
|
+
url: string;
|
|
562
|
+
}
|
|
563
|
+
/**
|
|
564
|
+
* The UI configuration for the workflow. This is managed by scenario webapp.
|
|
565
|
+
*/
|
|
566
|
+
interface UiConfig {
|
|
567
|
+
/**
|
|
568
|
+
* Configuration for the input properties
|
|
569
|
+
*/
|
|
570
|
+
inputProperties?: {
|
|
571
|
+
[key: string]: UiConfig.InputProperties;
|
|
572
|
+
};
|
|
573
|
+
/**
|
|
574
|
+
* Configuration for the loras component
|
|
575
|
+
*/
|
|
576
|
+
lorasComponent?: UiConfig.LorasComponent;
|
|
577
|
+
/**
|
|
578
|
+
* Configuration for the presets
|
|
579
|
+
*/
|
|
580
|
+
presets?: Array<UiConfig.Preset>;
|
|
581
|
+
/**
|
|
582
|
+
* Configuration for the resolution component
|
|
583
|
+
*/
|
|
584
|
+
resolutionComponent?: UiConfig.ResolutionComponent;
|
|
585
|
+
/**
|
|
586
|
+
* Configuration for the selects
|
|
587
|
+
*/
|
|
588
|
+
selects?: {
|
|
589
|
+
[key: string]: unknown;
|
|
590
|
+
};
|
|
591
|
+
/**
|
|
592
|
+
* Configuration for the trigger generate button
|
|
593
|
+
*/
|
|
594
|
+
triggerGenerate?: UiConfig.TriggerGenerate;
|
|
595
|
+
}
|
|
596
|
+
namespace UiConfig {
|
|
597
|
+
interface InputProperties {
|
|
598
|
+
collapsed?: boolean;
|
|
599
|
+
}
|
|
600
|
+
/**
|
|
601
|
+
* Configuration for the loras component
|
|
602
|
+
*/
|
|
603
|
+
interface LorasComponent {
|
|
604
|
+
/**
|
|
605
|
+
* The label of the component
|
|
606
|
+
*/
|
|
607
|
+
label: string;
|
|
608
|
+
/**
|
|
609
|
+
* The input name of the model (model_array)
|
|
610
|
+
*/
|
|
611
|
+
modelInput: string;
|
|
612
|
+
/**
|
|
613
|
+
* The input name of the scale (number_array)
|
|
614
|
+
*/
|
|
615
|
+
scaleInput: string;
|
|
616
|
+
/**
|
|
617
|
+
* The input model id (example: a composition or a single LoRA modelId) If
|
|
618
|
+
* specified, the model id will be attached to the output asset as a metadata If
|
|
619
|
+
* the model-decomposer parser is specified on it, modelInput and scaleInput will
|
|
620
|
+
* be automatically populated
|
|
621
|
+
*/
|
|
622
|
+
modelIdInput?: string;
|
|
623
|
+
}
|
|
624
|
+
interface Preset {
|
|
625
|
+
fields: Array<string>;
|
|
626
|
+
presets: unknown;
|
|
627
|
+
}
|
|
628
|
+
/**
|
|
629
|
+
* Configuration for the resolution component
|
|
630
|
+
*/
|
|
631
|
+
interface ResolutionComponent {
|
|
632
|
+
/**
|
|
633
|
+
* The input name of the height
|
|
634
|
+
*/
|
|
635
|
+
heightInput: string;
|
|
636
|
+
/**
|
|
637
|
+
* The label of the component
|
|
638
|
+
*/
|
|
639
|
+
label: string;
|
|
640
|
+
/**
|
|
641
|
+
* The resolution presets
|
|
642
|
+
*/
|
|
643
|
+
presets: Array<ResolutionComponent.Preset>;
|
|
644
|
+
/**
|
|
645
|
+
* The input name of the width
|
|
646
|
+
*/
|
|
647
|
+
widthInput: string;
|
|
648
|
+
}
|
|
649
|
+
namespace ResolutionComponent {
|
|
650
|
+
interface Preset {
|
|
651
|
+
height: number;
|
|
652
|
+
label: string;
|
|
653
|
+
width: number;
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
/**
|
|
657
|
+
* Configuration for the trigger generate button
|
|
658
|
+
*/
|
|
659
|
+
interface TriggerGenerate {
|
|
660
|
+
label: string;
|
|
661
|
+
/**
|
|
662
|
+
* The 'name' of the input where the trigger generate button will be displayed
|
|
663
|
+
* (after the input). Do not specify both position and after.
|
|
664
|
+
*/
|
|
665
|
+
after?: string;
|
|
666
|
+
/**
|
|
667
|
+
* The position of the trigger generate button. If position specified, the button
|
|
668
|
+
* will be displayed at the specified position. Do not specify both position and
|
|
669
|
+
* after.
|
|
670
|
+
*/
|
|
671
|
+
position?: 'bottom' | 'top';
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
export interface WorkflowRetrieveResponse {
|
|
677
|
+
workflow: WorkflowRetrieveResponse.Workflow;
|
|
678
|
+
}
|
|
679
|
+
export declare namespace WorkflowRetrieveResponse {
|
|
680
|
+
interface Workflow {
|
|
681
|
+
id: string;
|
|
682
|
+
authorId: string;
|
|
683
|
+
/**
|
|
684
|
+
* ISO string
|
|
685
|
+
*/
|
|
686
|
+
createdAt: string;
|
|
687
|
+
/**
|
|
688
|
+
* The description of the workflow.
|
|
689
|
+
*/
|
|
690
|
+
description: string;
|
|
691
|
+
/**
|
|
692
|
+
* The UI data about the workflow. This is managed by scenario webapp.
|
|
693
|
+
*/
|
|
694
|
+
editorInfo: unknown;
|
|
695
|
+
/**
|
|
696
|
+
* The flow of the workflow.
|
|
697
|
+
*/
|
|
698
|
+
flow: Array<Workflow.Flow>;
|
|
699
|
+
/**
|
|
700
|
+
* The inputs of the workflow.
|
|
701
|
+
*/
|
|
702
|
+
inputs: Array<Workflow.Input>;
|
|
703
|
+
name: string;
|
|
704
|
+
ownerId: string;
|
|
705
|
+
privacy: 'private' | 'public' | 'unlisted';
|
|
706
|
+
status: 'deleted' | 'draft' | 'ready';
|
|
707
|
+
/**
|
|
708
|
+
* The tag set of the workflow.
|
|
709
|
+
*/
|
|
710
|
+
tagSet: Array<string>;
|
|
711
|
+
/**
|
|
712
|
+
* ISO string
|
|
713
|
+
*/
|
|
714
|
+
updatedAt: string;
|
|
715
|
+
/**
|
|
716
|
+
* A representation of an asset after being processed by the workflow
|
|
717
|
+
*/
|
|
718
|
+
after?: Workflow.After;
|
|
719
|
+
/**
|
|
720
|
+
* A representation of an asset before being processed by the workflow
|
|
721
|
+
*/
|
|
722
|
+
before?: Workflow.Before;
|
|
723
|
+
outputAssetKinds?: Array<'3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'video'>;
|
|
724
|
+
shortDescription?: string;
|
|
725
|
+
/**
|
|
726
|
+
* Currently the thumbnail is identical to the after asset.
|
|
727
|
+
*/
|
|
728
|
+
thumbnail?: Workflow.Thumbnail;
|
|
729
|
+
/**
|
|
730
|
+
* The UI configuration for the workflow. This is managed by scenario webapp.
|
|
731
|
+
*/
|
|
732
|
+
uiConfig?: Workflow.UiConfig;
|
|
733
|
+
}
|
|
734
|
+
namespace Workflow {
|
|
735
|
+
interface Flow {
|
|
736
|
+
/**
|
|
737
|
+
* The id of the node.
|
|
738
|
+
*/
|
|
739
|
+
id: string;
|
|
740
|
+
/**
|
|
741
|
+
* The type of the job for the node.
|
|
742
|
+
*/
|
|
743
|
+
type: 'custom-model' | 'generate-prompt' | 'logic' | 'remove-background' | 'transform' | 'user-approval' | 'workflow';
|
|
744
|
+
/**
|
|
745
|
+
* The nodes that this node depends on. Only available for nodes that have
|
|
746
|
+
* dependencies. Mainly used for user approval nodes.
|
|
747
|
+
*/
|
|
748
|
+
dependsOn?: Array<string>;
|
|
749
|
+
/**
|
|
750
|
+
* The inputs of the node.
|
|
751
|
+
*/
|
|
752
|
+
inputs?: Array<Flow.Input>;
|
|
753
|
+
/**
|
|
754
|
+
* The logic of the node. Only available for logic nodes.
|
|
755
|
+
*/
|
|
756
|
+
logic?: Flow.Logic;
|
|
757
|
+
/**
|
|
758
|
+
* The type of the logic for the node. Only available for logic nodes.
|
|
759
|
+
*/
|
|
760
|
+
logicType?: 'if-else';
|
|
761
|
+
/**
|
|
762
|
+
* The model id for the node. Mainly used for custom model tasks.
|
|
763
|
+
*/
|
|
764
|
+
modelId?: string;
|
|
765
|
+
/**
|
|
766
|
+
* The workflow id for the node. Mainly used for workflow tasks.
|
|
767
|
+
*/
|
|
768
|
+
workflowId?: string;
|
|
769
|
+
}
|
|
770
|
+
namespace Flow {
|
|
771
|
+
/**
|
|
772
|
+
* This is used to run the flow.
|
|
773
|
+
*/
|
|
774
|
+
interface Input {
|
|
775
|
+
/**
|
|
776
|
+
* The name that must be user to call the model through the API
|
|
777
|
+
*/
|
|
778
|
+
name: string;
|
|
779
|
+
/**
|
|
780
|
+
* The data type of the input
|
|
781
|
+
*/
|
|
782
|
+
type: 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array';
|
|
783
|
+
/**
|
|
784
|
+
* The allowed values for the input. For \`string\` or \`number\` types, creates a
|
|
785
|
+
* single-select dropdown. For \`string_array\` type, creates a multi-select
|
|
786
|
+
* dropdown.
|
|
787
|
+
*/
|
|
788
|
+
allowedValues?: Array<unknown>;
|
|
789
|
+
/**
|
|
790
|
+
* Specifies the background behavior for the input. Only available for \`file\` and
|
|
791
|
+
* \`file_array\` input types with kind \`image\`.
|
|
792
|
+
*/
|
|
793
|
+
backgroundBehavior?: 'opaque' | 'transparent';
|
|
794
|
+
/**
|
|
795
|
+
* Whether the input is a color or not. Only available for \`string\` input type.
|
|
796
|
+
*/
|
|
797
|
+
color?: boolean;
|
|
798
|
+
/**
|
|
799
|
+
* Whether this input affects the model's cost calculation
|
|
800
|
+
*/
|
|
801
|
+
costImpact?: boolean;
|
|
802
|
+
/**
|
|
803
|
+
* Help text displayed in the UI to provide additional information about the input
|
|
804
|
+
*/
|
|
805
|
+
description?: string;
|
|
806
|
+
/**
|
|
807
|
+
* Used to visually group inputs together in the UI. Inputs with the same group
|
|
808
|
+
* value appear consecutively in the UI.
|
|
809
|
+
*/
|
|
810
|
+
group?: string;
|
|
811
|
+
/**
|
|
812
|
+
* Hint text displayed in the UI as a tooltip to guide the user
|
|
813
|
+
*/
|
|
814
|
+
hint?: string;
|
|
815
|
+
/**
|
|
816
|
+
* The list of inputs which form an object within a container array. All inputs are
|
|
817
|
+
* the same as the current object. This is only available for type inputs_array
|
|
818
|
+
* inputs.
|
|
819
|
+
*/
|
|
820
|
+
inputs?: Array<unknown>;
|
|
821
|
+
/**
|
|
822
|
+
* The asset kind of the input. Only taken into account for \`file\` and
|
|
823
|
+
* \`file_array\` input types.
|
|
824
|
+
*/
|
|
825
|
+
kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'video';
|
|
826
|
+
/**
|
|
827
|
+
* The label displayed in the UI for this input
|
|
828
|
+
*/
|
|
829
|
+
label?: string;
|
|
830
|
+
/**
|
|
831
|
+
* The name of the file input field to use as the mask source
|
|
832
|
+
*/
|
|
833
|
+
maskFrom?: string;
|
|
834
|
+
/**
|
|
835
|
+
* The maximum allowed value. Only available for \`number\` and \`array\` input
|
|
836
|
+
* types.
|
|
837
|
+
*/
|
|
838
|
+
max?: number;
|
|
839
|
+
/**
|
|
840
|
+
* The maximum allowed length for \`string\` inputs. Also applies to each item in
|
|
841
|
+
* \`string_array\`.
|
|
842
|
+
*/
|
|
843
|
+
maxLength?: number;
|
|
844
|
+
/**
|
|
845
|
+
* The minimum allowed value. Only available for \`number\` and array input types.
|
|
846
|
+
*/
|
|
847
|
+
min?: number;
|
|
848
|
+
/**
|
|
849
|
+
* The minimum allowed length for string inputs. Also applies to each item in
|
|
850
|
+
* \`string_array\`.
|
|
851
|
+
*/
|
|
852
|
+
minLength?: number;
|
|
853
|
+
/**
|
|
854
|
+
* The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only
|
|
855
|
+
* available for \`model_array\` input type.
|
|
856
|
+
*/
|
|
857
|
+
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'>;
|
|
858
|
+
/**
|
|
859
|
+
* Whether this input represents a parent asset to assign to the produced assets.
|
|
860
|
+
* Only available for \`file\` and \`file_array\` input types.
|
|
861
|
+
*
|
|
862
|
+
* For \`file_array\`, the parent asset is the first item in the array.
|
|
863
|
+
*/
|
|
864
|
+
parent?: boolean;
|
|
865
|
+
/**
|
|
866
|
+
* Placeholder text for the input. Only available for 'string' input type.
|
|
867
|
+
*/
|
|
868
|
+
placeholder?: string;
|
|
869
|
+
/**
|
|
870
|
+
* Whether the input is a prompt. When true, displays as a text area with prompt
|
|
871
|
+
* spark feature. Only available for \`string\` input type.
|
|
872
|
+
*/
|
|
873
|
+
prompt?: boolean;
|
|
874
|
+
/**
|
|
875
|
+
* Whether the input is used with prompt spark. Only available for \`string\` input
|
|
876
|
+
* type.
|
|
877
|
+
*/
|
|
878
|
+
promptSpark?: boolean;
|
|
879
|
+
/**
|
|
880
|
+
* The reference to another input or output of the same workflow. Must have at
|
|
881
|
+
* least one of node or conditional.
|
|
882
|
+
*/
|
|
883
|
+
ref?: Input.Ref;
|
|
884
|
+
/**
|
|
885
|
+
* Set of rules that describes when this input is required:
|
|
886
|
+
*
|
|
887
|
+
* - \`always\`: Input is always required
|
|
888
|
+
* - \`ifNotDefined\`: Input is required when another specified input is not
|
|
889
|
+
* defined
|
|
890
|
+
* - \`ifDefined\`: Input is required when another specified input is defined
|
|
891
|
+
* - \`conditionalValues\`: Input is required when another input has a specific
|
|
892
|
+
* value
|
|
893
|
+
*
|
|
894
|
+
* By default, the input is not required.
|
|
895
|
+
*/
|
|
896
|
+
required?: Input.Required;
|
|
897
|
+
/**
|
|
898
|
+
* The step increment for numeric inputs. Only available for \`number\` input type.
|
|
899
|
+
*/
|
|
900
|
+
step?: number;
|
|
901
|
+
}
|
|
902
|
+
namespace Input {
|
|
903
|
+
/**
|
|
904
|
+
* The reference to another input or output of the same workflow. Must have at
|
|
905
|
+
* least one of node or conditional.
|
|
906
|
+
*/
|
|
907
|
+
interface Ref {
|
|
908
|
+
/**
|
|
909
|
+
* The conditional nodes to reference. If the conditional nodes are successful, the
|
|
910
|
+
* node will be successful. If the conditional nodes are skipped, the node will be
|
|
911
|
+
* skipped. Contains an array of node ids used to check the status of the nodes.
|
|
912
|
+
*/
|
|
913
|
+
conditional?: Array<string>;
|
|
914
|
+
/**
|
|
915
|
+
* This is the desired node output value if ref is an if/else node.
|
|
916
|
+
*/
|
|
917
|
+
equal?: string;
|
|
918
|
+
/**
|
|
919
|
+
* The name of the input or output to reference. If the type is 'workflow', the
|
|
920
|
+
* name is the name of the input of the workflow is required If the type is 'node',
|
|
921
|
+
* the name is not mandatory, except if you want all outputs of the node. To get
|
|
922
|
+
* all outputs of a node, you can use the name 'all'.
|
|
923
|
+
*/
|
|
924
|
+
name?: string;
|
|
925
|
+
/**
|
|
926
|
+
* The node id or 'workflow' if the source is a workflow input.
|
|
927
|
+
*/
|
|
928
|
+
node?: string;
|
|
929
|
+
}
|
|
930
|
+
/**
|
|
931
|
+
* Set of rules that describes when this input is required:
|
|
932
|
+
*
|
|
933
|
+
* - \`always\`: Input is always required
|
|
934
|
+
* - \`ifNotDefined\`: Input is required when another specified input is not
|
|
935
|
+
* defined
|
|
936
|
+
* - \`ifDefined\`: Input is required when another specified input is defined
|
|
937
|
+
* - \`conditionalValues\`: Input is required when another input has a specific
|
|
938
|
+
* value
|
|
939
|
+
*
|
|
940
|
+
* By default, the input is not required.
|
|
941
|
+
*/
|
|
942
|
+
interface Required {
|
|
943
|
+
/**
|
|
944
|
+
* Whether the input is always required
|
|
945
|
+
*/
|
|
946
|
+
always?: boolean;
|
|
947
|
+
/**
|
|
948
|
+
* Makes this input required when another input has a specific value:
|
|
949
|
+
*
|
|
950
|
+
* - Key: name of the input to check
|
|
951
|
+
* - Value: operation and allowed values that trigger the requirement
|
|
952
|
+
*/
|
|
953
|
+
conditionalValues?: unknown;
|
|
954
|
+
/**
|
|
955
|
+
* Makes this input required when another input is defined:
|
|
956
|
+
*
|
|
957
|
+
* - Key: name of the input that must be defined
|
|
958
|
+
* - Value: message to display when this input is required
|
|
959
|
+
*/
|
|
960
|
+
ifDefined?: unknown;
|
|
961
|
+
/**
|
|
962
|
+
* Makes this input required when another input is not defined:
|
|
963
|
+
*
|
|
964
|
+
* - Key: name of the input that must be undefined
|
|
965
|
+
* - Value: message to display when this input is required
|
|
966
|
+
*/
|
|
967
|
+
ifNotDefined?: unknown;
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
/**
|
|
971
|
+
* The logic of the node. Only available for logic nodes.
|
|
972
|
+
*/
|
|
973
|
+
interface Logic {
|
|
974
|
+
/**
|
|
975
|
+
* The cases of the logic. Only available for if/else nodes.
|
|
976
|
+
*/
|
|
977
|
+
cases?: Array<Logic.Case>;
|
|
978
|
+
/**
|
|
979
|
+
* The default case of the logic. Contains the id/output of the node to execute if
|
|
980
|
+
* no case is matched. Only available for if/else nodes.
|
|
981
|
+
*/
|
|
982
|
+
default?: string;
|
|
983
|
+
/**
|
|
984
|
+
* The transform of the logic. Only available for transform nodes.
|
|
985
|
+
*/
|
|
986
|
+
transform?: string;
|
|
987
|
+
}
|
|
988
|
+
namespace Logic {
|
|
989
|
+
interface Case {
|
|
990
|
+
condition: string;
|
|
991
|
+
value: string;
|
|
992
|
+
}
|
|
993
|
+
}
|
|
994
|
+
}
|
|
995
|
+
/**
|
|
996
|
+
* Defines the input parameters for a model. Use this to understand the available
|
|
997
|
+
* input parameters for a given `modelId` when calling
|
|
998
|
+
* `POST /generate/custom/{modelId}`. See {@link
|
|
999
|
+
* https://docs.scenario.com/docs/video-generation} for examples.
|
|
1000
|
+
*/
|
|
1001
|
+
interface Input {
|
|
1002
|
+
/**
|
|
1003
|
+
* The name that must be user to call the model through the API
|
|
1004
|
+
*/
|
|
1005
|
+
name: string;
|
|
1006
|
+
/**
|
|
1007
|
+
* The data type of the input
|
|
1008
|
+
*/
|
|
1009
|
+
type: 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array';
|
|
1010
|
+
/**
|
|
1011
|
+
* The allowed values for the input. For \`string\` or \`number\` types, creates a
|
|
1012
|
+
* single-select dropdown. For \`string_array\` type, creates a multi-select
|
|
1013
|
+
* dropdown.
|
|
1014
|
+
*/
|
|
1015
|
+
allowedValues?: Array<unknown>;
|
|
1016
|
+
/**
|
|
1017
|
+
* Specifies the background behavior for the input. Only available for \`file\` and
|
|
1018
|
+
* \`file_array\` input types with kind \`image\`.
|
|
1019
|
+
*/
|
|
1020
|
+
backgroundBehavior?: 'opaque' | 'transparent';
|
|
1021
|
+
/**
|
|
1022
|
+
* Whether the input is a color or not. Only available for \`string\` input type.
|
|
1023
|
+
*/
|
|
1024
|
+
color?: boolean;
|
|
1025
|
+
/**
|
|
1026
|
+
* Whether this input affects the model's cost calculation
|
|
1027
|
+
*/
|
|
1028
|
+
costImpact?: boolean;
|
|
1029
|
+
/**
|
|
1030
|
+
* Help text displayed in the UI to provide additional information about the input
|
|
1031
|
+
*/
|
|
1032
|
+
description?: string;
|
|
1033
|
+
/**
|
|
1034
|
+
* Used to visually group inputs together in the UI. Inputs with the same group
|
|
1035
|
+
* value appear consecutively in the UI.
|
|
1036
|
+
*/
|
|
1037
|
+
group?: string;
|
|
1038
|
+
/**
|
|
1039
|
+
* Hint text displayed in the UI as a tooltip to guide the user
|
|
1040
|
+
*/
|
|
1041
|
+
hint?: string;
|
|
1042
|
+
/**
|
|
1043
|
+
* The list of inputs which form an object within a container array. All inputs are
|
|
1044
|
+
* the same as the current object. This is only available for type inputs_array
|
|
1045
|
+
* inputs.
|
|
1046
|
+
*/
|
|
1047
|
+
inputs?: Array<unknown>;
|
|
1048
|
+
/**
|
|
1049
|
+
* The asset kind of the input. Only taken into account for \`file\` and
|
|
1050
|
+
* \`file_array\` input types.
|
|
1051
|
+
*/
|
|
1052
|
+
kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'video';
|
|
1053
|
+
/**
|
|
1054
|
+
* The label displayed in the UI for this input
|
|
1055
|
+
*/
|
|
1056
|
+
label?: string;
|
|
1057
|
+
/**
|
|
1058
|
+
* The name of the file input field to use as the mask source
|
|
1059
|
+
*/
|
|
1060
|
+
maskFrom?: string;
|
|
1061
|
+
/**
|
|
1062
|
+
* The maximum allowed value. Only available for \`number\` and \`array\` input
|
|
1063
|
+
* types.
|
|
1064
|
+
*/
|
|
1065
|
+
max?: number;
|
|
1066
|
+
/**
|
|
1067
|
+
* The maximum allowed length for \`string\` inputs. Also applies to each item in
|
|
1068
|
+
* \`string_array\`.
|
|
1069
|
+
*/
|
|
1070
|
+
maxLength?: number;
|
|
1071
|
+
/**
|
|
1072
|
+
* The minimum allowed value. Only available for \`number\` and array input types.
|
|
1073
|
+
*/
|
|
1074
|
+
min?: number;
|
|
1075
|
+
/**
|
|
1076
|
+
* The minimum allowed length for string inputs. Also applies to each item in
|
|
1077
|
+
* \`string_array\`.
|
|
1078
|
+
*/
|
|
1079
|
+
minLength?: number;
|
|
1080
|
+
/**
|
|
1081
|
+
* The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only
|
|
1082
|
+
* available for \`model_array\` input type.
|
|
1083
|
+
*/
|
|
1084
|
+
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'>;
|
|
1085
|
+
/**
|
|
1086
|
+
* Whether this input represents a parent asset to assign to the produced assets.
|
|
1087
|
+
* Only available for \`file\` and \`file_array\` input types.
|
|
1088
|
+
*
|
|
1089
|
+
* For \`file_array\`, the parent asset is the first item in the array.
|
|
1090
|
+
*/
|
|
1091
|
+
parent?: boolean;
|
|
1092
|
+
/**
|
|
1093
|
+
* Placeholder text for the input. Only available for 'string' input type.
|
|
1094
|
+
*/
|
|
1095
|
+
placeholder?: string;
|
|
1096
|
+
/**
|
|
1097
|
+
* Whether the input is a prompt. When true, displays as a text area with prompt
|
|
1098
|
+
* spark feature. Only available for \`string\` input type.
|
|
1099
|
+
*/
|
|
1100
|
+
prompt?: boolean;
|
|
1101
|
+
/**
|
|
1102
|
+
* Whether the input is used with prompt spark. Only available for \`string\` input
|
|
1103
|
+
* type.
|
|
1104
|
+
*/
|
|
1105
|
+
promptSpark?: boolean;
|
|
1106
|
+
/**
|
|
1107
|
+
* Set of rules that describes when this input is required:
|
|
1108
|
+
*
|
|
1109
|
+
* - \`always\`: Input is always required
|
|
1110
|
+
* - \`ifNotDefined\`: Input is required when another specified input is not
|
|
1111
|
+
* defined
|
|
1112
|
+
* - \`ifDefined\`: Input is required when another specified input is defined
|
|
1113
|
+
* - \`conditionalValues\`: Input is required when another input has a specific
|
|
1114
|
+
* value
|
|
1115
|
+
*
|
|
1116
|
+
* By default, the input is not required.
|
|
1117
|
+
*/
|
|
1118
|
+
required?: Input.Required;
|
|
1119
|
+
/**
|
|
1120
|
+
* The step increment for numeric inputs. Only available for \`number\` input type.
|
|
1121
|
+
*/
|
|
1122
|
+
step?: number;
|
|
1123
|
+
}
|
|
1124
|
+
namespace Input {
|
|
1125
|
+
/**
|
|
1126
|
+
* Set of rules that describes when this input is required:
|
|
1127
|
+
*
|
|
1128
|
+
* - \`always\`: Input is always required
|
|
1129
|
+
* - \`ifNotDefined\`: Input is required when another specified input is not
|
|
1130
|
+
* defined
|
|
1131
|
+
* - \`ifDefined\`: Input is required when another specified input is defined
|
|
1132
|
+
* - \`conditionalValues\`: Input is required when another input has a specific
|
|
1133
|
+
* value
|
|
1134
|
+
*
|
|
1135
|
+
* By default, the input is not required.
|
|
1136
|
+
*/
|
|
1137
|
+
interface Required {
|
|
1138
|
+
/**
|
|
1139
|
+
* Whether the input is always required
|
|
1140
|
+
*/
|
|
1141
|
+
always?: boolean;
|
|
1142
|
+
/**
|
|
1143
|
+
* Makes this input required when another input has a specific value:
|
|
1144
|
+
*
|
|
1145
|
+
* - Key: name of the input to check
|
|
1146
|
+
* - Value: operation and allowed values that trigger the requirement
|
|
1147
|
+
*/
|
|
1148
|
+
conditionalValues?: unknown;
|
|
1149
|
+
/**
|
|
1150
|
+
* Makes this input required when another input is defined:
|
|
1151
|
+
*
|
|
1152
|
+
* - Key: name of the input that must be defined
|
|
1153
|
+
* - Value: message to display when this input is required
|
|
1154
|
+
*/
|
|
1155
|
+
ifDefined?: unknown;
|
|
1156
|
+
/**
|
|
1157
|
+
* Makes this input required when another input is not defined:
|
|
1158
|
+
*
|
|
1159
|
+
* - Key: name of the input that must be undefined
|
|
1160
|
+
* - Value: message to display when this input is required
|
|
1161
|
+
*/
|
|
1162
|
+
ifNotDefined?: unknown;
|
|
1163
|
+
}
|
|
1164
|
+
}
|
|
1165
|
+
/**
|
|
1166
|
+
* A representation of an asset after being processed by the workflow
|
|
1167
|
+
*/
|
|
1168
|
+
interface After {
|
|
1169
|
+
/**
|
|
1170
|
+
* The AssetId of the image used as a thumbnail for your model (example:
|
|
1171
|
+
* "asset_GTrL3mq4SXWyMxkOHRxlpw")
|
|
1172
|
+
*/
|
|
1173
|
+
assetId: string;
|
|
1174
|
+
/**
|
|
1175
|
+
* The url of the image used as a thumbnail for your model
|
|
1176
|
+
*/
|
|
1177
|
+
url: string;
|
|
1178
|
+
}
|
|
1179
|
+
/**
|
|
1180
|
+
* A representation of an asset before being processed by the workflow
|
|
1181
|
+
*/
|
|
1182
|
+
interface Before {
|
|
1183
|
+
/**
|
|
1184
|
+
* The AssetId of the image used as a thumbnail for your model (example:
|
|
1185
|
+
* "asset_GTrL3mq4SXWyMxkOHRxlpw")
|
|
1186
|
+
*/
|
|
1187
|
+
assetId: string;
|
|
1188
|
+
/**
|
|
1189
|
+
* The url of the image used as a thumbnail for your model
|
|
1190
|
+
*/
|
|
1191
|
+
url: string;
|
|
1192
|
+
}
|
|
1193
|
+
/**
|
|
1194
|
+
* Currently the thumbnail is identical to the after asset.
|
|
1195
|
+
*/
|
|
1196
|
+
interface Thumbnail {
|
|
1197
|
+
assetId: string;
|
|
1198
|
+
url: string;
|
|
1199
|
+
}
|
|
1200
|
+
/**
|
|
1201
|
+
* The UI configuration for the workflow. This is managed by scenario webapp.
|
|
1202
|
+
*/
|
|
1203
|
+
interface UiConfig {
|
|
1204
|
+
/**
|
|
1205
|
+
* Configuration for the input properties
|
|
1206
|
+
*/
|
|
1207
|
+
inputProperties?: {
|
|
1208
|
+
[key: string]: UiConfig.InputProperties;
|
|
1209
|
+
};
|
|
1210
|
+
/**
|
|
1211
|
+
* Configuration for the loras component
|
|
1212
|
+
*/
|
|
1213
|
+
lorasComponent?: UiConfig.LorasComponent;
|
|
1214
|
+
/**
|
|
1215
|
+
* Configuration for the presets
|
|
1216
|
+
*/
|
|
1217
|
+
presets?: Array<UiConfig.Preset>;
|
|
1218
|
+
/**
|
|
1219
|
+
* Configuration for the resolution component
|
|
1220
|
+
*/
|
|
1221
|
+
resolutionComponent?: UiConfig.ResolutionComponent;
|
|
1222
|
+
/**
|
|
1223
|
+
* Configuration for the selects
|
|
1224
|
+
*/
|
|
1225
|
+
selects?: {
|
|
1226
|
+
[key: string]: unknown;
|
|
1227
|
+
};
|
|
1228
|
+
/**
|
|
1229
|
+
* Configuration for the trigger generate button
|
|
1230
|
+
*/
|
|
1231
|
+
triggerGenerate?: UiConfig.TriggerGenerate;
|
|
1232
|
+
}
|
|
1233
|
+
namespace UiConfig {
|
|
1234
|
+
interface InputProperties {
|
|
1235
|
+
collapsed?: boolean;
|
|
1236
|
+
}
|
|
1237
|
+
/**
|
|
1238
|
+
* Configuration for the loras component
|
|
1239
|
+
*/
|
|
1240
|
+
interface LorasComponent {
|
|
1241
|
+
/**
|
|
1242
|
+
* The label of the component
|
|
1243
|
+
*/
|
|
1244
|
+
label: string;
|
|
1245
|
+
/**
|
|
1246
|
+
* The input name of the model (model_array)
|
|
1247
|
+
*/
|
|
1248
|
+
modelInput: string;
|
|
1249
|
+
/**
|
|
1250
|
+
* The input name of the scale (number_array)
|
|
1251
|
+
*/
|
|
1252
|
+
scaleInput: string;
|
|
1253
|
+
/**
|
|
1254
|
+
* The input model id (example: a composition or a single LoRA modelId) If
|
|
1255
|
+
* specified, the model id will be attached to the output asset as a metadata If
|
|
1256
|
+
* the model-decomposer parser is specified on it, modelInput and scaleInput will
|
|
1257
|
+
* be automatically populated
|
|
1258
|
+
*/
|
|
1259
|
+
modelIdInput?: string;
|
|
1260
|
+
}
|
|
1261
|
+
interface Preset {
|
|
1262
|
+
fields: Array<string>;
|
|
1263
|
+
presets: unknown;
|
|
1264
|
+
}
|
|
1265
|
+
/**
|
|
1266
|
+
* Configuration for the resolution component
|
|
1267
|
+
*/
|
|
1268
|
+
interface ResolutionComponent {
|
|
1269
|
+
/**
|
|
1270
|
+
* The input name of the height
|
|
1271
|
+
*/
|
|
1272
|
+
heightInput: string;
|
|
1273
|
+
/**
|
|
1274
|
+
* The label of the component
|
|
1275
|
+
*/
|
|
1276
|
+
label: string;
|
|
1277
|
+
/**
|
|
1278
|
+
* The resolution presets
|
|
1279
|
+
*/
|
|
1280
|
+
presets: Array<ResolutionComponent.Preset>;
|
|
1281
|
+
/**
|
|
1282
|
+
* The input name of the width
|
|
1283
|
+
*/
|
|
1284
|
+
widthInput: string;
|
|
1285
|
+
}
|
|
1286
|
+
namespace ResolutionComponent {
|
|
1287
|
+
interface Preset {
|
|
1288
|
+
height: number;
|
|
1289
|
+
label: string;
|
|
1290
|
+
width: number;
|
|
1291
|
+
}
|
|
1292
|
+
}
|
|
1293
|
+
/**
|
|
1294
|
+
* Configuration for the trigger generate button
|
|
1295
|
+
*/
|
|
1296
|
+
interface TriggerGenerate {
|
|
1297
|
+
label: string;
|
|
1298
|
+
/**
|
|
1299
|
+
* The 'name' of the input where the trigger generate button will be displayed
|
|
1300
|
+
* (after the input). Do not specify both position and after.
|
|
1301
|
+
*/
|
|
1302
|
+
after?: string;
|
|
1303
|
+
/**
|
|
1304
|
+
* The position of the trigger generate button. If position specified, the button
|
|
1305
|
+
* will be displayed at the specified position. Do not specify both position and
|
|
1306
|
+
* after.
|
|
1307
|
+
*/
|
|
1308
|
+
position?: 'bottom' | 'top';
|
|
1309
|
+
}
|
|
1310
|
+
}
|
|
1311
|
+
}
|
|
1312
|
+
}
|
|
1313
|
+
export interface WorkflowUpdateResponse {
|
|
1314
|
+
workflow: WorkflowUpdateResponse.Workflow;
|
|
1315
|
+
}
|
|
1316
|
+
export declare namespace WorkflowUpdateResponse {
|
|
1317
|
+
interface Workflow {
|
|
1318
|
+
id: string;
|
|
1319
|
+
authorId: string;
|
|
1320
|
+
/**
|
|
1321
|
+
* ISO string
|
|
1322
|
+
*/
|
|
1323
|
+
createdAt: string;
|
|
1324
|
+
/**
|
|
1325
|
+
* The description of the workflow.
|
|
1326
|
+
*/
|
|
1327
|
+
description: string;
|
|
1328
|
+
/**
|
|
1329
|
+
* The UI data about the workflow. This is managed by scenario webapp.
|
|
1330
|
+
*/
|
|
1331
|
+
editorInfo: unknown;
|
|
1332
|
+
/**
|
|
1333
|
+
* The flow of the workflow.
|
|
1334
|
+
*/
|
|
1335
|
+
flow: Array<Workflow.Flow>;
|
|
1336
|
+
/**
|
|
1337
|
+
* The inputs of the workflow.
|
|
1338
|
+
*/
|
|
1339
|
+
inputs: Array<Workflow.Input>;
|
|
1340
|
+
name: string;
|
|
1341
|
+
ownerId: string;
|
|
1342
|
+
privacy: 'private' | 'public' | 'unlisted';
|
|
1343
|
+
status: 'deleted' | 'draft' | 'ready';
|
|
1344
|
+
/**
|
|
1345
|
+
* The tag set of the workflow.
|
|
1346
|
+
*/
|
|
1347
|
+
tagSet: Array<string>;
|
|
1348
|
+
/**
|
|
1349
|
+
* ISO string
|
|
1350
|
+
*/
|
|
1351
|
+
updatedAt: string;
|
|
1352
|
+
/**
|
|
1353
|
+
* A representation of an asset after being processed by the workflow
|
|
1354
|
+
*/
|
|
1355
|
+
after?: Workflow.After;
|
|
1356
|
+
/**
|
|
1357
|
+
* A representation of an asset before being processed by the workflow
|
|
1358
|
+
*/
|
|
1359
|
+
before?: Workflow.Before;
|
|
1360
|
+
outputAssetKinds?: Array<'3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'video'>;
|
|
1361
|
+
shortDescription?: string;
|
|
1362
|
+
/**
|
|
1363
|
+
* Currently the thumbnail is identical to the after asset.
|
|
1364
|
+
*/
|
|
1365
|
+
thumbnail?: Workflow.Thumbnail;
|
|
1366
|
+
/**
|
|
1367
|
+
* The UI configuration for the workflow. This is managed by scenario webapp.
|
|
1368
|
+
*/
|
|
1369
|
+
uiConfig?: Workflow.UiConfig;
|
|
1370
|
+
}
|
|
1371
|
+
namespace Workflow {
|
|
1372
|
+
interface Flow {
|
|
1373
|
+
/**
|
|
1374
|
+
* The id of the node.
|
|
1375
|
+
*/
|
|
1376
|
+
id: string;
|
|
1377
|
+
/**
|
|
1378
|
+
* The type of the job for the node.
|
|
1379
|
+
*/
|
|
1380
|
+
type: 'custom-model' | 'generate-prompt' | 'logic' | 'remove-background' | 'transform' | 'user-approval' | 'workflow';
|
|
1381
|
+
/**
|
|
1382
|
+
* The nodes that this node depends on. Only available for nodes that have
|
|
1383
|
+
* dependencies. Mainly used for user approval nodes.
|
|
1384
|
+
*/
|
|
1385
|
+
dependsOn?: Array<string>;
|
|
1386
|
+
/**
|
|
1387
|
+
* The inputs of the node.
|
|
1388
|
+
*/
|
|
1389
|
+
inputs?: Array<Flow.Input>;
|
|
1390
|
+
/**
|
|
1391
|
+
* The logic of the node. Only available for logic nodes.
|
|
1392
|
+
*/
|
|
1393
|
+
logic?: Flow.Logic;
|
|
1394
|
+
/**
|
|
1395
|
+
* The type of the logic for the node. Only available for logic nodes.
|
|
1396
|
+
*/
|
|
1397
|
+
logicType?: 'if-else';
|
|
1398
|
+
/**
|
|
1399
|
+
* The model id for the node. Mainly used for custom model tasks.
|
|
1400
|
+
*/
|
|
1401
|
+
modelId?: string;
|
|
1402
|
+
/**
|
|
1403
|
+
* The workflow id for the node. Mainly used for workflow tasks.
|
|
1404
|
+
*/
|
|
1405
|
+
workflowId?: string;
|
|
1406
|
+
}
|
|
1407
|
+
namespace Flow {
|
|
1408
|
+
/**
|
|
1409
|
+
* This is used to run the flow.
|
|
1410
|
+
*/
|
|
1411
|
+
interface Input {
|
|
1412
|
+
/**
|
|
1413
|
+
* The name that must be user to call the model through the API
|
|
1414
|
+
*/
|
|
1415
|
+
name: string;
|
|
1416
|
+
/**
|
|
1417
|
+
* The data type of the input
|
|
1418
|
+
*/
|
|
1419
|
+
type: 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array';
|
|
1420
|
+
/**
|
|
1421
|
+
* The allowed values for the input. For \`string\` or \`number\` types, creates a
|
|
1422
|
+
* single-select dropdown. For \`string_array\` type, creates a multi-select
|
|
1423
|
+
* dropdown.
|
|
1424
|
+
*/
|
|
1425
|
+
allowedValues?: Array<unknown>;
|
|
1426
|
+
/**
|
|
1427
|
+
* Specifies the background behavior for the input. Only available for \`file\` and
|
|
1428
|
+
* \`file_array\` input types with kind \`image\`.
|
|
1429
|
+
*/
|
|
1430
|
+
backgroundBehavior?: 'opaque' | 'transparent';
|
|
1431
|
+
/**
|
|
1432
|
+
* Whether the input is a color or not. Only available for \`string\` input type.
|
|
1433
|
+
*/
|
|
1434
|
+
color?: boolean;
|
|
1435
|
+
/**
|
|
1436
|
+
* Whether this input affects the model's cost calculation
|
|
1437
|
+
*/
|
|
1438
|
+
costImpact?: boolean;
|
|
1439
|
+
/**
|
|
1440
|
+
* Help text displayed in the UI to provide additional information about the input
|
|
1441
|
+
*/
|
|
1442
|
+
description?: string;
|
|
1443
|
+
/**
|
|
1444
|
+
* Used to visually group inputs together in the UI. Inputs with the same group
|
|
1445
|
+
* value appear consecutively in the UI.
|
|
1446
|
+
*/
|
|
1447
|
+
group?: string;
|
|
1448
|
+
/**
|
|
1449
|
+
* Hint text displayed in the UI as a tooltip to guide the user
|
|
1450
|
+
*/
|
|
1451
|
+
hint?: string;
|
|
1452
|
+
/**
|
|
1453
|
+
* The list of inputs which form an object within a container array. All inputs are
|
|
1454
|
+
* the same as the current object. This is only available for type inputs_array
|
|
1455
|
+
* inputs.
|
|
1456
|
+
*/
|
|
1457
|
+
inputs?: Array<unknown>;
|
|
1458
|
+
/**
|
|
1459
|
+
* The asset kind of the input. Only taken into account for \`file\` and
|
|
1460
|
+
* \`file_array\` input types.
|
|
1461
|
+
*/
|
|
1462
|
+
kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'video';
|
|
1463
|
+
/**
|
|
1464
|
+
* The label displayed in the UI for this input
|
|
1465
|
+
*/
|
|
1466
|
+
label?: string;
|
|
1467
|
+
/**
|
|
1468
|
+
* The name of the file input field to use as the mask source
|
|
1469
|
+
*/
|
|
1470
|
+
maskFrom?: string;
|
|
1471
|
+
/**
|
|
1472
|
+
* The maximum allowed value. Only available for \`number\` and \`array\` input
|
|
1473
|
+
* types.
|
|
1474
|
+
*/
|
|
1475
|
+
max?: number;
|
|
1476
|
+
/**
|
|
1477
|
+
* The maximum allowed length for \`string\` inputs. Also applies to each item in
|
|
1478
|
+
* \`string_array\`.
|
|
1479
|
+
*/
|
|
1480
|
+
maxLength?: number;
|
|
1481
|
+
/**
|
|
1482
|
+
* The minimum allowed value. Only available for \`number\` and array input types.
|
|
1483
|
+
*/
|
|
1484
|
+
min?: number;
|
|
1485
|
+
/**
|
|
1486
|
+
* The minimum allowed length for string inputs. Also applies to each item in
|
|
1487
|
+
* \`string_array\`.
|
|
1488
|
+
*/
|
|
1489
|
+
minLength?: number;
|
|
1490
|
+
/**
|
|
1491
|
+
* The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only
|
|
1492
|
+
* available for \`model_array\` input type.
|
|
1493
|
+
*/
|
|
1494
|
+
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'>;
|
|
1495
|
+
/**
|
|
1496
|
+
* Whether this input represents a parent asset to assign to the produced assets.
|
|
1497
|
+
* Only available for \`file\` and \`file_array\` input types.
|
|
1498
|
+
*
|
|
1499
|
+
* For \`file_array\`, the parent asset is the first item in the array.
|
|
1500
|
+
*/
|
|
1501
|
+
parent?: boolean;
|
|
1502
|
+
/**
|
|
1503
|
+
* Placeholder text for the input. Only available for 'string' input type.
|
|
1504
|
+
*/
|
|
1505
|
+
placeholder?: string;
|
|
1506
|
+
/**
|
|
1507
|
+
* Whether the input is a prompt. When true, displays as a text area with prompt
|
|
1508
|
+
* spark feature. Only available for \`string\` input type.
|
|
1509
|
+
*/
|
|
1510
|
+
prompt?: boolean;
|
|
1511
|
+
/**
|
|
1512
|
+
* Whether the input is used with prompt spark. Only available for \`string\` input
|
|
1513
|
+
* type.
|
|
1514
|
+
*/
|
|
1515
|
+
promptSpark?: boolean;
|
|
1516
|
+
/**
|
|
1517
|
+
* The reference to another input or output of the same workflow. Must have at
|
|
1518
|
+
* least one of node or conditional.
|
|
1519
|
+
*/
|
|
1520
|
+
ref?: Input.Ref;
|
|
1521
|
+
/**
|
|
1522
|
+
* Set of rules that describes when this input is required:
|
|
1523
|
+
*
|
|
1524
|
+
* - \`always\`: Input is always required
|
|
1525
|
+
* - \`ifNotDefined\`: Input is required when another specified input is not
|
|
1526
|
+
* defined
|
|
1527
|
+
* - \`ifDefined\`: Input is required when another specified input is defined
|
|
1528
|
+
* - \`conditionalValues\`: Input is required when another input has a specific
|
|
1529
|
+
* value
|
|
1530
|
+
*
|
|
1531
|
+
* By default, the input is not required.
|
|
1532
|
+
*/
|
|
1533
|
+
required?: Input.Required;
|
|
1534
|
+
/**
|
|
1535
|
+
* The step increment for numeric inputs. Only available for \`number\` input type.
|
|
1536
|
+
*/
|
|
1537
|
+
step?: number;
|
|
1538
|
+
}
|
|
1539
|
+
namespace Input {
|
|
1540
|
+
/**
|
|
1541
|
+
* The reference to another input or output of the same workflow. Must have at
|
|
1542
|
+
* least one of node or conditional.
|
|
1543
|
+
*/
|
|
1544
|
+
interface Ref {
|
|
1545
|
+
/**
|
|
1546
|
+
* The conditional nodes to reference. If the conditional nodes are successful, the
|
|
1547
|
+
* node will be successful. If the conditional nodes are skipped, the node will be
|
|
1548
|
+
* skipped. Contains an array of node ids used to check the status of the nodes.
|
|
1549
|
+
*/
|
|
1550
|
+
conditional?: Array<string>;
|
|
1551
|
+
/**
|
|
1552
|
+
* This is the desired node output value if ref is an if/else node.
|
|
1553
|
+
*/
|
|
1554
|
+
equal?: string;
|
|
1555
|
+
/**
|
|
1556
|
+
* The name of the input or output to reference. If the type is 'workflow', the
|
|
1557
|
+
* name is the name of the input of the workflow is required If the type is 'node',
|
|
1558
|
+
* the name is not mandatory, except if you want all outputs of the node. To get
|
|
1559
|
+
* all outputs of a node, you can use the name 'all'.
|
|
1560
|
+
*/
|
|
1561
|
+
name?: string;
|
|
1562
|
+
/**
|
|
1563
|
+
* The node id or 'workflow' if the source is a workflow input.
|
|
1564
|
+
*/
|
|
1565
|
+
node?: string;
|
|
1566
|
+
}
|
|
1567
|
+
/**
|
|
1568
|
+
* Set of rules that describes when this input is required:
|
|
1569
|
+
*
|
|
1570
|
+
* - \`always\`: Input is always required
|
|
1571
|
+
* - \`ifNotDefined\`: Input is required when another specified input is not
|
|
1572
|
+
* defined
|
|
1573
|
+
* - \`ifDefined\`: Input is required when another specified input is defined
|
|
1574
|
+
* - \`conditionalValues\`: Input is required when another input has a specific
|
|
1575
|
+
* value
|
|
1576
|
+
*
|
|
1577
|
+
* By default, the input is not required.
|
|
1578
|
+
*/
|
|
1579
|
+
interface Required {
|
|
1580
|
+
/**
|
|
1581
|
+
* Whether the input is always required
|
|
1582
|
+
*/
|
|
1583
|
+
always?: boolean;
|
|
1584
|
+
/**
|
|
1585
|
+
* Makes this input required when another input has a specific value:
|
|
1586
|
+
*
|
|
1587
|
+
* - Key: name of the input to check
|
|
1588
|
+
* - Value: operation and allowed values that trigger the requirement
|
|
1589
|
+
*/
|
|
1590
|
+
conditionalValues?: unknown;
|
|
1591
|
+
/**
|
|
1592
|
+
* Makes this input required when another input is defined:
|
|
1593
|
+
*
|
|
1594
|
+
* - Key: name of the input that must be defined
|
|
1595
|
+
* - Value: message to display when this input is required
|
|
1596
|
+
*/
|
|
1597
|
+
ifDefined?: unknown;
|
|
1598
|
+
/**
|
|
1599
|
+
* Makes this input required when another input is not defined:
|
|
1600
|
+
*
|
|
1601
|
+
* - Key: name of the input that must be undefined
|
|
1602
|
+
* - Value: message to display when this input is required
|
|
1603
|
+
*/
|
|
1604
|
+
ifNotDefined?: unknown;
|
|
1605
|
+
}
|
|
1606
|
+
}
|
|
1607
|
+
/**
|
|
1608
|
+
* The logic of the node. Only available for logic nodes.
|
|
1609
|
+
*/
|
|
1610
|
+
interface Logic {
|
|
1611
|
+
/**
|
|
1612
|
+
* The cases of the logic. Only available for if/else nodes.
|
|
1613
|
+
*/
|
|
1614
|
+
cases?: Array<Logic.Case>;
|
|
1615
|
+
/**
|
|
1616
|
+
* The default case of the logic. Contains the id/output of the node to execute if
|
|
1617
|
+
* no case is matched. Only available for if/else nodes.
|
|
1618
|
+
*/
|
|
1619
|
+
default?: string;
|
|
1620
|
+
/**
|
|
1621
|
+
* The transform of the logic. Only available for transform nodes.
|
|
1622
|
+
*/
|
|
1623
|
+
transform?: string;
|
|
1624
|
+
}
|
|
1625
|
+
namespace Logic {
|
|
1626
|
+
interface Case {
|
|
1627
|
+
condition: string;
|
|
1628
|
+
value: string;
|
|
1629
|
+
}
|
|
1630
|
+
}
|
|
1631
|
+
}
|
|
1632
|
+
/**
|
|
1633
|
+
* Defines the input parameters for a model. Use this to understand the available
|
|
1634
|
+
* input parameters for a given `modelId` when calling
|
|
1635
|
+
* `POST /generate/custom/{modelId}`. See {@link
|
|
1636
|
+
* https://docs.scenario.com/docs/video-generation} for examples.
|
|
1637
|
+
*/
|
|
1638
|
+
interface Input {
|
|
1639
|
+
/**
|
|
1640
|
+
* The name that must be user to call the model through the API
|
|
1641
|
+
*/
|
|
1642
|
+
name: string;
|
|
1643
|
+
/**
|
|
1644
|
+
* The data type of the input
|
|
1645
|
+
*/
|
|
1646
|
+
type: 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array';
|
|
1647
|
+
/**
|
|
1648
|
+
* The allowed values for the input. For \`string\` or \`number\` types, creates a
|
|
1649
|
+
* single-select dropdown. For \`string_array\` type, creates a multi-select
|
|
1650
|
+
* dropdown.
|
|
1651
|
+
*/
|
|
1652
|
+
allowedValues?: Array<unknown>;
|
|
1653
|
+
/**
|
|
1654
|
+
* Specifies the background behavior for the input. Only available for \`file\` and
|
|
1655
|
+
* \`file_array\` input types with kind \`image\`.
|
|
1656
|
+
*/
|
|
1657
|
+
backgroundBehavior?: 'opaque' | 'transparent';
|
|
1658
|
+
/**
|
|
1659
|
+
* Whether the input is a color or not. Only available for \`string\` input type.
|
|
1660
|
+
*/
|
|
1661
|
+
color?: boolean;
|
|
1662
|
+
/**
|
|
1663
|
+
* Whether this input affects the model's cost calculation
|
|
1664
|
+
*/
|
|
1665
|
+
costImpact?: boolean;
|
|
1666
|
+
/**
|
|
1667
|
+
* Help text displayed in the UI to provide additional information about the input
|
|
1668
|
+
*/
|
|
1669
|
+
description?: string;
|
|
1670
|
+
/**
|
|
1671
|
+
* Used to visually group inputs together in the UI. Inputs with the same group
|
|
1672
|
+
* value appear consecutively in the UI.
|
|
1673
|
+
*/
|
|
1674
|
+
group?: string;
|
|
1675
|
+
/**
|
|
1676
|
+
* Hint text displayed in the UI as a tooltip to guide the user
|
|
1677
|
+
*/
|
|
1678
|
+
hint?: string;
|
|
1679
|
+
/**
|
|
1680
|
+
* The list of inputs which form an object within a container array. All inputs are
|
|
1681
|
+
* the same as the current object. This is only available for type inputs_array
|
|
1682
|
+
* inputs.
|
|
1683
|
+
*/
|
|
1684
|
+
inputs?: Array<unknown>;
|
|
1685
|
+
/**
|
|
1686
|
+
* The asset kind of the input. Only taken into account for \`file\` and
|
|
1687
|
+
* \`file_array\` input types.
|
|
1688
|
+
*/
|
|
1689
|
+
kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'video';
|
|
1690
|
+
/**
|
|
1691
|
+
* The label displayed in the UI for this input
|
|
1692
|
+
*/
|
|
1693
|
+
label?: string;
|
|
1694
|
+
/**
|
|
1695
|
+
* The name of the file input field to use as the mask source
|
|
1696
|
+
*/
|
|
1697
|
+
maskFrom?: string;
|
|
1698
|
+
/**
|
|
1699
|
+
* The maximum allowed value. Only available for \`number\` and \`array\` input
|
|
1700
|
+
* types.
|
|
1701
|
+
*/
|
|
1702
|
+
max?: number;
|
|
1703
|
+
/**
|
|
1704
|
+
* The maximum allowed length for \`string\` inputs. Also applies to each item in
|
|
1705
|
+
* \`string_array\`.
|
|
1706
|
+
*/
|
|
1707
|
+
maxLength?: number;
|
|
1708
|
+
/**
|
|
1709
|
+
* The minimum allowed value. Only available for \`number\` and array input types.
|
|
1710
|
+
*/
|
|
1711
|
+
min?: number;
|
|
1712
|
+
/**
|
|
1713
|
+
* The minimum allowed length for string inputs. Also applies to each item in
|
|
1714
|
+
* \`string_array\`.
|
|
1715
|
+
*/
|
|
1716
|
+
minLength?: number;
|
|
1717
|
+
/**
|
|
1718
|
+
* The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only
|
|
1719
|
+
* available for \`model_array\` input type.
|
|
1720
|
+
*/
|
|
1721
|
+
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'>;
|
|
1722
|
+
/**
|
|
1723
|
+
* Whether this input represents a parent asset to assign to the produced assets.
|
|
1724
|
+
* Only available for \`file\` and \`file_array\` input types.
|
|
1725
|
+
*
|
|
1726
|
+
* For \`file_array\`, the parent asset is the first item in the array.
|
|
1727
|
+
*/
|
|
1728
|
+
parent?: boolean;
|
|
1729
|
+
/**
|
|
1730
|
+
* Placeholder text for the input. Only available for 'string' input type.
|
|
1731
|
+
*/
|
|
1732
|
+
placeholder?: string;
|
|
1733
|
+
/**
|
|
1734
|
+
* Whether the input is a prompt. When true, displays as a text area with prompt
|
|
1735
|
+
* spark feature. Only available for \`string\` input type.
|
|
1736
|
+
*/
|
|
1737
|
+
prompt?: boolean;
|
|
1738
|
+
/**
|
|
1739
|
+
* Whether the input is used with prompt spark. Only available for \`string\` input
|
|
1740
|
+
* type.
|
|
1741
|
+
*/
|
|
1742
|
+
promptSpark?: boolean;
|
|
1743
|
+
/**
|
|
1744
|
+
* Set of rules that describes when this input is required:
|
|
1745
|
+
*
|
|
1746
|
+
* - \`always\`: Input is always required
|
|
1747
|
+
* - \`ifNotDefined\`: Input is required when another specified input is not
|
|
1748
|
+
* defined
|
|
1749
|
+
* - \`ifDefined\`: Input is required when another specified input is defined
|
|
1750
|
+
* - \`conditionalValues\`: Input is required when another input has a specific
|
|
1751
|
+
* value
|
|
1752
|
+
*
|
|
1753
|
+
* By default, the input is not required.
|
|
1754
|
+
*/
|
|
1755
|
+
required?: Input.Required;
|
|
1756
|
+
/**
|
|
1757
|
+
* The step increment for numeric inputs. Only available for \`number\` input type.
|
|
1758
|
+
*/
|
|
1759
|
+
step?: number;
|
|
1760
|
+
}
|
|
1761
|
+
namespace Input {
|
|
1762
|
+
/**
|
|
1763
|
+
* Set of rules that describes when this input is required:
|
|
1764
|
+
*
|
|
1765
|
+
* - \`always\`: Input is always required
|
|
1766
|
+
* - \`ifNotDefined\`: Input is required when another specified input is not
|
|
1767
|
+
* defined
|
|
1768
|
+
* - \`ifDefined\`: Input is required when another specified input is defined
|
|
1769
|
+
* - \`conditionalValues\`: Input is required when another input has a specific
|
|
1770
|
+
* value
|
|
1771
|
+
*
|
|
1772
|
+
* By default, the input is not required.
|
|
1773
|
+
*/
|
|
1774
|
+
interface Required {
|
|
1775
|
+
/**
|
|
1776
|
+
* Whether the input is always required
|
|
1777
|
+
*/
|
|
1778
|
+
always?: boolean;
|
|
1779
|
+
/**
|
|
1780
|
+
* Makes this input required when another input has a specific value:
|
|
1781
|
+
*
|
|
1782
|
+
* - Key: name of the input to check
|
|
1783
|
+
* - Value: operation and allowed values that trigger the requirement
|
|
1784
|
+
*/
|
|
1785
|
+
conditionalValues?: unknown;
|
|
1786
|
+
/**
|
|
1787
|
+
* Makes this input required when another input is defined:
|
|
1788
|
+
*
|
|
1789
|
+
* - Key: name of the input that must be defined
|
|
1790
|
+
* - Value: message to display when this input is required
|
|
1791
|
+
*/
|
|
1792
|
+
ifDefined?: unknown;
|
|
1793
|
+
/**
|
|
1794
|
+
* Makes this input required when another input is not defined:
|
|
1795
|
+
*
|
|
1796
|
+
* - Key: name of the input that must be undefined
|
|
1797
|
+
* - Value: message to display when this input is required
|
|
1798
|
+
*/
|
|
1799
|
+
ifNotDefined?: unknown;
|
|
1800
|
+
}
|
|
1801
|
+
}
|
|
1802
|
+
/**
|
|
1803
|
+
* A representation of an asset after being processed by the workflow
|
|
1804
|
+
*/
|
|
1805
|
+
interface After {
|
|
1806
|
+
/**
|
|
1807
|
+
* The AssetId of the image used as a thumbnail for your model (example:
|
|
1808
|
+
* "asset_GTrL3mq4SXWyMxkOHRxlpw")
|
|
1809
|
+
*/
|
|
1810
|
+
assetId: string;
|
|
1811
|
+
/**
|
|
1812
|
+
* The url of the image used as a thumbnail for your model
|
|
1813
|
+
*/
|
|
1814
|
+
url: string;
|
|
1815
|
+
}
|
|
1816
|
+
/**
|
|
1817
|
+
* A representation of an asset before being processed by the workflow
|
|
1818
|
+
*/
|
|
1819
|
+
interface Before {
|
|
1820
|
+
/**
|
|
1821
|
+
* The AssetId of the image used as a thumbnail for your model (example:
|
|
1822
|
+
* "asset_GTrL3mq4SXWyMxkOHRxlpw")
|
|
1823
|
+
*/
|
|
1824
|
+
assetId: string;
|
|
1825
|
+
/**
|
|
1826
|
+
* The url of the image used as a thumbnail for your model
|
|
1827
|
+
*/
|
|
1828
|
+
url: string;
|
|
1829
|
+
}
|
|
1830
|
+
/**
|
|
1831
|
+
* Currently the thumbnail is identical to the after asset.
|
|
1832
|
+
*/
|
|
1833
|
+
interface Thumbnail {
|
|
1834
|
+
assetId: string;
|
|
1835
|
+
url: string;
|
|
1836
|
+
}
|
|
1837
|
+
/**
|
|
1838
|
+
* The UI configuration for the workflow. This is managed by scenario webapp.
|
|
1839
|
+
*/
|
|
1840
|
+
interface UiConfig {
|
|
1841
|
+
/**
|
|
1842
|
+
* Configuration for the input properties
|
|
1843
|
+
*/
|
|
1844
|
+
inputProperties?: {
|
|
1845
|
+
[key: string]: UiConfig.InputProperties;
|
|
1846
|
+
};
|
|
1847
|
+
/**
|
|
1848
|
+
* Configuration for the loras component
|
|
1849
|
+
*/
|
|
1850
|
+
lorasComponent?: UiConfig.LorasComponent;
|
|
1851
|
+
/**
|
|
1852
|
+
* Configuration for the presets
|
|
1853
|
+
*/
|
|
1854
|
+
presets?: Array<UiConfig.Preset>;
|
|
1855
|
+
/**
|
|
1856
|
+
* Configuration for the resolution component
|
|
1857
|
+
*/
|
|
1858
|
+
resolutionComponent?: UiConfig.ResolutionComponent;
|
|
1859
|
+
/**
|
|
1860
|
+
* Configuration for the selects
|
|
1861
|
+
*/
|
|
1862
|
+
selects?: {
|
|
1863
|
+
[key: string]: unknown;
|
|
1864
|
+
};
|
|
1865
|
+
/**
|
|
1866
|
+
* Configuration for the trigger generate button
|
|
1867
|
+
*/
|
|
1868
|
+
triggerGenerate?: UiConfig.TriggerGenerate;
|
|
1869
|
+
}
|
|
1870
|
+
namespace UiConfig {
|
|
1871
|
+
interface InputProperties {
|
|
1872
|
+
collapsed?: boolean;
|
|
1873
|
+
}
|
|
1874
|
+
/**
|
|
1875
|
+
* Configuration for the loras component
|
|
1876
|
+
*/
|
|
1877
|
+
interface LorasComponent {
|
|
1878
|
+
/**
|
|
1879
|
+
* The label of the component
|
|
1880
|
+
*/
|
|
1881
|
+
label: string;
|
|
1882
|
+
/**
|
|
1883
|
+
* The input name of the model (model_array)
|
|
1884
|
+
*/
|
|
1885
|
+
modelInput: string;
|
|
1886
|
+
/**
|
|
1887
|
+
* The input name of the scale (number_array)
|
|
1888
|
+
*/
|
|
1889
|
+
scaleInput: string;
|
|
1890
|
+
/**
|
|
1891
|
+
* The input model id (example: a composition or a single LoRA modelId) If
|
|
1892
|
+
* specified, the model id will be attached to the output asset as a metadata If
|
|
1893
|
+
* the model-decomposer parser is specified on it, modelInput and scaleInput will
|
|
1894
|
+
* be automatically populated
|
|
1895
|
+
*/
|
|
1896
|
+
modelIdInput?: string;
|
|
1897
|
+
}
|
|
1898
|
+
interface Preset {
|
|
1899
|
+
fields: Array<string>;
|
|
1900
|
+
presets: unknown;
|
|
1901
|
+
}
|
|
1902
|
+
/**
|
|
1903
|
+
* Configuration for the resolution component
|
|
1904
|
+
*/
|
|
1905
|
+
interface ResolutionComponent {
|
|
1906
|
+
/**
|
|
1907
|
+
* The input name of the height
|
|
1908
|
+
*/
|
|
1909
|
+
heightInput: string;
|
|
1910
|
+
/**
|
|
1911
|
+
* The label of the component
|
|
1912
|
+
*/
|
|
1913
|
+
label: string;
|
|
1914
|
+
/**
|
|
1915
|
+
* The resolution presets
|
|
1916
|
+
*/
|
|
1917
|
+
presets: Array<ResolutionComponent.Preset>;
|
|
1918
|
+
/**
|
|
1919
|
+
* The input name of the width
|
|
1920
|
+
*/
|
|
1921
|
+
widthInput: string;
|
|
1922
|
+
}
|
|
1923
|
+
namespace ResolutionComponent {
|
|
1924
|
+
interface Preset {
|
|
1925
|
+
height: number;
|
|
1926
|
+
label: string;
|
|
1927
|
+
width: number;
|
|
1928
|
+
}
|
|
1929
|
+
}
|
|
1930
|
+
/**
|
|
1931
|
+
* Configuration for the trigger generate button
|
|
1932
|
+
*/
|
|
1933
|
+
interface TriggerGenerate {
|
|
1934
|
+
label: string;
|
|
1935
|
+
/**
|
|
1936
|
+
* The 'name' of the input where the trigger generate button will be displayed
|
|
1937
|
+
* (after the input). Do not specify both position and after.
|
|
1938
|
+
*/
|
|
1939
|
+
after?: string;
|
|
1940
|
+
/**
|
|
1941
|
+
* The position of the trigger generate button. If position specified, the button
|
|
1942
|
+
* will be displayed at the specified position. Do not specify both position and
|
|
1943
|
+
* after.
|
|
1944
|
+
*/
|
|
1945
|
+
position?: 'bottom' | 'top';
|
|
1946
|
+
}
|
|
1947
|
+
}
|
|
1948
|
+
}
|
|
1949
|
+
}
|
|
1950
|
+
/**
|
|
1951
|
+
* Returns a paginated list of workflows. Supports both public access (via the
|
|
1952
|
+
* `Authorization` header set to `public-auth-token`) and authenticated user access
|
|
1953
|
+
* (including API keys). Public responses exclude some attributes.
|
|
1954
|
+
*/
|
|
1955
|
+
export interface WorkflowListResponse {
|
|
1956
|
+
workflows: Array<WorkflowListResponse.Workflow>;
|
|
1957
|
+
/**
|
|
1958
|
+
* A token to query the next page of workflows
|
|
1959
|
+
*/
|
|
1960
|
+
nextPaginationToken?: string;
|
|
1961
|
+
}
|
|
1962
|
+
export declare namespace WorkflowListResponse {
|
|
1963
|
+
interface Workflow {
|
|
1964
|
+
id: string;
|
|
1965
|
+
authorId: string;
|
|
1966
|
+
/**
|
|
1967
|
+
* ISO string
|
|
1968
|
+
*/
|
|
1969
|
+
createdAt: string;
|
|
1970
|
+
/**
|
|
1971
|
+
* The description of the workflow.
|
|
1972
|
+
*/
|
|
1973
|
+
description: string;
|
|
1974
|
+
/**
|
|
1975
|
+
* The UI data about the workflow. This is managed by scenario webapp.
|
|
1976
|
+
*/
|
|
1977
|
+
editorInfo: unknown;
|
|
1978
|
+
/**
|
|
1979
|
+
* The flow of the workflow.
|
|
1980
|
+
*/
|
|
1981
|
+
flow: Array<Workflow.Flow>;
|
|
1982
|
+
/**
|
|
1983
|
+
* The inputs of the workflow.
|
|
1984
|
+
*/
|
|
1985
|
+
inputs: Array<Workflow.Input>;
|
|
1986
|
+
name: string;
|
|
1987
|
+
ownerId: string;
|
|
1988
|
+
privacy: 'private' | 'public' | 'unlisted';
|
|
1989
|
+
status: 'deleted' | 'draft' | 'ready';
|
|
1990
|
+
/**
|
|
1991
|
+
* The tag set of the workflow.
|
|
1992
|
+
*/
|
|
1993
|
+
tagSet: Array<string>;
|
|
1994
|
+
/**
|
|
1995
|
+
* ISO string
|
|
1996
|
+
*/
|
|
1997
|
+
updatedAt: string;
|
|
1998
|
+
/**
|
|
1999
|
+
* A representation of an asset after being processed by the workflow
|
|
2000
|
+
*/
|
|
2001
|
+
after?: Workflow.After;
|
|
2002
|
+
/**
|
|
2003
|
+
* A representation of an asset before being processed by the workflow
|
|
2004
|
+
*/
|
|
2005
|
+
before?: Workflow.Before;
|
|
2006
|
+
outputAssetKinds?: Array<'3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'video'>;
|
|
2007
|
+
shortDescription?: string;
|
|
2008
|
+
/**
|
|
2009
|
+
* Currently the thumbnail is identical to the after asset.
|
|
2010
|
+
*/
|
|
2011
|
+
thumbnail?: Workflow.Thumbnail;
|
|
2012
|
+
/**
|
|
2013
|
+
* The UI configuration for the workflow. This is managed by scenario webapp.
|
|
2014
|
+
*/
|
|
2015
|
+
uiConfig?: Workflow.UiConfig;
|
|
2016
|
+
}
|
|
2017
|
+
namespace Workflow {
|
|
2018
|
+
interface Flow {
|
|
2019
|
+
/**
|
|
2020
|
+
* The id of the node.
|
|
2021
|
+
*/
|
|
2022
|
+
id: string;
|
|
2023
|
+
/**
|
|
2024
|
+
* The type of the job for the node.
|
|
2025
|
+
*/
|
|
2026
|
+
type: 'custom-model' | 'generate-prompt' | 'logic' | 'remove-background' | 'transform' | 'user-approval' | 'workflow';
|
|
2027
|
+
/**
|
|
2028
|
+
* The nodes that this node depends on. Only available for nodes that have
|
|
2029
|
+
* dependencies. Mainly used for user approval nodes.
|
|
2030
|
+
*/
|
|
2031
|
+
dependsOn?: Array<string>;
|
|
2032
|
+
/**
|
|
2033
|
+
* The inputs of the node.
|
|
2034
|
+
*/
|
|
2035
|
+
inputs?: Array<Flow.Input>;
|
|
2036
|
+
/**
|
|
2037
|
+
* The logic of the node. Only available for logic nodes.
|
|
2038
|
+
*/
|
|
2039
|
+
logic?: Flow.Logic;
|
|
2040
|
+
/**
|
|
2041
|
+
* The type of the logic for the node. Only available for logic nodes.
|
|
2042
|
+
*/
|
|
2043
|
+
logicType?: 'if-else';
|
|
2044
|
+
/**
|
|
2045
|
+
* The model id for the node. Mainly used for custom model tasks.
|
|
2046
|
+
*/
|
|
2047
|
+
modelId?: string;
|
|
2048
|
+
/**
|
|
2049
|
+
* The workflow id for the node. Mainly used for workflow tasks.
|
|
2050
|
+
*/
|
|
2051
|
+
workflowId?: string;
|
|
2052
|
+
}
|
|
2053
|
+
namespace Flow {
|
|
2054
|
+
/**
|
|
2055
|
+
* This is used to run the flow.
|
|
2056
|
+
*/
|
|
2057
|
+
interface Input {
|
|
2058
|
+
/**
|
|
2059
|
+
* The name that must be user to call the model through the API
|
|
2060
|
+
*/
|
|
2061
|
+
name: string;
|
|
2062
|
+
/**
|
|
2063
|
+
* The data type of the input
|
|
2064
|
+
*/
|
|
2065
|
+
type: 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array';
|
|
2066
|
+
/**
|
|
2067
|
+
* The allowed values for the input. For \`string\` or \`number\` types, creates a
|
|
2068
|
+
* single-select dropdown. For \`string_array\` type, creates a multi-select
|
|
2069
|
+
* dropdown.
|
|
2070
|
+
*/
|
|
2071
|
+
allowedValues?: Array<unknown>;
|
|
2072
|
+
/**
|
|
2073
|
+
* Specifies the background behavior for the input. Only available for \`file\` and
|
|
2074
|
+
* \`file_array\` input types with kind \`image\`.
|
|
2075
|
+
*/
|
|
2076
|
+
backgroundBehavior?: 'opaque' | 'transparent';
|
|
2077
|
+
/**
|
|
2078
|
+
* Whether the input is a color or not. Only available for \`string\` input type.
|
|
2079
|
+
*/
|
|
2080
|
+
color?: boolean;
|
|
2081
|
+
/**
|
|
2082
|
+
* Whether this input affects the model's cost calculation
|
|
2083
|
+
*/
|
|
2084
|
+
costImpact?: boolean;
|
|
2085
|
+
/**
|
|
2086
|
+
* Help text displayed in the UI to provide additional information about the input
|
|
2087
|
+
*/
|
|
2088
|
+
description?: string;
|
|
2089
|
+
/**
|
|
2090
|
+
* Used to visually group inputs together in the UI. Inputs with the same group
|
|
2091
|
+
* value appear consecutively in the UI.
|
|
2092
|
+
*/
|
|
2093
|
+
group?: string;
|
|
2094
|
+
/**
|
|
2095
|
+
* Hint text displayed in the UI as a tooltip to guide the user
|
|
2096
|
+
*/
|
|
2097
|
+
hint?: string;
|
|
2098
|
+
/**
|
|
2099
|
+
* The list of inputs which form an object within a container array. All inputs are
|
|
2100
|
+
* the same as the current object. This is only available for type inputs_array
|
|
2101
|
+
* inputs.
|
|
2102
|
+
*/
|
|
2103
|
+
inputs?: Array<unknown>;
|
|
2104
|
+
/**
|
|
2105
|
+
* The asset kind of the input. Only taken into account for \`file\` and
|
|
2106
|
+
* \`file_array\` input types.
|
|
2107
|
+
*/
|
|
2108
|
+
kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'video';
|
|
2109
|
+
/**
|
|
2110
|
+
* The label displayed in the UI for this input
|
|
2111
|
+
*/
|
|
2112
|
+
label?: string;
|
|
2113
|
+
/**
|
|
2114
|
+
* The name of the file input field to use as the mask source
|
|
2115
|
+
*/
|
|
2116
|
+
maskFrom?: string;
|
|
2117
|
+
/**
|
|
2118
|
+
* The maximum allowed value. Only available for \`number\` and \`array\` input
|
|
2119
|
+
* types.
|
|
2120
|
+
*/
|
|
2121
|
+
max?: number;
|
|
2122
|
+
/**
|
|
2123
|
+
* The maximum allowed length for \`string\` inputs. Also applies to each item in
|
|
2124
|
+
* \`string_array\`.
|
|
2125
|
+
*/
|
|
2126
|
+
maxLength?: number;
|
|
2127
|
+
/**
|
|
2128
|
+
* The minimum allowed value. Only available for \`number\` and array input types.
|
|
2129
|
+
*/
|
|
2130
|
+
min?: number;
|
|
2131
|
+
/**
|
|
2132
|
+
* The minimum allowed length for string inputs. Also applies to each item in
|
|
2133
|
+
* \`string_array\`.
|
|
2134
|
+
*/
|
|
2135
|
+
minLength?: number;
|
|
2136
|
+
/**
|
|
2137
|
+
* The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only
|
|
2138
|
+
* available for \`model_array\` input type.
|
|
2139
|
+
*/
|
|
2140
|
+
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'>;
|
|
2141
|
+
/**
|
|
2142
|
+
* Whether this input represents a parent asset to assign to the produced assets.
|
|
2143
|
+
* Only available for \`file\` and \`file_array\` input types.
|
|
2144
|
+
*
|
|
2145
|
+
* For \`file_array\`, the parent asset is the first item in the array.
|
|
2146
|
+
*/
|
|
2147
|
+
parent?: boolean;
|
|
2148
|
+
/**
|
|
2149
|
+
* Placeholder text for the input. Only available for 'string' input type.
|
|
2150
|
+
*/
|
|
2151
|
+
placeholder?: string;
|
|
2152
|
+
/**
|
|
2153
|
+
* Whether the input is a prompt. When true, displays as a text area with prompt
|
|
2154
|
+
* spark feature. Only available for \`string\` input type.
|
|
2155
|
+
*/
|
|
2156
|
+
prompt?: boolean;
|
|
2157
|
+
/**
|
|
2158
|
+
* Whether the input is used with prompt spark. Only available for \`string\` input
|
|
2159
|
+
* type.
|
|
2160
|
+
*/
|
|
2161
|
+
promptSpark?: boolean;
|
|
2162
|
+
/**
|
|
2163
|
+
* The reference to another input or output of the same workflow. Must have at
|
|
2164
|
+
* least one of node or conditional.
|
|
2165
|
+
*/
|
|
2166
|
+
ref?: Input.Ref;
|
|
2167
|
+
/**
|
|
2168
|
+
* Set of rules that describes when this input is required:
|
|
2169
|
+
*
|
|
2170
|
+
* - \`always\`: Input is always required
|
|
2171
|
+
* - \`ifNotDefined\`: Input is required when another specified input is not
|
|
2172
|
+
* defined
|
|
2173
|
+
* - \`ifDefined\`: Input is required when another specified input is defined
|
|
2174
|
+
* - \`conditionalValues\`: Input is required when another input has a specific
|
|
2175
|
+
* value
|
|
2176
|
+
*
|
|
2177
|
+
* By default, the input is not required.
|
|
2178
|
+
*/
|
|
2179
|
+
required?: Input.Required;
|
|
2180
|
+
/**
|
|
2181
|
+
* The step increment for numeric inputs. Only available for \`number\` input type.
|
|
2182
|
+
*/
|
|
2183
|
+
step?: number;
|
|
2184
|
+
}
|
|
2185
|
+
namespace Input {
|
|
2186
|
+
/**
|
|
2187
|
+
* The reference to another input or output of the same workflow. Must have at
|
|
2188
|
+
* least one of node or conditional.
|
|
2189
|
+
*/
|
|
2190
|
+
interface Ref {
|
|
2191
|
+
/**
|
|
2192
|
+
* The conditional nodes to reference. If the conditional nodes are successful, the
|
|
2193
|
+
* node will be successful. If the conditional nodes are skipped, the node will be
|
|
2194
|
+
* skipped. Contains an array of node ids used to check the status of the nodes.
|
|
2195
|
+
*/
|
|
2196
|
+
conditional?: Array<string>;
|
|
2197
|
+
/**
|
|
2198
|
+
* This is the desired node output value if ref is an if/else node.
|
|
2199
|
+
*/
|
|
2200
|
+
equal?: string;
|
|
2201
|
+
/**
|
|
2202
|
+
* The name of the input or output to reference. If the type is 'workflow', the
|
|
2203
|
+
* name is the name of the input of the workflow is required If the type is 'node',
|
|
2204
|
+
* the name is not mandatory, except if you want all outputs of the node. To get
|
|
2205
|
+
* all outputs of a node, you can use the name 'all'.
|
|
2206
|
+
*/
|
|
2207
|
+
name?: string;
|
|
2208
|
+
/**
|
|
2209
|
+
* The node id or 'workflow' if the source is a workflow input.
|
|
2210
|
+
*/
|
|
2211
|
+
node?: string;
|
|
2212
|
+
}
|
|
2213
|
+
/**
|
|
2214
|
+
* Set of rules that describes when this input is required:
|
|
2215
|
+
*
|
|
2216
|
+
* - \`always\`: Input is always required
|
|
2217
|
+
* - \`ifNotDefined\`: Input is required when another specified input is not
|
|
2218
|
+
* defined
|
|
2219
|
+
* - \`ifDefined\`: Input is required when another specified input is defined
|
|
2220
|
+
* - \`conditionalValues\`: Input is required when another input has a specific
|
|
2221
|
+
* value
|
|
2222
|
+
*
|
|
2223
|
+
* By default, the input is not required.
|
|
2224
|
+
*/
|
|
2225
|
+
interface Required {
|
|
2226
|
+
/**
|
|
2227
|
+
* Whether the input is always required
|
|
2228
|
+
*/
|
|
2229
|
+
always?: boolean;
|
|
2230
|
+
/**
|
|
2231
|
+
* Makes this input required when another input has a specific value:
|
|
2232
|
+
*
|
|
2233
|
+
* - Key: name of the input to check
|
|
2234
|
+
* - Value: operation and allowed values that trigger the requirement
|
|
2235
|
+
*/
|
|
2236
|
+
conditionalValues?: unknown;
|
|
2237
|
+
/**
|
|
2238
|
+
* Makes this input required when another input is defined:
|
|
2239
|
+
*
|
|
2240
|
+
* - Key: name of the input that must be defined
|
|
2241
|
+
* - Value: message to display when this input is required
|
|
2242
|
+
*/
|
|
2243
|
+
ifDefined?: unknown;
|
|
2244
|
+
/**
|
|
2245
|
+
* Makes this input required when another input is not defined:
|
|
2246
|
+
*
|
|
2247
|
+
* - Key: name of the input that must be undefined
|
|
2248
|
+
* - Value: message to display when this input is required
|
|
2249
|
+
*/
|
|
2250
|
+
ifNotDefined?: unknown;
|
|
2251
|
+
}
|
|
2252
|
+
}
|
|
2253
|
+
/**
|
|
2254
|
+
* The logic of the node. Only available for logic nodes.
|
|
2255
|
+
*/
|
|
2256
|
+
interface Logic {
|
|
2257
|
+
/**
|
|
2258
|
+
* The cases of the logic. Only available for if/else nodes.
|
|
2259
|
+
*/
|
|
2260
|
+
cases?: Array<Logic.Case>;
|
|
2261
|
+
/**
|
|
2262
|
+
* The default case of the logic. Contains the id/output of the node to execute if
|
|
2263
|
+
* no case is matched. Only available for if/else nodes.
|
|
2264
|
+
*/
|
|
2265
|
+
default?: string;
|
|
2266
|
+
/**
|
|
2267
|
+
* The transform of the logic. Only available for transform nodes.
|
|
2268
|
+
*/
|
|
2269
|
+
transform?: string;
|
|
2270
|
+
}
|
|
2271
|
+
namespace Logic {
|
|
2272
|
+
interface Case {
|
|
2273
|
+
condition: string;
|
|
2274
|
+
value: string;
|
|
2275
|
+
}
|
|
2276
|
+
}
|
|
2277
|
+
}
|
|
2278
|
+
/**
|
|
2279
|
+
* Defines the input parameters for a model. Use this to understand the available
|
|
2280
|
+
* input parameters for a given `modelId` when calling
|
|
2281
|
+
* `POST /generate/custom/{modelId}`. See {@link
|
|
2282
|
+
* https://docs.scenario.com/docs/video-generation} for examples.
|
|
2283
|
+
*/
|
|
2284
|
+
interface Input {
|
|
2285
|
+
/**
|
|
2286
|
+
* The name that must be user to call the model through the API
|
|
2287
|
+
*/
|
|
2288
|
+
name: string;
|
|
2289
|
+
/**
|
|
2290
|
+
* The data type of the input
|
|
2291
|
+
*/
|
|
2292
|
+
type: 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array';
|
|
2293
|
+
/**
|
|
2294
|
+
* The allowed values for the input. For \`string\` or \`number\` types, creates a
|
|
2295
|
+
* single-select dropdown. For \`string_array\` type, creates a multi-select
|
|
2296
|
+
* dropdown.
|
|
2297
|
+
*/
|
|
2298
|
+
allowedValues?: Array<unknown>;
|
|
2299
|
+
/**
|
|
2300
|
+
* Specifies the background behavior for the input. Only available for \`file\` and
|
|
2301
|
+
* \`file_array\` input types with kind \`image\`.
|
|
2302
|
+
*/
|
|
2303
|
+
backgroundBehavior?: 'opaque' | 'transparent';
|
|
2304
|
+
/**
|
|
2305
|
+
* Whether the input is a color or not. Only available for \`string\` input type.
|
|
2306
|
+
*/
|
|
2307
|
+
color?: boolean;
|
|
2308
|
+
/**
|
|
2309
|
+
* Whether this input affects the model's cost calculation
|
|
2310
|
+
*/
|
|
2311
|
+
costImpact?: boolean;
|
|
2312
|
+
/**
|
|
2313
|
+
* Help text displayed in the UI to provide additional information about the input
|
|
2314
|
+
*/
|
|
2315
|
+
description?: string;
|
|
2316
|
+
/**
|
|
2317
|
+
* Used to visually group inputs together in the UI. Inputs with the same group
|
|
2318
|
+
* value appear consecutively in the UI.
|
|
2319
|
+
*/
|
|
2320
|
+
group?: string;
|
|
2321
|
+
/**
|
|
2322
|
+
* Hint text displayed in the UI as a tooltip to guide the user
|
|
2323
|
+
*/
|
|
2324
|
+
hint?: string;
|
|
2325
|
+
/**
|
|
2326
|
+
* The list of inputs which form an object within a container array. All inputs are
|
|
2327
|
+
* the same as the current object. This is only available for type inputs_array
|
|
2328
|
+
* inputs.
|
|
2329
|
+
*/
|
|
2330
|
+
inputs?: Array<unknown>;
|
|
2331
|
+
/**
|
|
2332
|
+
* The asset kind of the input. Only taken into account for \`file\` and
|
|
2333
|
+
* \`file_array\` input types.
|
|
2334
|
+
*/
|
|
2335
|
+
kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'video';
|
|
2336
|
+
/**
|
|
2337
|
+
* The label displayed in the UI for this input
|
|
2338
|
+
*/
|
|
2339
|
+
label?: string;
|
|
2340
|
+
/**
|
|
2341
|
+
* The name of the file input field to use as the mask source
|
|
2342
|
+
*/
|
|
2343
|
+
maskFrom?: string;
|
|
2344
|
+
/**
|
|
2345
|
+
* The maximum allowed value. Only available for \`number\` and \`array\` input
|
|
2346
|
+
* types.
|
|
2347
|
+
*/
|
|
2348
|
+
max?: number;
|
|
2349
|
+
/**
|
|
2350
|
+
* The maximum allowed length for \`string\` inputs. Also applies to each item in
|
|
2351
|
+
* \`string_array\`.
|
|
2352
|
+
*/
|
|
2353
|
+
maxLength?: number;
|
|
2354
|
+
/**
|
|
2355
|
+
* The minimum allowed value. Only available for \`number\` and array input types.
|
|
2356
|
+
*/
|
|
2357
|
+
min?: number;
|
|
2358
|
+
/**
|
|
2359
|
+
* The minimum allowed length for string inputs. Also applies to each item in
|
|
2360
|
+
* \`string_array\`.
|
|
2361
|
+
*/
|
|
2362
|
+
minLength?: number;
|
|
2363
|
+
/**
|
|
2364
|
+
* The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only
|
|
2365
|
+
* available for \`model_array\` input type.
|
|
2366
|
+
*/
|
|
2367
|
+
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'>;
|
|
2368
|
+
/**
|
|
2369
|
+
* Whether this input represents a parent asset to assign to the produced assets.
|
|
2370
|
+
* Only available for \`file\` and \`file_array\` input types.
|
|
2371
|
+
*
|
|
2372
|
+
* For \`file_array\`, the parent asset is the first item in the array.
|
|
2373
|
+
*/
|
|
2374
|
+
parent?: boolean;
|
|
2375
|
+
/**
|
|
2376
|
+
* Placeholder text for the input. Only available for 'string' input type.
|
|
2377
|
+
*/
|
|
2378
|
+
placeholder?: string;
|
|
2379
|
+
/**
|
|
2380
|
+
* Whether the input is a prompt. When true, displays as a text area with prompt
|
|
2381
|
+
* spark feature. Only available for \`string\` input type.
|
|
2382
|
+
*/
|
|
2383
|
+
prompt?: boolean;
|
|
2384
|
+
/**
|
|
2385
|
+
* Whether the input is used with prompt spark. Only available for \`string\` input
|
|
2386
|
+
* type.
|
|
2387
|
+
*/
|
|
2388
|
+
promptSpark?: boolean;
|
|
2389
|
+
/**
|
|
2390
|
+
* Set of rules that describes when this input is required:
|
|
2391
|
+
*
|
|
2392
|
+
* - \`always\`: Input is always required
|
|
2393
|
+
* - \`ifNotDefined\`: Input is required when another specified input is not
|
|
2394
|
+
* defined
|
|
2395
|
+
* - \`ifDefined\`: Input is required when another specified input is defined
|
|
2396
|
+
* - \`conditionalValues\`: Input is required when another input has a specific
|
|
2397
|
+
* value
|
|
2398
|
+
*
|
|
2399
|
+
* By default, the input is not required.
|
|
2400
|
+
*/
|
|
2401
|
+
required?: Input.Required;
|
|
2402
|
+
/**
|
|
2403
|
+
* The step increment for numeric inputs. Only available for \`number\` input type.
|
|
2404
|
+
*/
|
|
2405
|
+
step?: number;
|
|
2406
|
+
}
|
|
2407
|
+
namespace Input {
|
|
2408
|
+
/**
|
|
2409
|
+
* Set of rules that describes when this input is required:
|
|
2410
|
+
*
|
|
2411
|
+
* - \`always\`: Input is always required
|
|
2412
|
+
* - \`ifNotDefined\`: Input is required when another specified input is not
|
|
2413
|
+
* defined
|
|
2414
|
+
* - \`ifDefined\`: Input is required when another specified input is defined
|
|
2415
|
+
* - \`conditionalValues\`: Input is required when another input has a specific
|
|
2416
|
+
* value
|
|
2417
|
+
*
|
|
2418
|
+
* By default, the input is not required.
|
|
2419
|
+
*/
|
|
2420
|
+
interface Required {
|
|
2421
|
+
/**
|
|
2422
|
+
* Whether the input is always required
|
|
2423
|
+
*/
|
|
2424
|
+
always?: boolean;
|
|
2425
|
+
/**
|
|
2426
|
+
* Makes this input required when another input has a specific value:
|
|
2427
|
+
*
|
|
2428
|
+
* - Key: name of the input to check
|
|
2429
|
+
* - Value: operation and allowed values that trigger the requirement
|
|
2430
|
+
*/
|
|
2431
|
+
conditionalValues?: unknown;
|
|
2432
|
+
/**
|
|
2433
|
+
* Makes this input required when another input is defined:
|
|
2434
|
+
*
|
|
2435
|
+
* - Key: name of the input that must be defined
|
|
2436
|
+
* - Value: message to display when this input is required
|
|
2437
|
+
*/
|
|
2438
|
+
ifDefined?: unknown;
|
|
2439
|
+
/**
|
|
2440
|
+
* Makes this input required when another input is not defined:
|
|
2441
|
+
*
|
|
2442
|
+
* - Key: name of the input that must be undefined
|
|
2443
|
+
* - Value: message to display when this input is required
|
|
2444
|
+
*/
|
|
2445
|
+
ifNotDefined?: unknown;
|
|
2446
|
+
}
|
|
2447
|
+
}
|
|
2448
|
+
/**
|
|
2449
|
+
* A representation of an asset after being processed by the workflow
|
|
2450
|
+
*/
|
|
2451
|
+
interface After {
|
|
2452
|
+
/**
|
|
2453
|
+
* The AssetId of the image used as a thumbnail for your model (example:
|
|
2454
|
+
* "asset_GTrL3mq4SXWyMxkOHRxlpw")
|
|
2455
|
+
*/
|
|
2456
|
+
assetId: string;
|
|
2457
|
+
/**
|
|
2458
|
+
* The url of the image used as a thumbnail for your model
|
|
2459
|
+
*/
|
|
2460
|
+
url: string;
|
|
2461
|
+
}
|
|
2462
|
+
/**
|
|
2463
|
+
* A representation of an asset before being processed by the workflow
|
|
2464
|
+
*/
|
|
2465
|
+
interface Before {
|
|
2466
|
+
/**
|
|
2467
|
+
* The AssetId of the image used as a thumbnail for your model (example:
|
|
2468
|
+
* "asset_GTrL3mq4SXWyMxkOHRxlpw")
|
|
2469
|
+
*/
|
|
2470
|
+
assetId: string;
|
|
2471
|
+
/**
|
|
2472
|
+
* The url of the image used as a thumbnail for your model
|
|
2473
|
+
*/
|
|
2474
|
+
url: string;
|
|
2475
|
+
}
|
|
2476
|
+
/**
|
|
2477
|
+
* Currently the thumbnail is identical to the after asset.
|
|
2478
|
+
*/
|
|
2479
|
+
interface Thumbnail {
|
|
2480
|
+
assetId: string;
|
|
2481
|
+
url: string;
|
|
2482
|
+
}
|
|
2483
|
+
/**
|
|
2484
|
+
* The UI configuration for the workflow. This is managed by scenario webapp.
|
|
2485
|
+
*/
|
|
2486
|
+
interface UiConfig {
|
|
2487
|
+
/**
|
|
2488
|
+
* Configuration for the input properties
|
|
2489
|
+
*/
|
|
2490
|
+
inputProperties?: {
|
|
2491
|
+
[key: string]: UiConfig.InputProperties;
|
|
2492
|
+
};
|
|
2493
|
+
/**
|
|
2494
|
+
* Configuration for the loras component
|
|
2495
|
+
*/
|
|
2496
|
+
lorasComponent?: UiConfig.LorasComponent;
|
|
2497
|
+
/**
|
|
2498
|
+
* Configuration for the presets
|
|
2499
|
+
*/
|
|
2500
|
+
presets?: Array<UiConfig.Preset>;
|
|
2501
|
+
/**
|
|
2502
|
+
* Configuration for the resolution component
|
|
2503
|
+
*/
|
|
2504
|
+
resolutionComponent?: UiConfig.ResolutionComponent;
|
|
2505
|
+
/**
|
|
2506
|
+
* Configuration for the selects
|
|
2507
|
+
*/
|
|
2508
|
+
selects?: {
|
|
2509
|
+
[key: string]: unknown;
|
|
2510
|
+
};
|
|
2511
|
+
/**
|
|
2512
|
+
* Configuration for the trigger generate button
|
|
2513
|
+
*/
|
|
2514
|
+
triggerGenerate?: UiConfig.TriggerGenerate;
|
|
2515
|
+
}
|
|
2516
|
+
namespace UiConfig {
|
|
2517
|
+
interface InputProperties {
|
|
2518
|
+
collapsed?: boolean;
|
|
2519
|
+
}
|
|
2520
|
+
/**
|
|
2521
|
+
* Configuration for the loras component
|
|
2522
|
+
*/
|
|
2523
|
+
interface LorasComponent {
|
|
2524
|
+
/**
|
|
2525
|
+
* The label of the component
|
|
2526
|
+
*/
|
|
2527
|
+
label: string;
|
|
2528
|
+
/**
|
|
2529
|
+
* The input name of the model (model_array)
|
|
2530
|
+
*/
|
|
2531
|
+
modelInput: string;
|
|
2532
|
+
/**
|
|
2533
|
+
* The input name of the scale (number_array)
|
|
2534
|
+
*/
|
|
2535
|
+
scaleInput: string;
|
|
2536
|
+
/**
|
|
2537
|
+
* The input model id (example: a composition or a single LoRA modelId) If
|
|
2538
|
+
* specified, the model id will be attached to the output asset as a metadata If
|
|
2539
|
+
* the model-decomposer parser is specified on it, modelInput and scaleInput will
|
|
2540
|
+
* be automatically populated
|
|
2541
|
+
*/
|
|
2542
|
+
modelIdInput?: string;
|
|
2543
|
+
}
|
|
2544
|
+
interface Preset {
|
|
2545
|
+
fields: Array<string>;
|
|
2546
|
+
presets: unknown;
|
|
2547
|
+
}
|
|
2548
|
+
/**
|
|
2549
|
+
* Configuration for the resolution component
|
|
2550
|
+
*/
|
|
2551
|
+
interface ResolutionComponent {
|
|
2552
|
+
/**
|
|
2553
|
+
* The input name of the height
|
|
2554
|
+
*/
|
|
2555
|
+
heightInput: string;
|
|
2556
|
+
/**
|
|
2557
|
+
* The label of the component
|
|
2558
|
+
*/
|
|
2559
|
+
label: string;
|
|
2560
|
+
/**
|
|
2561
|
+
* The resolution presets
|
|
2562
|
+
*/
|
|
2563
|
+
presets: Array<ResolutionComponent.Preset>;
|
|
2564
|
+
/**
|
|
2565
|
+
* The input name of the width
|
|
2566
|
+
*/
|
|
2567
|
+
widthInput: string;
|
|
2568
|
+
}
|
|
2569
|
+
namespace ResolutionComponent {
|
|
2570
|
+
interface Preset {
|
|
2571
|
+
height: number;
|
|
2572
|
+
label: string;
|
|
2573
|
+
width: number;
|
|
2574
|
+
}
|
|
2575
|
+
}
|
|
2576
|
+
/**
|
|
2577
|
+
* Configuration for the trigger generate button
|
|
2578
|
+
*/
|
|
2579
|
+
interface TriggerGenerate {
|
|
2580
|
+
label: string;
|
|
2581
|
+
/**
|
|
2582
|
+
* The 'name' of the input where the trigger generate button will be displayed
|
|
2583
|
+
* (after the input). Do not specify both position and after.
|
|
2584
|
+
*/
|
|
2585
|
+
after?: string;
|
|
2586
|
+
/**
|
|
2587
|
+
* The position of the trigger generate button. If position specified, the button
|
|
2588
|
+
* will be displayed at the specified position. Do not specify both position and
|
|
2589
|
+
* after.
|
|
2590
|
+
*/
|
|
2591
|
+
position?: 'bottom' | 'top';
|
|
2592
|
+
}
|
|
2593
|
+
}
|
|
2594
|
+
}
|
|
2595
|
+
}
|
|
2596
|
+
export type WorkflowDeleteResponse = unknown;
|
|
2597
|
+
export interface WorkflowApproveUserResponse {
|
|
2598
|
+
job: WorkflowApproveUserResponse.Job;
|
|
2599
|
+
}
|
|
2600
|
+
export declare namespace WorkflowApproveUserResponse {
|
|
2601
|
+
interface Job {
|
|
2602
|
+
/**
|
|
2603
|
+
* The job creation date as an ISO string (example: "2023-02-03T11:19:41.579Z")
|
|
2604
|
+
*/
|
|
2605
|
+
createdAt: string;
|
|
2606
|
+
/**
|
|
2607
|
+
* The job ID (example: "job_ocZCnG1Df35XRL1QyCZSRxAG8")
|
|
2608
|
+
*/
|
|
2609
|
+
jobId: string;
|
|
2610
|
+
/**
|
|
2611
|
+
* The type of job
|
|
2612
|
+
*/
|
|
2613
|
+
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';
|
|
2614
|
+
/**
|
|
2615
|
+
* Metadata of the job with some additional information
|
|
2616
|
+
*/
|
|
2617
|
+
metadata: Job.Metadata;
|
|
2618
|
+
/**
|
|
2619
|
+
* Progress of the job (between 0 and 1)
|
|
2620
|
+
*/
|
|
2621
|
+
progress: number;
|
|
2622
|
+
/**
|
|
2623
|
+
* The current status of the job
|
|
2624
|
+
*/
|
|
2625
|
+
status: 'canceled' | 'failure' | 'finalizing' | 'in-progress' | 'pending' | 'queued' | 'success' | 'warming-up';
|
|
2626
|
+
/**
|
|
2627
|
+
* The history of the different statuses the job went through with the ISO string
|
|
2628
|
+
* date of when the job reached each statuses.
|
|
2629
|
+
*/
|
|
2630
|
+
statusHistory: Array<Job.StatusHistory>;
|
|
2631
|
+
/**
|
|
2632
|
+
* The job last update date as an ISO string (example: "2023-02-03T11:19:41.579Z")
|
|
2633
|
+
*/
|
|
2634
|
+
updatedAt: string;
|
|
2635
|
+
/**
|
|
2636
|
+
* The author user ID (example: "dcf121faaa1a0a0bbbd9ca1b73d62aea")
|
|
2637
|
+
*/
|
|
2638
|
+
authorId?: string;
|
|
2639
|
+
/**
|
|
2640
|
+
* The billing of the job
|
|
2641
|
+
*/
|
|
2642
|
+
billing?: Job.Billing;
|
|
2643
|
+
/**
|
|
2644
|
+
* The owner ID (example: "team_U3Qmc8PCdWXwAQJ4Dvw4tV6D")
|
|
2645
|
+
*/
|
|
2646
|
+
ownerId?: string;
|
|
2647
|
+
}
|
|
2648
|
+
namespace Job {
|
|
2649
|
+
/**
|
|
2650
|
+
* Metadata of the job with some additional information
|
|
2651
|
+
*/
|
|
2652
|
+
interface Metadata {
|
|
2653
|
+
/**
|
|
2654
|
+
* List of produced assets for this job
|
|
2655
|
+
*/
|
|
2656
|
+
assetIds?: Array<string>;
|
|
2657
|
+
/**
|
|
2658
|
+
* The flow of the job. Only available for workflow jobs.
|
|
2659
|
+
*/
|
|
2660
|
+
flow?: Array<Metadata.Flow>;
|
|
2661
|
+
/**
|
|
2662
|
+
* The inputs for the job
|
|
2663
|
+
*/
|
|
2664
|
+
input?: unknown;
|
|
2665
|
+
/**
|
|
2666
|
+
* The output of the job
|
|
2667
|
+
*/
|
|
2668
|
+
output?: unknown;
|
|
2669
|
+
/**
|
|
2670
|
+
* The workflow ID of the job if job is part of a workflow.
|
|
2671
|
+
*/
|
|
2672
|
+
workflowId?: string;
|
|
2673
|
+
/**
|
|
2674
|
+
* The workflow job ID of the job if job is part of a workflow job.
|
|
2675
|
+
*/
|
|
2676
|
+
workflowJobId?: string;
|
|
2677
|
+
}
|
|
2678
|
+
namespace Metadata {
|
|
2679
|
+
interface Flow {
|
|
2680
|
+
/**
|
|
2681
|
+
* The id of the node.
|
|
2682
|
+
*/
|
|
2683
|
+
id: string;
|
|
2684
|
+
/**
|
|
2685
|
+
* The status of the node. Only available for WorkflowJob nodes.
|
|
2686
|
+
*/
|
|
2687
|
+
status: 'failure' | 'pending' | 'processing' | 'skipped' | 'success';
|
|
2688
|
+
/**
|
|
2689
|
+
* The type of the job for the node.
|
|
2690
|
+
*/
|
|
2691
|
+
type: 'custom-model' | 'generate-prompt' | 'logic' | 'remove-background' | 'transform' | 'user-approval' | 'workflow';
|
|
2692
|
+
/**
|
|
2693
|
+
* List of produced assets for this node.
|
|
2694
|
+
*/
|
|
2695
|
+
assets?: Array<Flow.Asset>;
|
|
2696
|
+
/**
|
|
2697
|
+
* The nodes that this node depends on. Only available for nodes that have
|
|
2698
|
+
* dependencies. Mainly used for user approval nodes.
|
|
2699
|
+
*/
|
|
2700
|
+
dependsOn?: Array<string>;
|
|
2701
|
+
/**
|
|
2702
|
+
* The inputs of the node.
|
|
2703
|
+
*/
|
|
2704
|
+
inputs?: Array<Flow.Input>;
|
|
2705
|
+
/**
|
|
2706
|
+
* If the flow is part of a WorkflowJob, this is the jobId for the node. jobId is
|
|
2707
|
+
* only available for nodes started. A node "Pending" for a running workflow job is
|
|
2708
|
+
* not started.
|
|
2709
|
+
*/
|
|
2710
|
+
jobId?: string;
|
|
2711
|
+
/**
|
|
2712
|
+
* The logic of the node. Only available for logic nodes.
|
|
2713
|
+
*/
|
|
2714
|
+
logic?: Flow.Logic;
|
|
2715
|
+
/**
|
|
2716
|
+
* The type of the logic for the node. Only available for logic nodes.
|
|
2717
|
+
*/
|
|
2718
|
+
logicType?: 'if-else';
|
|
2719
|
+
/**
|
|
2720
|
+
* The model id for the node. Mainly used for custom model tasks.
|
|
2721
|
+
*/
|
|
2722
|
+
modelId?: string;
|
|
2723
|
+
/**
|
|
2724
|
+
* The workflow id for the node. Mainly used for workflow tasks.
|
|
2725
|
+
*/
|
|
2726
|
+
workflowId?: string;
|
|
2727
|
+
}
|
|
2728
|
+
namespace Flow {
|
|
2729
|
+
interface Asset {
|
|
2730
|
+
assetId: string;
|
|
2731
|
+
url: string;
|
|
2732
|
+
}
|
|
2733
|
+
/**
|
|
2734
|
+
* This is used to run the flow.
|
|
2735
|
+
*/
|
|
2736
|
+
interface Input {
|
|
2737
|
+
/**
|
|
2738
|
+
* The name that must be user to call the model through the API
|
|
2739
|
+
*/
|
|
2740
|
+
name: string;
|
|
2741
|
+
/**
|
|
2742
|
+
* The data type of the input
|
|
2743
|
+
*/
|
|
2744
|
+
type: 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array';
|
|
2745
|
+
/**
|
|
2746
|
+
* The allowed values for the input. For \`string\` or \`number\` types, creates a
|
|
2747
|
+
* single-select dropdown. For \`string_array\` type, creates a multi-select
|
|
2748
|
+
* dropdown.
|
|
2749
|
+
*/
|
|
2750
|
+
allowedValues?: Array<unknown>;
|
|
2751
|
+
/**
|
|
2752
|
+
* Specifies the background behavior for the input. Only available for \`file\` and
|
|
2753
|
+
* \`file_array\` input types with kind \`image\`.
|
|
2754
|
+
*/
|
|
2755
|
+
backgroundBehavior?: 'opaque' | 'transparent';
|
|
2756
|
+
/**
|
|
2757
|
+
* Whether the input is a color or not. Only available for \`string\` input type.
|
|
2758
|
+
*/
|
|
2759
|
+
color?: boolean;
|
|
2760
|
+
/**
|
|
2761
|
+
* Whether this input affects the model's cost calculation
|
|
2762
|
+
*/
|
|
2763
|
+
costImpact?: boolean;
|
|
2764
|
+
/**
|
|
2765
|
+
* Help text displayed in the UI to provide additional information about the input
|
|
2766
|
+
*/
|
|
2767
|
+
description?: string;
|
|
2768
|
+
/**
|
|
2769
|
+
* Used to visually group inputs together in the UI. Inputs with the same group
|
|
2770
|
+
* value appear consecutively in the UI.
|
|
2771
|
+
*/
|
|
2772
|
+
group?: string;
|
|
2773
|
+
/**
|
|
2774
|
+
* Hint text displayed in the UI as a tooltip to guide the user
|
|
2775
|
+
*/
|
|
2776
|
+
hint?: string;
|
|
2777
|
+
/**
|
|
2778
|
+
* The list of inputs which form an object within a container array. All inputs are
|
|
2779
|
+
* the same as the current object. This is only available for type inputs_array
|
|
2780
|
+
* inputs.
|
|
2781
|
+
*/
|
|
2782
|
+
inputs?: Array<unknown>;
|
|
2783
|
+
/**
|
|
2784
|
+
* The asset kind of the input. Only taken into account for \`file\` and
|
|
2785
|
+
* \`file_array\` input types.
|
|
2786
|
+
*/
|
|
2787
|
+
kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'video';
|
|
2788
|
+
/**
|
|
2789
|
+
* The label displayed in the UI for this input
|
|
2790
|
+
*/
|
|
2791
|
+
label?: string;
|
|
2792
|
+
/**
|
|
2793
|
+
* The name of the file input field to use as the mask source
|
|
2794
|
+
*/
|
|
2795
|
+
maskFrom?: string;
|
|
2796
|
+
/**
|
|
2797
|
+
* The maximum allowed value. Only available for \`number\` and \`array\` input
|
|
2798
|
+
* types.
|
|
2799
|
+
*/
|
|
2800
|
+
max?: number;
|
|
2801
|
+
/**
|
|
2802
|
+
* The maximum allowed length for \`string\` inputs. Also applies to each item in
|
|
2803
|
+
* \`string_array\`.
|
|
2804
|
+
*/
|
|
2805
|
+
maxLength?: number;
|
|
2806
|
+
/**
|
|
2807
|
+
* The minimum allowed value. Only available for \`number\` and array input types.
|
|
2808
|
+
*/
|
|
2809
|
+
min?: number;
|
|
2810
|
+
/**
|
|
2811
|
+
* The minimum allowed length for string inputs. Also applies to each item in
|
|
2812
|
+
* \`string_array\`.
|
|
2813
|
+
*/
|
|
2814
|
+
minLength?: number;
|
|
2815
|
+
/**
|
|
2816
|
+
* The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only
|
|
2817
|
+
* available for \`model_array\` input type.
|
|
2818
|
+
*/
|
|
2819
|
+
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'>;
|
|
2820
|
+
/**
|
|
2821
|
+
* Whether this input represents a parent asset to assign to the produced assets.
|
|
2822
|
+
* Only available for \`file\` and \`file_array\` input types.
|
|
2823
|
+
*
|
|
2824
|
+
* For \`file_array\`, the parent asset is the first item in the array.
|
|
2825
|
+
*/
|
|
2826
|
+
parent?: boolean;
|
|
2827
|
+
/**
|
|
2828
|
+
* Placeholder text for the input. Only available for 'string' input type.
|
|
2829
|
+
*/
|
|
2830
|
+
placeholder?: string;
|
|
2831
|
+
/**
|
|
2832
|
+
* Whether the input is a prompt. When true, displays as a text area with prompt
|
|
2833
|
+
* spark feature. Only available for \`string\` input type.
|
|
2834
|
+
*/
|
|
2835
|
+
prompt?: boolean;
|
|
2836
|
+
/**
|
|
2837
|
+
* Whether the input is used with prompt spark. Only available for \`string\` input
|
|
2838
|
+
* type.
|
|
2839
|
+
*/
|
|
2840
|
+
promptSpark?: boolean;
|
|
2841
|
+
/**
|
|
2842
|
+
* The reference to another input or output of the same workflow. Must have at
|
|
2843
|
+
* least one of node or conditional.
|
|
2844
|
+
*/
|
|
2845
|
+
ref?: Input.Ref;
|
|
2846
|
+
/**
|
|
2847
|
+
* Set of rules that describes when this input is required:
|
|
2848
|
+
*
|
|
2849
|
+
* - \`always\`: Input is always required
|
|
2850
|
+
* - \`ifNotDefined\`: Input is required when another specified input is not
|
|
2851
|
+
* defined
|
|
2852
|
+
* - \`ifDefined\`: Input is required when another specified input is defined
|
|
2853
|
+
* - \`conditionalValues\`: Input is required when another input has a specific
|
|
2854
|
+
* value
|
|
2855
|
+
*
|
|
2856
|
+
* By default, the input is not required.
|
|
2857
|
+
*/
|
|
2858
|
+
required?: Input.Required;
|
|
2859
|
+
/**
|
|
2860
|
+
* The step increment for numeric inputs. Only available for \`number\` input type.
|
|
2861
|
+
*/
|
|
2862
|
+
step?: number;
|
|
2863
|
+
}
|
|
2864
|
+
namespace Input {
|
|
2865
|
+
/**
|
|
2866
|
+
* The reference to another input or output of the same workflow. Must have at
|
|
2867
|
+
* least one of node or conditional.
|
|
2868
|
+
*/
|
|
2869
|
+
interface Ref {
|
|
2870
|
+
/**
|
|
2871
|
+
* The conditional nodes to reference. If the conditional nodes are successful, the
|
|
2872
|
+
* node will be successful. If the conditional nodes are skipped, the node will be
|
|
2873
|
+
* skipped. Contains an array of node ids used to check the status of the nodes.
|
|
2874
|
+
*/
|
|
2875
|
+
conditional?: Array<string>;
|
|
2876
|
+
/**
|
|
2877
|
+
* This is the desired node output value if ref is an if/else node.
|
|
2878
|
+
*/
|
|
2879
|
+
equal?: string;
|
|
2880
|
+
/**
|
|
2881
|
+
* The name of the input or output to reference. If the type is 'workflow', the
|
|
2882
|
+
* name is the name of the input of the workflow is required If the type is 'node',
|
|
2883
|
+
* the name is not mandatory, except if you want all outputs of the node. To get
|
|
2884
|
+
* all outputs of a node, you can use the name 'all'.
|
|
2885
|
+
*/
|
|
2886
|
+
name?: string;
|
|
2887
|
+
/**
|
|
2888
|
+
* The node id or 'workflow' if the source is a workflow input.
|
|
2889
|
+
*/
|
|
2890
|
+
node?: string;
|
|
2891
|
+
}
|
|
2892
|
+
/**
|
|
2893
|
+
* Set of rules that describes when this input is required:
|
|
2894
|
+
*
|
|
2895
|
+
* - \`always\`: Input is always required
|
|
2896
|
+
* - \`ifNotDefined\`: Input is required when another specified input is not
|
|
2897
|
+
* defined
|
|
2898
|
+
* - \`ifDefined\`: Input is required when another specified input is defined
|
|
2899
|
+
* - \`conditionalValues\`: Input is required when another input has a specific
|
|
2900
|
+
* value
|
|
2901
|
+
*
|
|
2902
|
+
* By default, the input is not required.
|
|
2903
|
+
*/
|
|
2904
|
+
interface Required {
|
|
2905
|
+
/**
|
|
2906
|
+
* Whether the input is always required
|
|
2907
|
+
*/
|
|
2908
|
+
always?: boolean;
|
|
2909
|
+
/**
|
|
2910
|
+
* Makes this input required when another input has a specific value:
|
|
2911
|
+
*
|
|
2912
|
+
* - Key: name of the input to check
|
|
2913
|
+
* - Value: operation and allowed values that trigger the requirement
|
|
2914
|
+
*/
|
|
2915
|
+
conditionalValues?: unknown;
|
|
2916
|
+
/**
|
|
2917
|
+
* Makes this input required when another input is defined:
|
|
2918
|
+
*
|
|
2919
|
+
* - Key: name of the input that must be defined
|
|
2920
|
+
* - Value: message to display when this input is required
|
|
2921
|
+
*/
|
|
2922
|
+
ifDefined?: unknown;
|
|
2923
|
+
/**
|
|
2924
|
+
* Makes this input required when another input is not defined:
|
|
2925
|
+
*
|
|
2926
|
+
* - Key: name of the input that must be undefined
|
|
2927
|
+
* - Value: message to display when this input is required
|
|
2928
|
+
*/
|
|
2929
|
+
ifNotDefined?: unknown;
|
|
2930
|
+
}
|
|
2931
|
+
}
|
|
2932
|
+
/**
|
|
2933
|
+
* The logic of the node. Only available for logic nodes.
|
|
2934
|
+
*/
|
|
2935
|
+
interface Logic {
|
|
2936
|
+
/**
|
|
2937
|
+
* The cases of the logic. Only available for if/else nodes.
|
|
2938
|
+
*/
|
|
2939
|
+
cases?: Array<Logic.Case>;
|
|
2940
|
+
/**
|
|
2941
|
+
* The default case of the logic. Contains the id/output of the node to execute if
|
|
2942
|
+
* no case is matched. Only available for if/else nodes.
|
|
2943
|
+
*/
|
|
2944
|
+
default?: string;
|
|
2945
|
+
/**
|
|
2946
|
+
* The transform of the logic. Only available for transform nodes.
|
|
2947
|
+
*/
|
|
2948
|
+
transform?: string;
|
|
2949
|
+
}
|
|
2950
|
+
namespace Logic {
|
|
2951
|
+
interface Case {
|
|
2952
|
+
condition: string;
|
|
2953
|
+
value: string;
|
|
2954
|
+
}
|
|
2955
|
+
}
|
|
2956
|
+
}
|
|
2957
|
+
}
|
|
2958
|
+
interface StatusHistory {
|
|
2959
|
+
date: string;
|
|
2960
|
+
status: 'canceled' | 'failure' | 'finalizing' | 'in-progress' | 'pending' | 'queued' | 'success' | 'warming-up';
|
|
2961
|
+
}
|
|
2962
|
+
/**
|
|
2963
|
+
* The billing of the job
|
|
2964
|
+
*/
|
|
2965
|
+
interface Billing {
|
|
2966
|
+
cuCost: number;
|
|
2967
|
+
cuDiscount: number;
|
|
2968
|
+
}
|
|
2969
|
+
}
|
|
2970
|
+
}
|
|
2971
|
+
export interface WorkflowGetTagsResponse {
|
|
2972
|
+
/**
|
|
2973
|
+
* Array of unique tags from workflows in the project
|
|
2974
|
+
*/
|
|
2975
|
+
tags: Array<string>;
|
|
2976
|
+
}
|
|
2977
|
+
export interface WorkflowRunResponse {
|
|
2978
|
+
job: WorkflowRunResponse.Job;
|
|
2979
|
+
workflow: WorkflowRunResponse.Workflow;
|
|
2980
|
+
}
|
|
2981
|
+
export declare namespace WorkflowRunResponse {
|
|
2982
|
+
interface Job {
|
|
2983
|
+
/**
|
|
2984
|
+
* The job creation date as an ISO string (example: "2023-02-03T11:19:41.579Z")
|
|
2985
|
+
*/
|
|
2986
|
+
createdAt: string;
|
|
2987
|
+
/**
|
|
2988
|
+
* The job ID (example: "job_ocZCnG1Df35XRL1QyCZSRxAG8")
|
|
2989
|
+
*/
|
|
2990
|
+
jobId: string;
|
|
2991
|
+
/**
|
|
2992
|
+
* The type of job
|
|
2993
|
+
*/
|
|
2994
|
+
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';
|
|
2995
|
+
/**
|
|
2996
|
+
* Metadata of the job with some additional information
|
|
2997
|
+
*/
|
|
2998
|
+
metadata: Job.Metadata;
|
|
2999
|
+
/**
|
|
3000
|
+
* Progress of the job (between 0 and 1)
|
|
3001
|
+
*/
|
|
3002
|
+
progress: number;
|
|
3003
|
+
/**
|
|
3004
|
+
* The current status of the job
|
|
3005
|
+
*/
|
|
3006
|
+
status: 'canceled' | 'failure' | 'finalizing' | 'in-progress' | 'pending' | 'queued' | 'success' | 'warming-up';
|
|
3007
|
+
/**
|
|
3008
|
+
* The history of the different statuses the job went through with the ISO string
|
|
3009
|
+
* date of when the job reached each statuses.
|
|
3010
|
+
*/
|
|
3011
|
+
statusHistory: Array<Job.StatusHistory>;
|
|
3012
|
+
/**
|
|
3013
|
+
* The job last update date as an ISO string (example: "2023-02-03T11:19:41.579Z")
|
|
3014
|
+
*/
|
|
3015
|
+
updatedAt: string;
|
|
3016
|
+
/**
|
|
3017
|
+
* The author user ID (example: "dcf121faaa1a0a0bbbd9ca1b73d62aea")
|
|
3018
|
+
*/
|
|
3019
|
+
authorId?: string;
|
|
3020
|
+
/**
|
|
3021
|
+
* The billing of the job
|
|
3022
|
+
*/
|
|
3023
|
+
billing?: Job.Billing;
|
|
3024
|
+
/**
|
|
3025
|
+
* The owner ID (example: "team_U3Qmc8PCdWXwAQJ4Dvw4tV6D")
|
|
3026
|
+
*/
|
|
3027
|
+
ownerId?: string;
|
|
3028
|
+
}
|
|
3029
|
+
namespace Job {
|
|
3030
|
+
/**
|
|
3031
|
+
* Metadata of the job with some additional information
|
|
3032
|
+
*/
|
|
3033
|
+
interface Metadata {
|
|
3034
|
+
/**
|
|
3035
|
+
* List of produced assets for this job
|
|
3036
|
+
*/
|
|
3037
|
+
assetIds?: Array<string>;
|
|
3038
|
+
/**
|
|
3039
|
+
* The flow of the job. Only available for workflow jobs.
|
|
3040
|
+
*/
|
|
3041
|
+
flow?: Array<Metadata.Flow>;
|
|
3042
|
+
/**
|
|
3043
|
+
* The inputs for the job
|
|
3044
|
+
*/
|
|
3045
|
+
input?: unknown;
|
|
3046
|
+
/**
|
|
3047
|
+
* The output of the job
|
|
3048
|
+
*/
|
|
3049
|
+
output?: unknown;
|
|
3050
|
+
/**
|
|
3051
|
+
* The workflow ID of the job if job is part of a workflow.
|
|
3052
|
+
*/
|
|
3053
|
+
workflowId?: string;
|
|
3054
|
+
/**
|
|
3055
|
+
* The workflow job ID of the job if job is part of a workflow job.
|
|
3056
|
+
*/
|
|
3057
|
+
workflowJobId?: string;
|
|
3058
|
+
}
|
|
3059
|
+
namespace Metadata {
|
|
3060
|
+
interface Flow {
|
|
3061
|
+
/**
|
|
3062
|
+
* The id of the node.
|
|
3063
|
+
*/
|
|
3064
|
+
id: string;
|
|
3065
|
+
/**
|
|
3066
|
+
* The status of the node. Only available for WorkflowJob nodes.
|
|
3067
|
+
*/
|
|
3068
|
+
status: 'failure' | 'pending' | 'processing' | 'skipped' | 'success';
|
|
3069
|
+
/**
|
|
3070
|
+
* The type of the job for the node.
|
|
3071
|
+
*/
|
|
3072
|
+
type: 'custom-model' | 'generate-prompt' | 'logic' | 'remove-background' | 'transform' | 'user-approval' | 'workflow';
|
|
3073
|
+
/**
|
|
3074
|
+
* List of produced assets for this node.
|
|
3075
|
+
*/
|
|
3076
|
+
assets?: Array<Flow.Asset>;
|
|
3077
|
+
/**
|
|
3078
|
+
* The nodes that this node depends on. Only available for nodes that have
|
|
3079
|
+
* dependencies. Mainly used for user approval nodes.
|
|
3080
|
+
*/
|
|
3081
|
+
dependsOn?: Array<string>;
|
|
3082
|
+
/**
|
|
3083
|
+
* The inputs of the node.
|
|
3084
|
+
*/
|
|
3085
|
+
inputs?: Array<Flow.Input>;
|
|
3086
|
+
/**
|
|
3087
|
+
* If the flow is part of a WorkflowJob, this is the jobId for the node. jobId is
|
|
3088
|
+
* only available for nodes started. A node "Pending" for a running workflow job is
|
|
3089
|
+
* not started.
|
|
3090
|
+
*/
|
|
3091
|
+
jobId?: string;
|
|
3092
|
+
/**
|
|
3093
|
+
* The logic of the node. Only available for logic nodes.
|
|
3094
|
+
*/
|
|
3095
|
+
logic?: Flow.Logic;
|
|
3096
|
+
/**
|
|
3097
|
+
* The type of the logic for the node. Only available for logic nodes.
|
|
3098
|
+
*/
|
|
3099
|
+
logicType?: 'if-else';
|
|
3100
|
+
/**
|
|
3101
|
+
* The model id for the node. Mainly used for custom model tasks.
|
|
3102
|
+
*/
|
|
3103
|
+
modelId?: string;
|
|
3104
|
+
/**
|
|
3105
|
+
* The workflow id for the node. Mainly used for workflow tasks.
|
|
3106
|
+
*/
|
|
3107
|
+
workflowId?: string;
|
|
3108
|
+
}
|
|
3109
|
+
namespace Flow {
|
|
3110
|
+
interface Asset {
|
|
3111
|
+
assetId: string;
|
|
3112
|
+
url: string;
|
|
3113
|
+
}
|
|
3114
|
+
/**
|
|
3115
|
+
* This is used to run the flow.
|
|
3116
|
+
*/
|
|
3117
|
+
interface Input {
|
|
3118
|
+
/**
|
|
3119
|
+
* The name that must be user to call the model through the API
|
|
3120
|
+
*/
|
|
3121
|
+
name: string;
|
|
3122
|
+
/**
|
|
3123
|
+
* The data type of the input
|
|
3124
|
+
*/
|
|
3125
|
+
type: 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array';
|
|
3126
|
+
/**
|
|
3127
|
+
* The allowed values for the input. For \`string\` or \`number\` types, creates a
|
|
3128
|
+
* single-select dropdown. For \`string_array\` type, creates a multi-select
|
|
3129
|
+
* dropdown.
|
|
3130
|
+
*/
|
|
3131
|
+
allowedValues?: Array<unknown>;
|
|
3132
|
+
/**
|
|
3133
|
+
* Specifies the background behavior for the input. Only available for \`file\` and
|
|
3134
|
+
* \`file_array\` input types with kind \`image\`.
|
|
3135
|
+
*/
|
|
3136
|
+
backgroundBehavior?: 'opaque' | 'transparent';
|
|
3137
|
+
/**
|
|
3138
|
+
* Whether the input is a color or not. Only available for \`string\` input type.
|
|
3139
|
+
*/
|
|
3140
|
+
color?: boolean;
|
|
3141
|
+
/**
|
|
3142
|
+
* Whether this input affects the model's cost calculation
|
|
3143
|
+
*/
|
|
3144
|
+
costImpact?: boolean;
|
|
3145
|
+
/**
|
|
3146
|
+
* Help text displayed in the UI to provide additional information about the input
|
|
3147
|
+
*/
|
|
3148
|
+
description?: string;
|
|
3149
|
+
/**
|
|
3150
|
+
* Used to visually group inputs together in the UI. Inputs with the same group
|
|
3151
|
+
* value appear consecutively in the UI.
|
|
3152
|
+
*/
|
|
3153
|
+
group?: string;
|
|
3154
|
+
/**
|
|
3155
|
+
* Hint text displayed in the UI as a tooltip to guide the user
|
|
3156
|
+
*/
|
|
3157
|
+
hint?: string;
|
|
3158
|
+
/**
|
|
3159
|
+
* The list of inputs which form an object within a container array. All inputs are
|
|
3160
|
+
* the same as the current object. This is only available for type inputs_array
|
|
3161
|
+
* inputs.
|
|
3162
|
+
*/
|
|
3163
|
+
inputs?: Array<unknown>;
|
|
3164
|
+
/**
|
|
3165
|
+
* The asset kind of the input. Only taken into account for \`file\` and
|
|
3166
|
+
* \`file_array\` input types.
|
|
3167
|
+
*/
|
|
3168
|
+
kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'video';
|
|
3169
|
+
/**
|
|
3170
|
+
* The label displayed in the UI for this input
|
|
3171
|
+
*/
|
|
3172
|
+
label?: string;
|
|
3173
|
+
/**
|
|
3174
|
+
* The name of the file input field to use as the mask source
|
|
3175
|
+
*/
|
|
3176
|
+
maskFrom?: string;
|
|
3177
|
+
/**
|
|
3178
|
+
* The maximum allowed value. Only available for \`number\` and \`array\` input
|
|
3179
|
+
* types.
|
|
3180
|
+
*/
|
|
3181
|
+
max?: number;
|
|
3182
|
+
/**
|
|
3183
|
+
* The maximum allowed length for \`string\` inputs. Also applies to each item in
|
|
3184
|
+
* \`string_array\`.
|
|
3185
|
+
*/
|
|
3186
|
+
maxLength?: number;
|
|
3187
|
+
/**
|
|
3188
|
+
* The minimum allowed value. Only available for \`number\` and array input types.
|
|
3189
|
+
*/
|
|
3190
|
+
min?: number;
|
|
3191
|
+
/**
|
|
3192
|
+
* The minimum allowed length for string inputs. Also applies to each item in
|
|
3193
|
+
* \`string_array\`.
|
|
3194
|
+
*/
|
|
3195
|
+
minLength?: number;
|
|
3196
|
+
/**
|
|
3197
|
+
* The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only
|
|
3198
|
+
* available for \`model_array\` input type.
|
|
3199
|
+
*/
|
|
3200
|
+
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'>;
|
|
3201
|
+
/**
|
|
3202
|
+
* Whether this input represents a parent asset to assign to the produced assets.
|
|
3203
|
+
* Only available for \`file\` and \`file_array\` input types.
|
|
3204
|
+
*
|
|
3205
|
+
* For \`file_array\`, the parent asset is the first item in the array.
|
|
3206
|
+
*/
|
|
3207
|
+
parent?: boolean;
|
|
3208
|
+
/**
|
|
3209
|
+
* Placeholder text for the input. Only available for 'string' input type.
|
|
3210
|
+
*/
|
|
3211
|
+
placeholder?: string;
|
|
3212
|
+
/**
|
|
3213
|
+
* Whether the input is a prompt. When true, displays as a text area with prompt
|
|
3214
|
+
* spark feature. Only available for \`string\` input type.
|
|
3215
|
+
*/
|
|
3216
|
+
prompt?: boolean;
|
|
3217
|
+
/**
|
|
3218
|
+
* Whether the input is used with prompt spark. Only available for \`string\` input
|
|
3219
|
+
* type.
|
|
3220
|
+
*/
|
|
3221
|
+
promptSpark?: boolean;
|
|
3222
|
+
/**
|
|
3223
|
+
* The reference to another input or output of the same workflow. Must have at
|
|
3224
|
+
* least one of node or conditional.
|
|
3225
|
+
*/
|
|
3226
|
+
ref?: Input.Ref;
|
|
3227
|
+
/**
|
|
3228
|
+
* Set of rules that describes when this input is required:
|
|
3229
|
+
*
|
|
3230
|
+
* - \`always\`: Input is always required
|
|
3231
|
+
* - \`ifNotDefined\`: Input is required when another specified input is not
|
|
3232
|
+
* defined
|
|
3233
|
+
* - \`ifDefined\`: Input is required when another specified input is defined
|
|
3234
|
+
* - \`conditionalValues\`: Input is required when another input has a specific
|
|
3235
|
+
* value
|
|
3236
|
+
*
|
|
3237
|
+
* By default, the input is not required.
|
|
3238
|
+
*/
|
|
3239
|
+
required?: Input.Required;
|
|
3240
|
+
/**
|
|
3241
|
+
* The step increment for numeric inputs. Only available for \`number\` input type.
|
|
3242
|
+
*/
|
|
3243
|
+
step?: number;
|
|
3244
|
+
}
|
|
3245
|
+
namespace Input {
|
|
3246
|
+
/**
|
|
3247
|
+
* The reference to another input or output of the same workflow. Must have at
|
|
3248
|
+
* least one of node or conditional.
|
|
3249
|
+
*/
|
|
3250
|
+
interface Ref {
|
|
3251
|
+
/**
|
|
3252
|
+
* The conditional nodes to reference. If the conditional nodes are successful, the
|
|
3253
|
+
* node will be successful. If the conditional nodes are skipped, the node will be
|
|
3254
|
+
* skipped. Contains an array of node ids used to check the status of the nodes.
|
|
3255
|
+
*/
|
|
3256
|
+
conditional?: Array<string>;
|
|
3257
|
+
/**
|
|
3258
|
+
* This is the desired node output value if ref is an if/else node.
|
|
3259
|
+
*/
|
|
3260
|
+
equal?: string;
|
|
3261
|
+
/**
|
|
3262
|
+
* The name of the input or output to reference. If the type is 'workflow', the
|
|
3263
|
+
* name is the name of the input of the workflow is required If the type is 'node',
|
|
3264
|
+
* the name is not mandatory, except if you want all outputs of the node. To get
|
|
3265
|
+
* all outputs of a node, you can use the name 'all'.
|
|
3266
|
+
*/
|
|
3267
|
+
name?: string;
|
|
3268
|
+
/**
|
|
3269
|
+
* The node id or 'workflow' if the source is a workflow input.
|
|
3270
|
+
*/
|
|
3271
|
+
node?: string;
|
|
3272
|
+
}
|
|
3273
|
+
/**
|
|
3274
|
+
* Set of rules that describes when this input is required:
|
|
3275
|
+
*
|
|
3276
|
+
* - \`always\`: Input is always required
|
|
3277
|
+
* - \`ifNotDefined\`: Input is required when another specified input is not
|
|
3278
|
+
* defined
|
|
3279
|
+
* - \`ifDefined\`: Input is required when another specified input is defined
|
|
3280
|
+
* - \`conditionalValues\`: Input is required when another input has a specific
|
|
3281
|
+
* value
|
|
3282
|
+
*
|
|
3283
|
+
* By default, the input is not required.
|
|
3284
|
+
*/
|
|
3285
|
+
interface Required {
|
|
3286
|
+
/**
|
|
3287
|
+
* Whether the input is always required
|
|
3288
|
+
*/
|
|
3289
|
+
always?: boolean;
|
|
3290
|
+
/**
|
|
3291
|
+
* Makes this input required when another input has a specific value:
|
|
3292
|
+
*
|
|
3293
|
+
* - Key: name of the input to check
|
|
3294
|
+
* - Value: operation and allowed values that trigger the requirement
|
|
3295
|
+
*/
|
|
3296
|
+
conditionalValues?: unknown;
|
|
3297
|
+
/**
|
|
3298
|
+
* Makes this input required when another input is defined:
|
|
3299
|
+
*
|
|
3300
|
+
* - Key: name of the input that must be defined
|
|
3301
|
+
* - Value: message to display when this input is required
|
|
3302
|
+
*/
|
|
3303
|
+
ifDefined?: unknown;
|
|
3304
|
+
/**
|
|
3305
|
+
* Makes this input required when another input is not defined:
|
|
3306
|
+
*
|
|
3307
|
+
* - Key: name of the input that must be undefined
|
|
3308
|
+
* - Value: message to display when this input is required
|
|
3309
|
+
*/
|
|
3310
|
+
ifNotDefined?: unknown;
|
|
3311
|
+
}
|
|
3312
|
+
}
|
|
3313
|
+
/**
|
|
3314
|
+
* The logic of the node. Only available for logic nodes.
|
|
3315
|
+
*/
|
|
3316
|
+
interface Logic {
|
|
3317
|
+
/**
|
|
3318
|
+
* The cases of the logic. Only available for if/else nodes.
|
|
3319
|
+
*/
|
|
3320
|
+
cases?: Array<Logic.Case>;
|
|
3321
|
+
/**
|
|
3322
|
+
* The default case of the logic. Contains the id/output of the node to execute if
|
|
3323
|
+
* no case is matched. Only available for if/else nodes.
|
|
3324
|
+
*/
|
|
3325
|
+
default?: string;
|
|
3326
|
+
/**
|
|
3327
|
+
* The transform of the logic. Only available for transform nodes.
|
|
3328
|
+
*/
|
|
3329
|
+
transform?: string;
|
|
3330
|
+
}
|
|
3331
|
+
namespace Logic {
|
|
3332
|
+
interface Case {
|
|
3333
|
+
condition: string;
|
|
3334
|
+
value: string;
|
|
3335
|
+
}
|
|
3336
|
+
}
|
|
3337
|
+
}
|
|
3338
|
+
}
|
|
3339
|
+
interface StatusHistory {
|
|
3340
|
+
date: string;
|
|
3341
|
+
status: 'canceled' | 'failure' | 'finalizing' | 'in-progress' | 'pending' | 'queued' | 'success' | 'warming-up';
|
|
3342
|
+
}
|
|
3343
|
+
/**
|
|
3344
|
+
* The billing of the job
|
|
3345
|
+
*/
|
|
3346
|
+
interface Billing {
|
|
3347
|
+
cuCost: number;
|
|
3348
|
+
cuDiscount: number;
|
|
3349
|
+
}
|
|
3350
|
+
}
|
|
3351
|
+
interface Workflow {
|
|
3352
|
+
id: string;
|
|
3353
|
+
authorId: string;
|
|
3354
|
+
/**
|
|
3355
|
+
* ISO string
|
|
3356
|
+
*/
|
|
3357
|
+
createdAt: string;
|
|
3358
|
+
/**
|
|
3359
|
+
* The description of the workflow.
|
|
3360
|
+
*/
|
|
3361
|
+
description: string;
|
|
3362
|
+
/**
|
|
3363
|
+
* The UI data about the workflow. This is managed by scenario webapp.
|
|
3364
|
+
*/
|
|
3365
|
+
editorInfo: unknown;
|
|
3366
|
+
/**
|
|
3367
|
+
* The flow of the workflow.
|
|
3368
|
+
*/
|
|
3369
|
+
flow: Array<Workflow.Flow>;
|
|
3370
|
+
/**
|
|
3371
|
+
* The inputs of the workflow.
|
|
3372
|
+
*/
|
|
3373
|
+
inputs: Array<Workflow.Input>;
|
|
3374
|
+
name: string;
|
|
3375
|
+
ownerId: string;
|
|
3376
|
+
privacy: 'private' | 'public' | 'unlisted';
|
|
3377
|
+
status: 'deleted' | 'draft' | 'ready';
|
|
3378
|
+
/**
|
|
3379
|
+
* The tag set of the workflow.
|
|
3380
|
+
*/
|
|
3381
|
+
tagSet: Array<string>;
|
|
3382
|
+
/**
|
|
3383
|
+
* ISO string
|
|
3384
|
+
*/
|
|
3385
|
+
updatedAt: string;
|
|
3386
|
+
/**
|
|
3387
|
+
* A representation of an asset after being processed by the workflow
|
|
3388
|
+
*/
|
|
3389
|
+
after?: Workflow.After;
|
|
3390
|
+
/**
|
|
3391
|
+
* A representation of an asset before being processed by the workflow
|
|
3392
|
+
*/
|
|
3393
|
+
before?: Workflow.Before;
|
|
3394
|
+
outputAssetKinds?: Array<'3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'video'>;
|
|
3395
|
+
shortDescription?: string;
|
|
3396
|
+
/**
|
|
3397
|
+
* Currently the thumbnail is identical to the after asset.
|
|
3398
|
+
*/
|
|
3399
|
+
thumbnail?: Workflow.Thumbnail;
|
|
3400
|
+
/**
|
|
3401
|
+
* The UI configuration for the workflow. This is managed by scenario webapp.
|
|
3402
|
+
*/
|
|
3403
|
+
uiConfig?: Workflow.UiConfig;
|
|
3404
|
+
}
|
|
3405
|
+
namespace Workflow {
|
|
3406
|
+
interface Flow {
|
|
3407
|
+
/**
|
|
3408
|
+
* The id of the node.
|
|
3409
|
+
*/
|
|
3410
|
+
id: string;
|
|
3411
|
+
/**
|
|
3412
|
+
* The type of the job for the node.
|
|
3413
|
+
*/
|
|
3414
|
+
type: 'custom-model' | 'generate-prompt' | 'logic' | 'remove-background' | 'transform' | 'user-approval' | 'workflow';
|
|
3415
|
+
/**
|
|
3416
|
+
* The nodes that this node depends on. Only available for nodes that have
|
|
3417
|
+
* dependencies. Mainly used for user approval nodes.
|
|
3418
|
+
*/
|
|
3419
|
+
dependsOn?: Array<string>;
|
|
3420
|
+
/**
|
|
3421
|
+
* The inputs of the node.
|
|
3422
|
+
*/
|
|
3423
|
+
inputs?: Array<Flow.Input>;
|
|
3424
|
+
/**
|
|
3425
|
+
* The logic of the node. Only available for logic nodes.
|
|
3426
|
+
*/
|
|
3427
|
+
logic?: Flow.Logic;
|
|
3428
|
+
/**
|
|
3429
|
+
* The type of the logic for the node. Only available for logic nodes.
|
|
3430
|
+
*/
|
|
3431
|
+
logicType?: 'if-else';
|
|
3432
|
+
/**
|
|
3433
|
+
* The model id for the node. Mainly used for custom model tasks.
|
|
3434
|
+
*/
|
|
3435
|
+
modelId?: string;
|
|
3436
|
+
/**
|
|
3437
|
+
* The workflow id for the node. Mainly used for workflow tasks.
|
|
3438
|
+
*/
|
|
3439
|
+
workflowId?: string;
|
|
3440
|
+
}
|
|
3441
|
+
namespace Flow {
|
|
3442
|
+
/**
|
|
3443
|
+
* This is used to run the flow.
|
|
3444
|
+
*/
|
|
3445
|
+
interface Input {
|
|
3446
|
+
/**
|
|
3447
|
+
* The name that must be user to call the model through the API
|
|
3448
|
+
*/
|
|
3449
|
+
name: string;
|
|
3450
|
+
/**
|
|
3451
|
+
* The data type of the input
|
|
3452
|
+
*/
|
|
3453
|
+
type: 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array';
|
|
3454
|
+
/**
|
|
3455
|
+
* The allowed values for the input. For \`string\` or \`number\` types, creates a
|
|
3456
|
+
* single-select dropdown. For \`string_array\` type, creates a multi-select
|
|
3457
|
+
* dropdown.
|
|
3458
|
+
*/
|
|
3459
|
+
allowedValues?: Array<unknown>;
|
|
3460
|
+
/**
|
|
3461
|
+
* Specifies the background behavior for the input. Only available for \`file\` and
|
|
3462
|
+
* \`file_array\` input types with kind \`image\`.
|
|
3463
|
+
*/
|
|
3464
|
+
backgroundBehavior?: 'opaque' | 'transparent';
|
|
3465
|
+
/**
|
|
3466
|
+
* Whether the input is a color or not. Only available for \`string\` input type.
|
|
3467
|
+
*/
|
|
3468
|
+
color?: boolean;
|
|
3469
|
+
/**
|
|
3470
|
+
* Whether this input affects the model's cost calculation
|
|
3471
|
+
*/
|
|
3472
|
+
costImpact?: boolean;
|
|
3473
|
+
/**
|
|
3474
|
+
* Help text displayed in the UI to provide additional information about the input
|
|
3475
|
+
*/
|
|
3476
|
+
description?: string;
|
|
3477
|
+
/**
|
|
3478
|
+
* Used to visually group inputs together in the UI. Inputs with the same group
|
|
3479
|
+
* value appear consecutively in the UI.
|
|
3480
|
+
*/
|
|
3481
|
+
group?: string;
|
|
3482
|
+
/**
|
|
3483
|
+
* Hint text displayed in the UI as a tooltip to guide the user
|
|
3484
|
+
*/
|
|
3485
|
+
hint?: string;
|
|
3486
|
+
/**
|
|
3487
|
+
* The list of inputs which form an object within a container array. All inputs are
|
|
3488
|
+
* the same as the current object. This is only available for type inputs_array
|
|
3489
|
+
* inputs.
|
|
3490
|
+
*/
|
|
3491
|
+
inputs?: Array<unknown>;
|
|
3492
|
+
/**
|
|
3493
|
+
* The asset kind of the input. Only taken into account for \`file\` and
|
|
3494
|
+
* \`file_array\` input types.
|
|
3495
|
+
*/
|
|
3496
|
+
kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'video';
|
|
3497
|
+
/**
|
|
3498
|
+
* The label displayed in the UI for this input
|
|
3499
|
+
*/
|
|
3500
|
+
label?: string;
|
|
3501
|
+
/**
|
|
3502
|
+
* The name of the file input field to use as the mask source
|
|
3503
|
+
*/
|
|
3504
|
+
maskFrom?: string;
|
|
3505
|
+
/**
|
|
3506
|
+
* The maximum allowed value. Only available for \`number\` and \`array\` input
|
|
3507
|
+
* types.
|
|
3508
|
+
*/
|
|
3509
|
+
max?: number;
|
|
3510
|
+
/**
|
|
3511
|
+
* The maximum allowed length for \`string\` inputs. Also applies to each item in
|
|
3512
|
+
* \`string_array\`.
|
|
3513
|
+
*/
|
|
3514
|
+
maxLength?: number;
|
|
3515
|
+
/**
|
|
3516
|
+
* The minimum allowed value. Only available for \`number\` and array input types.
|
|
3517
|
+
*/
|
|
3518
|
+
min?: number;
|
|
3519
|
+
/**
|
|
3520
|
+
* The minimum allowed length for string inputs. Also applies to each item in
|
|
3521
|
+
* \`string_array\`.
|
|
3522
|
+
*/
|
|
3523
|
+
minLength?: number;
|
|
3524
|
+
/**
|
|
3525
|
+
* The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only
|
|
3526
|
+
* available for \`model_array\` input type.
|
|
3527
|
+
*/
|
|
3528
|
+
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'>;
|
|
3529
|
+
/**
|
|
3530
|
+
* Whether this input represents a parent asset to assign to the produced assets.
|
|
3531
|
+
* Only available for \`file\` and \`file_array\` input types.
|
|
3532
|
+
*
|
|
3533
|
+
* For \`file_array\`, the parent asset is the first item in the array.
|
|
3534
|
+
*/
|
|
3535
|
+
parent?: boolean;
|
|
3536
|
+
/**
|
|
3537
|
+
* Placeholder text for the input. Only available for 'string' input type.
|
|
3538
|
+
*/
|
|
3539
|
+
placeholder?: string;
|
|
3540
|
+
/**
|
|
3541
|
+
* Whether the input is a prompt. When true, displays as a text area with prompt
|
|
3542
|
+
* spark feature. Only available for \`string\` input type.
|
|
3543
|
+
*/
|
|
3544
|
+
prompt?: boolean;
|
|
3545
|
+
/**
|
|
3546
|
+
* Whether the input is used with prompt spark. Only available for \`string\` input
|
|
3547
|
+
* type.
|
|
3548
|
+
*/
|
|
3549
|
+
promptSpark?: boolean;
|
|
3550
|
+
/**
|
|
3551
|
+
* The reference to another input or output of the same workflow. Must have at
|
|
3552
|
+
* least one of node or conditional.
|
|
3553
|
+
*/
|
|
3554
|
+
ref?: Input.Ref;
|
|
3555
|
+
/**
|
|
3556
|
+
* Set of rules that describes when this input is required:
|
|
3557
|
+
*
|
|
3558
|
+
* - \`always\`: Input is always required
|
|
3559
|
+
* - \`ifNotDefined\`: Input is required when another specified input is not
|
|
3560
|
+
* defined
|
|
3561
|
+
* - \`ifDefined\`: Input is required when another specified input is defined
|
|
3562
|
+
* - \`conditionalValues\`: Input is required when another input has a specific
|
|
3563
|
+
* value
|
|
3564
|
+
*
|
|
3565
|
+
* By default, the input is not required.
|
|
3566
|
+
*/
|
|
3567
|
+
required?: Input.Required;
|
|
3568
|
+
/**
|
|
3569
|
+
* The step increment for numeric inputs. Only available for \`number\` input type.
|
|
3570
|
+
*/
|
|
3571
|
+
step?: number;
|
|
3572
|
+
}
|
|
3573
|
+
namespace Input {
|
|
3574
|
+
/**
|
|
3575
|
+
* The reference to another input or output of the same workflow. Must have at
|
|
3576
|
+
* least one of node or conditional.
|
|
3577
|
+
*/
|
|
3578
|
+
interface Ref {
|
|
3579
|
+
/**
|
|
3580
|
+
* The conditional nodes to reference. If the conditional nodes are successful, the
|
|
3581
|
+
* node will be successful. If the conditional nodes are skipped, the node will be
|
|
3582
|
+
* skipped. Contains an array of node ids used to check the status of the nodes.
|
|
3583
|
+
*/
|
|
3584
|
+
conditional?: Array<string>;
|
|
3585
|
+
/**
|
|
3586
|
+
* This is the desired node output value if ref is an if/else node.
|
|
3587
|
+
*/
|
|
3588
|
+
equal?: string;
|
|
3589
|
+
/**
|
|
3590
|
+
* The name of the input or output to reference. If the type is 'workflow', the
|
|
3591
|
+
* name is the name of the input of the workflow is required If the type is 'node',
|
|
3592
|
+
* the name is not mandatory, except if you want all outputs of the node. To get
|
|
3593
|
+
* all outputs of a node, you can use the name 'all'.
|
|
3594
|
+
*/
|
|
3595
|
+
name?: string;
|
|
3596
|
+
/**
|
|
3597
|
+
* The node id or 'workflow' if the source is a workflow input.
|
|
3598
|
+
*/
|
|
3599
|
+
node?: string;
|
|
3600
|
+
}
|
|
3601
|
+
/**
|
|
3602
|
+
* Set of rules that describes when this input is required:
|
|
3603
|
+
*
|
|
3604
|
+
* - \`always\`: Input is always required
|
|
3605
|
+
* - \`ifNotDefined\`: Input is required when another specified input is not
|
|
3606
|
+
* defined
|
|
3607
|
+
* - \`ifDefined\`: Input is required when another specified input is defined
|
|
3608
|
+
* - \`conditionalValues\`: Input is required when another input has a specific
|
|
3609
|
+
* value
|
|
3610
|
+
*
|
|
3611
|
+
* By default, the input is not required.
|
|
3612
|
+
*/
|
|
3613
|
+
interface Required {
|
|
3614
|
+
/**
|
|
3615
|
+
* Whether the input is always required
|
|
3616
|
+
*/
|
|
3617
|
+
always?: boolean;
|
|
3618
|
+
/**
|
|
3619
|
+
* Makes this input required when another input has a specific value:
|
|
3620
|
+
*
|
|
3621
|
+
* - Key: name of the input to check
|
|
3622
|
+
* - Value: operation and allowed values that trigger the requirement
|
|
3623
|
+
*/
|
|
3624
|
+
conditionalValues?: unknown;
|
|
3625
|
+
/**
|
|
3626
|
+
* Makes this input required when another input is defined:
|
|
3627
|
+
*
|
|
3628
|
+
* - Key: name of the input that must be defined
|
|
3629
|
+
* - Value: message to display when this input is required
|
|
3630
|
+
*/
|
|
3631
|
+
ifDefined?: unknown;
|
|
3632
|
+
/**
|
|
3633
|
+
* Makes this input required when another input is not defined:
|
|
3634
|
+
*
|
|
3635
|
+
* - Key: name of the input that must be undefined
|
|
3636
|
+
* - Value: message to display when this input is required
|
|
3637
|
+
*/
|
|
3638
|
+
ifNotDefined?: unknown;
|
|
3639
|
+
}
|
|
3640
|
+
}
|
|
3641
|
+
/**
|
|
3642
|
+
* The logic of the node. Only available for logic nodes.
|
|
3643
|
+
*/
|
|
3644
|
+
interface Logic {
|
|
3645
|
+
/**
|
|
3646
|
+
* The cases of the logic. Only available for if/else nodes.
|
|
3647
|
+
*/
|
|
3648
|
+
cases?: Array<Logic.Case>;
|
|
3649
|
+
/**
|
|
3650
|
+
* The default case of the logic. Contains the id/output of the node to execute if
|
|
3651
|
+
* no case is matched. Only available for if/else nodes.
|
|
3652
|
+
*/
|
|
3653
|
+
default?: string;
|
|
3654
|
+
/**
|
|
3655
|
+
* The transform of the logic. Only available for transform nodes.
|
|
3656
|
+
*/
|
|
3657
|
+
transform?: string;
|
|
3658
|
+
}
|
|
3659
|
+
namespace Logic {
|
|
3660
|
+
interface Case {
|
|
3661
|
+
condition: string;
|
|
3662
|
+
value: string;
|
|
3663
|
+
}
|
|
3664
|
+
}
|
|
3665
|
+
}
|
|
3666
|
+
/**
|
|
3667
|
+
* Defines the input parameters for a model. Use this to understand the available
|
|
3668
|
+
* input parameters for a given `modelId` when calling
|
|
3669
|
+
* `POST /generate/custom/{modelId}`. See {@link
|
|
3670
|
+
* https://docs.scenario.com/docs/video-generation} for examples.
|
|
3671
|
+
*/
|
|
3672
|
+
interface Input {
|
|
3673
|
+
/**
|
|
3674
|
+
* The name that must be user to call the model through the API
|
|
3675
|
+
*/
|
|
3676
|
+
name: string;
|
|
3677
|
+
/**
|
|
3678
|
+
* The data type of the input
|
|
3679
|
+
*/
|
|
3680
|
+
type: 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array';
|
|
3681
|
+
/**
|
|
3682
|
+
* The allowed values for the input. For \`string\` or \`number\` types, creates a
|
|
3683
|
+
* single-select dropdown. For \`string_array\` type, creates a multi-select
|
|
3684
|
+
* dropdown.
|
|
3685
|
+
*/
|
|
3686
|
+
allowedValues?: Array<unknown>;
|
|
3687
|
+
/**
|
|
3688
|
+
* Specifies the background behavior for the input. Only available for \`file\` and
|
|
3689
|
+
* \`file_array\` input types with kind \`image\`.
|
|
3690
|
+
*/
|
|
3691
|
+
backgroundBehavior?: 'opaque' | 'transparent';
|
|
3692
|
+
/**
|
|
3693
|
+
* Whether the input is a color or not. Only available for \`string\` input type.
|
|
3694
|
+
*/
|
|
3695
|
+
color?: boolean;
|
|
3696
|
+
/**
|
|
3697
|
+
* Whether this input affects the model's cost calculation
|
|
3698
|
+
*/
|
|
3699
|
+
costImpact?: boolean;
|
|
3700
|
+
/**
|
|
3701
|
+
* Help text displayed in the UI to provide additional information about the input
|
|
3702
|
+
*/
|
|
3703
|
+
description?: string;
|
|
3704
|
+
/**
|
|
3705
|
+
* Used to visually group inputs together in the UI. Inputs with the same group
|
|
3706
|
+
* value appear consecutively in the UI.
|
|
3707
|
+
*/
|
|
3708
|
+
group?: string;
|
|
3709
|
+
/**
|
|
3710
|
+
* Hint text displayed in the UI as a tooltip to guide the user
|
|
3711
|
+
*/
|
|
3712
|
+
hint?: string;
|
|
3713
|
+
/**
|
|
3714
|
+
* The list of inputs which form an object within a container array. All inputs are
|
|
3715
|
+
* the same as the current object. This is only available for type inputs_array
|
|
3716
|
+
* inputs.
|
|
3717
|
+
*/
|
|
3718
|
+
inputs?: Array<unknown>;
|
|
3719
|
+
/**
|
|
3720
|
+
* The asset kind of the input. Only taken into account for \`file\` and
|
|
3721
|
+
* \`file_array\` input types.
|
|
3722
|
+
*/
|
|
3723
|
+
kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'video';
|
|
3724
|
+
/**
|
|
3725
|
+
* The label displayed in the UI for this input
|
|
3726
|
+
*/
|
|
3727
|
+
label?: string;
|
|
3728
|
+
/**
|
|
3729
|
+
* The name of the file input field to use as the mask source
|
|
3730
|
+
*/
|
|
3731
|
+
maskFrom?: string;
|
|
3732
|
+
/**
|
|
3733
|
+
* The maximum allowed value. Only available for \`number\` and \`array\` input
|
|
3734
|
+
* types.
|
|
3735
|
+
*/
|
|
3736
|
+
max?: number;
|
|
3737
|
+
/**
|
|
3738
|
+
* The maximum allowed length for \`string\` inputs. Also applies to each item in
|
|
3739
|
+
* \`string_array\`.
|
|
3740
|
+
*/
|
|
3741
|
+
maxLength?: number;
|
|
3742
|
+
/**
|
|
3743
|
+
* The minimum allowed value. Only available for \`number\` and array input types.
|
|
3744
|
+
*/
|
|
3745
|
+
min?: number;
|
|
3746
|
+
/**
|
|
3747
|
+
* The minimum allowed length for string inputs. Also applies to each item in
|
|
3748
|
+
* \`string_array\`.
|
|
3749
|
+
*/
|
|
3750
|
+
minLength?: number;
|
|
3751
|
+
/**
|
|
3752
|
+
* The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only
|
|
3753
|
+
* available for \`model_array\` input type.
|
|
3754
|
+
*/
|
|
3755
|
+
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'>;
|
|
3756
|
+
/**
|
|
3757
|
+
* Whether this input represents a parent asset to assign to the produced assets.
|
|
3758
|
+
* Only available for \`file\` and \`file_array\` input types.
|
|
3759
|
+
*
|
|
3760
|
+
* For \`file_array\`, the parent asset is the first item in the array.
|
|
3761
|
+
*/
|
|
3762
|
+
parent?: boolean;
|
|
3763
|
+
/**
|
|
3764
|
+
* Placeholder text for the input. Only available for 'string' input type.
|
|
3765
|
+
*/
|
|
3766
|
+
placeholder?: string;
|
|
3767
|
+
/**
|
|
3768
|
+
* Whether the input is a prompt. When true, displays as a text area with prompt
|
|
3769
|
+
* spark feature. Only available for \`string\` input type.
|
|
3770
|
+
*/
|
|
3771
|
+
prompt?: boolean;
|
|
3772
|
+
/**
|
|
3773
|
+
* Whether the input is used with prompt spark. Only available for \`string\` input
|
|
3774
|
+
* type.
|
|
3775
|
+
*/
|
|
3776
|
+
promptSpark?: boolean;
|
|
3777
|
+
/**
|
|
3778
|
+
* Set of rules that describes when this input is required:
|
|
3779
|
+
*
|
|
3780
|
+
* - \`always\`: Input is always required
|
|
3781
|
+
* - \`ifNotDefined\`: Input is required when another specified input is not
|
|
3782
|
+
* defined
|
|
3783
|
+
* - \`ifDefined\`: Input is required when another specified input is defined
|
|
3784
|
+
* - \`conditionalValues\`: Input is required when another input has a specific
|
|
3785
|
+
* value
|
|
3786
|
+
*
|
|
3787
|
+
* By default, the input is not required.
|
|
3788
|
+
*/
|
|
3789
|
+
required?: Input.Required;
|
|
3790
|
+
/**
|
|
3791
|
+
* The step increment for numeric inputs. Only available for \`number\` input type.
|
|
3792
|
+
*/
|
|
3793
|
+
step?: number;
|
|
3794
|
+
}
|
|
3795
|
+
namespace Input {
|
|
3796
|
+
/**
|
|
3797
|
+
* Set of rules that describes when this input is required:
|
|
3798
|
+
*
|
|
3799
|
+
* - \`always\`: Input is always required
|
|
3800
|
+
* - \`ifNotDefined\`: Input is required when another specified input is not
|
|
3801
|
+
* defined
|
|
3802
|
+
* - \`ifDefined\`: Input is required when another specified input is defined
|
|
3803
|
+
* - \`conditionalValues\`: Input is required when another input has a specific
|
|
3804
|
+
* value
|
|
3805
|
+
*
|
|
3806
|
+
* By default, the input is not required.
|
|
3807
|
+
*/
|
|
3808
|
+
interface Required {
|
|
3809
|
+
/**
|
|
3810
|
+
* Whether the input is always required
|
|
3811
|
+
*/
|
|
3812
|
+
always?: boolean;
|
|
3813
|
+
/**
|
|
3814
|
+
* Makes this input required when another input has a specific value:
|
|
3815
|
+
*
|
|
3816
|
+
* - Key: name of the input to check
|
|
3817
|
+
* - Value: operation and allowed values that trigger the requirement
|
|
3818
|
+
*/
|
|
3819
|
+
conditionalValues?: unknown;
|
|
3820
|
+
/**
|
|
3821
|
+
* Makes this input required when another input is defined:
|
|
3822
|
+
*
|
|
3823
|
+
* - Key: name of the input that must be defined
|
|
3824
|
+
* - Value: message to display when this input is required
|
|
3825
|
+
*/
|
|
3826
|
+
ifDefined?: unknown;
|
|
3827
|
+
/**
|
|
3828
|
+
* Makes this input required when another input is not defined:
|
|
3829
|
+
*
|
|
3830
|
+
* - Key: name of the input that must be undefined
|
|
3831
|
+
* - Value: message to display when this input is required
|
|
3832
|
+
*/
|
|
3833
|
+
ifNotDefined?: unknown;
|
|
3834
|
+
}
|
|
3835
|
+
}
|
|
3836
|
+
/**
|
|
3837
|
+
* A representation of an asset after being processed by the workflow
|
|
3838
|
+
*/
|
|
3839
|
+
interface After {
|
|
3840
|
+
/**
|
|
3841
|
+
* The AssetId of the image used as a thumbnail for your model (example:
|
|
3842
|
+
* "asset_GTrL3mq4SXWyMxkOHRxlpw")
|
|
3843
|
+
*/
|
|
3844
|
+
assetId: string;
|
|
3845
|
+
/**
|
|
3846
|
+
* The url of the image used as a thumbnail for your model
|
|
3847
|
+
*/
|
|
3848
|
+
url: string;
|
|
3849
|
+
}
|
|
3850
|
+
/**
|
|
3851
|
+
* A representation of an asset before being processed by the workflow
|
|
3852
|
+
*/
|
|
3853
|
+
interface Before {
|
|
3854
|
+
/**
|
|
3855
|
+
* The AssetId of the image used as a thumbnail for your model (example:
|
|
3856
|
+
* "asset_GTrL3mq4SXWyMxkOHRxlpw")
|
|
3857
|
+
*/
|
|
3858
|
+
assetId: string;
|
|
3859
|
+
/**
|
|
3860
|
+
* The url of the image used as a thumbnail for your model
|
|
3861
|
+
*/
|
|
3862
|
+
url: string;
|
|
3863
|
+
}
|
|
3864
|
+
/**
|
|
3865
|
+
* Currently the thumbnail is identical to the after asset.
|
|
3866
|
+
*/
|
|
3867
|
+
interface Thumbnail {
|
|
3868
|
+
assetId: string;
|
|
3869
|
+
url: string;
|
|
3870
|
+
}
|
|
3871
|
+
/**
|
|
3872
|
+
* The UI configuration for the workflow. This is managed by scenario webapp.
|
|
3873
|
+
*/
|
|
3874
|
+
interface UiConfig {
|
|
3875
|
+
/**
|
|
3876
|
+
* Configuration for the input properties
|
|
3877
|
+
*/
|
|
3878
|
+
inputProperties?: {
|
|
3879
|
+
[key: string]: UiConfig.InputProperties;
|
|
3880
|
+
};
|
|
3881
|
+
/**
|
|
3882
|
+
* Configuration for the loras component
|
|
3883
|
+
*/
|
|
3884
|
+
lorasComponent?: UiConfig.LorasComponent;
|
|
3885
|
+
/**
|
|
3886
|
+
* Configuration for the presets
|
|
3887
|
+
*/
|
|
3888
|
+
presets?: Array<UiConfig.Preset>;
|
|
3889
|
+
/**
|
|
3890
|
+
* Configuration for the resolution component
|
|
3891
|
+
*/
|
|
3892
|
+
resolutionComponent?: UiConfig.ResolutionComponent;
|
|
3893
|
+
/**
|
|
3894
|
+
* Configuration for the selects
|
|
3895
|
+
*/
|
|
3896
|
+
selects?: {
|
|
3897
|
+
[key: string]: unknown;
|
|
3898
|
+
};
|
|
3899
|
+
/**
|
|
3900
|
+
* Configuration for the trigger generate button
|
|
3901
|
+
*/
|
|
3902
|
+
triggerGenerate?: UiConfig.TriggerGenerate;
|
|
3903
|
+
}
|
|
3904
|
+
namespace UiConfig {
|
|
3905
|
+
interface InputProperties {
|
|
3906
|
+
collapsed?: boolean;
|
|
3907
|
+
}
|
|
3908
|
+
/**
|
|
3909
|
+
* Configuration for the loras component
|
|
3910
|
+
*/
|
|
3911
|
+
interface LorasComponent {
|
|
3912
|
+
/**
|
|
3913
|
+
* The label of the component
|
|
3914
|
+
*/
|
|
3915
|
+
label: string;
|
|
3916
|
+
/**
|
|
3917
|
+
* The input name of the model (model_array)
|
|
3918
|
+
*/
|
|
3919
|
+
modelInput: string;
|
|
3920
|
+
/**
|
|
3921
|
+
* The input name of the scale (number_array)
|
|
3922
|
+
*/
|
|
3923
|
+
scaleInput: string;
|
|
3924
|
+
/**
|
|
3925
|
+
* The input model id (example: a composition or a single LoRA modelId) If
|
|
3926
|
+
* specified, the model id will be attached to the output asset as a metadata If
|
|
3927
|
+
* the model-decomposer parser is specified on it, modelInput and scaleInput will
|
|
3928
|
+
* be automatically populated
|
|
3929
|
+
*/
|
|
3930
|
+
modelIdInput?: string;
|
|
3931
|
+
}
|
|
3932
|
+
interface Preset {
|
|
3933
|
+
fields: Array<string>;
|
|
3934
|
+
presets: unknown;
|
|
3935
|
+
}
|
|
3936
|
+
/**
|
|
3937
|
+
* Configuration for the resolution component
|
|
3938
|
+
*/
|
|
3939
|
+
interface ResolutionComponent {
|
|
3940
|
+
/**
|
|
3941
|
+
* The input name of the height
|
|
3942
|
+
*/
|
|
3943
|
+
heightInput: string;
|
|
3944
|
+
/**
|
|
3945
|
+
* The label of the component
|
|
3946
|
+
*/
|
|
3947
|
+
label: string;
|
|
3948
|
+
/**
|
|
3949
|
+
* The resolution presets
|
|
3950
|
+
*/
|
|
3951
|
+
presets: Array<ResolutionComponent.Preset>;
|
|
3952
|
+
/**
|
|
3953
|
+
* The input name of the width
|
|
3954
|
+
*/
|
|
3955
|
+
widthInput: string;
|
|
3956
|
+
}
|
|
3957
|
+
namespace ResolutionComponent {
|
|
3958
|
+
interface Preset {
|
|
3959
|
+
height: number;
|
|
3960
|
+
label: string;
|
|
3961
|
+
width: number;
|
|
3962
|
+
}
|
|
3963
|
+
}
|
|
3964
|
+
/**
|
|
3965
|
+
* Configuration for the trigger generate button
|
|
3966
|
+
*/
|
|
3967
|
+
interface TriggerGenerate {
|
|
3968
|
+
label: string;
|
|
3969
|
+
/**
|
|
3970
|
+
* The 'name' of the input where the trigger generate button will be displayed
|
|
3971
|
+
* (after the input). Do not specify both position and after.
|
|
3972
|
+
*/
|
|
3973
|
+
after?: string;
|
|
3974
|
+
/**
|
|
3975
|
+
* The position of the trigger generate button. If position specified, the button
|
|
3976
|
+
* will be displayed at the specified position. Do not specify both position and
|
|
3977
|
+
* after.
|
|
3978
|
+
*/
|
|
3979
|
+
position?: 'bottom' | 'top';
|
|
3980
|
+
}
|
|
3981
|
+
}
|
|
3982
|
+
}
|
|
3983
|
+
}
|
|
3984
|
+
export interface WorkflowCreateParams {
|
|
3985
|
+
description: string;
|
|
3986
|
+
name: string;
|
|
3987
|
+
}
|
|
3988
|
+
export interface WorkflowUpdateParams {
|
|
3989
|
+
/**
|
|
3990
|
+
* The after asset of the workflow. Set to null to unset the after asset.
|
|
3991
|
+
*/
|
|
3992
|
+
after?: string;
|
|
3993
|
+
/**
|
|
3994
|
+
* The before asset of the workflow. Set to null to unset the before asset.
|
|
3995
|
+
*/
|
|
3996
|
+
before?: string;
|
|
3997
|
+
/**
|
|
3998
|
+
* The description of the workflow.
|
|
3999
|
+
*/
|
|
4000
|
+
description?: string;
|
|
4001
|
+
/**
|
|
4002
|
+
* The UI data about the workflow. This is managed by scenario webapp.
|
|
4003
|
+
*/
|
|
4004
|
+
editorInfo?: unknown;
|
|
4005
|
+
/**
|
|
4006
|
+
* The flow of the workflow.
|
|
4007
|
+
*/
|
|
4008
|
+
flow?: Array<WorkflowUpdateParams.Flow>;
|
|
4009
|
+
/**
|
|
4010
|
+
* The inputs of the workflow.
|
|
4011
|
+
*/
|
|
4012
|
+
inputs?: Array<WorkflowUpdateParams.Input>;
|
|
4013
|
+
/**
|
|
4014
|
+
* The name of the workflow.
|
|
4015
|
+
*/
|
|
4016
|
+
name?: string;
|
|
4017
|
+
/**
|
|
4018
|
+
* The output asset kinds of the workflow.
|
|
4019
|
+
*/
|
|
4020
|
+
outputAssetKinds?: Array<'3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'video'>;
|
|
4021
|
+
/**
|
|
4022
|
+
* The privacy of the workflow.
|
|
4023
|
+
*/
|
|
4024
|
+
privacy?: 'private' | 'public' | 'unlisted';
|
|
4025
|
+
/**
|
|
4026
|
+
* The status of the workflow.
|
|
4027
|
+
*/
|
|
4028
|
+
status?: 'draft' | 'ready';
|
|
4029
|
+
/**
|
|
4030
|
+
* The tag set of the workflow.
|
|
4031
|
+
*/
|
|
4032
|
+
tagSet?: Array<string>;
|
|
4033
|
+
/**
|
|
4034
|
+
* The thumbnail asset of the workflow. Set to null to unset the thumbnail.
|
|
4035
|
+
*/
|
|
4036
|
+
thumbnail?: string;
|
|
4037
|
+
}
|
|
4038
|
+
export declare namespace WorkflowUpdateParams {
|
|
4039
|
+
interface Flow {
|
|
4040
|
+
/**
|
|
4041
|
+
* The id of the node.
|
|
4042
|
+
*/
|
|
4043
|
+
id: string;
|
|
4044
|
+
/**
|
|
4045
|
+
* The status of the node. Only available for WorkflowJob nodes.
|
|
4046
|
+
*/
|
|
4047
|
+
status: 'failure' | 'pending' | 'processing' | 'skipped' | 'success';
|
|
4048
|
+
/**
|
|
4049
|
+
* The type of the job for the node.
|
|
4050
|
+
*/
|
|
4051
|
+
type: 'custom-model' | 'generate-prompt' | 'logic' | 'remove-background' | 'transform' | 'user-approval' | 'workflow';
|
|
4052
|
+
/**
|
|
4053
|
+
* The nodes that this node depends on. Only available for nodes that have
|
|
4054
|
+
* dependencies. Mainly used for user approval nodes.
|
|
4055
|
+
*/
|
|
4056
|
+
dependsOn?: Array<string>;
|
|
4057
|
+
/**
|
|
4058
|
+
* The inputs of the node.
|
|
4059
|
+
*/
|
|
4060
|
+
inputs?: Array<Flow.Input>;
|
|
4061
|
+
/**
|
|
4062
|
+
* If the flow is part of a WorkflowJob, this is the jobId for the node. jobId is
|
|
4063
|
+
* only available for nodes started. A node "Pending" for a running workflow job is
|
|
4064
|
+
* not started.
|
|
4065
|
+
*/
|
|
4066
|
+
jobId?: string;
|
|
4067
|
+
/**
|
|
4068
|
+
* The logic of the node. Only available for logic nodes.
|
|
4069
|
+
*/
|
|
4070
|
+
logic?: Flow.Logic;
|
|
4071
|
+
/**
|
|
4072
|
+
* The type of the logic for the node. Only available for logic nodes.
|
|
4073
|
+
*/
|
|
4074
|
+
logicType?: 'if-else';
|
|
4075
|
+
/**
|
|
4076
|
+
* The model id for the node. Mainly used for custom model tasks.
|
|
4077
|
+
*/
|
|
4078
|
+
modelId?: string;
|
|
4079
|
+
/**
|
|
4080
|
+
* The asset IDs of the node. Only available for nodes that produce assets.
|
|
4081
|
+
*/
|
|
4082
|
+
outputAssetIds?: Array<string>;
|
|
4083
|
+
/**
|
|
4084
|
+
* The workflow id for the node. Mainly used for workflow tasks.
|
|
4085
|
+
*/
|
|
4086
|
+
workflowId?: string;
|
|
4087
|
+
}
|
|
4088
|
+
namespace Flow {
|
|
4089
|
+
/**
|
|
4090
|
+
* This is used to run the flow.
|
|
4091
|
+
*/
|
|
4092
|
+
interface Input {
|
|
4093
|
+
/**
|
|
4094
|
+
* The name that must be user to call the model through the API
|
|
4095
|
+
*/
|
|
4096
|
+
name: string;
|
|
4097
|
+
/**
|
|
4098
|
+
* The data type of the input
|
|
4099
|
+
*/
|
|
4100
|
+
type: 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array';
|
|
4101
|
+
/**
|
|
4102
|
+
* The allowed values for the input. For \`string\` or \`number\` types, creates a
|
|
4103
|
+
* single-select dropdown. For \`string_array\` type, creates a multi-select
|
|
4104
|
+
* dropdown.
|
|
4105
|
+
*/
|
|
4106
|
+
allowedValues?: Array<unknown>;
|
|
4107
|
+
/**
|
|
4108
|
+
* Specifies the background behavior for the input. Only available for \`file\` and
|
|
4109
|
+
* \`file_array\` input types with kind \`image\`.
|
|
4110
|
+
*/
|
|
4111
|
+
backgroundBehavior?: 'opaque' | 'transparent';
|
|
4112
|
+
/**
|
|
4113
|
+
* Whether the input is a color or not. Only available for \`string\` input type.
|
|
4114
|
+
*/
|
|
4115
|
+
color?: boolean;
|
|
4116
|
+
/**
|
|
4117
|
+
* Whether this input affects the model's cost calculation
|
|
4118
|
+
*/
|
|
4119
|
+
costImpact?: boolean;
|
|
4120
|
+
/**
|
|
4121
|
+
* Help text displayed in the UI to provide additional information about the input
|
|
4122
|
+
*/
|
|
4123
|
+
description?: string;
|
|
4124
|
+
/**
|
|
4125
|
+
* Used to visually group inputs together in the UI. Inputs with the same group
|
|
4126
|
+
* value appear consecutively in the UI.
|
|
4127
|
+
*/
|
|
4128
|
+
group?: string;
|
|
4129
|
+
/**
|
|
4130
|
+
* Hint text displayed in the UI as a tooltip to guide the user
|
|
4131
|
+
*/
|
|
4132
|
+
hint?: string;
|
|
4133
|
+
/**
|
|
4134
|
+
* The list of inputs which form an object within a container array. All inputs are
|
|
4135
|
+
* the same as the current object. This is only available for type inputs_array
|
|
4136
|
+
* inputs.
|
|
4137
|
+
*/
|
|
4138
|
+
inputs?: Array<unknown>;
|
|
4139
|
+
/**
|
|
4140
|
+
* The asset kind of the input. Only taken into account for \`file\` and
|
|
4141
|
+
* \`file_array\` input types.
|
|
4142
|
+
*/
|
|
4143
|
+
kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'video';
|
|
4144
|
+
/**
|
|
4145
|
+
* The label displayed in the UI for this input
|
|
4146
|
+
*/
|
|
4147
|
+
label?: string;
|
|
4148
|
+
/**
|
|
4149
|
+
* The name of the file input field to use as the mask source
|
|
4150
|
+
*/
|
|
4151
|
+
maskFrom?: string;
|
|
4152
|
+
/**
|
|
4153
|
+
* The maximum allowed value. Only available for \`number\` and \`array\` input
|
|
4154
|
+
* types.
|
|
4155
|
+
*/
|
|
4156
|
+
max?: number;
|
|
4157
|
+
/**
|
|
4158
|
+
* The maximum allowed length for \`string\` inputs. Also applies to each item in
|
|
4159
|
+
* \`string_array\`.
|
|
4160
|
+
*/
|
|
4161
|
+
maxLength?: number;
|
|
4162
|
+
/**
|
|
4163
|
+
* The minimum allowed value. Only available for \`number\` and array input types.
|
|
4164
|
+
*/
|
|
4165
|
+
min?: number;
|
|
4166
|
+
/**
|
|
4167
|
+
* The minimum allowed length for string inputs. Also applies to each item in
|
|
4168
|
+
* \`string_array\`.
|
|
4169
|
+
*/
|
|
4170
|
+
minLength?: number;
|
|
4171
|
+
/**
|
|
4172
|
+
* The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only
|
|
4173
|
+
* available for \`model_array\` input type.
|
|
4174
|
+
*/
|
|
4175
|
+
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'>;
|
|
4176
|
+
/**
|
|
4177
|
+
* Whether this input represents a parent asset to assign to the produced assets.
|
|
4178
|
+
* Only available for \`file\` and \`file_array\` input types.
|
|
4179
|
+
*
|
|
4180
|
+
* For \`file_array\`, the parent asset is the first item in the array.
|
|
4181
|
+
*/
|
|
4182
|
+
parent?: boolean;
|
|
4183
|
+
/**
|
|
4184
|
+
* Placeholder text for the input. Only available for 'string' input type.
|
|
4185
|
+
*/
|
|
4186
|
+
placeholder?: string;
|
|
4187
|
+
/**
|
|
4188
|
+
* Whether the input is a prompt. When true, displays as a text area with prompt
|
|
4189
|
+
* spark feature. Only available for \`string\` input type.
|
|
4190
|
+
*/
|
|
4191
|
+
prompt?: boolean;
|
|
4192
|
+
/**
|
|
4193
|
+
* Whether the input is used with prompt spark. Only available for \`string\` input
|
|
4194
|
+
* type.
|
|
4195
|
+
*/
|
|
4196
|
+
promptSpark?: boolean;
|
|
4197
|
+
/**
|
|
4198
|
+
* The reference to another input or output of the same workflow. Must have at
|
|
4199
|
+
* least one of node or conditional.
|
|
4200
|
+
*/
|
|
4201
|
+
ref?: Input.Ref;
|
|
4202
|
+
/**
|
|
4203
|
+
* Set of rules that describes when this input is required:
|
|
4204
|
+
*
|
|
4205
|
+
* - \`always\`: Input is always required
|
|
4206
|
+
* - \`ifNotDefined\`: Input is required when another specified input is not
|
|
4207
|
+
* defined
|
|
4208
|
+
* - \`ifDefined\`: Input is required when another specified input is defined
|
|
4209
|
+
* - \`conditionalValues\`: Input is required when another input has a specific
|
|
4210
|
+
* value
|
|
4211
|
+
*
|
|
4212
|
+
* By default, the input is not required.
|
|
4213
|
+
*/
|
|
4214
|
+
required?: Input.Required;
|
|
4215
|
+
/**
|
|
4216
|
+
* The step increment for numeric inputs. Only available for \`number\` input type.
|
|
4217
|
+
*/
|
|
4218
|
+
step?: number;
|
|
4219
|
+
}
|
|
4220
|
+
namespace Input {
|
|
4221
|
+
/**
|
|
4222
|
+
* The reference to another input or output of the same workflow. Must have at
|
|
4223
|
+
* least one of node or conditional.
|
|
4224
|
+
*/
|
|
4225
|
+
interface Ref {
|
|
4226
|
+
/**
|
|
4227
|
+
* The conditional nodes to reference. If the conditional nodes are successful, the
|
|
4228
|
+
* node will be successful. If the conditional nodes are skipped, the node will be
|
|
4229
|
+
* skipped. Contains an array of node ids used to check the status of the nodes.
|
|
4230
|
+
*/
|
|
4231
|
+
conditional?: Array<string>;
|
|
4232
|
+
/**
|
|
4233
|
+
* This is the desired node output value if ref is an if/else node.
|
|
4234
|
+
*/
|
|
4235
|
+
equal?: string;
|
|
4236
|
+
/**
|
|
4237
|
+
* The name of the input or output to reference. If the type is 'workflow', the
|
|
4238
|
+
* name is the name of the input of the workflow is required If the type is 'node',
|
|
4239
|
+
* the name is not mandatory, except if you want all outputs of the node. To get
|
|
4240
|
+
* all outputs of a node, you can use the name 'all'.
|
|
4241
|
+
*/
|
|
4242
|
+
name?: string;
|
|
4243
|
+
/**
|
|
4244
|
+
* The node id or 'workflow' if the source is a workflow input.
|
|
4245
|
+
*/
|
|
4246
|
+
node?: string;
|
|
4247
|
+
}
|
|
4248
|
+
/**
|
|
4249
|
+
* Set of rules that describes when this input is required:
|
|
4250
|
+
*
|
|
4251
|
+
* - \`always\`: Input is always required
|
|
4252
|
+
* - \`ifNotDefined\`: Input is required when another specified input is not
|
|
4253
|
+
* defined
|
|
4254
|
+
* - \`ifDefined\`: Input is required when another specified input is defined
|
|
4255
|
+
* - \`conditionalValues\`: Input is required when another input has a specific
|
|
4256
|
+
* value
|
|
4257
|
+
*
|
|
4258
|
+
* By default, the input is not required.
|
|
4259
|
+
*/
|
|
4260
|
+
interface Required {
|
|
4261
|
+
/**
|
|
4262
|
+
* Whether the input is always required
|
|
4263
|
+
*/
|
|
4264
|
+
always?: boolean;
|
|
4265
|
+
/**
|
|
4266
|
+
* Makes this input required when another input has a specific value:
|
|
4267
|
+
*
|
|
4268
|
+
* - Key: name of the input to check
|
|
4269
|
+
* - Value: operation and allowed values that trigger the requirement
|
|
4270
|
+
*/
|
|
4271
|
+
conditionalValues?: unknown;
|
|
4272
|
+
/**
|
|
4273
|
+
* Makes this input required when another input is defined:
|
|
4274
|
+
*
|
|
4275
|
+
* - Key: name of the input that must be defined
|
|
4276
|
+
* - Value: message to display when this input is required
|
|
4277
|
+
*/
|
|
4278
|
+
ifDefined?: unknown;
|
|
4279
|
+
/**
|
|
4280
|
+
* Makes this input required when another input is not defined:
|
|
4281
|
+
*
|
|
4282
|
+
* - Key: name of the input that must be undefined
|
|
4283
|
+
* - Value: message to display when this input is required
|
|
4284
|
+
*/
|
|
4285
|
+
ifNotDefined?: unknown;
|
|
4286
|
+
}
|
|
4287
|
+
}
|
|
4288
|
+
/**
|
|
4289
|
+
* The logic of the node. Only available for logic nodes.
|
|
4290
|
+
*/
|
|
4291
|
+
interface Logic {
|
|
4292
|
+
/**
|
|
4293
|
+
* The cases of the logic. Only available for if/else nodes.
|
|
4294
|
+
*/
|
|
4295
|
+
cases?: Array<Logic.Case>;
|
|
4296
|
+
/**
|
|
4297
|
+
* The default case of the logic. Contains the id/output of the node to execute if
|
|
4298
|
+
* no case is matched. Only available for if/else nodes.
|
|
4299
|
+
*/
|
|
4300
|
+
default?: string;
|
|
4301
|
+
/**
|
|
4302
|
+
* The transform of the logic. Only available for transform nodes.
|
|
4303
|
+
*/
|
|
4304
|
+
transform?: string;
|
|
4305
|
+
}
|
|
4306
|
+
namespace Logic {
|
|
4307
|
+
interface Case {
|
|
4308
|
+
condition: string;
|
|
4309
|
+
value: string;
|
|
4310
|
+
}
|
|
4311
|
+
}
|
|
4312
|
+
}
|
|
4313
|
+
/**
|
|
4314
|
+
* Defines the input parameters for a model. Use this to understand the available
|
|
4315
|
+
* input parameters for a given `modelId` when calling
|
|
4316
|
+
* `POST /generate/custom/{modelId}`. See {@link
|
|
4317
|
+
* https://docs.scenario.com/docs/video-generation} for examples.
|
|
4318
|
+
*/
|
|
4319
|
+
interface Input {
|
|
4320
|
+
/**
|
|
4321
|
+
* The name that must be user to call the model through the API
|
|
4322
|
+
*/
|
|
4323
|
+
name: string;
|
|
4324
|
+
/**
|
|
4325
|
+
* The data type of the input
|
|
4326
|
+
*/
|
|
4327
|
+
type: 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array';
|
|
4328
|
+
/**
|
|
4329
|
+
* The allowed values for the input. For \`string\` or \`number\` types, creates a
|
|
4330
|
+
* single-select dropdown. For \`string_array\` type, creates a multi-select
|
|
4331
|
+
* dropdown.
|
|
4332
|
+
*/
|
|
4333
|
+
allowedValues?: Array<unknown>;
|
|
4334
|
+
/**
|
|
4335
|
+
* Specifies the background behavior for the input. Only available for \`file\` and
|
|
4336
|
+
* \`file_array\` input types with kind \`image\`.
|
|
4337
|
+
*/
|
|
4338
|
+
backgroundBehavior?: 'opaque' | 'transparent';
|
|
4339
|
+
/**
|
|
4340
|
+
* Whether the input is a color or not. Only available for \`string\` input type.
|
|
4341
|
+
*/
|
|
4342
|
+
color?: boolean;
|
|
4343
|
+
/**
|
|
4344
|
+
* Whether this input affects the model's cost calculation
|
|
4345
|
+
*/
|
|
4346
|
+
costImpact?: boolean;
|
|
4347
|
+
/**
|
|
4348
|
+
* Help text displayed in the UI to provide additional information about the input
|
|
4349
|
+
*/
|
|
4350
|
+
description?: string;
|
|
4351
|
+
/**
|
|
4352
|
+
* Used to visually group inputs together in the UI. Inputs with the same group
|
|
4353
|
+
* value appear consecutively in the UI.
|
|
4354
|
+
*/
|
|
4355
|
+
group?: string;
|
|
4356
|
+
/**
|
|
4357
|
+
* Hint text displayed in the UI as a tooltip to guide the user
|
|
4358
|
+
*/
|
|
4359
|
+
hint?: string;
|
|
4360
|
+
/**
|
|
4361
|
+
* The list of inputs which form an object within a container array. All inputs are
|
|
4362
|
+
* the same as the current object. This is only available for type inputs_array
|
|
4363
|
+
* inputs.
|
|
4364
|
+
*/
|
|
4365
|
+
inputs?: Array<unknown>;
|
|
4366
|
+
/**
|
|
4367
|
+
* The asset kind of the input. Only taken into account for \`file\` and
|
|
4368
|
+
* \`file_array\` input types.
|
|
4369
|
+
*/
|
|
4370
|
+
kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'video';
|
|
4371
|
+
/**
|
|
4372
|
+
* The label displayed in the UI for this input
|
|
4373
|
+
*/
|
|
4374
|
+
label?: string;
|
|
4375
|
+
/**
|
|
4376
|
+
* The name of the file input field to use as the mask source
|
|
4377
|
+
*/
|
|
4378
|
+
maskFrom?: string;
|
|
4379
|
+
/**
|
|
4380
|
+
* The maximum allowed value. Only available for \`number\` and \`array\` input
|
|
4381
|
+
* types.
|
|
4382
|
+
*/
|
|
4383
|
+
max?: number;
|
|
4384
|
+
/**
|
|
4385
|
+
* The maximum allowed length for \`string\` inputs. Also applies to each item in
|
|
4386
|
+
* \`string_array\`.
|
|
4387
|
+
*/
|
|
4388
|
+
maxLength?: number;
|
|
4389
|
+
/**
|
|
4390
|
+
* The minimum allowed value. Only available for \`number\` and array input types.
|
|
4391
|
+
*/
|
|
4392
|
+
min?: number;
|
|
4393
|
+
/**
|
|
4394
|
+
* The minimum allowed length for string inputs. Also applies to each item in
|
|
4395
|
+
* \`string_array\`.
|
|
4396
|
+
*/
|
|
4397
|
+
minLength?: number;
|
|
4398
|
+
/**
|
|
4399
|
+
* The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only
|
|
4400
|
+
* available for \`model_array\` input type.
|
|
4401
|
+
*/
|
|
4402
|
+
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'>;
|
|
4403
|
+
/**
|
|
4404
|
+
* Whether this input represents a parent asset to assign to the produced assets.
|
|
4405
|
+
* Only available for \`file\` and \`file_array\` input types.
|
|
4406
|
+
*
|
|
4407
|
+
* For \`file_array\`, the parent asset is the first item in the array.
|
|
4408
|
+
*/
|
|
4409
|
+
parent?: boolean;
|
|
4410
|
+
/**
|
|
4411
|
+
* Placeholder text for the input. Only available for 'string' input type.
|
|
4412
|
+
*/
|
|
4413
|
+
placeholder?: string;
|
|
4414
|
+
/**
|
|
4415
|
+
* Whether the input is a prompt. When true, displays as a text area with prompt
|
|
4416
|
+
* spark feature. Only available for \`string\` input type.
|
|
4417
|
+
*/
|
|
4418
|
+
prompt?: boolean;
|
|
4419
|
+
/**
|
|
4420
|
+
* Whether the input is used with prompt spark. Only available for \`string\` input
|
|
4421
|
+
* type.
|
|
4422
|
+
*/
|
|
4423
|
+
promptSpark?: boolean;
|
|
4424
|
+
/**
|
|
4425
|
+
* Set of rules that describes when this input is required:
|
|
4426
|
+
*
|
|
4427
|
+
* - \`always\`: Input is always required
|
|
4428
|
+
* - \`ifNotDefined\`: Input is required when another specified input is not
|
|
4429
|
+
* defined
|
|
4430
|
+
* - \`ifDefined\`: Input is required when another specified input is defined
|
|
4431
|
+
* - \`conditionalValues\`: Input is required when another input has a specific
|
|
4432
|
+
* value
|
|
4433
|
+
*
|
|
4434
|
+
* By default, the input is not required.
|
|
4435
|
+
*/
|
|
4436
|
+
required?: Input.Required;
|
|
4437
|
+
/**
|
|
4438
|
+
* The step increment for numeric inputs. Only available for \`number\` input type.
|
|
4439
|
+
*/
|
|
4440
|
+
step?: number;
|
|
4441
|
+
}
|
|
4442
|
+
namespace Input {
|
|
4443
|
+
/**
|
|
4444
|
+
* Set of rules that describes when this input is required:
|
|
4445
|
+
*
|
|
4446
|
+
* - \`always\`: Input is always required
|
|
4447
|
+
* - \`ifNotDefined\`: Input is required when another specified input is not
|
|
4448
|
+
* defined
|
|
4449
|
+
* - \`ifDefined\`: Input is required when another specified input is defined
|
|
4450
|
+
* - \`conditionalValues\`: Input is required when another input has a specific
|
|
4451
|
+
* value
|
|
4452
|
+
*
|
|
4453
|
+
* By default, the input is not required.
|
|
4454
|
+
*/
|
|
4455
|
+
interface Required {
|
|
4456
|
+
/**
|
|
4457
|
+
* Whether the input is always required
|
|
4458
|
+
*/
|
|
4459
|
+
always?: boolean;
|
|
4460
|
+
/**
|
|
4461
|
+
* Makes this input required when another input has a specific value:
|
|
4462
|
+
*
|
|
4463
|
+
* - Key: name of the input to check
|
|
4464
|
+
* - Value: operation and allowed values that trigger the requirement
|
|
4465
|
+
*/
|
|
4466
|
+
conditionalValues?: unknown;
|
|
4467
|
+
/**
|
|
4468
|
+
* Makes this input required when another input is defined:
|
|
4469
|
+
*
|
|
4470
|
+
* - Key: name of the input that must be defined
|
|
4471
|
+
* - Value: message to display when this input is required
|
|
4472
|
+
*/
|
|
4473
|
+
ifDefined?: unknown;
|
|
4474
|
+
/**
|
|
4475
|
+
* Makes this input required when another input is not defined:
|
|
4476
|
+
*
|
|
4477
|
+
* - Key: name of the input that must be undefined
|
|
4478
|
+
* - Value: message to display when this input is required
|
|
4479
|
+
*/
|
|
4480
|
+
ifNotDefined?: unknown;
|
|
4481
|
+
}
|
|
4482
|
+
}
|
|
4483
|
+
}
|
|
4484
|
+
export interface WorkflowListParams {
|
|
4485
|
+
/**
|
|
4486
|
+
* The number of items to return in the response. The default value is 10, maximum
|
|
4487
|
+
* value is 200, minimum value is 1
|
|
4488
|
+
*/
|
|
4489
|
+
pageSize?: string;
|
|
4490
|
+
/**
|
|
4491
|
+
* A token you received in a previous request to query the next page of items
|
|
4492
|
+
*/
|
|
4493
|
+
paginationToken?: string;
|
|
4494
|
+
/**
|
|
4495
|
+
* The privacy of the workflows to return. The default value is `private`, possible
|
|
4496
|
+
* values are `private`, `public` and `unlisted`. Default value is `private`.
|
|
4497
|
+
*/
|
|
4498
|
+
privacy?: string;
|
|
4499
|
+
/**
|
|
4500
|
+
* The status of the workflows to return. Only available when
|
|
4501
|
+
* privacy=private/unlisted. Default undefined value returns all statuses for
|
|
4502
|
+
* private, `ready` for public.
|
|
4503
|
+
*/
|
|
4504
|
+
status?: string;
|
|
4505
|
+
tags?: string;
|
|
4506
|
+
}
|
|
4507
|
+
export interface WorkflowApproveUserParams {
|
|
4508
|
+
/**
|
|
4509
|
+
* The ID of the user approval node to approve in the workflow
|
|
4510
|
+
*/
|
|
4511
|
+
nodeId: string;
|
|
4512
|
+
/**
|
|
4513
|
+
* The ID of the workflow job that contains the user approval node
|
|
4514
|
+
*/
|
|
4515
|
+
workflowJobId: string;
|
|
4516
|
+
}
|
|
4517
|
+
export interface WorkflowGetTagsParams {
|
|
4518
|
+
/**
|
|
4519
|
+
* The status of the workflows to return. Only available when
|
|
4520
|
+
* privacy=private/unlisted. Default undefined value returns all statuses for
|
|
4521
|
+
* private, `ready` for public.
|
|
4522
|
+
*/
|
|
4523
|
+
status?: string;
|
|
4524
|
+
}
|
|
4525
|
+
export interface WorkflowRunParams {
|
|
4526
|
+
/**
|
|
4527
|
+
* Body param: The request body for the workflow run must be retrieve from GET
|
|
4528
|
+
* /workflows/{workflowId} inputs fields
|
|
4529
|
+
*/
|
|
4530
|
+
body: unknown;
|
|
4531
|
+
/**
|
|
4532
|
+
* Query param
|
|
4533
|
+
*/
|
|
4534
|
+
dryRun?: string;
|
|
4535
|
+
}
|
|
4536
|
+
export declare namespace Workflows {
|
|
4537
|
+
export { type WorkflowCreateResponse as WorkflowCreateResponse, type WorkflowRetrieveResponse as WorkflowRetrieveResponse, type WorkflowUpdateResponse as WorkflowUpdateResponse, type WorkflowListResponse as WorkflowListResponse, type WorkflowDeleteResponse as WorkflowDeleteResponse, type WorkflowApproveUserResponse as WorkflowApproveUserResponse, type WorkflowGetTagsResponse as WorkflowGetTagsResponse, type WorkflowRunResponse as WorkflowRunResponse, type WorkflowCreateParams as WorkflowCreateParams, type WorkflowUpdateParams as WorkflowUpdateParams, type WorkflowListParams as WorkflowListParams, type WorkflowApproveUserParams as WorkflowApproveUserParams, type WorkflowGetTagsParams as WorkflowGetTagsParams, type WorkflowRunParams as WorkflowRunParams, };
|
|
4538
|
+
}
|
|
4539
|
+
//# sourceMappingURL=workflows.d.ts.map
|