@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,2334 @@
|
|
|
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 Train extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* Trigger an action on a model training: cancel
|
|
7
|
+
*/
|
|
8
|
+
action(modelID: string, body: TrainActionParams, options?: RequestOptions): APIPromise<TrainActionResponse>;
|
|
9
|
+
/**
|
|
10
|
+
* Trigger the given `modelId` training
|
|
11
|
+
*/
|
|
12
|
+
trigger(modelID: string, params: TrainTriggerParams, options?: RequestOptions): APIPromise<TrainTriggerResponse>;
|
|
13
|
+
}
|
|
14
|
+
export interface TrainActionResponse {
|
|
15
|
+
model: TrainActionResponse.Model;
|
|
16
|
+
}
|
|
17
|
+
export declare namespace TrainActionResponse {
|
|
18
|
+
interface Model {
|
|
19
|
+
/**
|
|
20
|
+
* The model ID (example: "model_eyVcnFJcR92BxBkz7N6g5w")
|
|
21
|
+
*/
|
|
22
|
+
id: string;
|
|
23
|
+
/**
|
|
24
|
+
* List of model capabilities (example: ["txt2img", "img2img",
|
|
25
|
+
* "txt2img_ip_adapter", ...])
|
|
26
|
+
*/
|
|
27
|
+
capabilities: Array<'3d23d' | 'audio2audio' | 'controlnet' | 'controlnet_img2img' | 'controlnet_inpaint' | 'controlnet_inpaint_ip_adapter' | 'controlnet_ip_adapter' | 'controlnet_reference' | 'controlnet_texture' | 'img23d' | 'img2img' | 'img2img_ip_adapter' | 'img2img_texture' | 'img2txt' | 'img2video' | 'inpaint' | 'inpaint_ip_adapter' | 'outpaint' | 'reference' | 'reference_texture' | 'txt23d' | 'txt2audio' | 'txt2img' | 'txt2img_ip_adapter' | 'txt2img_texture' | 'txt2txt' | 'txt2video' | 'video2img' | 'video2video'>;
|
|
28
|
+
/**
|
|
29
|
+
* A list of CollectionId this model belongs to
|
|
30
|
+
*/
|
|
31
|
+
collectionIds: Array<string>;
|
|
32
|
+
/**
|
|
33
|
+
* The model creation date as an ISO string (example: "2023-02-03T11:19:41.579Z")
|
|
34
|
+
*/
|
|
35
|
+
createdAt: string;
|
|
36
|
+
/**
|
|
37
|
+
* Whether the model is a custom model and can be used only with POST
|
|
38
|
+
* /generate/custom/{modelId} endpoint
|
|
39
|
+
*/
|
|
40
|
+
custom: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* List of all example asset IDs setup by the model owner
|
|
43
|
+
*/
|
|
44
|
+
exampleAssetIds: Array<string>;
|
|
45
|
+
/**
|
|
46
|
+
* The privacy of the model (default: private)
|
|
47
|
+
*/
|
|
48
|
+
privacy: 'private' | 'public' | 'unlisted';
|
|
49
|
+
/**
|
|
50
|
+
* The source of the model
|
|
51
|
+
*/
|
|
52
|
+
source: 'civitai' | 'huggingface' | 'other' | 'scenario';
|
|
53
|
+
/**
|
|
54
|
+
* The model status
|
|
55
|
+
*/
|
|
56
|
+
status: 'copying' | 'failed' | 'new' | 'trained' | 'training' | 'training-canceled';
|
|
57
|
+
/**
|
|
58
|
+
* The associated tags (example: ["sci-fi", "landscape"])
|
|
59
|
+
*/
|
|
60
|
+
tags: Array<string>;
|
|
61
|
+
/**
|
|
62
|
+
* The total number of training images
|
|
63
|
+
*/
|
|
64
|
+
trainingImagesNumber: number;
|
|
65
|
+
/**
|
|
66
|
+
* The model type (example: "flux.1-lora")
|
|
67
|
+
*/
|
|
68
|
+
type: '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';
|
|
69
|
+
/**
|
|
70
|
+
* The model last update date as an ISO string (example:
|
|
71
|
+
* "2023-02-03T11:19:41.579Z")
|
|
72
|
+
*/
|
|
73
|
+
updatedAt: string;
|
|
74
|
+
/**
|
|
75
|
+
* The access restrictions of the model 0: Free plan 25: Creator plan 50: Pro plan
|
|
76
|
+
* 75: Team plan 100: Enterprise plan
|
|
77
|
+
*/
|
|
78
|
+
accessRestrictions?: number;
|
|
79
|
+
/**
|
|
80
|
+
* The author user ID (example: "user_VFhihHKMRZyDDnZAJwLb2Q")
|
|
81
|
+
*/
|
|
82
|
+
authorId?: string;
|
|
83
|
+
/**
|
|
84
|
+
* The class of the model
|
|
85
|
+
*/
|
|
86
|
+
class?: Model.Class;
|
|
87
|
+
/**
|
|
88
|
+
* Compliance and regulatory metadata for the model
|
|
89
|
+
*/
|
|
90
|
+
complianceMetadata?: Model.ComplianceMetadata;
|
|
91
|
+
/**
|
|
92
|
+
* List of base model IDs compliant with the model (example: ["flux.1-dev",
|
|
93
|
+
* "flux.1-schnell"]) This attribute is mainly used for Flux LoRA models
|
|
94
|
+
*/
|
|
95
|
+
compliantModelIds?: Array<string>;
|
|
96
|
+
/**
|
|
97
|
+
* The concepts is required for the type model: composition
|
|
98
|
+
*/
|
|
99
|
+
concepts?: Array<Model.Concept>;
|
|
100
|
+
/**
|
|
101
|
+
* The epoch of the model. Only available for Flux Lora Trained models. If not set,
|
|
102
|
+
* uses the final model epoch (latest)
|
|
103
|
+
*/
|
|
104
|
+
epoch?: string;
|
|
105
|
+
/**
|
|
106
|
+
* The epochs of the model. Only available for Flux Lora Trained models.
|
|
107
|
+
*/
|
|
108
|
+
epochs?: Array<Model.Epoch>;
|
|
109
|
+
/**
|
|
110
|
+
* The inputs of the model. Only used for custom models. To retrieve this list, get
|
|
111
|
+
* it by modelId with GET /models/{modelId}
|
|
112
|
+
*/
|
|
113
|
+
inputs?: Array<Model.Input>;
|
|
114
|
+
/**
|
|
115
|
+
* The model keyword, this is a legacy parameter, please use conceptPrompt in
|
|
116
|
+
* parameters
|
|
117
|
+
*/
|
|
118
|
+
modelKeyword?: string;
|
|
119
|
+
/**
|
|
120
|
+
* The model name (example: "Cinematic Realism")
|
|
121
|
+
*/
|
|
122
|
+
name?: string;
|
|
123
|
+
/**
|
|
124
|
+
* Fine-tune the model's inferences with negative prompt embedding
|
|
125
|
+
*/
|
|
126
|
+
negativePromptEmbedding?: string;
|
|
127
|
+
/**
|
|
128
|
+
* The owner ID (example: "team_VFhihHKMRZyDDnZAJwLb2Q")
|
|
129
|
+
*/
|
|
130
|
+
ownerId?: string;
|
|
131
|
+
/**
|
|
132
|
+
* The parameters of the model
|
|
133
|
+
*/
|
|
134
|
+
parameters?: Model.Parameters;
|
|
135
|
+
/**
|
|
136
|
+
* The id of the parent model
|
|
137
|
+
*/
|
|
138
|
+
parentModelId?: string;
|
|
139
|
+
/**
|
|
140
|
+
* Fine-tune the model's inferences with prompt embedding
|
|
141
|
+
*/
|
|
142
|
+
promptEmbedding?: string;
|
|
143
|
+
/**
|
|
144
|
+
* The model short description (example: "This model generates highly detailed
|
|
145
|
+
* cinematic scenes.")
|
|
146
|
+
*/
|
|
147
|
+
shortDescription?: string;
|
|
148
|
+
/**
|
|
149
|
+
* The date when the model will be soft deleted (only for Free plan)
|
|
150
|
+
*/
|
|
151
|
+
softDeletionOn?: string;
|
|
152
|
+
/**
|
|
153
|
+
* A thumbnail for your model
|
|
154
|
+
*/
|
|
155
|
+
thumbnail?: Model.Thumbnail;
|
|
156
|
+
/**
|
|
157
|
+
* Array of training image pairs
|
|
158
|
+
*/
|
|
159
|
+
trainingImagePairs?: Array<Model.TrainingImagePair>;
|
|
160
|
+
/**
|
|
161
|
+
* The URLs of the first 3 training images of the model. To retrieve the full set
|
|
162
|
+
* of images, get it by modelId
|
|
163
|
+
*/
|
|
164
|
+
trainingImages?: Array<Model.TrainingImage>;
|
|
165
|
+
/**
|
|
166
|
+
* Additional information about the training progress of the model
|
|
167
|
+
*/
|
|
168
|
+
trainingProgress?: Model.TrainingProgress;
|
|
169
|
+
/**
|
|
170
|
+
* Additional information about the model's training
|
|
171
|
+
*/
|
|
172
|
+
trainingStats?: Model.TrainingStats;
|
|
173
|
+
/**
|
|
174
|
+
* The UI configuration for the model
|
|
175
|
+
*/
|
|
176
|
+
uiConfig?: Model.UiConfig;
|
|
177
|
+
/**
|
|
178
|
+
* (Deprecated) The user ID (example: "user_VFhihHKMRZyDDnZAJwLb2Q")
|
|
179
|
+
*/
|
|
180
|
+
userId?: string;
|
|
181
|
+
}
|
|
182
|
+
namespace Model {
|
|
183
|
+
/**
|
|
184
|
+
* The class of the model
|
|
185
|
+
*/
|
|
186
|
+
interface Class {
|
|
187
|
+
/**
|
|
188
|
+
* The category slug of the class (example: "art-style")
|
|
189
|
+
*/
|
|
190
|
+
category: string;
|
|
191
|
+
/**
|
|
192
|
+
* The concept prompt of the class (example: "a sks character design")
|
|
193
|
+
*/
|
|
194
|
+
conceptPrompt: string;
|
|
195
|
+
/**
|
|
196
|
+
* The model ID of the class (example: "stable-diffusion-v1-5")
|
|
197
|
+
*/
|
|
198
|
+
modelId: string;
|
|
199
|
+
/**
|
|
200
|
+
* The class name (example: "Character Design")
|
|
201
|
+
*/
|
|
202
|
+
name: string;
|
|
203
|
+
/**
|
|
204
|
+
* The class prompt (example: "a character design")
|
|
205
|
+
*/
|
|
206
|
+
prompt: string;
|
|
207
|
+
/**
|
|
208
|
+
* The class slug (example: "art-style-character-design")
|
|
209
|
+
*/
|
|
210
|
+
slug: string;
|
|
211
|
+
/**
|
|
212
|
+
* The class status (only published classes are listed, but unpublished classes can
|
|
213
|
+
* still appear in existing models)
|
|
214
|
+
*/
|
|
215
|
+
status: 'published' | 'unpublished';
|
|
216
|
+
/**
|
|
217
|
+
* Some example images URLs to showcase the class
|
|
218
|
+
*/
|
|
219
|
+
thumbnails: Array<string>;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Compliance and regulatory metadata for the model
|
|
223
|
+
*/
|
|
224
|
+
interface ComplianceMetadata {
|
|
225
|
+
/**
|
|
226
|
+
* Data processing comment (e.g., zeroRetention, temporaryRetention, etc.)
|
|
227
|
+
*/
|
|
228
|
+
dataProcessingComment?: 'researchOnly' | 'serviceImprovement' | 'temporaryRetention' | 'zeroRetention';
|
|
229
|
+
/**
|
|
230
|
+
* URL to license terms
|
|
231
|
+
*/
|
|
232
|
+
licenseTerms?: string;
|
|
233
|
+
/**
|
|
234
|
+
* The maintainer of the model
|
|
235
|
+
*/
|
|
236
|
+
maintainer?: 'Fal' | 'Provider' | 'Replicate' | 'Scenario';
|
|
237
|
+
/**
|
|
238
|
+
* The provider of the model (examples: 'Google', 'AWS', 'BFL', 'Meshy', etc.)
|
|
239
|
+
*/
|
|
240
|
+
modelProvider?: string;
|
|
241
|
+
/**
|
|
242
|
+
* The sub-processor used for the model
|
|
243
|
+
*/
|
|
244
|
+
subProcessor?: 'AWS' | 'Fal' | 'Modal' | 'Provider' | 'Replicate';
|
|
245
|
+
}
|
|
246
|
+
interface Concept {
|
|
247
|
+
/**
|
|
248
|
+
* The model ID (example: "model_eyVcnFJcR92BxBkz7N6g5w")
|
|
249
|
+
*/
|
|
250
|
+
modelId: string;
|
|
251
|
+
/**
|
|
252
|
+
* The scale of the model (example: 1.0) For Flux Kontext Prompt Editing, the scale
|
|
253
|
+
* is between 0 and 2.
|
|
254
|
+
*/
|
|
255
|
+
scale: number;
|
|
256
|
+
/**
|
|
257
|
+
* The epoch of the model (example: "000001") Only available for Flux Lora Trained
|
|
258
|
+
* models
|
|
259
|
+
*/
|
|
260
|
+
modelEpoch?: string;
|
|
261
|
+
}
|
|
262
|
+
interface Epoch {
|
|
263
|
+
/**
|
|
264
|
+
* The epoch hash to identify the epoch
|
|
265
|
+
*/
|
|
266
|
+
epoch: string;
|
|
267
|
+
/**
|
|
268
|
+
* The assets of the epoch if sample prompts as been supplied during training
|
|
269
|
+
*/
|
|
270
|
+
assets?: Array<Epoch.Asset>;
|
|
271
|
+
}
|
|
272
|
+
namespace Epoch {
|
|
273
|
+
interface Asset {
|
|
274
|
+
/**
|
|
275
|
+
* The AssetId of the image during training (example:
|
|
276
|
+
* "asset_GTrL3mq4SXWyMxkOHRxlpw")
|
|
277
|
+
*/
|
|
278
|
+
assetId: string;
|
|
279
|
+
/**
|
|
280
|
+
* The url of the asset
|
|
281
|
+
*/
|
|
282
|
+
url: string;
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Defines the input parameters for a model. Use this to understand the available
|
|
287
|
+
* input parameters for a given `modelId` when calling
|
|
288
|
+
* `POST /generate/custom/{modelId}`. See {@link
|
|
289
|
+
* https://docs.scenario.com/docs/video-generation} for examples.
|
|
290
|
+
*/
|
|
291
|
+
interface Input {
|
|
292
|
+
/**
|
|
293
|
+
* The name that must be user to call the model through the API
|
|
294
|
+
*/
|
|
295
|
+
name: string;
|
|
296
|
+
/**
|
|
297
|
+
* The data type of the input
|
|
298
|
+
*/
|
|
299
|
+
type: 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array';
|
|
300
|
+
/**
|
|
301
|
+
* The allowed values for the input. For \`string\` or \`number\` types, creates a
|
|
302
|
+
* single-select dropdown. For \`string_array\` type, creates a multi-select
|
|
303
|
+
* dropdown.
|
|
304
|
+
*/
|
|
305
|
+
allowedValues?: Array<unknown>;
|
|
306
|
+
/**
|
|
307
|
+
* Specifies the background behavior for the input. Only available for \`file\` and
|
|
308
|
+
* \`file_array\` input types with kind \`image\`.
|
|
309
|
+
*/
|
|
310
|
+
backgroundBehavior?: 'opaque' | 'transparent';
|
|
311
|
+
/**
|
|
312
|
+
* Whether the input is a color or not. Only available for \`string\` input type.
|
|
313
|
+
*/
|
|
314
|
+
color?: boolean;
|
|
315
|
+
/**
|
|
316
|
+
* Whether this input affects the model's cost calculation
|
|
317
|
+
*/
|
|
318
|
+
costImpact?: boolean;
|
|
319
|
+
/**
|
|
320
|
+
* Help text displayed in the UI to provide additional information about the input
|
|
321
|
+
*/
|
|
322
|
+
description?: string;
|
|
323
|
+
/**
|
|
324
|
+
* Used to visually group inputs together in the UI. Inputs with the same group
|
|
325
|
+
* value appear consecutively in the UI.
|
|
326
|
+
*/
|
|
327
|
+
group?: string;
|
|
328
|
+
/**
|
|
329
|
+
* Hint text displayed in the UI as a tooltip to guide the user
|
|
330
|
+
*/
|
|
331
|
+
hint?: string;
|
|
332
|
+
/**
|
|
333
|
+
* The list of inputs which form an object within a container array. All inputs are
|
|
334
|
+
* the same as the current object. This is only available for type inputs_array
|
|
335
|
+
* inputs.
|
|
336
|
+
*/
|
|
337
|
+
inputs?: Array<unknown>;
|
|
338
|
+
/**
|
|
339
|
+
* The asset kind of the input. Only taken into account for \`file\` and
|
|
340
|
+
* \`file_array\` input types.
|
|
341
|
+
*/
|
|
342
|
+
kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'video';
|
|
343
|
+
/**
|
|
344
|
+
* The label displayed in the UI for this input
|
|
345
|
+
*/
|
|
346
|
+
label?: string;
|
|
347
|
+
/**
|
|
348
|
+
* The name of the file input field to use as the mask source
|
|
349
|
+
*/
|
|
350
|
+
maskFrom?: string;
|
|
351
|
+
/**
|
|
352
|
+
* The maximum allowed value. Only available for \`number\` and \`array\` input
|
|
353
|
+
* types.
|
|
354
|
+
*/
|
|
355
|
+
max?: number;
|
|
356
|
+
/**
|
|
357
|
+
* The maximum allowed length for \`string\` inputs. Also applies to each item in
|
|
358
|
+
* \`string_array\`.
|
|
359
|
+
*/
|
|
360
|
+
maxLength?: number;
|
|
361
|
+
/**
|
|
362
|
+
* The minimum allowed value. Only available for \`number\` and array input types.
|
|
363
|
+
*/
|
|
364
|
+
min?: number;
|
|
365
|
+
/**
|
|
366
|
+
* The minimum allowed length for string inputs. Also applies to each item in
|
|
367
|
+
* \`string_array\`.
|
|
368
|
+
*/
|
|
369
|
+
minLength?: number;
|
|
370
|
+
/**
|
|
371
|
+
* The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only
|
|
372
|
+
* available for \`model_array\` input type.
|
|
373
|
+
*/
|
|
374
|
+
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'>;
|
|
375
|
+
/**
|
|
376
|
+
* Whether this input represents a parent asset to assign to the produced assets.
|
|
377
|
+
* Only available for \`file\` and \`file_array\` input types.
|
|
378
|
+
*
|
|
379
|
+
* For \`file_array\`, the parent asset is the first item in the array.
|
|
380
|
+
*/
|
|
381
|
+
parent?: boolean;
|
|
382
|
+
/**
|
|
383
|
+
* Placeholder text for the input. Only available for 'string' input type.
|
|
384
|
+
*/
|
|
385
|
+
placeholder?: string;
|
|
386
|
+
/**
|
|
387
|
+
* Whether the input is a prompt. When true, displays as a text area with prompt
|
|
388
|
+
* spark feature. Only available for \`string\` input type.
|
|
389
|
+
*/
|
|
390
|
+
prompt?: boolean;
|
|
391
|
+
/**
|
|
392
|
+
* Whether the input is used with prompt spark. Only available for \`string\` input
|
|
393
|
+
* type.
|
|
394
|
+
*/
|
|
395
|
+
promptSpark?: boolean;
|
|
396
|
+
/**
|
|
397
|
+
* Set of rules that describes when this input is required:
|
|
398
|
+
*
|
|
399
|
+
* - \`always\`: Input is always required
|
|
400
|
+
* - \`ifNotDefined\`: Input is required when another specified input is not
|
|
401
|
+
* defined
|
|
402
|
+
* - \`ifDefined\`: Input is required when another specified input is defined
|
|
403
|
+
* - \`conditionalValues\`: Input is required when another input has a specific
|
|
404
|
+
* value
|
|
405
|
+
*
|
|
406
|
+
* By default, the input is not required.
|
|
407
|
+
*/
|
|
408
|
+
required?: Input.Required;
|
|
409
|
+
/**
|
|
410
|
+
* The step increment for numeric inputs. Only available for \`number\` input type.
|
|
411
|
+
*/
|
|
412
|
+
step?: number;
|
|
413
|
+
}
|
|
414
|
+
namespace Input {
|
|
415
|
+
/**
|
|
416
|
+
* Set of rules that describes when this input is required:
|
|
417
|
+
*
|
|
418
|
+
* - \`always\`: Input is always required
|
|
419
|
+
* - \`ifNotDefined\`: Input is required when another specified input is not
|
|
420
|
+
* defined
|
|
421
|
+
* - \`ifDefined\`: Input is required when another specified input is defined
|
|
422
|
+
* - \`conditionalValues\`: Input is required when another input has a specific
|
|
423
|
+
* value
|
|
424
|
+
*
|
|
425
|
+
* By default, the input is not required.
|
|
426
|
+
*/
|
|
427
|
+
interface Required {
|
|
428
|
+
/**
|
|
429
|
+
* Whether the input is always required
|
|
430
|
+
*/
|
|
431
|
+
always?: boolean;
|
|
432
|
+
/**
|
|
433
|
+
* Makes this input required when another input has a specific value:
|
|
434
|
+
*
|
|
435
|
+
* - Key: name of the input to check
|
|
436
|
+
* - Value: operation and allowed values that trigger the requirement
|
|
437
|
+
*/
|
|
438
|
+
conditionalValues?: unknown;
|
|
439
|
+
/**
|
|
440
|
+
* Makes this input required when another input is defined:
|
|
441
|
+
*
|
|
442
|
+
* - Key: name of the input that must be defined
|
|
443
|
+
* - Value: message to display when this input is required
|
|
444
|
+
*/
|
|
445
|
+
ifDefined?: unknown;
|
|
446
|
+
/**
|
|
447
|
+
* Makes this input required when another input is not defined:
|
|
448
|
+
*
|
|
449
|
+
* - Key: name of the input that must be undefined
|
|
450
|
+
* - Value: message to display when this input is required
|
|
451
|
+
*/
|
|
452
|
+
ifNotDefined?: unknown;
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
/**
|
|
456
|
+
* The parameters of the model
|
|
457
|
+
*/
|
|
458
|
+
interface Parameters {
|
|
459
|
+
/**
|
|
460
|
+
* The batch size Less steps, and will increase the learning rate
|
|
461
|
+
*
|
|
462
|
+
* Only available for Flux LoRA training
|
|
463
|
+
*/
|
|
464
|
+
batchSize?: number;
|
|
465
|
+
/**
|
|
466
|
+
* The prompt to specify images in the same class as provided instance images
|
|
467
|
+
*
|
|
468
|
+
* Only available for SD15 training
|
|
469
|
+
*/
|
|
470
|
+
classPrompt?: string;
|
|
471
|
+
/**
|
|
472
|
+
* The prompt with identifier specifying the instance (or subject) of the class
|
|
473
|
+
* (example: "a daiton dog")
|
|
474
|
+
*
|
|
475
|
+
* Default value varies depending on the model type:
|
|
476
|
+
*
|
|
477
|
+
* - For SD1.5: "daiton" if no class is associated with the model
|
|
478
|
+
* - For SDXL: "daiton"
|
|
479
|
+
* - For Flux: ""
|
|
480
|
+
*/
|
|
481
|
+
conceptPrompt?: string;
|
|
482
|
+
/**
|
|
483
|
+
* Initial learning rate (after the potential warmup period)
|
|
484
|
+
*
|
|
485
|
+
* Default value varies depending on the model type:
|
|
486
|
+
*
|
|
487
|
+
* - For SD1.5 and SDXL: 0.000005
|
|
488
|
+
* - For Flux: 0.0001
|
|
489
|
+
*/
|
|
490
|
+
learningRate?: number;
|
|
491
|
+
/**
|
|
492
|
+
* Initial learning rate (after the potential warmup period) for the text encoder
|
|
493
|
+
*
|
|
494
|
+
* Maximum [Flux LoRA: 0.001] Default [SDXL: 0.00005 | Flux LoRA: 0.00001] Minimum
|
|
495
|
+
* [SDXL: 0 | Flux LoRA: 0.000001]
|
|
496
|
+
*/
|
|
497
|
+
learningRateTextEncoder?: number;
|
|
498
|
+
/**
|
|
499
|
+
* Initial learning rate (after the potential warmup period) for the UNet
|
|
500
|
+
*
|
|
501
|
+
* Only available for SDXL LoRA training
|
|
502
|
+
*/
|
|
503
|
+
learningRateUnet?: number;
|
|
504
|
+
/**
|
|
505
|
+
* The scheduler type to use (default: "constant")
|
|
506
|
+
*
|
|
507
|
+
* Only available for SD15 and SDXL LoRA training
|
|
508
|
+
*/
|
|
509
|
+
lrScheduler?: 'constant' | 'constant-with-warmup' | 'cosine' | 'cosine-with-restarts' | 'linear' | 'polynomial';
|
|
510
|
+
/**
|
|
511
|
+
* Maximum number of training steps to execute (default: varies depending on the
|
|
512
|
+
* model type)
|
|
513
|
+
*
|
|
514
|
+
* For SDXL LoRA training, please use `numTextTrainSteps` and `numUNetTrainSteps`
|
|
515
|
+
* instead
|
|
516
|
+
*
|
|
517
|
+
* Default value varies depending on the model type:
|
|
518
|
+
*
|
|
519
|
+
* - For SD1.5: round((number of training images \* 225) / 3)
|
|
520
|
+
* - For SDXL: number of training images \* 175
|
|
521
|
+
* - For Flux: number of training images \* 100
|
|
522
|
+
*
|
|
523
|
+
* Maximum value varies depending on the model type:
|
|
524
|
+
*
|
|
525
|
+
* - For SD1.5 and SDXL: [0, 40000]
|
|
526
|
+
* - For Flux: [0, 10000]
|
|
527
|
+
*/
|
|
528
|
+
maxTrainSteps?: number;
|
|
529
|
+
/**
|
|
530
|
+
* The number of epochs to train for
|
|
531
|
+
*
|
|
532
|
+
* Only available for Flux LoRA training
|
|
533
|
+
*/
|
|
534
|
+
nbEpochs?: number;
|
|
535
|
+
/**
|
|
536
|
+
* The number of times to repeat the training
|
|
537
|
+
*
|
|
538
|
+
* Only available for Flux LoRA training
|
|
539
|
+
*/
|
|
540
|
+
nbRepeats?: number;
|
|
541
|
+
/**
|
|
542
|
+
* The number of training steps for the text encoder
|
|
543
|
+
*
|
|
544
|
+
* Only available for SDXL LoRA training
|
|
545
|
+
*/
|
|
546
|
+
numTextTrainSteps?: number;
|
|
547
|
+
/**
|
|
548
|
+
* The number of training steps for the UNet
|
|
549
|
+
*
|
|
550
|
+
* Only available for SDXL LoRA training
|
|
551
|
+
*/
|
|
552
|
+
numUNetTrainSteps?: number;
|
|
553
|
+
/**
|
|
554
|
+
* Optimize the model training task for a specific type of input images. The
|
|
555
|
+
* available values are:
|
|
556
|
+
*
|
|
557
|
+
* - "likeness": optimize training for likeness or portrait (targets specific
|
|
558
|
+
* transformer blocks)
|
|
559
|
+
* - "all": train all transformer blocks
|
|
560
|
+
* - "none": train no specific transformer blocks
|
|
561
|
+
*
|
|
562
|
+
* This parameter controls which double and single transformer blocks are trained
|
|
563
|
+
* during the LoRA training process.
|
|
564
|
+
*
|
|
565
|
+
* Only available for Flux LoRA training
|
|
566
|
+
*/
|
|
567
|
+
optimizeFor?: 'likeness';
|
|
568
|
+
/**
|
|
569
|
+
* The weight of prior preservation loss
|
|
570
|
+
*
|
|
571
|
+
* Only available for SD15 and SDXL LoRA training
|
|
572
|
+
*/
|
|
573
|
+
priorLossWeight?: number;
|
|
574
|
+
/**
|
|
575
|
+
* Whether to random crop or center crop images before resizing to the working
|
|
576
|
+
* resolution
|
|
577
|
+
*
|
|
578
|
+
* Only available for SD15 and SDXL LoRA training
|
|
579
|
+
*/
|
|
580
|
+
randomCrop?: boolean;
|
|
581
|
+
/**
|
|
582
|
+
* Ratio of random crops
|
|
583
|
+
*
|
|
584
|
+
* Only available for SD15 and SDXL LoRA training
|
|
585
|
+
*/
|
|
586
|
+
randomCropRatio?: number;
|
|
587
|
+
/**
|
|
588
|
+
* Scale of random crops
|
|
589
|
+
*
|
|
590
|
+
* Only available for SD15 and SDXL LoRA training
|
|
591
|
+
*/
|
|
592
|
+
randomCropScale?: number;
|
|
593
|
+
/**
|
|
594
|
+
* The dimension of the LoRA update matrices
|
|
595
|
+
*
|
|
596
|
+
* Only available for SDXL and Flux LoRA training
|
|
597
|
+
*
|
|
598
|
+
* Default value varies depending on the model type:
|
|
599
|
+
*
|
|
600
|
+
* - For SDXL: 64
|
|
601
|
+
* - For Flux: 16
|
|
602
|
+
*/
|
|
603
|
+
rank?: number;
|
|
604
|
+
/**
|
|
605
|
+
* The prompts to use for each epoch Only available for Flux LoRA training
|
|
606
|
+
*/
|
|
607
|
+
samplePrompts?: Array<string>;
|
|
608
|
+
/**
|
|
609
|
+
* The sample prompt images (AssetIds) paired with samplePrompts Only available for
|
|
610
|
+
* Flux LoRA training Must be the same length as samplePrompts
|
|
611
|
+
*/
|
|
612
|
+
sampleSourceImages?: Array<string>;
|
|
613
|
+
/**
|
|
614
|
+
* Whether to scale the learning rate
|
|
615
|
+
*
|
|
616
|
+
* Note: Legacy parameter, will be ignored
|
|
617
|
+
*
|
|
618
|
+
* Only available for SD15 and SDXL LoRA training
|
|
619
|
+
*/
|
|
620
|
+
scaleLr?: boolean;
|
|
621
|
+
/**
|
|
622
|
+
* Used to reproduce previous results. Default: randomly generated number.
|
|
623
|
+
*
|
|
624
|
+
* Only available for SD15 and SDXL LoRA training
|
|
625
|
+
*/
|
|
626
|
+
seed?: number;
|
|
627
|
+
/**
|
|
628
|
+
* Whether to train the text encoder or not
|
|
629
|
+
*
|
|
630
|
+
* Example: For 100 steps and a value of 0.2, it means that the text encoder will
|
|
631
|
+
* be trained for 20 steps and then the UNet for 80 steps
|
|
632
|
+
*
|
|
633
|
+
* Note: Legacy parameter, please use `numTextTrainSteps` and `numUNetTrainSteps`
|
|
634
|
+
*
|
|
635
|
+
* Only available for SD15 and SDXL LoRA training
|
|
636
|
+
*/
|
|
637
|
+
textEncoderTrainingRatio?: number;
|
|
638
|
+
/**
|
|
639
|
+
* Validation frequency. Cannot be greater than maxTrainSteps value
|
|
640
|
+
*
|
|
641
|
+
* Only available for SD15 and SDXL LoRA training
|
|
642
|
+
*/
|
|
643
|
+
validationFrequency?: number;
|
|
644
|
+
/**
|
|
645
|
+
* Validation prompt
|
|
646
|
+
*
|
|
647
|
+
* Only available for SD15 and SDXL LoRA training
|
|
648
|
+
*/
|
|
649
|
+
validationPrompt?: string;
|
|
650
|
+
/**
|
|
651
|
+
* The Weights And Bias key to use for logging. The maximum length is 40 characters
|
|
652
|
+
*/
|
|
653
|
+
wandbKey?: string;
|
|
654
|
+
}
|
|
655
|
+
/**
|
|
656
|
+
* A thumbnail for your model
|
|
657
|
+
*/
|
|
658
|
+
interface Thumbnail {
|
|
659
|
+
/**
|
|
660
|
+
* The AssetId of the image used as a thumbnail for your model (example:
|
|
661
|
+
* "asset_GTrL3mq4SXWyMxkOHRxlpw")
|
|
662
|
+
*/
|
|
663
|
+
assetId: string;
|
|
664
|
+
/**
|
|
665
|
+
* The url of the image used as a thumbnail for your model
|
|
666
|
+
*/
|
|
667
|
+
url: string;
|
|
668
|
+
}
|
|
669
|
+
interface TrainingImagePair {
|
|
670
|
+
/**
|
|
671
|
+
* The instruction for the image pair, source to target
|
|
672
|
+
*/
|
|
673
|
+
instruction?: string;
|
|
674
|
+
/**
|
|
675
|
+
* The source asset ID (must be a training asset)
|
|
676
|
+
*/
|
|
677
|
+
sourceId?: string;
|
|
678
|
+
/**
|
|
679
|
+
* The target asset ID (must be a training asset)
|
|
680
|
+
*/
|
|
681
|
+
targetId?: string;
|
|
682
|
+
}
|
|
683
|
+
interface TrainingImage {
|
|
684
|
+
/**
|
|
685
|
+
* The training image ID (example: "asset_GTrL3mq4SXWyMxkOHRxlpw")
|
|
686
|
+
*/
|
|
687
|
+
id: string;
|
|
688
|
+
/**
|
|
689
|
+
* Automatic captioning of the image
|
|
690
|
+
*/
|
|
691
|
+
automaticCaptioning: string;
|
|
692
|
+
/**
|
|
693
|
+
* The training image upload date as an ISO string (example:
|
|
694
|
+
* "2023-02-03T11:19:41.579Z")
|
|
695
|
+
*/
|
|
696
|
+
createdAt: string;
|
|
697
|
+
/**
|
|
698
|
+
* Description for the image
|
|
699
|
+
*/
|
|
700
|
+
description: string;
|
|
701
|
+
/**
|
|
702
|
+
* The URL of the image
|
|
703
|
+
*/
|
|
704
|
+
downloadUrl: string;
|
|
705
|
+
/**
|
|
706
|
+
* The original file name of the image (example: "my-training-image.jpg")
|
|
707
|
+
*/
|
|
708
|
+
name: string;
|
|
709
|
+
}
|
|
710
|
+
/**
|
|
711
|
+
* Additional information about the training progress of the model
|
|
712
|
+
*/
|
|
713
|
+
interface TrainingProgress {
|
|
714
|
+
/**
|
|
715
|
+
* The stage of the request
|
|
716
|
+
*/
|
|
717
|
+
stage: 'pending' | 'queued-for-train' | 'running-train' | 'starting-train';
|
|
718
|
+
/**
|
|
719
|
+
* Timestamp in milliseconds of the last time the training progress was updated
|
|
720
|
+
*/
|
|
721
|
+
updatedAt: number;
|
|
722
|
+
/**
|
|
723
|
+
* Position of the job in the queue (ie. the number of job in the queue before this
|
|
724
|
+
* one)
|
|
725
|
+
*/
|
|
726
|
+
position?: number;
|
|
727
|
+
/**
|
|
728
|
+
* The progress of the job
|
|
729
|
+
*/
|
|
730
|
+
progress?: number;
|
|
731
|
+
/**
|
|
732
|
+
* The remaining time in milliseconds
|
|
733
|
+
*/
|
|
734
|
+
remainingTimeMs?: number;
|
|
735
|
+
/**
|
|
736
|
+
* The timestamp in millisecond marking the start of the process
|
|
737
|
+
*/
|
|
738
|
+
startedAt?: number;
|
|
739
|
+
}
|
|
740
|
+
/**
|
|
741
|
+
* Additional information about the model's training
|
|
742
|
+
*/
|
|
743
|
+
interface TrainingStats {
|
|
744
|
+
/**
|
|
745
|
+
* The training end time as an ISO date string
|
|
746
|
+
*/
|
|
747
|
+
endedAt?: string;
|
|
748
|
+
/**
|
|
749
|
+
* The training queued duration in seconds
|
|
750
|
+
*/
|
|
751
|
+
queueDuration?: number;
|
|
752
|
+
/**
|
|
753
|
+
* The training start time as an ISO date string
|
|
754
|
+
*/
|
|
755
|
+
startedAt?: string;
|
|
756
|
+
/**
|
|
757
|
+
* The training duration in seconds
|
|
758
|
+
*/
|
|
759
|
+
trainDuration?: number;
|
|
760
|
+
}
|
|
761
|
+
/**
|
|
762
|
+
* The UI configuration for the model
|
|
763
|
+
*/
|
|
764
|
+
interface UiConfig {
|
|
765
|
+
/**
|
|
766
|
+
* Configuration for the input properties
|
|
767
|
+
*/
|
|
768
|
+
inputProperties?: {
|
|
769
|
+
[key: string]: UiConfig.InputProperties;
|
|
770
|
+
};
|
|
771
|
+
/**
|
|
772
|
+
* Configuration for the loras component
|
|
773
|
+
*/
|
|
774
|
+
lorasComponent?: UiConfig.LorasComponent;
|
|
775
|
+
/**
|
|
776
|
+
* Configuration for the presets
|
|
777
|
+
*/
|
|
778
|
+
presets?: Array<UiConfig.Preset>;
|
|
779
|
+
/**
|
|
780
|
+
* Configuration for the resolution component
|
|
781
|
+
*/
|
|
782
|
+
resolutionComponent?: UiConfig.ResolutionComponent;
|
|
783
|
+
/**
|
|
784
|
+
* Configuration for the selects
|
|
785
|
+
*/
|
|
786
|
+
selects?: {
|
|
787
|
+
[key: string]: unknown;
|
|
788
|
+
};
|
|
789
|
+
/**
|
|
790
|
+
* Configuration for the trigger generate button
|
|
791
|
+
*/
|
|
792
|
+
triggerGenerate?: UiConfig.TriggerGenerate;
|
|
793
|
+
}
|
|
794
|
+
namespace UiConfig {
|
|
795
|
+
interface InputProperties {
|
|
796
|
+
collapsed?: boolean;
|
|
797
|
+
}
|
|
798
|
+
/**
|
|
799
|
+
* Configuration for the loras component
|
|
800
|
+
*/
|
|
801
|
+
interface LorasComponent {
|
|
802
|
+
/**
|
|
803
|
+
* The label of the component
|
|
804
|
+
*/
|
|
805
|
+
label: string;
|
|
806
|
+
/**
|
|
807
|
+
* The input name of the model (model_array)
|
|
808
|
+
*/
|
|
809
|
+
modelInput: string;
|
|
810
|
+
/**
|
|
811
|
+
* The input name of the scale (number_array)
|
|
812
|
+
*/
|
|
813
|
+
scaleInput: string;
|
|
814
|
+
/**
|
|
815
|
+
* The input model id (example: a composition or a single LoRA modelId) If
|
|
816
|
+
* specified, the model id will be attached to the output asset as a metadata If
|
|
817
|
+
* the model-decomposer parser is specified on it, modelInput and scaleInput will
|
|
818
|
+
* be automatically populated
|
|
819
|
+
*/
|
|
820
|
+
modelIdInput?: string;
|
|
821
|
+
}
|
|
822
|
+
interface Preset {
|
|
823
|
+
fields: Array<string>;
|
|
824
|
+
presets: unknown;
|
|
825
|
+
}
|
|
826
|
+
/**
|
|
827
|
+
* Configuration for the resolution component
|
|
828
|
+
*/
|
|
829
|
+
interface ResolutionComponent {
|
|
830
|
+
/**
|
|
831
|
+
* The input name of the height
|
|
832
|
+
*/
|
|
833
|
+
heightInput: string;
|
|
834
|
+
/**
|
|
835
|
+
* The label of the component
|
|
836
|
+
*/
|
|
837
|
+
label: string;
|
|
838
|
+
/**
|
|
839
|
+
* The resolution presets
|
|
840
|
+
*/
|
|
841
|
+
presets: Array<ResolutionComponent.Preset>;
|
|
842
|
+
/**
|
|
843
|
+
* The input name of the width
|
|
844
|
+
*/
|
|
845
|
+
widthInput: string;
|
|
846
|
+
}
|
|
847
|
+
namespace ResolutionComponent {
|
|
848
|
+
interface Preset {
|
|
849
|
+
height: number;
|
|
850
|
+
label: string;
|
|
851
|
+
width: number;
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
/**
|
|
855
|
+
* Configuration for the trigger generate button
|
|
856
|
+
*/
|
|
857
|
+
interface TriggerGenerate {
|
|
858
|
+
label: string;
|
|
859
|
+
/**
|
|
860
|
+
* The 'name' of the input where the trigger generate button will be displayed
|
|
861
|
+
* (after the input). Do not specify both position and after.
|
|
862
|
+
*/
|
|
863
|
+
after?: string;
|
|
864
|
+
/**
|
|
865
|
+
* The position of the trigger generate button. If position specified, the button
|
|
866
|
+
* will be displayed at the specified position. Do not specify both position and
|
|
867
|
+
* after.
|
|
868
|
+
*/
|
|
869
|
+
position?: 'bottom' | 'top';
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
}
|
|
874
|
+
export interface TrainTriggerResponse {
|
|
875
|
+
job: TrainTriggerResponse.Job;
|
|
876
|
+
model: TrainTriggerResponse.Model;
|
|
877
|
+
/**
|
|
878
|
+
* The Creative Units cost for the request billed
|
|
879
|
+
*/
|
|
880
|
+
creativeUnitsCost?: number;
|
|
881
|
+
/**
|
|
882
|
+
* The Creative Units discount for the request billed
|
|
883
|
+
*/
|
|
884
|
+
creativeUnitsDiscount?: number;
|
|
885
|
+
}
|
|
886
|
+
export declare namespace TrainTriggerResponse {
|
|
887
|
+
interface Job {
|
|
888
|
+
/**
|
|
889
|
+
* The job creation date as an ISO string (example: "2023-02-03T11:19:41.579Z")
|
|
890
|
+
*/
|
|
891
|
+
createdAt: string;
|
|
892
|
+
/**
|
|
893
|
+
* The job ID (example: "job_ocZCnG1Df35XRL1QyCZSRxAG8")
|
|
894
|
+
*/
|
|
895
|
+
jobId: string;
|
|
896
|
+
/**
|
|
897
|
+
* The type of job
|
|
898
|
+
*/
|
|
899
|
+
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';
|
|
900
|
+
/**
|
|
901
|
+
* Metadata of the job with some additional information
|
|
902
|
+
*/
|
|
903
|
+
metadata: Job.Metadata;
|
|
904
|
+
/**
|
|
905
|
+
* Progress of the job (between 0 and 1)
|
|
906
|
+
*/
|
|
907
|
+
progress: number;
|
|
908
|
+
/**
|
|
909
|
+
* The current status of the job
|
|
910
|
+
*/
|
|
911
|
+
status: 'canceled' | 'failure' | 'finalizing' | 'in-progress' | 'pending' | 'queued' | 'success' | 'warming-up';
|
|
912
|
+
/**
|
|
913
|
+
* The history of the different statuses the job went through with the ISO string
|
|
914
|
+
* date of when the job reached each statuses.
|
|
915
|
+
*/
|
|
916
|
+
statusHistory: Array<Job.StatusHistory>;
|
|
917
|
+
/**
|
|
918
|
+
* The job last update date as an ISO string (example: "2023-02-03T11:19:41.579Z")
|
|
919
|
+
*/
|
|
920
|
+
updatedAt: string;
|
|
921
|
+
/**
|
|
922
|
+
* The author user ID (example: "dcf121faaa1a0a0bbbd9ca1b73d62aea")
|
|
923
|
+
*/
|
|
924
|
+
authorId?: string;
|
|
925
|
+
/**
|
|
926
|
+
* The billing of the job
|
|
927
|
+
*/
|
|
928
|
+
billing?: Job.Billing;
|
|
929
|
+
/**
|
|
930
|
+
* The owner ID (example: "team_U3Qmc8PCdWXwAQJ4Dvw4tV6D")
|
|
931
|
+
*/
|
|
932
|
+
ownerId?: string;
|
|
933
|
+
}
|
|
934
|
+
namespace Job {
|
|
935
|
+
/**
|
|
936
|
+
* Metadata of the job with some additional information
|
|
937
|
+
*/
|
|
938
|
+
interface Metadata {
|
|
939
|
+
/**
|
|
940
|
+
* List of produced assets for this job
|
|
941
|
+
*/
|
|
942
|
+
assetIds?: Array<string>;
|
|
943
|
+
/**
|
|
944
|
+
* The flow of the job. Only available for workflow jobs.
|
|
945
|
+
*/
|
|
946
|
+
flow?: Array<Metadata.Flow>;
|
|
947
|
+
/**
|
|
948
|
+
* The inputs for the job
|
|
949
|
+
*/
|
|
950
|
+
input?: unknown;
|
|
951
|
+
/**
|
|
952
|
+
* The output of the job
|
|
953
|
+
*/
|
|
954
|
+
output?: unknown;
|
|
955
|
+
/**
|
|
956
|
+
* The workflow ID of the job if job is part of a workflow.
|
|
957
|
+
*/
|
|
958
|
+
workflowId?: string;
|
|
959
|
+
/**
|
|
960
|
+
* The workflow job ID of the job if job is part of a workflow job.
|
|
961
|
+
*/
|
|
962
|
+
workflowJobId?: string;
|
|
963
|
+
}
|
|
964
|
+
namespace Metadata {
|
|
965
|
+
interface Flow {
|
|
966
|
+
/**
|
|
967
|
+
* The id of the node.
|
|
968
|
+
*/
|
|
969
|
+
id: string;
|
|
970
|
+
/**
|
|
971
|
+
* The status of the node. Only available for WorkflowJob nodes.
|
|
972
|
+
*/
|
|
973
|
+
status: 'failure' | 'pending' | 'processing' | 'skipped' | 'success';
|
|
974
|
+
/**
|
|
975
|
+
* The type of the job for the node.
|
|
976
|
+
*/
|
|
977
|
+
type: 'custom-model' | 'generate-prompt' | 'logic' | 'remove-background' | 'transform' | 'user-approval' | 'workflow';
|
|
978
|
+
/**
|
|
979
|
+
* List of produced assets for this node.
|
|
980
|
+
*/
|
|
981
|
+
assets?: Array<Flow.Asset>;
|
|
982
|
+
/**
|
|
983
|
+
* The nodes that this node depends on. Only available for nodes that have
|
|
984
|
+
* dependencies. Mainly used for user approval nodes.
|
|
985
|
+
*/
|
|
986
|
+
dependsOn?: Array<string>;
|
|
987
|
+
/**
|
|
988
|
+
* The inputs of the node.
|
|
989
|
+
*/
|
|
990
|
+
inputs?: Array<Flow.Input>;
|
|
991
|
+
/**
|
|
992
|
+
* If the flow is part of a WorkflowJob, this is the jobId for the node. jobId is
|
|
993
|
+
* only available for nodes started. A node "Pending" for a running workflow job is
|
|
994
|
+
* not started.
|
|
995
|
+
*/
|
|
996
|
+
jobId?: string;
|
|
997
|
+
/**
|
|
998
|
+
* The logic of the node. Only available for logic nodes.
|
|
999
|
+
*/
|
|
1000
|
+
logic?: Flow.Logic;
|
|
1001
|
+
/**
|
|
1002
|
+
* The type of the logic for the node. Only available for logic nodes.
|
|
1003
|
+
*/
|
|
1004
|
+
logicType?: 'if-else';
|
|
1005
|
+
/**
|
|
1006
|
+
* The model id for the node. Mainly used for custom model tasks.
|
|
1007
|
+
*/
|
|
1008
|
+
modelId?: string;
|
|
1009
|
+
/**
|
|
1010
|
+
* The workflow id for the node. Mainly used for workflow tasks.
|
|
1011
|
+
*/
|
|
1012
|
+
workflowId?: string;
|
|
1013
|
+
}
|
|
1014
|
+
namespace Flow {
|
|
1015
|
+
interface Asset {
|
|
1016
|
+
assetId: string;
|
|
1017
|
+
url: string;
|
|
1018
|
+
}
|
|
1019
|
+
/**
|
|
1020
|
+
* This is used to run the flow.
|
|
1021
|
+
*/
|
|
1022
|
+
interface Input {
|
|
1023
|
+
/**
|
|
1024
|
+
* The name that must be user to call the model through the API
|
|
1025
|
+
*/
|
|
1026
|
+
name: string;
|
|
1027
|
+
/**
|
|
1028
|
+
* The data type of the input
|
|
1029
|
+
*/
|
|
1030
|
+
type: 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array';
|
|
1031
|
+
/**
|
|
1032
|
+
* The allowed values for the input. For \`string\` or \`number\` types, creates a
|
|
1033
|
+
* single-select dropdown. For \`string_array\` type, creates a multi-select
|
|
1034
|
+
* dropdown.
|
|
1035
|
+
*/
|
|
1036
|
+
allowedValues?: Array<unknown>;
|
|
1037
|
+
/**
|
|
1038
|
+
* Specifies the background behavior for the input. Only available for \`file\` and
|
|
1039
|
+
* \`file_array\` input types with kind \`image\`.
|
|
1040
|
+
*/
|
|
1041
|
+
backgroundBehavior?: 'opaque' | 'transparent';
|
|
1042
|
+
/**
|
|
1043
|
+
* Whether the input is a color or not. Only available for \`string\` input type.
|
|
1044
|
+
*/
|
|
1045
|
+
color?: boolean;
|
|
1046
|
+
/**
|
|
1047
|
+
* Whether this input affects the model's cost calculation
|
|
1048
|
+
*/
|
|
1049
|
+
costImpact?: boolean;
|
|
1050
|
+
/**
|
|
1051
|
+
* Help text displayed in the UI to provide additional information about the input
|
|
1052
|
+
*/
|
|
1053
|
+
description?: string;
|
|
1054
|
+
/**
|
|
1055
|
+
* Used to visually group inputs together in the UI. Inputs with the same group
|
|
1056
|
+
* value appear consecutively in the UI.
|
|
1057
|
+
*/
|
|
1058
|
+
group?: string;
|
|
1059
|
+
/**
|
|
1060
|
+
* Hint text displayed in the UI as a tooltip to guide the user
|
|
1061
|
+
*/
|
|
1062
|
+
hint?: string;
|
|
1063
|
+
/**
|
|
1064
|
+
* The list of inputs which form an object within a container array. All inputs are
|
|
1065
|
+
* the same as the current object. This is only available for type inputs_array
|
|
1066
|
+
* inputs.
|
|
1067
|
+
*/
|
|
1068
|
+
inputs?: Array<unknown>;
|
|
1069
|
+
/**
|
|
1070
|
+
* The asset kind of the input. Only taken into account for \`file\` and
|
|
1071
|
+
* \`file_array\` input types.
|
|
1072
|
+
*/
|
|
1073
|
+
kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'video';
|
|
1074
|
+
/**
|
|
1075
|
+
* The label displayed in the UI for this input
|
|
1076
|
+
*/
|
|
1077
|
+
label?: string;
|
|
1078
|
+
/**
|
|
1079
|
+
* The name of the file input field to use as the mask source
|
|
1080
|
+
*/
|
|
1081
|
+
maskFrom?: string;
|
|
1082
|
+
/**
|
|
1083
|
+
* The maximum allowed value. Only available for \`number\` and \`array\` input
|
|
1084
|
+
* types.
|
|
1085
|
+
*/
|
|
1086
|
+
max?: number;
|
|
1087
|
+
/**
|
|
1088
|
+
* The maximum allowed length for \`string\` inputs. Also applies to each item in
|
|
1089
|
+
* \`string_array\`.
|
|
1090
|
+
*/
|
|
1091
|
+
maxLength?: number;
|
|
1092
|
+
/**
|
|
1093
|
+
* The minimum allowed value. Only available for \`number\` and array input types.
|
|
1094
|
+
*/
|
|
1095
|
+
min?: number;
|
|
1096
|
+
/**
|
|
1097
|
+
* The minimum allowed length for string inputs. Also applies to each item in
|
|
1098
|
+
* \`string_array\`.
|
|
1099
|
+
*/
|
|
1100
|
+
minLength?: number;
|
|
1101
|
+
/**
|
|
1102
|
+
* The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only
|
|
1103
|
+
* available for \`model_array\` input type.
|
|
1104
|
+
*/
|
|
1105
|
+
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'>;
|
|
1106
|
+
/**
|
|
1107
|
+
* Whether this input represents a parent asset to assign to the produced assets.
|
|
1108
|
+
* Only available for \`file\` and \`file_array\` input types.
|
|
1109
|
+
*
|
|
1110
|
+
* For \`file_array\`, the parent asset is the first item in the array.
|
|
1111
|
+
*/
|
|
1112
|
+
parent?: boolean;
|
|
1113
|
+
/**
|
|
1114
|
+
* Placeholder text for the input. Only available for 'string' input type.
|
|
1115
|
+
*/
|
|
1116
|
+
placeholder?: string;
|
|
1117
|
+
/**
|
|
1118
|
+
* Whether the input is a prompt. When true, displays as a text area with prompt
|
|
1119
|
+
* spark feature. Only available for \`string\` input type.
|
|
1120
|
+
*/
|
|
1121
|
+
prompt?: boolean;
|
|
1122
|
+
/**
|
|
1123
|
+
* Whether the input is used with prompt spark. Only available for \`string\` input
|
|
1124
|
+
* type.
|
|
1125
|
+
*/
|
|
1126
|
+
promptSpark?: boolean;
|
|
1127
|
+
/**
|
|
1128
|
+
* The reference to another input or output of the same workflow. Must have at
|
|
1129
|
+
* least one of node or conditional.
|
|
1130
|
+
*/
|
|
1131
|
+
ref?: Input.Ref;
|
|
1132
|
+
/**
|
|
1133
|
+
* Set of rules that describes when this input is required:
|
|
1134
|
+
*
|
|
1135
|
+
* - \`always\`: Input is always required
|
|
1136
|
+
* - \`ifNotDefined\`: Input is required when another specified input is not
|
|
1137
|
+
* defined
|
|
1138
|
+
* - \`ifDefined\`: Input is required when another specified input is defined
|
|
1139
|
+
* - \`conditionalValues\`: Input is required when another input has a specific
|
|
1140
|
+
* value
|
|
1141
|
+
*
|
|
1142
|
+
* By default, the input is not required.
|
|
1143
|
+
*/
|
|
1144
|
+
required?: Input.Required;
|
|
1145
|
+
/**
|
|
1146
|
+
* The step increment for numeric inputs. Only available for \`number\` input type.
|
|
1147
|
+
*/
|
|
1148
|
+
step?: number;
|
|
1149
|
+
}
|
|
1150
|
+
namespace Input {
|
|
1151
|
+
/**
|
|
1152
|
+
* The reference to another input or output of the same workflow. Must have at
|
|
1153
|
+
* least one of node or conditional.
|
|
1154
|
+
*/
|
|
1155
|
+
interface Ref {
|
|
1156
|
+
/**
|
|
1157
|
+
* The conditional nodes to reference. If the conditional nodes are successful, the
|
|
1158
|
+
* node will be successful. If the conditional nodes are skipped, the node will be
|
|
1159
|
+
* skipped. Contains an array of node ids used to check the status of the nodes.
|
|
1160
|
+
*/
|
|
1161
|
+
conditional?: Array<string>;
|
|
1162
|
+
/**
|
|
1163
|
+
* This is the desired node output value if ref is an if/else node.
|
|
1164
|
+
*/
|
|
1165
|
+
equal?: string;
|
|
1166
|
+
/**
|
|
1167
|
+
* The name of the input or output to reference. If the type is 'workflow', the
|
|
1168
|
+
* name is the name of the input of the workflow is required If the type is 'node',
|
|
1169
|
+
* the name is not mandatory, except if you want all outputs of the node. To get
|
|
1170
|
+
* all outputs of a node, you can use the name 'all'.
|
|
1171
|
+
*/
|
|
1172
|
+
name?: string;
|
|
1173
|
+
/**
|
|
1174
|
+
* The node id or 'workflow' if the source is a workflow input.
|
|
1175
|
+
*/
|
|
1176
|
+
node?: string;
|
|
1177
|
+
}
|
|
1178
|
+
/**
|
|
1179
|
+
* Set of rules that describes when this input is required:
|
|
1180
|
+
*
|
|
1181
|
+
* - \`always\`: Input is always required
|
|
1182
|
+
* - \`ifNotDefined\`: Input is required when another specified input is not
|
|
1183
|
+
* defined
|
|
1184
|
+
* - \`ifDefined\`: Input is required when another specified input is defined
|
|
1185
|
+
* - \`conditionalValues\`: Input is required when another input has a specific
|
|
1186
|
+
* value
|
|
1187
|
+
*
|
|
1188
|
+
* By default, the input is not required.
|
|
1189
|
+
*/
|
|
1190
|
+
interface Required {
|
|
1191
|
+
/**
|
|
1192
|
+
* Whether the input is always required
|
|
1193
|
+
*/
|
|
1194
|
+
always?: boolean;
|
|
1195
|
+
/**
|
|
1196
|
+
* Makes this input required when another input has a specific value:
|
|
1197
|
+
*
|
|
1198
|
+
* - Key: name of the input to check
|
|
1199
|
+
* - Value: operation and allowed values that trigger the requirement
|
|
1200
|
+
*/
|
|
1201
|
+
conditionalValues?: unknown;
|
|
1202
|
+
/**
|
|
1203
|
+
* Makes this input required when another input is defined:
|
|
1204
|
+
*
|
|
1205
|
+
* - Key: name of the input that must be defined
|
|
1206
|
+
* - Value: message to display when this input is required
|
|
1207
|
+
*/
|
|
1208
|
+
ifDefined?: unknown;
|
|
1209
|
+
/**
|
|
1210
|
+
* Makes this input required when another input is not defined:
|
|
1211
|
+
*
|
|
1212
|
+
* - Key: name of the input that must be undefined
|
|
1213
|
+
* - Value: message to display when this input is required
|
|
1214
|
+
*/
|
|
1215
|
+
ifNotDefined?: unknown;
|
|
1216
|
+
}
|
|
1217
|
+
}
|
|
1218
|
+
/**
|
|
1219
|
+
* The logic of the node. Only available for logic nodes.
|
|
1220
|
+
*/
|
|
1221
|
+
interface Logic {
|
|
1222
|
+
/**
|
|
1223
|
+
* The cases of the logic. Only available for if/else nodes.
|
|
1224
|
+
*/
|
|
1225
|
+
cases?: Array<Logic.Case>;
|
|
1226
|
+
/**
|
|
1227
|
+
* The default case of the logic. Contains the id/output of the node to execute if
|
|
1228
|
+
* no case is matched. Only available for if/else nodes.
|
|
1229
|
+
*/
|
|
1230
|
+
default?: string;
|
|
1231
|
+
/**
|
|
1232
|
+
* The transform of the logic. Only available for transform nodes.
|
|
1233
|
+
*/
|
|
1234
|
+
transform?: string;
|
|
1235
|
+
}
|
|
1236
|
+
namespace Logic {
|
|
1237
|
+
interface Case {
|
|
1238
|
+
condition: string;
|
|
1239
|
+
value: string;
|
|
1240
|
+
}
|
|
1241
|
+
}
|
|
1242
|
+
}
|
|
1243
|
+
}
|
|
1244
|
+
interface StatusHistory {
|
|
1245
|
+
date: string;
|
|
1246
|
+
status: 'canceled' | 'failure' | 'finalizing' | 'in-progress' | 'pending' | 'queued' | 'success' | 'warming-up';
|
|
1247
|
+
}
|
|
1248
|
+
/**
|
|
1249
|
+
* The billing of the job
|
|
1250
|
+
*/
|
|
1251
|
+
interface Billing {
|
|
1252
|
+
cuCost: number;
|
|
1253
|
+
cuDiscount: number;
|
|
1254
|
+
}
|
|
1255
|
+
}
|
|
1256
|
+
interface Model {
|
|
1257
|
+
/**
|
|
1258
|
+
* The model ID (example: "model_eyVcnFJcR92BxBkz7N6g5w")
|
|
1259
|
+
*/
|
|
1260
|
+
id: string;
|
|
1261
|
+
/**
|
|
1262
|
+
* List of model capabilities (example: ["txt2img", "img2img",
|
|
1263
|
+
* "txt2img_ip_adapter", ...])
|
|
1264
|
+
*/
|
|
1265
|
+
capabilities: Array<'3d23d' | 'audio2audio' | 'controlnet' | 'controlnet_img2img' | 'controlnet_inpaint' | 'controlnet_inpaint_ip_adapter' | 'controlnet_ip_adapter' | 'controlnet_reference' | 'controlnet_texture' | 'img23d' | 'img2img' | 'img2img_ip_adapter' | 'img2img_texture' | 'img2txt' | 'img2video' | 'inpaint' | 'inpaint_ip_adapter' | 'outpaint' | 'reference' | 'reference_texture' | 'txt23d' | 'txt2audio' | 'txt2img' | 'txt2img_ip_adapter' | 'txt2img_texture' | 'txt2txt' | 'txt2video' | 'video2img' | 'video2video'>;
|
|
1266
|
+
/**
|
|
1267
|
+
* A list of CollectionId this model belongs to
|
|
1268
|
+
*/
|
|
1269
|
+
collectionIds: Array<string>;
|
|
1270
|
+
/**
|
|
1271
|
+
* The model creation date as an ISO string (example: "2023-02-03T11:19:41.579Z")
|
|
1272
|
+
*/
|
|
1273
|
+
createdAt: string;
|
|
1274
|
+
/**
|
|
1275
|
+
* Whether the model is a custom model and can be used only with POST
|
|
1276
|
+
* /generate/custom/{modelId} endpoint
|
|
1277
|
+
*/
|
|
1278
|
+
custom: boolean;
|
|
1279
|
+
/**
|
|
1280
|
+
* List of all example asset IDs setup by the model owner
|
|
1281
|
+
*/
|
|
1282
|
+
exampleAssetIds: Array<string>;
|
|
1283
|
+
/**
|
|
1284
|
+
* The privacy of the model (default: private)
|
|
1285
|
+
*/
|
|
1286
|
+
privacy: 'private' | 'public' | 'unlisted';
|
|
1287
|
+
/**
|
|
1288
|
+
* The source of the model
|
|
1289
|
+
*/
|
|
1290
|
+
source: 'civitai' | 'huggingface' | 'other' | 'scenario';
|
|
1291
|
+
/**
|
|
1292
|
+
* The model status
|
|
1293
|
+
*/
|
|
1294
|
+
status: 'copying' | 'failed' | 'new' | 'trained' | 'training' | 'training-canceled';
|
|
1295
|
+
/**
|
|
1296
|
+
* The associated tags (example: ["sci-fi", "landscape"])
|
|
1297
|
+
*/
|
|
1298
|
+
tags: Array<string>;
|
|
1299
|
+
/**
|
|
1300
|
+
* The total number of training images
|
|
1301
|
+
*/
|
|
1302
|
+
trainingImagesNumber: number;
|
|
1303
|
+
/**
|
|
1304
|
+
* The model type (example: "flux.1-lora")
|
|
1305
|
+
*/
|
|
1306
|
+
type: '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';
|
|
1307
|
+
/**
|
|
1308
|
+
* The model last update date as an ISO string (example:
|
|
1309
|
+
* "2023-02-03T11:19:41.579Z")
|
|
1310
|
+
*/
|
|
1311
|
+
updatedAt: string;
|
|
1312
|
+
/**
|
|
1313
|
+
* The access restrictions of the model 0: Free plan 25: Creator plan 50: Pro plan
|
|
1314
|
+
* 75: Team plan 100: Enterprise plan
|
|
1315
|
+
*/
|
|
1316
|
+
accessRestrictions?: number;
|
|
1317
|
+
/**
|
|
1318
|
+
* The author user ID (example: "user_VFhihHKMRZyDDnZAJwLb2Q")
|
|
1319
|
+
*/
|
|
1320
|
+
authorId?: string;
|
|
1321
|
+
/**
|
|
1322
|
+
* The class of the model
|
|
1323
|
+
*/
|
|
1324
|
+
class?: Model.Class;
|
|
1325
|
+
/**
|
|
1326
|
+
* Compliance and regulatory metadata for the model
|
|
1327
|
+
*/
|
|
1328
|
+
complianceMetadata?: Model.ComplianceMetadata;
|
|
1329
|
+
/**
|
|
1330
|
+
* List of base model IDs compliant with the model (example: ["flux.1-dev",
|
|
1331
|
+
* "flux.1-schnell"]) This attribute is mainly used for Flux LoRA models
|
|
1332
|
+
*/
|
|
1333
|
+
compliantModelIds?: Array<string>;
|
|
1334
|
+
/**
|
|
1335
|
+
* The concepts is required for the type model: composition
|
|
1336
|
+
*/
|
|
1337
|
+
concepts?: Array<Model.Concept>;
|
|
1338
|
+
/**
|
|
1339
|
+
* The epoch of the model. Only available for Flux Lora Trained models. If not set,
|
|
1340
|
+
* uses the final model epoch (latest)
|
|
1341
|
+
*/
|
|
1342
|
+
epoch?: string;
|
|
1343
|
+
/**
|
|
1344
|
+
* The epochs of the model. Only available for Flux Lora Trained models.
|
|
1345
|
+
*/
|
|
1346
|
+
epochs?: Array<Model.Epoch>;
|
|
1347
|
+
/**
|
|
1348
|
+
* The inputs of the model. Only used for custom models. To retrieve this list, get
|
|
1349
|
+
* it by modelId with GET /models/{modelId}
|
|
1350
|
+
*/
|
|
1351
|
+
inputs?: Array<Model.Input>;
|
|
1352
|
+
/**
|
|
1353
|
+
* The model keyword, this is a legacy parameter, please use conceptPrompt in
|
|
1354
|
+
* parameters
|
|
1355
|
+
*/
|
|
1356
|
+
modelKeyword?: string;
|
|
1357
|
+
/**
|
|
1358
|
+
* The model name (example: "Cinematic Realism")
|
|
1359
|
+
*/
|
|
1360
|
+
name?: string;
|
|
1361
|
+
/**
|
|
1362
|
+
* Fine-tune the model's inferences with negative prompt embedding
|
|
1363
|
+
*/
|
|
1364
|
+
negativePromptEmbedding?: string;
|
|
1365
|
+
/**
|
|
1366
|
+
* The owner ID (example: "team_VFhihHKMRZyDDnZAJwLb2Q")
|
|
1367
|
+
*/
|
|
1368
|
+
ownerId?: string;
|
|
1369
|
+
/**
|
|
1370
|
+
* The parameters of the model
|
|
1371
|
+
*/
|
|
1372
|
+
parameters?: Model.Parameters;
|
|
1373
|
+
/**
|
|
1374
|
+
* The id of the parent model
|
|
1375
|
+
*/
|
|
1376
|
+
parentModelId?: string;
|
|
1377
|
+
/**
|
|
1378
|
+
* Fine-tune the model's inferences with prompt embedding
|
|
1379
|
+
*/
|
|
1380
|
+
promptEmbedding?: string;
|
|
1381
|
+
/**
|
|
1382
|
+
* The model short description (example: "This model generates highly detailed
|
|
1383
|
+
* cinematic scenes.")
|
|
1384
|
+
*/
|
|
1385
|
+
shortDescription?: string;
|
|
1386
|
+
/**
|
|
1387
|
+
* The date when the model will be soft deleted (only for Free plan)
|
|
1388
|
+
*/
|
|
1389
|
+
softDeletionOn?: string;
|
|
1390
|
+
/**
|
|
1391
|
+
* A thumbnail for your model
|
|
1392
|
+
*/
|
|
1393
|
+
thumbnail?: Model.Thumbnail;
|
|
1394
|
+
/**
|
|
1395
|
+
* Array of training image pairs
|
|
1396
|
+
*/
|
|
1397
|
+
trainingImagePairs?: Array<Model.TrainingImagePair>;
|
|
1398
|
+
/**
|
|
1399
|
+
* The URLs of the first 3 training images of the model. To retrieve the full set
|
|
1400
|
+
* of images, get it by modelId
|
|
1401
|
+
*/
|
|
1402
|
+
trainingImages?: Array<Model.TrainingImage>;
|
|
1403
|
+
/**
|
|
1404
|
+
* Additional information about the training progress of the model
|
|
1405
|
+
*/
|
|
1406
|
+
trainingProgress?: Model.TrainingProgress;
|
|
1407
|
+
/**
|
|
1408
|
+
* Additional information about the model's training
|
|
1409
|
+
*/
|
|
1410
|
+
trainingStats?: Model.TrainingStats;
|
|
1411
|
+
/**
|
|
1412
|
+
* The UI configuration for the model
|
|
1413
|
+
*/
|
|
1414
|
+
uiConfig?: Model.UiConfig;
|
|
1415
|
+
/**
|
|
1416
|
+
* (Deprecated) The user ID (example: "user_VFhihHKMRZyDDnZAJwLb2Q")
|
|
1417
|
+
*/
|
|
1418
|
+
userId?: string;
|
|
1419
|
+
}
|
|
1420
|
+
namespace Model {
|
|
1421
|
+
/**
|
|
1422
|
+
* The class of the model
|
|
1423
|
+
*/
|
|
1424
|
+
interface Class {
|
|
1425
|
+
/**
|
|
1426
|
+
* The category slug of the class (example: "art-style")
|
|
1427
|
+
*/
|
|
1428
|
+
category: string;
|
|
1429
|
+
/**
|
|
1430
|
+
* The concept prompt of the class (example: "a sks character design")
|
|
1431
|
+
*/
|
|
1432
|
+
conceptPrompt: string;
|
|
1433
|
+
/**
|
|
1434
|
+
* The model ID of the class (example: "stable-diffusion-v1-5")
|
|
1435
|
+
*/
|
|
1436
|
+
modelId: string;
|
|
1437
|
+
/**
|
|
1438
|
+
* The class name (example: "Character Design")
|
|
1439
|
+
*/
|
|
1440
|
+
name: string;
|
|
1441
|
+
/**
|
|
1442
|
+
* The class prompt (example: "a character design")
|
|
1443
|
+
*/
|
|
1444
|
+
prompt: string;
|
|
1445
|
+
/**
|
|
1446
|
+
* The class slug (example: "art-style-character-design")
|
|
1447
|
+
*/
|
|
1448
|
+
slug: string;
|
|
1449
|
+
/**
|
|
1450
|
+
* The class status (only published classes are listed, but unpublished classes can
|
|
1451
|
+
* still appear in existing models)
|
|
1452
|
+
*/
|
|
1453
|
+
status: 'published' | 'unpublished';
|
|
1454
|
+
/**
|
|
1455
|
+
* Some example images URLs to showcase the class
|
|
1456
|
+
*/
|
|
1457
|
+
thumbnails: Array<string>;
|
|
1458
|
+
}
|
|
1459
|
+
/**
|
|
1460
|
+
* Compliance and regulatory metadata for the model
|
|
1461
|
+
*/
|
|
1462
|
+
interface ComplianceMetadata {
|
|
1463
|
+
/**
|
|
1464
|
+
* Data processing comment (e.g., zeroRetention, temporaryRetention, etc.)
|
|
1465
|
+
*/
|
|
1466
|
+
dataProcessingComment?: 'researchOnly' | 'serviceImprovement' | 'temporaryRetention' | 'zeroRetention';
|
|
1467
|
+
/**
|
|
1468
|
+
* URL to license terms
|
|
1469
|
+
*/
|
|
1470
|
+
licenseTerms?: string;
|
|
1471
|
+
/**
|
|
1472
|
+
* The maintainer of the model
|
|
1473
|
+
*/
|
|
1474
|
+
maintainer?: 'Fal' | 'Provider' | 'Replicate' | 'Scenario';
|
|
1475
|
+
/**
|
|
1476
|
+
* The provider of the model (examples: 'Google', 'AWS', 'BFL', 'Meshy', etc.)
|
|
1477
|
+
*/
|
|
1478
|
+
modelProvider?: string;
|
|
1479
|
+
/**
|
|
1480
|
+
* The sub-processor used for the model
|
|
1481
|
+
*/
|
|
1482
|
+
subProcessor?: 'AWS' | 'Fal' | 'Modal' | 'Provider' | 'Replicate';
|
|
1483
|
+
}
|
|
1484
|
+
interface Concept {
|
|
1485
|
+
/**
|
|
1486
|
+
* The model ID (example: "model_eyVcnFJcR92BxBkz7N6g5w")
|
|
1487
|
+
*/
|
|
1488
|
+
modelId: string;
|
|
1489
|
+
/**
|
|
1490
|
+
* The scale of the model (example: 1.0) For Flux Kontext Prompt Editing, the scale
|
|
1491
|
+
* is between 0 and 2.
|
|
1492
|
+
*/
|
|
1493
|
+
scale: number;
|
|
1494
|
+
/**
|
|
1495
|
+
* The epoch of the model (example: "000001") Only available for Flux Lora Trained
|
|
1496
|
+
* models
|
|
1497
|
+
*/
|
|
1498
|
+
modelEpoch?: string;
|
|
1499
|
+
}
|
|
1500
|
+
interface Epoch {
|
|
1501
|
+
/**
|
|
1502
|
+
* The epoch hash to identify the epoch
|
|
1503
|
+
*/
|
|
1504
|
+
epoch: string;
|
|
1505
|
+
/**
|
|
1506
|
+
* The assets of the epoch if sample prompts as been supplied during training
|
|
1507
|
+
*/
|
|
1508
|
+
assets?: Array<Epoch.Asset>;
|
|
1509
|
+
}
|
|
1510
|
+
namespace Epoch {
|
|
1511
|
+
interface Asset {
|
|
1512
|
+
/**
|
|
1513
|
+
* The AssetId of the image during training (example:
|
|
1514
|
+
* "asset_GTrL3mq4SXWyMxkOHRxlpw")
|
|
1515
|
+
*/
|
|
1516
|
+
assetId: string;
|
|
1517
|
+
/**
|
|
1518
|
+
* The url of the asset
|
|
1519
|
+
*/
|
|
1520
|
+
url: string;
|
|
1521
|
+
}
|
|
1522
|
+
}
|
|
1523
|
+
/**
|
|
1524
|
+
* Defines the input parameters for a model. Use this to understand the available
|
|
1525
|
+
* input parameters for a given `modelId` when calling
|
|
1526
|
+
* `POST /generate/custom/{modelId}`. See {@link
|
|
1527
|
+
* https://docs.scenario.com/docs/video-generation} for examples.
|
|
1528
|
+
*/
|
|
1529
|
+
interface Input {
|
|
1530
|
+
/**
|
|
1531
|
+
* The name that must be user to call the model through the API
|
|
1532
|
+
*/
|
|
1533
|
+
name: string;
|
|
1534
|
+
/**
|
|
1535
|
+
* The data type of the input
|
|
1536
|
+
*/
|
|
1537
|
+
type: 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array';
|
|
1538
|
+
/**
|
|
1539
|
+
* The allowed values for the input. For \`string\` or \`number\` types, creates a
|
|
1540
|
+
* single-select dropdown. For \`string_array\` type, creates a multi-select
|
|
1541
|
+
* dropdown.
|
|
1542
|
+
*/
|
|
1543
|
+
allowedValues?: Array<unknown>;
|
|
1544
|
+
/**
|
|
1545
|
+
* Specifies the background behavior for the input. Only available for \`file\` and
|
|
1546
|
+
* \`file_array\` input types with kind \`image\`.
|
|
1547
|
+
*/
|
|
1548
|
+
backgroundBehavior?: 'opaque' | 'transparent';
|
|
1549
|
+
/**
|
|
1550
|
+
* Whether the input is a color or not. Only available for \`string\` input type.
|
|
1551
|
+
*/
|
|
1552
|
+
color?: boolean;
|
|
1553
|
+
/**
|
|
1554
|
+
* Whether this input affects the model's cost calculation
|
|
1555
|
+
*/
|
|
1556
|
+
costImpact?: boolean;
|
|
1557
|
+
/**
|
|
1558
|
+
* Help text displayed in the UI to provide additional information about the input
|
|
1559
|
+
*/
|
|
1560
|
+
description?: string;
|
|
1561
|
+
/**
|
|
1562
|
+
* Used to visually group inputs together in the UI. Inputs with the same group
|
|
1563
|
+
* value appear consecutively in the UI.
|
|
1564
|
+
*/
|
|
1565
|
+
group?: string;
|
|
1566
|
+
/**
|
|
1567
|
+
* Hint text displayed in the UI as a tooltip to guide the user
|
|
1568
|
+
*/
|
|
1569
|
+
hint?: string;
|
|
1570
|
+
/**
|
|
1571
|
+
* The list of inputs which form an object within a container array. All inputs are
|
|
1572
|
+
* the same as the current object. This is only available for type inputs_array
|
|
1573
|
+
* inputs.
|
|
1574
|
+
*/
|
|
1575
|
+
inputs?: Array<unknown>;
|
|
1576
|
+
/**
|
|
1577
|
+
* The asset kind of the input. Only taken into account for \`file\` and
|
|
1578
|
+
* \`file_array\` input types.
|
|
1579
|
+
*/
|
|
1580
|
+
kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'video';
|
|
1581
|
+
/**
|
|
1582
|
+
* The label displayed in the UI for this input
|
|
1583
|
+
*/
|
|
1584
|
+
label?: string;
|
|
1585
|
+
/**
|
|
1586
|
+
* The name of the file input field to use as the mask source
|
|
1587
|
+
*/
|
|
1588
|
+
maskFrom?: string;
|
|
1589
|
+
/**
|
|
1590
|
+
* The maximum allowed value. Only available for \`number\` and \`array\` input
|
|
1591
|
+
* types.
|
|
1592
|
+
*/
|
|
1593
|
+
max?: number;
|
|
1594
|
+
/**
|
|
1595
|
+
* The maximum allowed length for \`string\` inputs. Also applies to each item in
|
|
1596
|
+
* \`string_array\`.
|
|
1597
|
+
*/
|
|
1598
|
+
maxLength?: number;
|
|
1599
|
+
/**
|
|
1600
|
+
* The minimum allowed value. Only available for \`number\` and array input types.
|
|
1601
|
+
*/
|
|
1602
|
+
min?: number;
|
|
1603
|
+
/**
|
|
1604
|
+
* The minimum allowed length for string inputs. Also applies to each item in
|
|
1605
|
+
* \`string_array\`.
|
|
1606
|
+
*/
|
|
1607
|
+
minLength?: number;
|
|
1608
|
+
/**
|
|
1609
|
+
* The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only
|
|
1610
|
+
* available for \`model_array\` input type.
|
|
1611
|
+
*/
|
|
1612
|
+
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'>;
|
|
1613
|
+
/**
|
|
1614
|
+
* Whether this input represents a parent asset to assign to the produced assets.
|
|
1615
|
+
* Only available for \`file\` and \`file_array\` input types.
|
|
1616
|
+
*
|
|
1617
|
+
* For \`file_array\`, the parent asset is the first item in the array.
|
|
1618
|
+
*/
|
|
1619
|
+
parent?: boolean;
|
|
1620
|
+
/**
|
|
1621
|
+
* Placeholder text for the input. Only available for 'string' input type.
|
|
1622
|
+
*/
|
|
1623
|
+
placeholder?: string;
|
|
1624
|
+
/**
|
|
1625
|
+
* Whether the input is a prompt. When true, displays as a text area with prompt
|
|
1626
|
+
* spark feature. Only available for \`string\` input type.
|
|
1627
|
+
*/
|
|
1628
|
+
prompt?: boolean;
|
|
1629
|
+
/**
|
|
1630
|
+
* Whether the input is used with prompt spark. Only available for \`string\` input
|
|
1631
|
+
* type.
|
|
1632
|
+
*/
|
|
1633
|
+
promptSpark?: boolean;
|
|
1634
|
+
/**
|
|
1635
|
+
* Set of rules that describes when this input is required:
|
|
1636
|
+
*
|
|
1637
|
+
* - \`always\`: Input is always required
|
|
1638
|
+
* - \`ifNotDefined\`: Input is required when another specified input is not
|
|
1639
|
+
* defined
|
|
1640
|
+
* - \`ifDefined\`: Input is required when another specified input is defined
|
|
1641
|
+
* - \`conditionalValues\`: Input is required when another input has a specific
|
|
1642
|
+
* value
|
|
1643
|
+
*
|
|
1644
|
+
* By default, the input is not required.
|
|
1645
|
+
*/
|
|
1646
|
+
required?: Input.Required;
|
|
1647
|
+
/**
|
|
1648
|
+
* The step increment for numeric inputs. Only available for \`number\` input type.
|
|
1649
|
+
*/
|
|
1650
|
+
step?: number;
|
|
1651
|
+
}
|
|
1652
|
+
namespace Input {
|
|
1653
|
+
/**
|
|
1654
|
+
* Set of rules that describes when this input is required:
|
|
1655
|
+
*
|
|
1656
|
+
* - \`always\`: Input is always required
|
|
1657
|
+
* - \`ifNotDefined\`: Input is required when another specified input is not
|
|
1658
|
+
* defined
|
|
1659
|
+
* - \`ifDefined\`: Input is required when another specified input is defined
|
|
1660
|
+
* - \`conditionalValues\`: Input is required when another input has a specific
|
|
1661
|
+
* value
|
|
1662
|
+
*
|
|
1663
|
+
* By default, the input is not required.
|
|
1664
|
+
*/
|
|
1665
|
+
interface Required {
|
|
1666
|
+
/**
|
|
1667
|
+
* Whether the input is always required
|
|
1668
|
+
*/
|
|
1669
|
+
always?: boolean;
|
|
1670
|
+
/**
|
|
1671
|
+
* Makes this input required when another input has a specific value:
|
|
1672
|
+
*
|
|
1673
|
+
* - Key: name of the input to check
|
|
1674
|
+
* - Value: operation and allowed values that trigger the requirement
|
|
1675
|
+
*/
|
|
1676
|
+
conditionalValues?: unknown;
|
|
1677
|
+
/**
|
|
1678
|
+
* Makes this input required when another input is defined:
|
|
1679
|
+
*
|
|
1680
|
+
* - Key: name of the input that must be defined
|
|
1681
|
+
* - Value: message to display when this input is required
|
|
1682
|
+
*/
|
|
1683
|
+
ifDefined?: unknown;
|
|
1684
|
+
/**
|
|
1685
|
+
* Makes this input required when another input is not defined:
|
|
1686
|
+
*
|
|
1687
|
+
* - Key: name of the input that must be undefined
|
|
1688
|
+
* - Value: message to display when this input is required
|
|
1689
|
+
*/
|
|
1690
|
+
ifNotDefined?: unknown;
|
|
1691
|
+
}
|
|
1692
|
+
}
|
|
1693
|
+
/**
|
|
1694
|
+
* The parameters of the model
|
|
1695
|
+
*/
|
|
1696
|
+
interface Parameters {
|
|
1697
|
+
/**
|
|
1698
|
+
* The batch size Less steps, and will increase the learning rate
|
|
1699
|
+
*
|
|
1700
|
+
* Only available for Flux LoRA training
|
|
1701
|
+
*/
|
|
1702
|
+
batchSize?: number;
|
|
1703
|
+
/**
|
|
1704
|
+
* The prompt to specify images in the same class as provided instance images
|
|
1705
|
+
*
|
|
1706
|
+
* Only available for SD15 training
|
|
1707
|
+
*/
|
|
1708
|
+
classPrompt?: string;
|
|
1709
|
+
/**
|
|
1710
|
+
* The prompt with identifier specifying the instance (or subject) of the class
|
|
1711
|
+
* (example: "a daiton dog")
|
|
1712
|
+
*
|
|
1713
|
+
* Default value varies depending on the model type:
|
|
1714
|
+
*
|
|
1715
|
+
* - For SD1.5: "daiton" if no class is associated with the model
|
|
1716
|
+
* - For SDXL: "daiton"
|
|
1717
|
+
* - For Flux: ""
|
|
1718
|
+
*/
|
|
1719
|
+
conceptPrompt?: string;
|
|
1720
|
+
/**
|
|
1721
|
+
* Initial learning rate (after the potential warmup period)
|
|
1722
|
+
*
|
|
1723
|
+
* Default value varies depending on the model type:
|
|
1724
|
+
*
|
|
1725
|
+
* - For SD1.5 and SDXL: 0.000005
|
|
1726
|
+
* - For Flux: 0.0001
|
|
1727
|
+
*/
|
|
1728
|
+
learningRate?: number;
|
|
1729
|
+
/**
|
|
1730
|
+
* Initial learning rate (after the potential warmup period) for the text encoder
|
|
1731
|
+
*
|
|
1732
|
+
* Maximum [Flux LoRA: 0.001] Default [SDXL: 0.00005 | Flux LoRA: 0.00001] Minimum
|
|
1733
|
+
* [SDXL: 0 | Flux LoRA: 0.000001]
|
|
1734
|
+
*/
|
|
1735
|
+
learningRateTextEncoder?: number;
|
|
1736
|
+
/**
|
|
1737
|
+
* Initial learning rate (after the potential warmup period) for the UNet
|
|
1738
|
+
*
|
|
1739
|
+
* Only available for SDXL LoRA training
|
|
1740
|
+
*/
|
|
1741
|
+
learningRateUnet?: number;
|
|
1742
|
+
/**
|
|
1743
|
+
* The scheduler type to use (default: "constant")
|
|
1744
|
+
*
|
|
1745
|
+
* Only available for SD15 and SDXL LoRA training
|
|
1746
|
+
*/
|
|
1747
|
+
lrScheduler?: 'constant' | 'constant-with-warmup' | 'cosine' | 'cosine-with-restarts' | 'linear' | 'polynomial';
|
|
1748
|
+
/**
|
|
1749
|
+
* Maximum number of training steps to execute (default: varies depending on the
|
|
1750
|
+
* model type)
|
|
1751
|
+
*
|
|
1752
|
+
* For SDXL LoRA training, please use `numTextTrainSteps` and `numUNetTrainSteps`
|
|
1753
|
+
* instead
|
|
1754
|
+
*
|
|
1755
|
+
* Default value varies depending on the model type:
|
|
1756
|
+
*
|
|
1757
|
+
* - For SD1.5: round((number of training images \* 225) / 3)
|
|
1758
|
+
* - For SDXL: number of training images \* 175
|
|
1759
|
+
* - For Flux: number of training images \* 100
|
|
1760
|
+
*
|
|
1761
|
+
* Maximum value varies depending on the model type:
|
|
1762
|
+
*
|
|
1763
|
+
* - For SD1.5 and SDXL: [0, 40000]
|
|
1764
|
+
* - For Flux: [0, 10000]
|
|
1765
|
+
*/
|
|
1766
|
+
maxTrainSteps?: number;
|
|
1767
|
+
/**
|
|
1768
|
+
* The number of epochs to train for
|
|
1769
|
+
*
|
|
1770
|
+
* Only available for Flux LoRA training
|
|
1771
|
+
*/
|
|
1772
|
+
nbEpochs?: number;
|
|
1773
|
+
/**
|
|
1774
|
+
* The number of times to repeat the training
|
|
1775
|
+
*
|
|
1776
|
+
* Only available for Flux LoRA training
|
|
1777
|
+
*/
|
|
1778
|
+
nbRepeats?: number;
|
|
1779
|
+
/**
|
|
1780
|
+
* The number of training steps for the text encoder
|
|
1781
|
+
*
|
|
1782
|
+
* Only available for SDXL LoRA training
|
|
1783
|
+
*/
|
|
1784
|
+
numTextTrainSteps?: number;
|
|
1785
|
+
/**
|
|
1786
|
+
* The number of training steps for the UNet
|
|
1787
|
+
*
|
|
1788
|
+
* Only available for SDXL LoRA training
|
|
1789
|
+
*/
|
|
1790
|
+
numUNetTrainSteps?: number;
|
|
1791
|
+
/**
|
|
1792
|
+
* Optimize the model training task for a specific type of input images. The
|
|
1793
|
+
* available values are:
|
|
1794
|
+
*
|
|
1795
|
+
* - "likeness": optimize training for likeness or portrait (targets specific
|
|
1796
|
+
* transformer blocks)
|
|
1797
|
+
* - "all": train all transformer blocks
|
|
1798
|
+
* - "none": train no specific transformer blocks
|
|
1799
|
+
*
|
|
1800
|
+
* This parameter controls which double and single transformer blocks are trained
|
|
1801
|
+
* during the LoRA training process.
|
|
1802
|
+
*
|
|
1803
|
+
* Only available for Flux LoRA training
|
|
1804
|
+
*/
|
|
1805
|
+
optimizeFor?: 'likeness';
|
|
1806
|
+
/**
|
|
1807
|
+
* The weight of prior preservation loss
|
|
1808
|
+
*
|
|
1809
|
+
* Only available for SD15 and SDXL LoRA training
|
|
1810
|
+
*/
|
|
1811
|
+
priorLossWeight?: number;
|
|
1812
|
+
/**
|
|
1813
|
+
* Whether to random crop or center crop images before resizing to the working
|
|
1814
|
+
* resolution
|
|
1815
|
+
*
|
|
1816
|
+
* Only available for SD15 and SDXL LoRA training
|
|
1817
|
+
*/
|
|
1818
|
+
randomCrop?: boolean;
|
|
1819
|
+
/**
|
|
1820
|
+
* Ratio of random crops
|
|
1821
|
+
*
|
|
1822
|
+
* Only available for SD15 and SDXL LoRA training
|
|
1823
|
+
*/
|
|
1824
|
+
randomCropRatio?: number;
|
|
1825
|
+
/**
|
|
1826
|
+
* Scale of random crops
|
|
1827
|
+
*
|
|
1828
|
+
* Only available for SD15 and SDXL LoRA training
|
|
1829
|
+
*/
|
|
1830
|
+
randomCropScale?: number;
|
|
1831
|
+
/**
|
|
1832
|
+
* The dimension of the LoRA update matrices
|
|
1833
|
+
*
|
|
1834
|
+
* Only available for SDXL and Flux LoRA training
|
|
1835
|
+
*
|
|
1836
|
+
* Default value varies depending on the model type:
|
|
1837
|
+
*
|
|
1838
|
+
* - For SDXL: 64
|
|
1839
|
+
* - For Flux: 16
|
|
1840
|
+
*/
|
|
1841
|
+
rank?: number;
|
|
1842
|
+
/**
|
|
1843
|
+
* The prompts to use for each epoch Only available for Flux LoRA training
|
|
1844
|
+
*/
|
|
1845
|
+
samplePrompts?: Array<string>;
|
|
1846
|
+
/**
|
|
1847
|
+
* The sample prompt images (AssetIds) paired with samplePrompts Only available for
|
|
1848
|
+
* Flux LoRA training Must be the same length as samplePrompts
|
|
1849
|
+
*/
|
|
1850
|
+
sampleSourceImages?: Array<string>;
|
|
1851
|
+
/**
|
|
1852
|
+
* Whether to scale the learning rate
|
|
1853
|
+
*
|
|
1854
|
+
* Note: Legacy parameter, will be ignored
|
|
1855
|
+
*
|
|
1856
|
+
* Only available for SD15 and SDXL LoRA training
|
|
1857
|
+
*/
|
|
1858
|
+
scaleLr?: boolean;
|
|
1859
|
+
/**
|
|
1860
|
+
* Used to reproduce previous results. Default: randomly generated number.
|
|
1861
|
+
*
|
|
1862
|
+
* Only available for SD15 and SDXL LoRA training
|
|
1863
|
+
*/
|
|
1864
|
+
seed?: number;
|
|
1865
|
+
/**
|
|
1866
|
+
* Whether to train the text encoder or not
|
|
1867
|
+
*
|
|
1868
|
+
* Example: For 100 steps and a value of 0.2, it means that the text encoder will
|
|
1869
|
+
* be trained for 20 steps and then the UNet for 80 steps
|
|
1870
|
+
*
|
|
1871
|
+
* Note: Legacy parameter, please use `numTextTrainSteps` and `numUNetTrainSteps`
|
|
1872
|
+
*
|
|
1873
|
+
* Only available for SD15 and SDXL LoRA training
|
|
1874
|
+
*/
|
|
1875
|
+
textEncoderTrainingRatio?: number;
|
|
1876
|
+
/**
|
|
1877
|
+
* Validation frequency. Cannot be greater than maxTrainSteps value
|
|
1878
|
+
*
|
|
1879
|
+
* Only available for SD15 and SDXL LoRA training
|
|
1880
|
+
*/
|
|
1881
|
+
validationFrequency?: number;
|
|
1882
|
+
/**
|
|
1883
|
+
* Validation prompt
|
|
1884
|
+
*
|
|
1885
|
+
* Only available for SD15 and SDXL LoRA training
|
|
1886
|
+
*/
|
|
1887
|
+
validationPrompt?: string;
|
|
1888
|
+
/**
|
|
1889
|
+
* The Weights And Bias key to use for logging. The maximum length is 40 characters
|
|
1890
|
+
*/
|
|
1891
|
+
wandbKey?: string;
|
|
1892
|
+
}
|
|
1893
|
+
/**
|
|
1894
|
+
* A thumbnail for your model
|
|
1895
|
+
*/
|
|
1896
|
+
interface Thumbnail {
|
|
1897
|
+
/**
|
|
1898
|
+
* The AssetId of the image used as a thumbnail for your model (example:
|
|
1899
|
+
* "asset_GTrL3mq4SXWyMxkOHRxlpw")
|
|
1900
|
+
*/
|
|
1901
|
+
assetId: string;
|
|
1902
|
+
/**
|
|
1903
|
+
* The url of the image used as a thumbnail for your model
|
|
1904
|
+
*/
|
|
1905
|
+
url: string;
|
|
1906
|
+
}
|
|
1907
|
+
interface TrainingImagePair {
|
|
1908
|
+
/**
|
|
1909
|
+
* The instruction for the image pair, source to target
|
|
1910
|
+
*/
|
|
1911
|
+
instruction?: string;
|
|
1912
|
+
/**
|
|
1913
|
+
* The source asset ID (must be a training asset)
|
|
1914
|
+
*/
|
|
1915
|
+
sourceId?: string;
|
|
1916
|
+
/**
|
|
1917
|
+
* The target asset ID (must be a training asset)
|
|
1918
|
+
*/
|
|
1919
|
+
targetId?: string;
|
|
1920
|
+
}
|
|
1921
|
+
interface TrainingImage {
|
|
1922
|
+
/**
|
|
1923
|
+
* The training image ID (example: "asset_GTrL3mq4SXWyMxkOHRxlpw")
|
|
1924
|
+
*/
|
|
1925
|
+
id: string;
|
|
1926
|
+
/**
|
|
1927
|
+
* Automatic captioning of the image
|
|
1928
|
+
*/
|
|
1929
|
+
automaticCaptioning: string;
|
|
1930
|
+
/**
|
|
1931
|
+
* The training image upload date as an ISO string (example:
|
|
1932
|
+
* "2023-02-03T11:19:41.579Z")
|
|
1933
|
+
*/
|
|
1934
|
+
createdAt: string;
|
|
1935
|
+
/**
|
|
1936
|
+
* Description for the image
|
|
1937
|
+
*/
|
|
1938
|
+
description: string;
|
|
1939
|
+
/**
|
|
1940
|
+
* The URL of the image
|
|
1941
|
+
*/
|
|
1942
|
+
downloadUrl: string;
|
|
1943
|
+
/**
|
|
1944
|
+
* The original file name of the image (example: "my-training-image.jpg")
|
|
1945
|
+
*/
|
|
1946
|
+
name: string;
|
|
1947
|
+
}
|
|
1948
|
+
/**
|
|
1949
|
+
* Additional information about the training progress of the model
|
|
1950
|
+
*/
|
|
1951
|
+
interface TrainingProgress {
|
|
1952
|
+
/**
|
|
1953
|
+
* The stage of the request
|
|
1954
|
+
*/
|
|
1955
|
+
stage: 'pending' | 'queued-for-train' | 'running-train' | 'starting-train';
|
|
1956
|
+
/**
|
|
1957
|
+
* Timestamp in milliseconds of the last time the training progress was updated
|
|
1958
|
+
*/
|
|
1959
|
+
updatedAt: number;
|
|
1960
|
+
/**
|
|
1961
|
+
* Position of the job in the queue (ie. the number of job in the queue before this
|
|
1962
|
+
* one)
|
|
1963
|
+
*/
|
|
1964
|
+
position?: number;
|
|
1965
|
+
/**
|
|
1966
|
+
* The progress of the job
|
|
1967
|
+
*/
|
|
1968
|
+
progress?: number;
|
|
1969
|
+
/**
|
|
1970
|
+
* The remaining time in milliseconds
|
|
1971
|
+
*/
|
|
1972
|
+
remainingTimeMs?: number;
|
|
1973
|
+
/**
|
|
1974
|
+
* The timestamp in millisecond marking the start of the process
|
|
1975
|
+
*/
|
|
1976
|
+
startedAt?: number;
|
|
1977
|
+
}
|
|
1978
|
+
/**
|
|
1979
|
+
* Additional information about the model's training
|
|
1980
|
+
*/
|
|
1981
|
+
interface TrainingStats {
|
|
1982
|
+
/**
|
|
1983
|
+
* The training end time as an ISO date string
|
|
1984
|
+
*/
|
|
1985
|
+
endedAt?: string;
|
|
1986
|
+
/**
|
|
1987
|
+
* The training queued duration in seconds
|
|
1988
|
+
*/
|
|
1989
|
+
queueDuration?: number;
|
|
1990
|
+
/**
|
|
1991
|
+
* The training start time as an ISO date string
|
|
1992
|
+
*/
|
|
1993
|
+
startedAt?: string;
|
|
1994
|
+
/**
|
|
1995
|
+
* The training duration in seconds
|
|
1996
|
+
*/
|
|
1997
|
+
trainDuration?: number;
|
|
1998
|
+
}
|
|
1999
|
+
/**
|
|
2000
|
+
* The UI configuration for the model
|
|
2001
|
+
*/
|
|
2002
|
+
interface UiConfig {
|
|
2003
|
+
/**
|
|
2004
|
+
* Configuration for the input properties
|
|
2005
|
+
*/
|
|
2006
|
+
inputProperties?: {
|
|
2007
|
+
[key: string]: UiConfig.InputProperties;
|
|
2008
|
+
};
|
|
2009
|
+
/**
|
|
2010
|
+
* Configuration for the loras component
|
|
2011
|
+
*/
|
|
2012
|
+
lorasComponent?: UiConfig.LorasComponent;
|
|
2013
|
+
/**
|
|
2014
|
+
* Configuration for the presets
|
|
2015
|
+
*/
|
|
2016
|
+
presets?: Array<UiConfig.Preset>;
|
|
2017
|
+
/**
|
|
2018
|
+
* Configuration for the resolution component
|
|
2019
|
+
*/
|
|
2020
|
+
resolutionComponent?: UiConfig.ResolutionComponent;
|
|
2021
|
+
/**
|
|
2022
|
+
* Configuration for the selects
|
|
2023
|
+
*/
|
|
2024
|
+
selects?: {
|
|
2025
|
+
[key: string]: unknown;
|
|
2026
|
+
};
|
|
2027
|
+
/**
|
|
2028
|
+
* Configuration for the trigger generate button
|
|
2029
|
+
*/
|
|
2030
|
+
triggerGenerate?: UiConfig.TriggerGenerate;
|
|
2031
|
+
}
|
|
2032
|
+
namespace UiConfig {
|
|
2033
|
+
interface InputProperties {
|
|
2034
|
+
collapsed?: boolean;
|
|
2035
|
+
}
|
|
2036
|
+
/**
|
|
2037
|
+
* Configuration for the loras component
|
|
2038
|
+
*/
|
|
2039
|
+
interface LorasComponent {
|
|
2040
|
+
/**
|
|
2041
|
+
* The label of the component
|
|
2042
|
+
*/
|
|
2043
|
+
label: string;
|
|
2044
|
+
/**
|
|
2045
|
+
* The input name of the model (model_array)
|
|
2046
|
+
*/
|
|
2047
|
+
modelInput: string;
|
|
2048
|
+
/**
|
|
2049
|
+
* The input name of the scale (number_array)
|
|
2050
|
+
*/
|
|
2051
|
+
scaleInput: string;
|
|
2052
|
+
/**
|
|
2053
|
+
* The input model id (example: a composition or a single LoRA modelId) If
|
|
2054
|
+
* specified, the model id will be attached to the output asset as a metadata If
|
|
2055
|
+
* the model-decomposer parser is specified on it, modelInput and scaleInput will
|
|
2056
|
+
* be automatically populated
|
|
2057
|
+
*/
|
|
2058
|
+
modelIdInput?: string;
|
|
2059
|
+
}
|
|
2060
|
+
interface Preset {
|
|
2061
|
+
fields: Array<string>;
|
|
2062
|
+
presets: unknown;
|
|
2063
|
+
}
|
|
2064
|
+
/**
|
|
2065
|
+
* Configuration for the resolution component
|
|
2066
|
+
*/
|
|
2067
|
+
interface ResolutionComponent {
|
|
2068
|
+
/**
|
|
2069
|
+
* The input name of the height
|
|
2070
|
+
*/
|
|
2071
|
+
heightInput: string;
|
|
2072
|
+
/**
|
|
2073
|
+
* The label of the component
|
|
2074
|
+
*/
|
|
2075
|
+
label: string;
|
|
2076
|
+
/**
|
|
2077
|
+
* The resolution presets
|
|
2078
|
+
*/
|
|
2079
|
+
presets: Array<ResolutionComponent.Preset>;
|
|
2080
|
+
/**
|
|
2081
|
+
* The input name of the width
|
|
2082
|
+
*/
|
|
2083
|
+
widthInput: string;
|
|
2084
|
+
}
|
|
2085
|
+
namespace ResolutionComponent {
|
|
2086
|
+
interface Preset {
|
|
2087
|
+
height: number;
|
|
2088
|
+
label: string;
|
|
2089
|
+
width: number;
|
|
2090
|
+
}
|
|
2091
|
+
}
|
|
2092
|
+
/**
|
|
2093
|
+
* Configuration for the trigger generate button
|
|
2094
|
+
*/
|
|
2095
|
+
interface TriggerGenerate {
|
|
2096
|
+
label: string;
|
|
2097
|
+
/**
|
|
2098
|
+
* The 'name' of the input where the trigger generate button will be displayed
|
|
2099
|
+
* (after the input). Do not specify both position and after.
|
|
2100
|
+
*/
|
|
2101
|
+
after?: string;
|
|
2102
|
+
/**
|
|
2103
|
+
* The position of the trigger generate button. If position specified, the button
|
|
2104
|
+
* will be displayed at the specified position. Do not specify both position and
|
|
2105
|
+
* after.
|
|
2106
|
+
*/
|
|
2107
|
+
position?: 'bottom' | 'top';
|
|
2108
|
+
}
|
|
2109
|
+
}
|
|
2110
|
+
}
|
|
2111
|
+
}
|
|
2112
|
+
export interface TrainActionParams {
|
|
2113
|
+
/**
|
|
2114
|
+
* The action to perform on the model training
|
|
2115
|
+
*/
|
|
2116
|
+
action: 'cancel';
|
|
2117
|
+
}
|
|
2118
|
+
export interface TrainTriggerParams {
|
|
2119
|
+
/**
|
|
2120
|
+
* Query param
|
|
2121
|
+
*/
|
|
2122
|
+
dryRun?: string;
|
|
2123
|
+
/**
|
|
2124
|
+
* Query param: If set to true, returns the original asset without transformation
|
|
2125
|
+
*/
|
|
2126
|
+
originalAssets?: string;
|
|
2127
|
+
/**
|
|
2128
|
+
* Body param
|
|
2129
|
+
*/
|
|
2130
|
+
parameters?: TrainTriggerParams.Parameters;
|
|
2131
|
+
}
|
|
2132
|
+
export declare namespace TrainTriggerParams {
|
|
2133
|
+
interface Parameters {
|
|
2134
|
+
/**
|
|
2135
|
+
* The batch size Less steps, and will increase the learning rate
|
|
2136
|
+
*
|
|
2137
|
+
* Only available for Flux LoRA training
|
|
2138
|
+
*/
|
|
2139
|
+
batchSize?: number;
|
|
2140
|
+
/**
|
|
2141
|
+
* The prompt to specify images in the same class as provided instance images
|
|
2142
|
+
*
|
|
2143
|
+
* Only available for SD15 training
|
|
2144
|
+
*/
|
|
2145
|
+
classPrompt?: string;
|
|
2146
|
+
/**
|
|
2147
|
+
* The prompt with identifier specifying the instance (or subject) of the class
|
|
2148
|
+
* (example: "a daiton dog")
|
|
2149
|
+
*
|
|
2150
|
+
* Default value varies depending on the model type:
|
|
2151
|
+
*
|
|
2152
|
+
* - For SD1.5: "daiton" if no class is associated with the model
|
|
2153
|
+
* - For SDXL: "daiton"
|
|
2154
|
+
* - For Flux: ""
|
|
2155
|
+
*/
|
|
2156
|
+
conceptPrompt?: string;
|
|
2157
|
+
/**
|
|
2158
|
+
* Initial learning rate (after the potential warmup period)
|
|
2159
|
+
*
|
|
2160
|
+
* Default value varies depending on the model type:
|
|
2161
|
+
*
|
|
2162
|
+
* - For SD1.5 and SDXL: 0.000005
|
|
2163
|
+
* - For Flux: 0.0001
|
|
2164
|
+
*/
|
|
2165
|
+
learningRate?: number;
|
|
2166
|
+
/**
|
|
2167
|
+
* Initial learning rate (after the potential warmup period) for the text encoder
|
|
2168
|
+
*
|
|
2169
|
+
* Maximum [Flux LoRA: 0.001] Default [SDXL: 0.00005 | Flux LoRA: 0.00001] Minimum
|
|
2170
|
+
* [SDXL: 0 | Flux LoRA: 0.000001]
|
|
2171
|
+
*/
|
|
2172
|
+
learningRateTextEncoder?: number;
|
|
2173
|
+
/**
|
|
2174
|
+
* Initial learning rate (after the potential warmup period) for the UNet
|
|
2175
|
+
*
|
|
2176
|
+
* Only available for SDXL LoRA training
|
|
2177
|
+
*/
|
|
2178
|
+
learningRateUnet?: number;
|
|
2179
|
+
/**
|
|
2180
|
+
* The scheduler type to use (default: "constant")
|
|
2181
|
+
*
|
|
2182
|
+
* Only available for SD15 and SDXL LoRA training
|
|
2183
|
+
*/
|
|
2184
|
+
lrScheduler?: 'constant' | 'constant-with-warmup' | 'cosine' | 'cosine-with-restarts' | 'linear' | 'polynomial';
|
|
2185
|
+
/**
|
|
2186
|
+
* Maximum number of training steps to execute (default: varies depending on the
|
|
2187
|
+
* model type)
|
|
2188
|
+
*
|
|
2189
|
+
* For SDXL LoRA training, please use `numTextTrainSteps` and `numUNetTrainSteps`
|
|
2190
|
+
* instead
|
|
2191
|
+
*
|
|
2192
|
+
* Default value varies depending on the model type:
|
|
2193
|
+
*
|
|
2194
|
+
* - For SD1.5: round((number of training images \* 225) / 3)
|
|
2195
|
+
* - For SDXL: number of training images \* 175
|
|
2196
|
+
* - For Flux: number of training images \* 100
|
|
2197
|
+
*
|
|
2198
|
+
* Maximum value varies depending on the model type:
|
|
2199
|
+
*
|
|
2200
|
+
* - For SD1.5 and SDXL: [0, 40000]
|
|
2201
|
+
* - For Flux: [0, 10000]
|
|
2202
|
+
*/
|
|
2203
|
+
maxTrainSteps?: number;
|
|
2204
|
+
/**
|
|
2205
|
+
* The number of epochs to train for
|
|
2206
|
+
*
|
|
2207
|
+
* Only available for Flux LoRA training
|
|
2208
|
+
*/
|
|
2209
|
+
nbEpochs?: number;
|
|
2210
|
+
/**
|
|
2211
|
+
* The number of times to repeat the training
|
|
2212
|
+
*
|
|
2213
|
+
* Only available for Flux LoRA training
|
|
2214
|
+
*/
|
|
2215
|
+
nbRepeats?: number;
|
|
2216
|
+
/**
|
|
2217
|
+
* The number of training steps for the text encoder
|
|
2218
|
+
*
|
|
2219
|
+
* Only available for SDXL LoRA training
|
|
2220
|
+
*/
|
|
2221
|
+
numTextTrainSteps?: number;
|
|
2222
|
+
/**
|
|
2223
|
+
* The number of training steps for the UNet
|
|
2224
|
+
*
|
|
2225
|
+
* Only available for SDXL LoRA training
|
|
2226
|
+
*/
|
|
2227
|
+
numUNetTrainSteps?: number;
|
|
2228
|
+
/**
|
|
2229
|
+
* Optimize the model training task for a specific type of input images. The
|
|
2230
|
+
* available values are:
|
|
2231
|
+
*
|
|
2232
|
+
* - "likeness": optimize training for likeness or portrait (targets specific
|
|
2233
|
+
* transformer blocks)
|
|
2234
|
+
* - "all": train all transformer blocks
|
|
2235
|
+
* - "none": train no specific transformer blocks
|
|
2236
|
+
*
|
|
2237
|
+
* This parameter controls which double and single transformer blocks are trained
|
|
2238
|
+
* during the LoRA training process.
|
|
2239
|
+
*
|
|
2240
|
+
* Only available for Flux LoRA training
|
|
2241
|
+
*/
|
|
2242
|
+
optimizeFor?: 'likeness';
|
|
2243
|
+
/**
|
|
2244
|
+
* The weight of prior preservation loss
|
|
2245
|
+
*
|
|
2246
|
+
* Only available for SD15 and SDXL LoRA training
|
|
2247
|
+
*/
|
|
2248
|
+
priorLossWeight?: number;
|
|
2249
|
+
/**
|
|
2250
|
+
* Whether to random crop or center crop images before resizing to the working
|
|
2251
|
+
* resolution
|
|
2252
|
+
*
|
|
2253
|
+
* Only available for SD15 and SDXL LoRA training
|
|
2254
|
+
*/
|
|
2255
|
+
randomCrop?: boolean;
|
|
2256
|
+
/**
|
|
2257
|
+
* Ratio of random crops
|
|
2258
|
+
*
|
|
2259
|
+
* Only available for SD15 and SDXL LoRA training
|
|
2260
|
+
*/
|
|
2261
|
+
randomCropRatio?: number;
|
|
2262
|
+
/**
|
|
2263
|
+
* Scale of random crops
|
|
2264
|
+
*
|
|
2265
|
+
* Only available for SD15 and SDXL LoRA training
|
|
2266
|
+
*/
|
|
2267
|
+
randomCropScale?: number;
|
|
2268
|
+
/**
|
|
2269
|
+
* The dimension of the LoRA update matrices
|
|
2270
|
+
*
|
|
2271
|
+
* Only available for SDXL and Flux LoRA training
|
|
2272
|
+
*
|
|
2273
|
+
* Default value varies depending on the model type:
|
|
2274
|
+
*
|
|
2275
|
+
* - For SDXL: 64
|
|
2276
|
+
* - For Flux: 16
|
|
2277
|
+
*/
|
|
2278
|
+
rank?: number;
|
|
2279
|
+
/**
|
|
2280
|
+
* The prompts to use for each epoch Only available for Flux LoRA training
|
|
2281
|
+
*/
|
|
2282
|
+
samplePrompts?: Array<string>;
|
|
2283
|
+
/**
|
|
2284
|
+
* The sample prompt images (AssetIds) paired with samplePrompts Only available for
|
|
2285
|
+
* Flux LoRA training Must be the same length as samplePrompts
|
|
2286
|
+
*/
|
|
2287
|
+
sampleSourceImages?: Array<string>;
|
|
2288
|
+
/**
|
|
2289
|
+
* Whether to scale the learning rate
|
|
2290
|
+
*
|
|
2291
|
+
* Note: Legacy parameter, will be ignored
|
|
2292
|
+
*
|
|
2293
|
+
* Only available for SD15 and SDXL LoRA training
|
|
2294
|
+
*/
|
|
2295
|
+
scaleLr?: boolean;
|
|
2296
|
+
/**
|
|
2297
|
+
* Used to reproduce previous results. Default: randomly generated number.
|
|
2298
|
+
*
|
|
2299
|
+
* Only available for SD15 and SDXL LoRA training
|
|
2300
|
+
*/
|
|
2301
|
+
seed?: number;
|
|
2302
|
+
/**
|
|
2303
|
+
* Whether to train the text encoder or not
|
|
2304
|
+
*
|
|
2305
|
+
* Example: For 100 steps and a value of 0.2, it means that the text encoder will
|
|
2306
|
+
* be trained for 20 steps and then the UNet for 80 steps
|
|
2307
|
+
*
|
|
2308
|
+
* Note: Legacy parameter, please use `numTextTrainSteps` and `numUNetTrainSteps`
|
|
2309
|
+
*
|
|
2310
|
+
* Only available for SD15 and SDXL LoRA training
|
|
2311
|
+
*/
|
|
2312
|
+
textEncoderTrainingRatio?: number;
|
|
2313
|
+
/**
|
|
2314
|
+
* Validation frequency. Cannot be greater than maxTrainSteps value
|
|
2315
|
+
*
|
|
2316
|
+
* Only available for SD15 and SDXL LoRA training
|
|
2317
|
+
*/
|
|
2318
|
+
validationFrequency?: number;
|
|
2319
|
+
/**
|
|
2320
|
+
* Validation prompt
|
|
2321
|
+
*
|
|
2322
|
+
* Only available for SD15 and SDXL LoRA training
|
|
2323
|
+
*/
|
|
2324
|
+
validationPrompt?: string;
|
|
2325
|
+
/**
|
|
2326
|
+
* The Weights And Bias key to use for logging. The maximum length is 40 characters
|
|
2327
|
+
*/
|
|
2328
|
+
wandbKey?: string;
|
|
2329
|
+
}
|
|
2330
|
+
}
|
|
2331
|
+
export declare namespace Train {
|
|
2332
|
+
export { type TrainActionResponse as TrainActionResponse, type TrainTriggerResponse as TrainTriggerResponse, type TrainActionParams as TrainActionParams, type TrainTriggerParams as TrainTriggerParams, };
|
|
2333
|
+
}
|
|
2334
|
+
//# sourceMappingURL=train.d.ts.map
|