import { APIResource } from "../../core/resource.js"; import * as DescriptionAPI from "./description.js"; import { Description, DescriptionRetrieveParams, DescriptionRetrieveResponse, DescriptionUpdateParams, DescriptionUpdateResponse } from "./description.js"; import * as ExamplesAPI from "./examples.js"; import { ExampleListParams, ExampleListResponse, ExampleUpdateParams, ExampleUpdateResponse, Examples } from "./examples.js"; import * as TrainAPI from "./train.js"; import { Train, TrainActionParams, TrainActionResponse, TrainTriggerParams, TrainTriggerResponse } from "./train.js"; import * as TrainingImagesAPI from "./training-images.js"; import { TrainingImageAddParams, TrainingImageAddResponse, TrainingImageDeleteParams, TrainingImageDeleteResponse, TrainingImageReplacePairsParams, TrainingImageReplacePairsResponse, TrainingImageReplaceParams, TrainingImageReplaceResponse, TrainingImages } from "./training-images.js"; import { APIPromise } from "../../core/api-promise.js"; import { ModelsCursor, type ModelsCursorParams, PagePromise } from "../../core/pagination.js"; import { RequestOptions } from "../../internal/request-options.js"; export declare class Models extends APIResource { description: DescriptionAPI.Description; examples: ExamplesAPI.Examples; train: TrainAPI.Train; trainingImages: TrainingImagesAPI.TrainingImages; /** * Create a new model */ create(params: ModelCreateParams, options?: RequestOptions): APIPromise; /** * Get the details of the given `modelId`, including its training status and * training progress if available. Supports both public access (via the * `Authorization` header set to `public-auth-token`) and authenticated user access * (including API keys). */ retrieve(modelID: string, query?: ModelRetrieveParams | null | undefined, options?: RequestOptions): APIPromise; /** * Update the given `modelId` */ update(modelID: string, params: ModelUpdateParams, options?: RequestOptions): APIPromise; /** * List all models. Supports both public access (via the `Authorization` header set * to `public-auth-token`) and authenticated user access (including API keys). */ list(query?: ModelListParams | null | undefined, options?: RequestOptions): PagePromise; /** * Delete a model */ delete(modelID: string, params?: ModelDeleteParams | null | undefined, options?: RequestOptions): APIPromise; /** * Copy the given `modelId` to a new model, thumbnail, presets, and all of its * training images and pairs if any */ copy(modelID: string, params: ModelCopyParams, options?: RequestOptions): APIPromise; /** * Delete an image */ deleteImages(modelID: string, params: ModelDeleteImagesParams, options?: RequestOptions): APIPromise; /** * Request a link to download the given `modelId` */ download(modelID: string, params: ModelDownloadParams, options?: RequestOptions): APIPromise; /** * Get multiple models by their `modelIds` */ getBulk(params: ModelGetBulkParams, options?: RequestOptions): APIPromise; /** * Transfer (with a copy or a full ownership change) a model to a new owner, * including all of its training images */ transfer(modelID: string, params: ModelTransferParams, options?: RequestOptions): APIPromise; /** * Add/delete tags for the given `modelId` */ updateTags(modelID: string, params: ModelUpdateTagsParams, options?: RequestOptions): APIPromise; } export type ModelListResponsesModelsCursor = ModelsCursor; export interface ModelCreateResponse { model: ModelCreateResponse.Model; } export declare namespace ModelCreateResponse { interface Model { /** * The model ID (example: "model_eyVcnFJcR92BxBkz7N6g5w") */ id: string; /** * List of model capabilities (example: ["txt2img", "img2img", * "txt2img_ip_adapter", ...]) */ capabilities: Array<'3d23d' | 'audio2audio' | 'audio2txt' | 'audio2video' | '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' | 'video23d' | 'video2audio' | 'video2img' | 'video2video'>; /** * A list of CollectionId this model belongs to */ collectionIds: Array; /** * The model creation date as an ISO string (example: "2023-02-03T11:19:41.579Z") */ createdAt: string; /** * Whether the model is a custom model and can be used only with POST * /generate/custom/{modelId} endpoint */ custom: boolean; /** * List of all example asset IDs setup by the model owner */ exampleAssetIds: Array; /** * The privacy of the model (default: private) */ privacy: 'private' | 'public' | 'unlisted'; /** * The source of the model */ source: 'civitai' | 'huggingface' | 'other' | 'scenario'; /** * The model status */ status: 'copying' | 'failed' | 'new' | 'trained' | 'training' | 'training-canceled'; /** * The associated tags (example: ["sci-fi", "landscape"]) */ tags: Array; /** * The total number of training images */ trainingImagesNumber: number; /** * The model type (example: "flux.1-lora") */ type: 'custom' | 'elevenlabs-voice' | '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' | 'flux.2-dev-edit-lora' | 'flux.2-dev-lora' | 'flux.2-klein-4b-edit-lora' | 'flux.2-klein-4b-lora' | 'flux.2-klein-9b-edit-lora' | 'flux.2-klein-9b-lora' | 'flux.2-klein-base-4b-edit-lora' | 'flux.2-klein-base-4b-lora' | 'flux.2-klein-base-9b-edit-lora' | 'flux.2-klein-base-9b-lora' | 'flux1.1-pro' | 'gpt-image-1' | 'qwen-image-2512-lora' | 'qwen-image-edit-2509-lora' | 'qwen-image-edit-2511-lora' | 'qwen-image-edit-lora' | 'qwen-image-lora' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora'; /** * The model last update date as an ISO string (example: * "2023-02-03T11:19:41.579Z") */ updatedAt: string; /** * The access restrictions of the model 0: Free plan 25: Creator plan 50: Pro plan * 75: Team plan 100: Enterprise plan */ accessRestrictions?: 0 | 100 | 25 | 50 | 75; /** * The author user ID (example: "user_VFhihHKMRZyDDnZAJwLb2Q") */ authorId?: string; /** * The class of the model */ class?: Model.Class; /** * List of base model IDs compliant with the model (example: ["flux.1-dev", * "flux.1-schnell"]) This attribute is mainly used for Flux LoRA models */ compliantModelIds?: Array; /** * The concepts is required for the type model: composition */ concepts?: Array; /** * When true, credits spent on a generation with this model are not automatically * refunded if the generation fails. Absent or false means failed generations are * refunded as usual. */ disableRefund?: boolean; /** * The epoch of the model. Only available for Flux Lora Trained models. If not set, * uses the final model epoch (latest) */ epoch?: string; /** * The epochs of the model. Only available for Flux Lora Trained models. */ epochs?: Array; /** * The inputs of the model. Only used for custom models. To retrieve this list, get * it by modelId with GET /models/{modelId} */ inputs?: Array; /** * The model keyword, this is a legacy parameter, please use conceptPrompt in * parameters */ modelKeyword?: string; /** * The model name (example: "Cinematic Realism") */ name?: string; /** * Fine-tune the model's inferences with negative prompt embedding */ negativePromptEmbedding?: string; /** * The owner ID (example: "team_VFhihHKMRZyDDnZAJwLb2Q") */ ownerId?: string; /** * The parameters of the model */ parameters?: Model.Parameters; /** * The id of the parent model */ parentModelId?: string; /** * Aggregated performance stats */ performanceStats?: Model.PerformanceStats; /** * Fine-tune the model's inferences with prompt embedding */ promptEmbedding?: string; /** * The model short description (example: "This model generates highly detailed * cinematic scenes.") */ shortDescription?: string; /** * The date when the model will be soft deleted (only for Free plan) */ softDeletionOn?: string; /** * A thumbnail for your model */ thumbnail?: Model.Thumbnail; /** * Array of training image pairs */ trainingImagePairs?: Array; /** * The URLs of the first 3 training images of the model. To retrieve the full set * of images, get it by modelId */ trainingImages?: Array; /** * Additional information about the training progress of the model */ trainingProgress?: Model.TrainingProgress; /** * Additional information about the model's training */ trainingStats?: Model.TrainingStats; /** * The UI configuration for the model */ uiConfig?: Model.UiConfig; /** * (Deprecated) The user ID (example: "user_VFhihHKMRZyDDnZAJwLb2Q") */ userId?: string; } namespace Model { /** * The class of the model */ interface Class { /** * The category slug of the class (example: "art-style") */ category: string; /** * The concept prompt of the class (example: "a sks character design") */ conceptPrompt: string; /** * The model ID of the class. Only available for legacy models. */ modelId: string; /** * The class name (example: "Character Design") */ name: string; /** * The class prompt (example: "a character design") */ prompt: string; /** * The class slug (example: "art-style-character-design") */ slug: string; /** * The class status (only published classes are listed, but unpublished classes can * still appear in existing models) */ status: 'published' | 'unpublished'; /** * Some example images URLs to showcase the class */ thumbnails: Array; } interface Concept { /** * The model ID (example: "model_eyVcnFJcR92BxBkz7N6g5w") */ modelId: string; /** * The scale of the model (example: 1.0) For Flux Kontext Prompt Editing, the scale * is between 0 and 2. */ scale: number; /** * The epoch of the model (example: "000001") Only available for Flux Lora Trained * models */ modelEpoch?: string; } interface Epoch { /** * The epoch hash to identify the epoch */ epoch: string; /** * The assets of the epoch if sample prompts as been supplied during training */ assets?: Array; } namespace Epoch { interface Asset { /** * The AssetId of the image during training (example: * "asset_GTrL3mq4SXWyMxkOHRxlpw") */ assetId: string; /** * The url of the asset */ url: string; } } /** * Defines the input parameters for a model. Use this to understand the available * input parameters for a given `modelId` when calling * `POST /generate/custom/{modelId}`. See {@link * https://docs.scenario.com/get-started/generation/video-generation} for examples. */ interface Input { /** * The name that must be user to call the model through the API */ name: string; /** * The data type of the input */ type: 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array'; /** * The allowed values for the input. For \`string\` or \`number\` types, creates a * single-select dropdown. For \`string_array\` type, creates a multi-select * dropdown. */ allowedValues?: Array; /** * Specifies the background behavior for the input. Only available for \`file\` and * \`file_array\` input types with kind \`image\`. */ backgroundBehavior?: 'opaque' | 'transparent'; /** * Whether the input is a color or not. Only available for \`string\` input type. */ color?: boolean; /** * Whether this input affects the model's cost calculation */ costImpact?: boolean; /** * The default value for the input */ default?: unknown; /** * Help text displayed in the UI to provide additional information about the input */ description?: string; /** * Used to visually group inputs together in the UI. Inputs with the same group * value appear consecutively in the UI. */ group?: string; /** * Hint text displayed in the UI as a tooltip to guide the user */ hint?: string; /** * The list of inputs which form an object within a container array. All inputs are * the same as the current object. This is only available for type inputs_array * inputs. */ inputs?: Array<{ [key: string]: unknown; }>; /** * The asset kind of the input. Only taken into account for \`file\` and * \`file_array\` input types. If model provides multiple kinds, the input will be * not able to create the asset on the flight on API side with dataurl without * data:kind, prefix */ kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'text' | 'video'; /** * The label displayed in the UI for this input */ label?: string; /** * The name of the file input field to use as the mask source */ maskFrom?: string; /** * The maximum allowed value. Only available for \`number\` and \`array\` input * types. */ max?: number; /** * The maximum allowed media duration in seconds. Only applies to \`file\` and * \`file_array\` input types for video and audio assets. Validated against * \`asset.properties.duration\` at job creation time. */ maxDuration?: number; /** * The maximum allowed length for \`string\` inputs. Also applies to each item in * \`string_array\`. */ maxLength?: number; /** * The maximum allowed file size in bytes. Only applies to \`file\` and * \`file_array\` input types. Validated against \`asset.properties.size\` at job * creation time. */ maxSize?: number; /** * The minimum allowed value. Only available for \`number\` and array input types. */ min?: number; /** * The minimum allowed length for string inputs. Also applies to each item in * \`string_array\`. */ minLength?: number; /** * The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only * available for \`model_array\` input type. */ modelTypes?: Array<'custom' | 'elevenlabs-voice' | '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' | 'flux.2-dev-edit-lora' | 'flux.2-dev-lora' | 'flux.2-klein-4b-edit-lora' | 'flux.2-klein-4b-lora' | 'flux.2-klein-9b-edit-lora' | 'flux.2-klein-9b-lora' | 'flux.2-klein-base-4b-edit-lora' | 'flux.2-klein-base-4b-lora' | 'flux.2-klein-base-9b-edit-lora' | 'flux.2-klein-base-9b-lora' | 'flux1.1-pro' | 'gpt-image-1' | 'qwen-image-2512-lora' | 'qwen-image-edit-2509-lora' | 'qwen-image-edit-2511-lora' | 'qwen-image-edit-lora' | 'qwen-image-lora' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora'>; /** * Whether this input represents a parent asset to assign to the produced assets. * Only available for \`file\` and \`file_array\` input types. * * For \`file_array\`, the parent asset is the first item in the array. */ parent?: boolean; /** * Placeholder text for the input. Only available for 'string' input type. */ placeholder?: string; /** * Whether the input is a prompt. When true, displays as a text area with prompt * spark feature. Only available for \`string\` input type. */ prompt?: boolean; /** * Whether the input is used with prompt spark. Only available for \`string\` input * type. */ promptSpark?: boolean; /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ required?: Input.Required; /** * The step increment for numeric inputs. Only available for \`number\` input type. */ step?: number; } namespace Input { /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ interface Required { /** * Whether the input is always required */ always?: boolean; /** * Makes this input required when another input has a specific value: * * - Key: name of the input to check * - Value: operation and allowed values that trigger the requirement */ conditionalValues?: unknown; /** * Makes this input required when another input is defined: * * - Key: name of the input that must be defined * - Value: message to display when this input is required */ ifDefined?: unknown; /** * Makes this input required when another input is not defined: * * - Key: name of the input that must be undefined * - Value: message to display when this input is required */ ifNotDefined?: unknown; } } /** * The parameters of the model */ interface Parameters { /** * Age group of the voice (for professional cloning) * * Only available for ElevenLabs voice training */ age?: string; /** * The batch size Less steps, and will increase the learning rate * * Only available for Flux LoRA training */ batchSize?: number; /** * The prompt to specify images in the same class as provided instance images * * Deprecated legacy training parameter. */ classPrompt?: string; /** * Type of voice cloning: "instant" (fast) or "professional" (higher quality, * requires captcha) * * Only available for ElevenLabs voice training */ cloneType?: string; /** * The prompt with identifier specifying the instance (or subject) of the class * (example: "a daiton dog") * * Default value varies depending on the model type. For Flux LoRA, the default is * an empty string. */ conceptPrompt?: string; /** * Gender of the voice (for professional cloning) * * Only available for ElevenLabs voice training */ gender?: string; /** * Language of the audio samples (ISO 639-1 code) * * Only available for ElevenLabs voice training */ language?: string; /** * Initial learning rate (after the potential warmup period) * * Default value varies depending on the model type. For Flux LoRA, the default is * 0.0001. */ learningRate?: number; /** * Initial learning rate (after the potential warmup period) for the text encoder * * Maximum [Flux LoRA: 0.001] Default [Flux LoRA: 0.00001] Minimum [Flux LoRA: * 0.000001] */ learningRateTextEncoder?: number; /** * Initial learning rate (after the potential warmup period) for the UNet * * Deprecated legacy training parameter. */ learningRateUnet?: number; /** * The scheduler type to use (default: "constant") * * Deprecated legacy training parameter. */ lrScheduler?: 'constant' | 'constant-with-warmup' | 'cosine' | 'cosine-with-restarts' | 'linear' | 'polynomial'; /** * Maximum number of training steps to execute (default: varies depending on the * model type) * * Default value varies depending on the model type: * * - For Flux: number of training images \* 100 * * Maximum value varies depending on the model type: * * - For Flux: [0, 10000] */ maxTrainSteps?: number; /** * The number of epochs to train for * * Only available for Flux LoRA training */ nbEpochs?: number; /** * The number of times to repeat the training * * Only available for Flux LoRA training */ nbRepeats?: number; /** * The number of training steps for the text encoder * * Deprecated legacy training parameter. */ numTextTrainSteps?: number; /** * The number of training steps for the UNet * * Deprecated legacy training parameter. */ numUNetTrainSteps?: number; /** * Optimize the model training task for a specific type of input images. The * available values are: * * - "likeness": optimize training for likeness or portrait (targets specific * transformer blocks) * - "all": train all transformer blocks * - "none": train no specific transformer blocks * * This parameter controls which double and single transformer blocks are trained * during the LoRA training process. * * Only available for Flux LoRA training */ optimizeFor?: 'likeness'; /** * The weight of prior preservation loss * * Deprecated legacy training parameter. */ priorLossWeight?: number; /** * Whether to random crop or center crop images before resizing to the working * resolution * * Deprecated legacy training parameter. */ randomCrop?: boolean; /** * Ratio of random crops * * Deprecated legacy training parameter. */ randomCropRatio?: number; /** * Scale of random crops * * Deprecated legacy training parameter. */ randomCropScale?: number; /** * The dimension of the LoRA update matrices * * Only available for Flux LoRA and Musubi training * * Default value varies depending on the model type: * * - For Flux: 16 * - For Musubi: 64 * * Each trainer enforces its own tighter limit (Flux LoRA: [2; 64], Musubi: [2; * 128]) */ rank?: number; /** * Whether to remove background noise from audio samples before cloning. When * enabled, each sample must be at least 5 seconds long. * * Only available for ElevenLabs voice training */ removeBackgroundNoise?: boolean; /** * The prompts to use for each epoch Only available for Flux LoRA training */ samplePrompts?: Array; /** * The sample prompt images (AssetIds) paired with samplePrompts Only available for * Flux LoRA training Must be the same length as samplePrompts */ sampleSourceImages?: Array; /** * Whether to scale the learning rate * * Note: Legacy parameter, will be ignored * * Deprecated legacy training parameter. */ scaleLr?: boolean; /** * Used to reproduce previous results. Default: randomly generated number. * * Deprecated legacy training parameter. */ seed?: number; /** * Whether to train the text encoder or not * * Example: For 100 steps and a value of 0.2, it means that the text encoder will * be trained for 20 steps and then the UNet for 80 steps * * Note: Legacy parameter, please use `numTextTrainSteps` and `numUNetTrainSteps` * * Deprecated legacy training parameter. */ textEncoderTrainingRatio?: number; /** * Validation frequency. Cannot be greater than maxTrainSteps value * * Deprecated legacy training parameter. */ validationFrequency?: number; /** * Validation prompt * * Deprecated legacy training parameter. */ validationPrompt?: string; /** * Description of the voice characteristics * * Only available for ElevenLabs voice training */ voiceDescription?: string; /** * The Weights And Bias key to use for logging. The maximum length is 40 characters */ wandbKey?: string; } /** * Aggregated performance stats */ interface PerformanceStats { /** * Performance metrics per variant */ variants: Array; /** * Default variant key for quick model comparison */ default?: string; } namespace PerformanceStats { /** * Performance stats for a model variant */ interface Variant { /** * The generation capability (example: "txt2img", "img2video", "txt2audio") */ capability: string; /** * When these stats were last computed (ISO date) */ computedAt: string; /** * Unique variant identifier (example: "txt2img:1K", "img2video:2K", "txt2audio") */ variantKey: string; /** * External quality score from arena.ai leaderboard */ arenaScore?: Variant.ArenaScore; /** * Maximum cost per output asset (CU) */ costPerAssetMaxCU?: number; /** * Minimum cost per output asset (CU) */ costPerAssetMinCU?: number; /** * Median cost per output asset (CU) */ costPerAssetP50CU?: number; /** * Inference latency P50 per output asset (seconds) */ inferenceLatencyP50Sec?: number; /** * Inference latency P75 per output asset (seconds) */ inferenceLatencyP75Sec?: number; /** * The resolution bucket (example: "0.5K", "1K", "2K", "4K") */ resolution?: string; /** * Total latency P50 per output asset, including queue time (seconds) */ totalLatencyP50Sec?: number; /** * Total latency P75 per output asset, including queue time (seconds) */ totalLatencyP75Sec?: number; } namespace Variant { /** * External quality score from arena.ai leaderboard */ interface ArenaScore { /** * Arena category (example: "text_to_image", "image_to_video") */ arenaCategory: string; /** * Model name on arena.ai */ arenaModelName: string; /** * When this score was last fetched (ISO date) */ fetchedAt: string; /** * Rank in the arena category */ rank: number; /** * ELO rating */ rating: number; /** * ELO rating confidence interval lower bound */ ratingLower: number; /** * ELO rating confidence interval upper bound */ ratingUpper: number; /** * Number of human votes */ votes: number; } } } /** * A thumbnail for your model */ interface Thumbnail { /** * The AssetId of the image used as a thumbnail for your model (example: * "asset_GTrL3mq4SXWyMxkOHRxlpw") */ assetId: string; /** * The url of the image used as a thumbnail for your model */ url: string; } interface TrainingImagePair { /** * The instruction for the image pair, source to target */ instruction?: string; /** * The source asset ID (must be a training asset) */ sourceId?: string; /** * The target asset ID (must be a training asset) */ targetId?: string; } interface TrainingImage { /** * The training image ID (example: "asset_GTrL3mq4SXWyMxkOHRxlpw") */ id: string; /** * Automatic captioning of the image */ automaticCaptioning: string; /** * The training image upload date as an ISO string (example: * "2023-02-03T11:19:41.579Z") */ createdAt: string; /** * Description for the image */ description: string; /** * The URL of the image */ downloadUrl: string; /** * The original file name of the image (example: "my-training-image.jpg") */ name: string; } /** * Additional information about the training progress of the model */ interface TrainingProgress { /** * The stage of the request */ stage: 'pending' | 'pending-captcha' | 'queued-for-train' | 'ready-for-captcha' | 'running-train' | 'starting-train'; /** * Timestamp in milliseconds of the last time the training progress was updated */ updatedAt: number; /** * Signed URL of the captcha image to read aloud during PVC voice cloning. Only * present when stage === 'pending-captcha'. Overwritten on each retry. */ captchaImageUrl?: string; /** * Position of the job in the queue (ie. the number of job in the queue before this * one) */ position?: number; /** * The progress of the job */ progress?: number; /** * The remaining time in milliseconds */ remainingTimeMs?: number; /** * Last recoverable failure message during PVC. Present when the model has bounced * back to stage === 'ready-for-captcha' after a step 2 or step 3 failure (e.g. * captcha rejected, time limit exceeded). Surface above the retry button so the * user understands why they're back here. */ retryableError?: string; /** * Number of consecutive PVC step 2 / step 3 failures on this voice model. The * model is marked Failed when this reaches the platform's max retries. */ retryCount?: number; /** * The timestamp in millisecond marking the start of the process */ startedAt?: number; } /** * Additional information about the model's training */ interface TrainingStats { /** * The training end time as an ISO date string */ endedAt?: string; /** * The training queued duration in seconds */ queueDuration?: number; /** * The training start time as an ISO date string */ startedAt?: string; /** * The training duration in seconds */ trainDuration?: number; } /** * The UI configuration for the model */ interface UiConfig { /** * Configuration for the input properties */ inputProperties?: { [key: string]: UiConfig.InputProperties; }; /** * Configuration for the loras component */ lorasComponent?: UiConfig.LorasComponent; /** * Configuration for the presets */ presets?: Array; /** * Configuration for the resolution component */ resolutionComponent?: UiConfig.ResolutionComponent; /** * Configuration for the selects */ selects?: { [key: string]: unknown; }; /** * Configuration for the trigger generate button */ triggerGenerate?: UiConfig.TriggerGenerate; } namespace UiConfig { interface InputProperties { collapsed?: boolean; } /** * Configuration for the loras component */ interface LorasComponent { /** * The label of the component */ label: string; /** * The input name of the model (model_array) */ modelInput: string; /** * The input name of the scale (number_array) */ scaleInput: string; /** * The input model id (example: a composition or a single LoRA modelId) If * specified, the model id will be attached to the output asset as a metadata If * the model-decomposer parser is specified on it, modelInput and scaleInput will * be automatically populated */ modelIdInput?: string; } interface Preset { fields: Array; presets: unknown; } /** * Configuration for the resolution component */ interface ResolutionComponent { /** * The input name of the height */ heightInput: string; /** * The label of the component */ label: string; /** * The resolution presets */ presets: Array; /** * The input name of the width */ widthInput: string; } namespace ResolutionComponent { interface Preset { height: number; label: string; width: number; } } /** * Configuration for the trigger generate button */ interface TriggerGenerate { label: string; /** * The 'name' of the input where the trigger generate button will be displayed * (after the input). Do not specify both position and after. */ after?: string; /** * The position of the trigger generate button. If position specified, the button * will be displayed at the specified position. Do not specify both position and * after. */ position?: 'bottom' | 'top'; } } } } export interface ModelRetrieveResponse { model: ModelRetrieveResponse.Model; } export declare namespace ModelRetrieveResponse { interface Model { /** * The model ID (example: "model_eyVcnFJcR92BxBkz7N6g5w") */ id: string; /** * List of model capabilities (example: ["txt2img", "img2img", * "txt2img_ip_adapter", ...]) */ capabilities: Array<'3d23d' | 'audio2audio' | 'audio2txt' | 'audio2video' | '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' | 'video23d' | 'video2audio' | 'video2img' | 'video2video'>; /** * A list of CollectionId this model belongs to */ collectionIds: Array; /** * The model creation date as an ISO string (example: "2023-02-03T11:19:41.579Z") */ createdAt: string; /** * Whether the model is a custom model and can be used only with POST * /generate/custom/{modelId} endpoint */ custom: boolean; /** * List of all example asset IDs setup by the model owner */ exampleAssetIds: Array; /** * The privacy of the model (default: private) */ privacy: 'private' | 'public' | 'unlisted'; /** * The source of the model */ source: 'civitai' | 'huggingface' | 'other' | 'scenario'; /** * The model status */ status: 'copying' | 'failed' | 'new' | 'trained' | 'training' | 'training-canceled'; /** * The associated tags (example: ["sci-fi", "landscape"]) */ tags: Array; /** * The total number of training images */ trainingImagesNumber: number; /** * The model type (example: "flux.1-lora") */ type: 'custom' | 'elevenlabs-voice' | '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' | 'flux.2-dev-edit-lora' | 'flux.2-dev-lora' | 'flux.2-klein-4b-edit-lora' | 'flux.2-klein-4b-lora' | 'flux.2-klein-9b-edit-lora' | 'flux.2-klein-9b-lora' | 'flux.2-klein-base-4b-edit-lora' | 'flux.2-klein-base-4b-lora' | 'flux.2-klein-base-9b-edit-lora' | 'flux.2-klein-base-9b-lora' | 'flux1.1-pro' | 'gpt-image-1' | 'qwen-image-2512-lora' | 'qwen-image-edit-2509-lora' | 'qwen-image-edit-2511-lora' | 'qwen-image-edit-lora' | 'qwen-image-lora' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora'; /** * The model last update date as an ISO string (example: * "2023-02-03T11:19:41.579Z") */ updatedAt: string; /** * The access restrictions of the model 0: Free plan 25: Creator plan 50: Pro plan * 75: Team plan 100: Enterprise plan */ accessRestrictions?: 0 | 100 | 25 | 50 | 75; /** * The author user ID (example: "user_VFhihHKMRZyDDnZAJwLb2Q") */ authorId?: string; /** * The class of the model */ class?: Model.Class; /** * List of base model IDs compliant with the model (example: ["flux.1-dev", * "flux.1-schnell"]) This attribute is mainly used for Flux LoRA models */ compliantModelIds?: Array; /** * The concepts is required for the type model: composition */ concepts?: Array; /** * When true, credits spent on a generation with this model are not automatically * refunded if the generation fails. Absent or false means failed generations are * refunded as usual. */ disableRefund?: boolean; /** * The epoch of the model. Only available for Flux Lora Trained models. If not set, * uses the final model epoch (latest) */ epoch?: string; /** * The epochs of the model. Only available for Flux Lora Trained models. */ epochs?: Array; /** * The inputs of the model. Only used for custom models. To retrieve this list, get * it by modelId with GET /models/{modelId} */ inputs?: Array; /** * The model keyword, this is a legacy parameter, please use conceptPrompt in * parameters */ modelKeyword?: string; /** * The model name (example: "Cinematic Realism") */ name?: string; /** * Fine-tune the model's inferences with negative prompt embedding */ negativePromptEmbedding?: string; /** * The owner ID (example: "team_VFhihHKMRZyDDnZAJwLb2Q") */ ownerId?: string; /** * The parameters of the model */ parameters?: Model.Parameters; /** * The id of the parent model */ parentModelId?: string; /** * Aggregated performance stats */ performanceStats?: Model.PerformanceStats; /** * Fine-tune the model's inferences with prompt embedding */ promptEmbedding?: string; /** * The model short description (example: "This model generates highly detailed * cinematic scenes.") */ shortDescription?: string; /** * The date when the model will be soft deleted (only for Free plan) */ softDeletionOn?: string; /** * A thumbnail for your model */ thumbnail?: Model.Thumbnail; /** * Array of training image pairs */ trainingImagePairs?: Array; /** * The URLs of the first 3 training images of the model. To retrieve the full set * of images, get it by modelId */ trainingImages?: Array; /** * Additional information about the training progress of the model */ trainingProgress?: Model.TrainingProgress; /** * Additional information about the model's training */ trainingStats?: Model.TrainingStats; /** * The UI configuration for the model */ uiConfig?: Model.UiConfig; /** * (Deprecated) The user ID (example: "user_VFhihHKMRZyDDnZAJwLb2Q") */ userId?: string; } namespace Model { /** * The class of the model */ interface Class { /** * The category slug of the class (example: "art-style") */ category: string; /** * The concept prompt of the class (example: "a sks character design") */ conceptPrompt: string; /** * The model ID of the class. Only available for legacy models. */ modelId: string; /** * The class name (example: "Character Design") */ name: string; /** * The class prompt (example: "a character design") */ prompt: string; /** * The class slug (example: "art-style-character-design") */ slug: string; /** * The class status (only published classes are listed, but unpublished classes can * still appear in existing models) */ status: 'published' | 'unpublished'; /** * Some example images URLs to showcase the class */ thumbnails: Array; } interface Concept { /** * The model ID (example: "model_eyVcnFJcR92BxBkz7N6g5w") */ modelId: string; /** * The scale of the model (example: 1.0) For Flux Kontext Prompt Editing, the scale * is between 0 and 2. */ scale: number; /** * The epoch of the model (example: "000001") Only available for Flux Lora Trained * models */ modelEpoch?: string; } interface Epoch { /** * The epoch hash to identify the epoch */ epoch: string; /** * The assets of the epoch if sample prompts as been supplied during training */ assets?: Array; } namespace Epoch { interface Asset { /** * The AssetId of the image during training (example: * "asset_GTrL3mq4SXWyMxkOHRxlpw") */ assetId: string; /** * The url of the asset */ url: string; } } /** * Defines the input parameters for a model. Use this to understand the available * input parameters for a given `modelId` when calling * `POST /generate/custom/{modelId}`. See {@link * https://docs.scenario.com/get-started/generation/video-generation} for examples. */ interface Input { /** * The name that must be user to call the model through the API */ name: string; /** * The data type of the input */ type: 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array'; /** * The allowed values for the input. For \`string\` or \`number\` types, creates a * single-select dropdown. For \`string_array\` type, creates a multi-select * dropdown. */ allowedValues?: Array; /** * Specifies the background behavior for the input. Only available for \`file\` and * \`file_array\` input types with kind \`image\`. */ backgroundBehavior?: 'opaque' | 'transparent'; /** * Whether the input is a color or not. Only available for \`string\` input type. */ color?: boolean; /** * Whether this input affects the model's cost calculation */ costImpact?: boolean; /** * The default value for the input */ default?: unknown; /** * Help text displayed in the UI to provide additional information about the input */ description?: string; /** * Used to visually group inputs together in the UI. Inputs with the same group * value appear consecutively in the UI. */ group?: string; /** * Hint text displayed in the UI as a tooltip to guide the user */ hint?: string; /** * The list of inputs which form an object within a container array. All inputs are * the same as the current object. This is only available for type inputs_array * inputs. */ inputs?: Array<{ [key: string]: unknown; }>; /** * The asset kind of the input. Only taken into account for \`file\` and * \`file_array\` input types. If model provides multiple kinds, the input will be * not able to create the asset on the flight on API side with dataurl without * data:kind, prefix */ kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'text' | 'video'; /** * The label displayed in the UI for this input */ label?: string; /** * The name of the file input field to use as the mask source */ maskFrom?: string; /** * The maximum allowed value. Only available for \`number\` and \`array\` input * types. */ max?: number; /** * The maximum allowed media duration in seconds. Only applies to \`file\` and * \`file_array\` input types for video and audio assets. Validated against * \`asset.properties.duration\` at job creation time. */ maxDuration?: number; /** * The maximum allowed length for \`string\` inputs. Also applies to each item in * \`string_array\`. */ maxLength?: number; /** * The maximum allowed file size in bytes. Only applies to \`file\` and * \`file_array\` input types. Validated against \`asset.properties.size\` at job * creation time. */ maxSize?: number; /** * The minimum allowed value. Only available for \`number\` and array input types. */ min?: number; /** * The minimum allowed length for string inputs. Also applies to each item in * \`string_array\`. */ minLength?: number; /** * The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only * available for \`model_array\` input type. */ modelTypes?: Array<'custom' | 'elevenlabs-voice' | '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' | 'flux.2-dev-edit-lora' | 'flux.2-dev-lora' | 'flux.2-klein-4b-edit-lora' | 'flux.2-klein-4b-lora' | 'flux.2-klein-9b-edit-lora' | 'flux.2-klein-9b-lora' | 'flux.2-klein-base-4b-edit-lora' | 'flux.2-klein-base-4b-lora' | 'flux.2-klein-base-9b-edit-lora' | 'flux.2-klein-base-9b-lora' | 'flux1.1-pro' | 'gpt-image-1' | 'qwen-image-2512-lora' | 'qwen-image-edit-2509-lora' | 'qwen-image-edit-2511-lora' | 'qwen-image-edit-lora' | 'qwen-image-lora' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora'>; /** * Whether this input represents a parent asset to assign to the produced assets. * Only available for \`file\` and \`file_array\` input types. * * For \`file_array\`, the parent asset is the first item in the array. */ parent?: boolean; /** * Placeholder text for the input. Only available for 'string' input type. */ placeholder?: string; /** * Whether the input is a prompt. When true, displays as a text area with prompt * spark feature. Only available for \`string\` input type. */ prompt?: boolean; /** * Whether the input is used with prompt spark. Only available for \`string\` input * type. */ promptSpark?: boolean; /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ required?: Input.Required; /** * The step increment for numeric inputs. Only available for \`number\` input type. */ step?: number; } namespace Input { /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ interface Required { /** * Whether the input is always required */ always?: boolean; /** * Makes this input required when another input has a specific value: * * - Key: name of the input to check * - Value: operation and allowed values that trigger the requirement */ conditionalValues?: unknown; /** * Makes this input required when another input is defined: * * - Key: name of the input that must be defined * - Value: message to display when this input is required */ ifDefined?: unknown; /** * Makes this input required when another input is not defined: * * - Key: name of the input that must be undefined * - Value: message to display when this input is required */ ifNotDefined?: unknown; } } /** * The parameters of the model */ interface Parameters { /** * Age group of the voice (for professional cloning) * * Only available for ElevenLabs voice training */ age?: string; /** * The batch size Less steps, and will increase the learning rate * * Only available for Flux LoRA training */ batchSize?: number; /** * The prompt to specify images in the same class as provided instance images * * Deprecated legacy training parameter. */ classPrompt?: string; /** * Type of voice cloning: "instant" (fast) or "professional" (higher quality, * requires captcha) * * Only available for ElevenLabs voice training */ cloneType?: string; /** * The prompt with identifier specifying the instance (or subject) of the class * (example: "a daiton dog") * * Default value varies depending on the model type. For Flux LoRA, the default is * an empty string. */ conceptPrompt?: string; /** * Gender of the voice (for professional cloning) * * Only available for ElevenLabs voice training */ gender?: string; /** * Language of the audio samples (ISO 639-1 code) * * Only available for ElevenLabs voice training */ language?: string; /** * Initial learning rate (after the potential warmup period) * * Default value varies depending on the model type. For Flux LoRA, the default is * 0.0001. */ learningRate?: number; /** * Initial learning rate (after the potential warmup period) for the text encoder * * Maximum [Flux LoRA: 0.001] Default [Flux LoRA: 0.00001] Minimum [Flux LoRA: * 0.000001] */ learningRateTextEncoder?: number; /** * Initial learning rate (after the potential warmup period) for the UNet * * Deprecated legacy training parameter. */ learningRateUnet?: number; /** * The scheduler type to use (default: "constant") * * Deprecated legacy training parameter. */ lrScheduler?: 'constant' | 'constant-with-warmup' | 'cosine' | 'cosine-with-restarts' | 'linear' | 'polynomial'; /** * Maximum number of training steps to execute (default: varies depending on the * model type) * * Default value varies depending on the model type: * * - For Flux: number of training images \* 100 * * Maximum value varies depending on the model type: * * - For Flux: [0, 10000] */ maxTrainSteps?: number; /** * The number of epochs to train for * * Only available for Flux LoRA training */ nbEpochs?: number; /** * The number of times to repeat the training * * Only available for Flux LoRA training */ nbRepeats?: number; /** * The number of training steps for the text encoder * * Deprecated legacy training parameter. */ numTextTrainSteps?: number; /** * The number of training steps for the UNet * * Deprecated legacy training parameter. */ numUNetTrainSteps?: number; /** * Optimize the model training task for a specific type of input images. The * available values are: * * - "likeness": optimize training for likeness or portrait (targets specific * transformer blocks) * - "all": train all transformer blocks * - "none": train no specific transformer blocks * * This parameter controls which double and single transformer blocks are trained * during the LoRA training process. * * Only available for Flux LoRA training */ optimizeFor?: 'likeness'; /** * The weight of prior preservation loss * * Deprecated legacy training parameter. */ priorLossWeight?: number; /** * Whether to random crop or center crop images before resizing to the working * resolution * * Deprecated legacy training parameter. */ randomCrop?: boolean; /** * Ratio of random crops * * Deprecated legacy training parameter. */ randomCropRatio?: number; /** * Scale of random crops * * Deprecated legacy training parameter. */ randomCropScale?: number; /** * The dimension of the LoRA update matrices * * Only available for Flux LoRA and Musubi training * * Default value varies depending on the model type: * * - For Flux: 16 * - For Musubi: 64 * * Each trainer enforces its own tighter limit (Flux LoRA: [2; 64], Musubi: [2; * 128]) */ rank?: number; /** * Whether to remove background noise from audio samples before cloning. When * enabled, each sample must be at least 5 seconds long. * * Only available for ElevenLabs voice training */ removeBackgroundNoise?: boolean; /** * The prompts to use for each epoch Only available for Flux LoRA training */ samplePrompts?: Array; /** * The sample prompt images (AssetIds) paired with samplePrompts Only available for * Flux LoRA training Must be the same length as samplePrompts */ sampleSourceImages?: Array; /** * Whether to scale the learning rate * * Note: Legacy parameter, will be ignored * * Deprecated legacy training parameter. */ scaleLr?: boolean; /** * Used to reproduce previous results. Default: randomly generated number. * * Deprecated legacy training parameter. */ seed?: number; /** * Whether to train the text encoder or not * * Example: For 100 steps and a value of 0.2, it means that the text encoder will * be trained for 20 steps and then the UNet for 80 steps * * Note: Legacy parameter, please use `numTextTrainSteps` and `numUNetTrainSteps` * * Deprecated legacy training parameter. */ textEncoderTrainingRatio?: number; /** * Validation frequency. Cannot be greater than maxTrainSteps value * * Deprecated legacy training parameter. */ validationFrequency?: number; /** * Validation prompt * * Deprecated legacy training parameter. */ validationPrompt?: string; /** * Description of the voice characteristics * * Only available for ElevenLabs voice training */ voiceDescription?: string; /** * The Weights And Bias key to use for logging. The maximum length is 40 characters */ wandbKey?: string; } /** * Aggregated performance stats */ interface PerformanceStats { /** * Performance metrics per variant */ variants: Array; /** * Default variant key for quick model comparison */ default?: string; } namespace PerformanceStats { /** * Performance stats for a model variant */ interface Variant { /** * The generation capability (example: "txt2img", "img2video", "txt2audio") */ capability: string; /** * When these stats were last computed (ISO date) */ computedAt: string; /** * Unique variant identifier (example: "txt2img:1K", "img2video:2K", "txt2audio") */ variantKey: string; /** * External quality score from arena.ai leaderboard */ arenaScore?: Variant.ArenaScore; /** * Maximum cost per output asset (CU) */ costPerAssetMaxCU?: number; /** * Minimum cost per output asset (CU) */ costPerAssetMinCU?: number; /** * Median cost per output asset (CU) */ costPerAssetP50CU?: number; /** * Inference latency P50 per output asset (seconds) */ inferenceLatencyP50Sec?: number; /** * Inference latency P75 per output asset (seconds) */ inferenceLatencyP75Sec?: number; /** * The resolution bucket (example: "0.5K", "1K", "2K", "4K") */ resolution?: string; /** * Total latency P50 per output asset, including queue time (seconds) */ totalLatencyP50Sec?: number; /** * Total latency P75 per output asset, including queue time (seconds) */ totalLatencyP75Sec?: number; } namespace Variant { /** * External quality score from arena.ai leaderboard */ interface ArenaScore { /** * Arena category (example: "text_to_image", "image_to_video") */ arenaCategory: string; /** * Model name on arena.ai */ arenaModelName: string; /** * When this score was last fetched (ISO date) */ fetchedAt: string; /** * Rank in the arena category */ rank: number; /** * ELO rating */ rating: number; /** * ELO rating confidence interval lower bound */ ratingLower: number; /** * ELO rating confidence interval upper bound */ ratingUpper: number; /** * Number of human votes */ votes: number; } } } /** * A thumbnail for your model */ interface Thumbnail { /** * The AssetId of the image used as a thumbnail for your model (example: * "asset_GTrL3mq4SXWyMxkOHRxlpw") */ assetId: string; /** * The url of the image used as a thumbnail for your model */ url: string; } interface TrainingImagePair { /** * The instruction for the image pair, source to target */ instruction?: string; /** * The source asset ID (must be a training asset) */ sourceId?: string; /** * The target asset ID (must be a training asset) */ targetId?: string; } interface TrainingImage { /** * The training image ID (example: "asset_GTrL3mq4SXWyMxkOHRxlpw") */ id: string; /** * Automatic captioning of the image */ automaticCaptioning: string; /** * The training image upload date as an ISO string (example: * "2023-02-03T11:19:41.579Z") */ createdAt: string; /** * Description for the image */ description: string; /** * The URL of the image */ downloadUrl: string; /** * The original file name of the image (example: "my-training-image.jpg") */ name: string; } /** * Additional information about the training progress of the model */ interface TrainingProgress { /** * The stage of the request */ stage: 'pending' | 'pending-captcha' | 'queued-for-train' | 'ready-for-captcha' | 'running-train' | 'starting-train'; /** * Timestamp in milliseconds of the last time the training progress was updated */ updatedAt: number; /** * Signed URL of the captcha image to read aloud during PVC voice cloning. Only * present when stage === 'pending-captcha'. Overwritten on each retry. */ captchaImageUrl?: string; /** * Position of the job in the queue (ie. the number of job in the queue before this * one) */ position?: number; /** * The progress of the job */ progress?: number; /** * The remaining time in milliseconds */ remainingTimeMs?: number; /** * Last recoverable failure message during PVC. Present when the model has bounced * back to stage === 'ready-for-captcha' after a step 2 or step 3 failure (e.g. * captcha rejected, time limit exceeded). Surface above the retry button so the * user understands why they're back here. */ retryableError?: string; /** * Number of consecutive PVC step 2 / step 3 failures on this voice model. The * model is marked Failed when this reaches the platform's max retries. */ retryCount?: number; /** * The timestamp in millisecond marking the start of the process */ startedAt?: number; } /** * Additional information about the model's training */ interface TrainingStats { /** * The training end time as an ISO date string */ endedAt?: string; /** * The training queued duration in seconds */ queueDuration?: number; /** * The training start time as an ISO date string */ startedAt?: string; /** * The training duration in seconds */ trainDuration?: number; } /** * The UI configuration for the model */ interface UiConfig { /** * Configuration for the input properties */ inputProperties?: { [key: string]: UiConfig.InputProperties; }; /** * Configuration for the loras component */ lorasComponent?: UiConfig.LorasComponent; /** * Configuration for the presets */ presets?: Array; /** * Configuration for the resolution component */ resolutionComponent?: UiConfig.ResolutionComponent; /** * Configuration for the selects */ selects?: { [key: string]: unknown; }; /** * Configuration for the trigger generate button */ triggerGenerate?: UiConfig.TriggerGenerate; } namespace UiConfig { interface InputProperties { collapsed?: boolean; } /** * Configuration for the loras component */ interface LorasComponent { /** * The label of the component */ label: string; /** * The input name of the model (model_array) */ modelInput: string; /** * The input name of the scale (number_array) */ scaleInput: string; /** * The input model id (example: a composition or a single LoRA modelId) If * specified, the model id will be attached to the output asset as a metadata If * the model-decomposer parser is specified on it, modelInput and scaleInput will * be automatically populated */ modelIdInput?: string; } interface Preset { fields: Array; presets: unknown; } /** * Configuration for the resolution component */ interface ResolutionComponent { /** * The input name of the height */ heightInput: string; /** * The label of the component */ label: string; /** * The resolution presets */ presets: Array; /** * The input name of the width */ widthInput: string; } namespace ResolutionComponent { interface Preset { height: number; label: string; width: number; } } /** * Configuration for the trigger generate button */ interface TriggerGenerate { label: string; /** * The 'name' of the input where the trigger generate button will be displayed * (after the input). Do not specify both position and after. */ after?: string; /** * The position of the trigger generate button. If position specified, the button * will be displayed at the specified position. Do not specify both position and * after. */ position?: 'bottom' | 'top'; } } } } export interface ModelUpdateResponse { model: ModelUpdateResponse.Model; } export declare namespace ModelUpdateResponse { interface Model { /** * The model ID (example: "model_eyVcnFJcR92BxBkz7N6g5w") */ id: string; /** * List of model capabilities (example: ["txt2img", "img2img", * "txt2img_ip_adapter", ...]) */ capabilities: Array<'3d23d' | 'audio2audio' | 'audio2txt' | 'audio2video' | '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' | 'video23d' | 'video2audio' | 'video2img' | 'video2video'>; /** * A list of CollectionId this model belongs to */ collectionIds: Array; /** * The model creation date as an ISO string (example: "2023-02-03T11:19:41.579Z") */ createdAt: string; /** * Whether the model is a custom model and can be used only with POST * /generate/custom/{modelId} endpoint */ custom: boolean; /** * List of all example asset IDs setup by the model owner */ exampleAssetIds: Array; /** * The privacy of the model (default: private) */ privacy: 'private' | 'public' | 'unlisted'; /** * The source of the model */ source: 'civitai' | 'huggingface' | 'other' | 'scenario'; /** * The model status */ status: 'copying' | 'failed' | 'new' | 'trained' | 'training' | 'training-canceled'; /** * The associated tags (example: ["sci-fi", "landscape"]) */ tags: Array; /** * The total number of training images */ trainingImagesNumber: number; /** * The model type (example: "flux.1-lora") */ type: 'custom' | 'elevenlabs-voice' | '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' | 'flux.2-dev-edit-lora' | 'flux.2-dev-lora' | 'flux.2-klein-4b-edit-lora' | 'flux.2-klein-4b-lora' | 'flux.2-klein-9b-edit-lora' | 'flux.2-klein-9b-lora' | 'flux.2-klein-base-4b-edit-lora' | 'flux.2-klein-base-4b-lora' | 'flux.2-klein-base-9b-edit-lora' | 'flux.2-klein-base-9b-lora' | 'flux1.1-pro' | 'gpt-image-1' | 'qwen-image-2512-lora' | 'qwen-image-edit-2509-lora' | 'qwen-image-edit-2511-lora' | 'qwen-image-edit-lora' | 'qwen-image-lora' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora'; /** * The model last update date as an ISO string (example: * "2023-02-03T11:19:41.579Z") */ updatedAt: string; /** * The access restrictions of the model 0: Free plan 25: Creator plan 50: Pro plan * 75: Team plan 100: Enterprise plan */ accessRestrictions?: 0 | 100 | 25 | 50 | 75; /** * The author user ID (example: "user_VFhihHKMRZyDDnZAJwLb2Q") */ authorId?: string; /** * The class of the model */ class?: Model.Class; /** * List of base model IDs compliant with the model (example: ["flux.1-dev", * "flux.1-schnell"]) This attribute is mainly used for Flux LoRA models */ compliantModelIds?: Array; /** * The concepts is required for the type model: composition */ concepts?: Array; /** * When true, credits spent on a generation with this model are not automatically * refunded if the generation fails. Absent or false means failed generations are * refunded as usual. */ disableRefund?: boolean; /** * The epoch of the model. Only available for Flux Lora Trained models. If not set, * uses the final model epoch (latest) */ epoch?: string; /** * The epochs of the model. Only available for Flux Lora Trained models. */ epochs?: Array; /** * The inputs of the model. Only used for custom models. To retrieve this list, get * it by modelId with GET /models/{modelId} */ inputs?: Array; /** * The model keyword, this is a legacy parameter, please use conceptPrompt in * parameters */ modelKeyword?: string; /** * The model name (example: "Cinematic Realism") */ name?: string; /** * Fine-tune the model's inferences with negative prompt embedding */ negativePromptEmbedding?: string; /** * The owner ID (example: "team_VFhihHKMRZyDDnZAJwLb2Q") */ ownerId?: string; /** * The parameters of the model */ parameters?: Model.Parameters; /** * The id of the parent model */ parentModelId?: string; /** * Aggregated performance stats */ performanceStats?: Model.PerformanceStats; /** * Fine-tune the model's inferences with prompt embedding */ promptEmbedding?: string; /** * The model short description (example: "This model generates highly detailed * cinematic scenes.") */ shortDescription?: string; /** * The date when the model will be soft deleted (only for Free plan) */ softDeletionOn?: string; /** * A thumbnail for your model */ thumbnail?: Model.Thumbnail; /** * Array of training image pairs */ trainingImagePairs?: Array; /** * The URLs of the first 3 training images of the model. To retrieve the full set * of images, get it by modelId */ trainingImages?: Array; /** * Additional information about the training progress of the model */ trainingProgress?: Model.TrainingProgress; /** * Additional information about the model's training */ trainingStats?: Model.TrainingStats; /** * The UI configuration for the model */ uiConfig?: Model.UiConfig; /** * (Deprecated) The user ID (example: "user_VFhihHKMRZyDDnZAJwLb2Q") */ userId?: string; } namespace Model { /** * The class of the model */ interface Class { /** * The category slug of the class (example: "art-style") */ category: string; /** * The concept prompt of the class (example: "a sks character design") */ conceptPrompt: string; /** * The model ID of the class. Only available for legacy models. */ modelId: string; /** * The class name (example: "Character Design") */ name: string; /** * The class prompt (example: "a character design") */ prompt: string; /** * The class slug (example: "art-style-character-design") */ slug: string; /** * The class status (only published classes are listed, but unpublished classes can * still appear in existing models) */ status: 'published' | 'unpublished'; /** * Some example images URLs to showcase the class */ thumbnails: Array; } interface Concept { /** * The model ID (example: "model_eyVcnFJcR92BxBkz7N6g5w") */ modelId: string; /** * The scale of the model (example: 1.0) For Flux Kontext Prompt Editing, the scale * is between 0 and 2. */ scale: number; /** * The epoch of the model (example: "000001") Only available for Flux Lora Trained * models */ modelEpoch?: string; } interface Epoch { /** * The epoch hash to identify the epoch */ epoch: string; /** * The assets of the epoch if sample prompts as been supplied during training */ assets?: Array; } namespace Epoch { interface Asset { /** * The AssetId of the image during training (example: * "asset_GTrL3mq4SXWyMxkOHRxlpw") */ assetId: string; /** * The url of the asset */ url: string; } } /** * Defines the input parameters for a model. Use this to understand the available * input parameters for a given `modelId` when calling * `POST /generate/custom/{modelId}`. See {@link * https://docs.scenario.com/get-started/generation/video-generation} for examples. */ interface Input { /** * The name that must be user to call the model through the API */ name: string; /** * The data type of the input */ type: 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array'; /** * The allowed values for the input. For \`string\` or \`number\` types, creates a * single-select dropdown. For \`string_array\` type, creates a multi-select * dropdown. */ allowedValues?: Array; /** * Specifies the background behavior for the input. Only available for \`file\` and * \`file_array\` input types with kind \`image\`. */ backgroundBehavior?: 'opaque' | 'transparent'; /** * Whether the input is a color or not. Only available for \`string\` input type. */ color?: boolean; /** * Whether this input affects the model's cost calculation */ costImpact?: boolean; /** * The default value for the input */ default?: unknown; /** * Help text displayed in the UI to provide additional information about the input */ description?: string; /** * Used to visually group inputs together in the UI. Inputs with the same group * value appear consecutively in the UI. */ group?: string; /** * Hint text displayed in the UI as a tooltip to guide the user */ hint?: string; /** * The list of inputs which form an object within a container array. All inputs are * the same as the current object. This is only available for type inputs_array * inputs. */ inputs?: Array<{ [key: string]: unknown; }>; /** * The asset kind of the input. Only taken into account for \`file\` and * \`file_array\` input types. If model provides multiple kinds, the input will be * not able to create the asset on the flight on API side with dataurl without * data:kind, prefix */ kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'text' | 'video'; /** * The label displayed in the UI for this input */ label?: string; /** * The name of the file input field to use as the mask source */ maskFrom?: string; /** * The maximum allowed value. Only available for \`number\` and \`array\` input * types. */ max?: number; /** * The maximum allowed media duration in seconds. Only applies to \`file\` and * \`file_array\` input types for video and audio assets. Validated against * \`asset.properties.duration\` at job creation time. */ maxDuration?: number; /** * The maximum allowed length for \`string\` inputs. Also applies to each item in * \`string_array\`. */ maxLength?: number; /** * The maximum allowed file size in bytes. Only applies to \`file\` and * \`file_array\` input types. Validated against \`asset.properties.size\` at job * creation time. */ maxSize?: number; /** * The minimum allowed value. Only available for \`number\` and array input types. */ min?: number; /** * The minimum allowed length for string inputs. Also applies to each item in * \`string_array\`. */ minLength?: number; /** * The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only * available for \`model_array\` input type. */ modelTypes?: Array<'custom' | 'elevenlabs-voice' | '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' | 'flux.2-dev-edit-lora' | 'flux.2-dev-lora' | 'flux.2-klein-4b-edit-lora' | 'flux.2-klein-4b-lora' | 'flux.2-klein-9b-edit-lora' | 'flux.2-klein-9b-lora' | 'flux.2-klein-base-4b-edit-lora' | 'flux.2-klein-base-4b-lora' | 'flux.2-klein-base-9b-edit-lora' | 'flux.2-klein-base-9b-lora' | 'flux1.1-pro' | 'gpt-image-1' | 'qwen-image-2512-lora' | 'qwen-image-edit-2509-lora' | 'qwen-image-edit-2511-lora' | 'qwen-image-edit-lora' | 'qwen-image-lora' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora'>; /** * Whether this input represents a parent asset to assign to the produced assets. * Only available for \`file\` and \`file_array\` input types. * * For \`file_array\`, the parent asset is the first item in the array. */ parent?: boolean; /** * Placeholder text for the input. Only available for 'string' input type. */ placeholder?: string; /** * Whether the input is a prompt. When true, displays as a text area with prompt * spark feature. Only available for \`string\` input type. */ prompt?: boolean; /** * Whether the input is used with prompt spark. Only available for \`string\` input * type. */ promptSpark?: boolean; /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ required?: Input.Required; /** * The step increment for numeric inputs. Only available for \`number\` input type. */ step?: number; } namespace Input { /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ interface Required { /** * Whether the input is always required */ always?: boolean; /** * Makes this input required when another input has a specific value: * * - Key: name of the input to check * - Value: operation and allowed values that trigger the requirement */ conditionalValues?: unknown; /** * Makes this input required when another input is defined: * * - Key: name of the input that must be defined * - Value: message to display when this input is required */ ifDefined?: unknown; /** * Makes this input required when another input is not defined: * * - Key: name of the input that must be undefined * - Value: message to display when this input is required */ ifNotDefined?: unknown; } } /** * The parameters of the model */ interface Parameters { /** * Age group of the voice (for professional cloning) * * Only available for ElevenLabs voice training */ age?: string; /** * The batch size Less steps, and will increase the learning rate * * Only available for Flux LoRA training */ batchSize?: number; /** * The prompt to specify images in the same class as provided instance images * * Deprecated legacy training parameter. */ classPrompt?: string; /** * Type of voice cloning: "instant" (fast) or "professional" (higher quality, * requires captcha) * * Only available for ElevenLabs voice training */ cloneType?: string; /** * The prompt with identifier specifying the instance (or subject) of the class * (example: "a daiton dog") * * Default value varies depending on the model type. For Flux LoRA, the default is * an empty string. */ conceptPrompt?: string; /** * Gender of the voice (for professional cloning) * * Only available for ElevenLabs voice training */ gender?: string; /** * Language of the audio samples (ISO 639-1 code) * * Only available for ElevenLabs voice training */ language?: string; /** * Initial learning rate (after the potential warmup period) * * Default value varies depending on the model type. For Flux LoRA, the default is * 0.0001. */ learningRate?: number; /** * Initial learning rate (after the potential warmup period) for the text encoder * * Maximum [Flux LoRA: 0.001] Default [Flux LoRA: 0.00001] Minimum [Flux LoRA: * 0.000001] */ learningRateTextEncoder?: number; /** * Initial learning rate (after the potential warmup period) for the UNet * * Deprecated legacy training parameter. */ learningRateUnet?: number; /** * The scheduler type to use (default: "constant") * * Deprecated legacy training parameter. */ lrScheduler?: 'constant' | 'constant-with-warmup' | 'cosine' | 'cosine-with-restarts' | 'linear' | 'polynomial'; /** * Maximum number of training steps to execute (default: varies depending on the * model type) * * Default value varies depending on the model type: * * - For Flux: number of training images \* 100 * * Maximum value varies depending on the model type: * * - For Flux: [0, 10000] */ maxTrainSteps?: number; /** * The number of epochs to train for * * Only available for Flux LoRA training */ nbEpochs?: number; /** * The number of times to repeat the training * * Only available for Flux LoRA training */ nbRepeats?: number; /** * The number of training steps for the text encoder * * Deprecated legacy training parameter. */ numTextTrainSteps?: number; /** * The number of training steps for the UNet * * Deprecated legacy training parameter. */ numUNetTrainSteps?: number; /** * Optimize the model training task for a specific type of input images. The * available values are: * * - "likeness": optimize training for likeness or portrait (targets specific * transformer blocks) * - "all": train all transformer blocks * - "none": train no specific transformer blocks * * This parameter controls which double and single transformer blocks are trained * during the LoRA training process. * * Only available for Flux LoRA training */ optimizeFor?: 'likeness'; /** * The weight of prior preservation loss * * Deprecated legacy training parameter. */ priorLossWeight?: number; /** * Whether to random crop or center crop images before resizing to the working * resolution * * Deprecated legacy training parameter. */ randomCrop?: boolean; /** * Ratio of random crops * * Deprecated legacy training parameter. */ randomCropRatio?: number; /** * Scale of random crops * * Deprecated legacy training parameter. */ randomCropScale?: number; /** * The dimension of the LoRA update matrices * * Only available for Flux LoRA and Musubi training * * Default value varies depending on the model type: * * - For Flux: 16 * - For Musubi: 64 * * Each trainer enforces its own tighter limit (Flux LoRA: [2; 64], Musubi: [2; * 128]) */ rank?: number; /** * Whether to remove background noise from audio samples before cloning. When * enabled, each sample must be at least 5 seconds long. * * Only available for ElevenLabs voice training */ removeBackgroundNoise?: boolean; /** * The prompts to use for each epoch Only available for Flux LoRA training */ samplePrompts?: Array; /** * The sample prompt images (AssetIds) paired with samplePrompts Only available for * Flux LoRA training Must be the same length as samplePrompts */ sampleSourceImages?: Array; /** * Whether to scale the learning rate * * Note: Legacy parameter, will be ignored * * Deprecated legacy training parameter. */ scaleLr?: boolean; /** * Used to reproduce previous results. Default: randomly generated number. * * Deprecated legacy training parameter. */ seed?: number; /** * Whether to train the text encoder or not * * Example: For 100 steps and a value of 0.2, it means that the text encoder will * be trained for 20 steps and then the UNet for 80 steps * * Note: Legacy parameter, please use `numTextTrainSteps` and `numUNetTrainSteps` * * Deprecated legacy training parameter. */ textEncoderTrainingRatio?: number; /** * Validation frequency. Cannot be greater than maxTrainSteps value * * Deprecated legacy training parameter. */ validationFrequency?: number; /** * Validation prompt * * Deprecated legacy training parameter. */ validationPrompt?: string; /** * Description of the voice characteristics * * Only available for ElevenLabs voice training */ voiceDescription?: string; /** * The Weights And Bias key to use for logging. The maximum length is 40 characters */ wandbKey?: string; } /** * Aggregated performance stats */ interface PerformanceStats { /** * Performance metrics per variant */ variants: Array; /** * Default variant key for quick model comparison */ default?: string; } namespace PerformanceStats { /** * Performance stats for a model variant */ interface Variant { /** * The generation capability (example: "txt2img", "img2video", "txt2audio") */ capability: string; /** * When these stats were last computed (ISO date) */ computedAt: string; /** * Unique variant identifier (example: "txt2img:1K", "img2video:2K", "txt2audio") */ variantKey: string; /** * External quality score from arena.ai leaderboard */ arenaScore?: Variant.ArenaScore; /** * Maximum cost per output asset (CU) */ costPerAssetMaxCU?: number; /** * Minimum cost per output asset (CU) */ costPerAssetMinCU?: number; /** * Median cost per output asset (CU) */ costPerAssetP50CU?: number; /** * Inference latency P50 per output asset (seconds) */ inferenceLatencyP50Sec?: number; /** * Inference latency P75 per output asset (seconds) */ inferenceLatencyP75Sec?: number; /** * The resolution bucket (example: "0.5K", "1K", "2K", "4K") */ resolution?: string; /** * Total latency P50 per output asset, including queue time (seconds) */ totalLatencyP50Sec?: number; /** * Total latency P75 per output asset, including queue time (seconds) */ totalLatencyP75Sec?: number; } namespace Variant { /** * External quality score from arena.ai leaderboard */ interface ArenaScore { /** * Arena category (example: "text_to_image", "image_to_video") */ arenaCategory: string; /** * Model name on arena.ai */ arenaModelName: string; /** * When this score was last fetched (ISO date) */ fetchedAt: string; /** * Rank in the arena category */ rank: number; /** * ELO rating */ rating: number; /** * ELO rating confidence interval lower bound */ ratingLower: number; /** * ELO rating confidence interval upper bound */ ratingUpper: number; /** * Number of human votes */ votes: number; } } } /** * A thumbnail for your model */ interface Thumbnail { /** * The AssetId of the image used as a thumbnail for your model (example: * "asset_GTrL3mq4SXWyMxkOHRxlpw") */ assetId: string; /** * The url of the image used as a thumbnail for your model */ url: string; } interface TrainingImagePair { /** * The instruction for the image pair, source to target */ instruction?: string; /** * The source asset ID (must be a training asset) */ sourceId?: string; /** * The target asset ID (must be a training asset) */ targetId?: string; } interface TrainingImage { /** * The training image ID (example: "asset_GTrL3mq4SXWyMxkOHRxlpw") */ id: string; /** * Automatic captioning of the image */ automaticCaptioning: string; /** * The training image upload date as an ISO string (example: * "2023-02-03T11:19:41.579Z") */ createdAt: string; /** * Description for the image */ description: string; /** * The URL of the image */ downloadUrl: string; /** * The original file name of the image (example: "my-training-image.jpg") */ name: string; } /** * Additional information about the training progress of the model */ interface TrainingProgress { /** * The stage of the request */ stage: 'pending' | 'pending-captcha' | 'queued-for-train' | 'ready-for-captcha' | 'running-train' | 'starting-train'; /** * Timestamp in milliseconds of the last time the training progress was updated */ updatedAt: number; /** * Signed URL of the captcha image to read aloud during PVC voice cloning. Only * present when stage === 'pending-captcha'. Overwritten on each retry. */ captchaImageUrl?: string; /** * Position of the job in the queue (ie. the number of job in the queue before this * one) */ position?: number; /** * The progress of the job */ progress?: number; /** * The remaining time in milliseconds */ remainingTimeMs?: number; /** * Last recoverable failure message during PVC. Present when the model has bounced * back to stage === 'ready-for-captcha' after a step 2 or step 3 failure (e.g. * captcha rejected, time limit exceeded). Surface above the retry button so the * user understands why they're back here. */ retryableError?: string; /** * Number of consecutive PVC step 2 / step 3 failures on this voice model. The * model is marked Failed when this reaches the platform's max retries. */ retryCount?: number; /** * The timestamp in millisecond marking the start of the process */ startedAt?: number; } /** * Additional information about the model's training */ interface TrainingStats { /** * The training end time as an ISO date string */ endedAt?: string; /** * The training queued duration in seconds */ queueDuration?: number; /** * The training start time as an ISO date string */ startedAt?: string; /** * The training duration in seconds */ trainDuration?: number; } /** * The UI configuration for the model */ interface UiConfig { /** * Configuration for the input properties */ inputProperties?: { [key: string]: UiConfig.InputProperties; }; /** * Configuration for the loras component */ lorasComponent?: UiConfig.LorasComponent; /** * Configuration for the presets */ presets?: Array; /** * Configuration for the resolution component */ resolutionComponent?: UiConfig.ResolutionComponent; /** * Configuration for the selects */ selects?: { [key: string]: unknown; }; /** * Configuration for the trigger generate button */ triggerGenerate?: UiConfig.TriggerGenerate; } namespace UiConfig { interface InputProperties { collapsed?: boolean; } /** * Configuration for the loras component */ interface LorasComponent { /** * The label of the component */ label: string; /** * The input name of the model (model_array) */ modelInput: string; /** * The input name of the scale (number_array) */ scaleInput: string; /** * The input model id (example: a composition or a single LoRA modelId) If * specified, the model id will be attached to the output asset as a metadata If * the model-decomposer parser is specified on it, modelInput and scaleInput will * be automatically populated */ modelIdInput?: string; } interface Preset { fields: Array; presets: unknown; } /** * Configuration for the resolution component */ interface ResolutionComponent { /** * The input name of the height */ heightInput: string; /** * The label of the component */ label: string; /** * The resolution presets */ presets: Array; /** * The input name of the width */ widthInput: string; } namespace ResolutionComponent { interface Preset { height: number; label: string; width: number; } } /** * Configuration for the trigger generate button */ interface TriggerGenerate { label: string; /** * The 'name' of the input where the trigger generate button will be displayed * (after the input). Do not specify both position and after. */ after?: string; /** * The position of the trigger generate button. If position specified, the button * will be displayed at the specified position. Do not specify both position and * after. */ position?: 'bottom' | 'top'; } } } } export interface ModelListResponse { /** * The model ID (example: "model_eyVcnFJcR92BxBkz7N6g5w") */ id: string; /** * List of model capabilities (example: ["txt2img", "img2img", * "txt2img_ip_adapter", ...]) */ capabilities: Array<'3d23d' | 'audio2audio' | 'audio2txt' | 'audio2video' | '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' | 'video23d' | 'video2audio' | 'video2img' | 'video2video'>; /** * A list of CollectionId this model belongs to */ collectionIds: Array; /** * The model creation date as an ISO string (example: "2023-02-03T11:19:41.579Z") */ createdAt: string; /** * Whether the model is a custom model and can be used only with POST * /generate/custom/{modelId} endpoint */ custom: boolean; /** * List of all example asset IDs setup by the model owner */ exampleAssetIds: Array; /** * The privacy of the model (default: private) */ privacy: 'private' | 'public' | 'unlisted'; /** * The source of the model */ source: 'civitai' | 'huggingface' | 'other' | 'scenario'; /** * The model status */ status: 'copying' | 'failed' | 'new' | 'trained' | 'training' | 'training-canceled'; /** * The associated tags (example: ["sci-fi", "landscape"]) */ tags: Array; /** * The total number of training images */ trainingImagesNumber: number; /** * The model type (example: "flux.1-lora") */ type: 'custom' | 'elevenlabs-voice' | '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' | 'flux.2-dev-edit-lora' | 'flux.2-dev-lora' | 'flux.2-klein-4b-edit-lora' | 'flux.2-klein-4b-lora' | 'flux.2-klein-9b-edit-lora' | 'flux.2-klein-9b-lora' | 'flux.2-klein-base-4b-edit-lora' | 'flux.2-klein-base-4b-lora' | 'flux.2-klein-base-9b-edit-lora' | 'flux.2-klein-base-9b-lora' | 'flux1.1-pro' | 'gpt-image-1' | 'qwen-image-2512-lora' | 'qwen-image-edit-2509-lora' | 'qwen-image-edit-2511-lora' | 'qwen-image-edit-lora' | 'qwen-image-lora' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora'; /** * The model last update date as an ISO string (example: * "2023-02-03T11:19:41.579Z") */ updatedAt: string; /** * The access restrictions of the model 0: Free plan 25: Creator plan 50: Pro plan * 75: Team plan 100: Enterprise plan */ accessRestrictions?: 0 | 100 | 25 | 50 | 75; /** * The author user ID (example: "user_VFhihHKMRZyDDnZAJwLb2Q") */ authorId?: string; /** * The class of the model */ class?: ModelListResponse.Class; /** * List of base model IDs compliant with the model (example: ["flux.1-dev", * "flux.1-schnell"]) This attribute is mainly used for Flux LoRA models */ compliantModelIds?: Array; /** * The concepts is required for the type model: composition */ concepts?: Array; /** * When true, credits spent on a generation with this model are not automatically * refunded if the generation fails. Absent or false means failed generations are * refunded as usual. */ disableRefund?: boolean; /** * The epoch of the model. Only available for Flux Lora Trained models. If not set, * uses the final model epoch (latest) */ epoch?: string; /** * The epochs of the model. Only available for Flux Lora Trained models. */ epochs?: Array; /** * The inputs of the model. Only used for custom models. To retrieve this list, get * it by modelId with GET /models/{modelId} */ inputs?: Array; /** * The model keyword, this is a legacy parameter, please use conceptPrompt in * parameters */ modelKeyword?: string; /** * The model name (example: "Cinematic Realism") */ name?: string; /** * Fine-tune the model's inferences with negative prompt embedding */ negativePromptEmbedding?: string; /** * The owner ID (example: "team_VFhihHKMRZyDDnZAJwLb2Q") */ ownerId?: string; /** * The parameters of the model */ parameters?: ModelListResponse.Parameters; /** * The id of the parent model */ parentModelId?: string; /** * Aggregated performance stats */ performanceStats?: ModelListResponse.PerformanceStats; /** * Fine-tune the model's inferences with prompt embedding */ promptEmbedding?: string; /** * The model short description (example: "This model generates highly detailed * cinematic scenes.") */ shortDescription?: string; /** * The date when the model will be soft deleted (only for Free plan) */ softDeletionOn?: string; /** * A thumbnail for your model */ thumbnail?: ModelListResponse.Thumbnail; /** * Array of training image pairs */ trainingImagePairs?: Array; /** * The URLs of the first 3 training images of the model. To retrieve the full set * of images, get it by modelId */ trainingImages?: Array; /** * Additional information about the training progress of the model */ trainingProgress?: ModelListResponse.TrainingProgress; /** * Additional information about the model's training */ trainingStats?: ModelListResponse.TrainingStats; /** * The UI configuration for the model */ uiConfig?: ModelListResponse.UiConfig; /** * (Deprecated) The user ID (example: "user_VFhihHKMRZyDDnZAJwLb2Q") */ userId?: string; } export declare namespace ModelListResponse { /** * The class of the model */ interface Class { /** * The category slug of the class (example: "art-style") */ category: string; /** * The concept prompt of the class (example: "a sks character design") */ conceptPrompt: string; /** * The model ID of the class. Only available for legacy models. */ modelId: string; /** * The class name (example: "Character Design") */ name: string; /** * The class prompt (example: "a character design") */ prompt: string; /** * The class slug (example: "art-style-character-design") */ slug: string; /** * The class status (only published classes are listed, but unpublished classes can * still appear in existing models) */ status: 'published' | 'unpublished'; /** * Some example images URLs to showcase the class */ thumbnails: Array; } interface Concept { /** * The model ID (example: "model_eyVcnFJcR92BxBkz7N6g5w") */ modelId: string; /** * The scale of the model (example: 1.0) For Flux Kontext Prompt Editing, the scale * is between 0 and 2. */ scale: number; /** * The epoch of the model (example: "000001") Only available for Flux Lora Trained * models */ modelEpoch?: string; } interface Epoch { /** * The epoch hash to identify the epoch */ epoch: string; /** * The assets of the epoch if sample prompts as been supplied during training */ assets?: Array; } namespace Epoch { interface Asset { /** * The AssetId of the image during training (example: * "asset_GTrL3mq4SXWyMxkOHRxlpw") */ assetId: string; /** * The url of the asset */ url: string; } } /** * Defines the input parameters for a model. Use this to understand the available * input parameters for a given `modelId` when calling * `POST /generate/custom/{modelId}`. See {@link * https://docs.scenario.com/get-started/generation/video-generation} for examples. */ interface Input { /** * The name that must be user to call the model through the API */ name: string; /** * The data type of the input */ type: 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array'; /** * The allowed values for the input. For \`string\` or \`number\` types, creates a * single-select dropdown. For \`string_array\` type, creates a multi-select * dropdown. */ allowedValues?: Array; /** * Specifies the background behavior for the input. Only available for \`file\` and * \`file_array\` input types with kind \`image\`. */ backgroundBehavior?: 'opaque' | 'transparent'; /** * Whether the input is a color or not. Only available for \`string\` input type. */ color?: boolean; /** * Whether this input affects the model's cost calculation */ costImpact?: boolean; /** * The default value for the input */ default?: unknown; /** * Help text displayed in the UI to provide additional information about the input */ description?: string; /** * Used to visually group inputs together in the UI. Inputs with the same group * value appear consecutively in the UI. */ group?: string; /** * Hint text displayed in the UI as a tooltip to guide the user */ hint?: string; /** * The list of inputs which form an object within a container array. All inputs are * the same as the current object. This is only available for type inputs_array * inputs. */ inputs?: Array<{ [key: string]: unknown; }>; /** * The asset kind of the input. Only taken into account for \`file\` and * \`file_array\` input types. If model provides multiple kinds, the input will be * not able to create the asset on the flight on API side with dataurl without * data:kind, prefix */ kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'text' | 'video'; /** * The label displayed in the UI for this input */ label?: string; /** * The name of the file input field to use as the mask source */ maskFrom?: string; /** * The maximum allowed value. Only available for \`number\` and \`array\` input * types. */ max?: number; /** * The maximum allowed media duration in seconds. Only applies to \`file\` and * \`file_array\` input types for video and audio assets. Validated against * \`asset.properties.duration\` at job creation time. */ maxDuration?: number; /** * The maximum allowed length for \`string\` inputs. Also applies to each item in * \`string_array\`. */ maxLength?: number; /** * The maximum allowed file size in bytes. Only applies to \`file\` and * \`file_array\` input types. Validated against \`asset.properties.size\` at job * creation time. */ maxSize?: number; /** * The minimum allowed value. Only available for \`number\` and array input types. */ min?: number; /** * The minimum allowed length for string inputs. Also applies to each item in * \`string_array\`. */ minLength?: number; /** * The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only * available for \`model_array\` input type. */ modelTypes?: Array<'custom' | 'elevenlabs-voice' | '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' | 'flux.2-dev-edit-lora' | 'flux.2-dev-lora' | 'flux.2-klein-4b-edit-lora' | 'flux.2-klein-4b-lora' | 'flux.2-klein-9b-edit-lora' | 'flux.2-klein-9b-lora' | 'flux.2-klein-base-4b-edit-lora' | 'flux.2-klein-base-4b-lora' | 'flux.2-klein-base-9b-edit-lora' | 'flux.2-klein-base-9b-lora' | 'flux1.1-pro' | 'gpt-image-1' | 'qwen-image-2512-lora' | 'qwen-image-edit-2509-lora' | 'qwen-image-edit-2511-lora' | 'qwen-image-edit-lora' | 'qwen-image-lora' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora'>; /** * Whether this input represents a parent asset to assign to the produced assets. * Only available for \`file\` and \`file_array\` input types. * * For \`file_array\`, the parent asset is the first item in the array. */ parent?: boolean; /** * Placeholder text for the input. Only available for 'string' input type. */ placeholder?: string; /** * Whether the input is a prompt. When true, displays as a text area with prompt * spark feature. Only available for \`string\` input type. */ prompt?: boolean; /** * Whether the input is used with prompt spark. Only available for \`string\` input * type. */ promptSpark?: boolean; /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ required?: Input.Required; /** * The step increment for numeric inputs. Only available for \`number\` input type. */ step?: number; } namespace Input { /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ interface Required { /** * Whether the input is always required */ always?: boolean; /** * Makes this input required when another input has a specific value: * * - Key: name of the input to check * - Value: operation and allowed values that trigger the requirement */ conditionalValues?: unknown; /** * Makes this input required when another input is defined: * * - Key: name of the input that must be defined * - Value: message to display when this input is required */ ifDefined?: unknown; /** * Makes this input required when another input is not defined: * * - Key: name of the input that must be undefined * - Value: message to display when this input is required */ ifNotDefined?: unknown; } } /** * The parameters of the model */ interface Parameters { /** * Age group of the voice (for professional cloning) * * Only available for ElevenLabs voice training */ age?: string; /** * The batch size Less steps, and will increase the learning rate * * Only available for Flux LoRA training */ batchSize?: number; /** * The prompt to specify images in the same class as provided instance images * * Deprecated legacy training parameter. */ classPrompt?: string; /** * Type of voice cloning: "instant" (fast) or "professional" (higher quality, * requires captcha) * * Only available for ElevenLabs voice training */ cloneType?: string; /** * The prompt with identifier specifying the instance (or subject) of the class * (example: "a daiton dog") * * Default value varies depending on the model type. For Flux LoRA, the default is * an empty string. */ conceptPrompt?: string; /** * Gender of the voice (for professional cloning) * * Only available for ElevenLabs voice training */ gender?: string; /** * Language of the audio samples (ISO 639-1 code) * * Only available for ElevenLabs voice training */ language?: string; /** * Initial learning rate (after the potential warmup period) * * Default value varies depending on the model type. For Flux LoRA, the default is * 0.0001. */ learningRate?: number; /** * Initial learning rate (after the potential warmup period) for the text encoder * * Maximum [Flux LoRA: 0.001] Default [Flux LoRA: 0.00001] Minimum [Flux LoRA: * 0.000001] */ learningRateTextEncoder?: number; /** * Initial learning rate (after the potential warmup period) for the UNet * * Deprecated legacy training parameter. */ learningRateUnet?: number; /** * The scheduler type to use (default: "constant") * * Deprecated legacy training parameter. */ lrScheduler?: 'constant' | 'constant-with-warmup' | 'cosine' | 'cosine-with-restarts' | 'linear' | 'polynomial'; /** * Maximum number of training steps to execute (default: varies depending on the * model type) * * Default value varies depending on the model type: * * - For Flux: number of training images \* 100 * * Maximum value varies depending on the model type: * * - For Flux: [0, 10000] */ maxTrainSteps?: number; /** * The number of epochs to train for * * Only available for Flux LoRA training */ nbEpochs?: number; /** * The number of times to repeat the training * * Only available for Flux LoRA training */ nbRepeats?: number; /** * The number of training steps for the text encoder * * Deprecated legacy training parameter. */ numTextTrainSteps?: number; /** * The number of training steps for the UNet * * Deprecated legacy training parameter. */ numUNetTrainSteps?: number; /** * Optimize the model training task for a specific type of input images. The * available values are: * * - "likeness": optimize training for likeness or portrait (targets specific * transformer blocks) * - "all": train all transformer blocks * - "none": train no specific transformer blocks * * This parameter controls which double and single transformer blocks are trained * during the LoRA training process. * * Only available for Flux LoRA training */ optimizeFor?: 'likeness'; /** * The weight of prior preservation loss * * Deprecated legacy training parameter. */ priorLossWeight?: number; /** * Whether to random crop or center crop images before resizing to the working * resolution * * Deprecated legacy training parameter. */ randomCrop?: boolean; /** * Ratio of random crops * * Deprecated legacy training parameter. */ randomCropRatio?: number; /** * Scale of random crops * * Deprecated legacy training parameter. */ randomCropScale?: number; /** * The dimension of the LoRA update matrices * * Only available for Flux LoRA and Musubi training * * Default value varies depending on the model type: * * - For Flux: 16 * - For Musubi: 64 * * Each trainer enforces its own tighter limit (Flux LoRA: [2; 64], Musubi: [2; * 128]) */ rank?: number; /** * Whether to remove background noise from audio samples before cloning. When * enabled, each sample must be at least 5 seconds long. * * Only available for ElevenLabs voice training */ removeBackgroundNoise?: boolean; /** * The prompts to use for each epoch Only available for Flux LoRA training */ samplePrompts?: Array; /** * The sample prompt images (AssetIds) paired with samplePrompts Only available for * Flux LoRA training Must be the same length as samplePrompts */ sampleSourceImages?: Array; /** * Whether to scale the learning rate * * Note: Legacy parameter, will be ignored * * Deprecated legacy training parameter. */ scaleLr?: boolean; /** * Used to reproduce previous results. Default: randomly generated number. * * Deprecated legacy training parameter. */ seed?: number; /** * Whether to train the text encoder or not * * Example: For 100 steps and a value of 0.2, it means that the text encoder will * be trained for 20 steps and then the UNet for 80 steps * * Note: Legacy parameter, please use `numTextTrainSteps` and `numUNetTrainSteps` * * Deprecated legacy training parameter. */ textEncoderTrainingRatio?: number; /** * Validation frequency. Cannot be greater than maxTrainSteps value * * Deprecated legacy training parameter. */ validationFrequency?: number; /** * Validation prompt * * Deprecated legacy training parameter. */ validationPrompt?: string; /** * Description of the voice characteristics * * Only available for ElevenLabs voice training */ voiceDescription?: string; /** * The Weights And Bias key to use for logging. The maximum length is 40 characters */ wandbKey?: string; } /** * Aggregated performance stats */ interface PerformanceStats { /** * Performance metrics per variant */ variants: Array; /** * Default variant key for quick model comparison */ default?: string; } namespace PerformanceStats { /** * Performance stats for a model variant */ interface Variant { /** * The generation capability (example: "txt2img", "img2video", "txt2audio") */ capability: string; /** * When these stats were last computed (ISO date) */ computedAt: string; /** * Unique variant identifier (example: "txt2img:1K", "img2video:2K", "txt2audio") */ variantKey: string; /** * External quality score from arena.ai leaderboard */ arenaScore?: Variant.ArenaScore; /** * Maximum cost per output asset (CU) */ costPerAssetMaxCU?: number; /** * Minimum cost per output asset (CU) */ costPerAssetMinCU?: number; /** * Median cost per output asset (CU) */ costPerAssetP50CU?: number; /** * Inference latency P50 per output asset (seconds) */ inferenceLatencyP50Sec?: number; /** * Inference latency P75 per output asset (seconds) */ inferenceLatencyP75Sec?: number; /** * The resolution bucket (example: "0.5K", "1K", "2K", "4K") */ resolution?: string; /** * Total latency P50 per output asset, including queue time (seconds) */ totalLatencyP50Sec?: number; /** * Total latency P75 per output asset, including queue time (seconds) */ totalLatencyP75Sec?: number; } namespace Variant { /** * External quality score from arena.ai leaderboard */ interface ArenaScore { /** * Arena category (example: "text_to_image", "image_to_video") */ arenaCategory: string; /** * Model name on arena.ai */ arenaModelName: string; /** * When this score was last fetched (ISO date) */ fetchedAt: string; /** * Rank in the arena category */ rank: number; /** * ELO rating */ rating: number; /** * ELO rating confidence interval lower bound */ ratingLower: number; /** * ELO rating confidence interval upper bound */ ratingUpper: number; /** * Number of human votes */ votes: number; } } } /** * A thumbnail for your model */ interface Thumbnail { /** * The AssetId of the image used as a thumbnail for your model (example: * "asset_GTrL3mq4SXWyMxkOHRxlpw") */ assetId: string; /** * The url of the image used as a thumbnail for your model */ url: string; } interface TrainingImagePair { /** * The instruction for the image pair, source to target */ instruction?: string; /** * The source asset ID (must be a training asset) */ sourceId?: string; /** * The target asset ID (must be a training asset) */ targetId?: string; } interface TrainingImage { /** * The training image ID (example: "asset_GTrL3mq4SXWyMxkOHRxlpw") */ id: string; /** * Automatic captioning of the image */ automaticCaptioning: string; /** * The training image upload date as an ISO string (example: * "2023-02-03T11:19:41.579Z") */ createdAt: string; /** * Description for the image */ description: string; /** * The URL of the image */ downloadUrl: string; /** * The original file name of the image (example: "my-training-image.jpg") */ name: string; } /** * Additional information about the training progress of the model */ interface TrainingProgress { /** * The stage of the request */ stage: 'pending' | 'pending-captcha' | 'queued-for-train' | 'ready-for-captcha' | 'running-train' | 'starting-train'; /** * Timestamp in milliseconds of the last time the training progress was updated */ updatedAt: number; /** * Signed URL of the captcha image to read aloud during PVC voice cloning. Only * present when stage === 'pending-captcha'. Overwritten on each retry. */ captchaImageUrl?: string; /** * Position of the job in the queue (ie. the number of job in the queue before this * one) */ position?: number; /** * The progress of the job */ progress?: number; /** * The remaining time in milliseconds */ remainingTimeMs?: number; /** * Last recoverable failure message during PVC. Present when the model has bounced * back to stage === 'ready-for-captcha' after a step 2 or step 3 failure (e.g. * captcha rejected, time limit exceeded). Surface above the retry button so the * user understands why they're back here. */ retryableError?: string; /** * Number of consecutive PVC step 2 / step 3 failures on this voice model. The * model is marked Failed when this reaches the platform's max retries. */ retryCount?: number; /** * The timestamp in millisecond marking the start of the process */ startedAt?: number; } /** * Additional information about the model's training */ interface TrainingStats { /** * The training end time as an ISO date string */ endedAt?: string; /** * The training queued duration in seconds */ queueDuration?: number; /** * The training start time as an ISO date string */ startedAt?: string; /** * The training duration in seconds */ trainDuration?: number; } /** * The UI configuration for the model */ interface UiConfig { /** * Configuration for the input properties */ inputProperties?: { [key: string]: UiConfig.InputProperties; }; /** * Configuration for the loras component */ lorasComponent?: UiConfig.LorasComponent; /** * Configuration for the presets */ presets?: Array; /** * Configuration for the resolution component */ resolutionComponent?: UiConfig.ResolutionComponent; /** * Configuration for the selects */ selects?: { [key: string]: unknown; }; /** * Configuration for the trigger generate button */ triggerGenerate?: UiConfig.TriggerGenerate; } namespace UiConfig { interface InputProperties { collapsed?: boolean; } /** * Configuration for the loras component */ interface LorasComponent { /** * The label of the component */ label: string; /** * The input name of the model (model_array) */ modelInput: string; /** * The input name of the scale (number_array) */ scaleInput: string; /** * The input model id (example: a composition or a single LoRA modelId) If * specified, the model id will be attached to the output asset as a metadata If * the model-decomposer parser is specified on it, modelInput and scaleInput will * be automatically populated */ modelIdInput?: string; } interface Preset { fields: Array; presets: unknown; } /** * Configuration for the resolution component */ interface ResolutionComponent { /** * The input name of the height */ heightInput: string; /** * The label of the component */ label: string; /** * The resolution presets */ presets: Array; /** * The input name of the width */ widthInput: string; } namespace ResolutionComponent { interface Preset { height: number; label: string; width: number; } } /** * Configuration for the trigger generate button */ interface TriggerGenerate { label: string; /** * The 'name' of the input where the trigger generate button will be displayed * (after the input). Do not specify both position and after. */ after?: string; /** * The position of the trigger generate button. If position specified, the button * will be displayed at the specified position. Do not specify both position and * after. */ position?: 'bottom' | 'top'; } } } export type ModelDeleteResponse = unknown; export interface ModelCopyResponse { model: ModelCopyResponse.Model; } export declare namespace ModelCopyResponse { interface Model { /** * The model ID (example: "model_eyVcnFJcR92BxBkz7N6g5w") */ id: string; /** * List of model capabilities (example: ["txt2img", "img2img", * "txt2img_ip_adapter", ...]) */ capabilities: Array<'3d23d' | 'audio2audio' | 'audio2txt' | 'audio2video' | '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' | 'video23d' | 'video2audio' | 'video2img' | 'video2video'>; /** * A list of CollectionId this model belongs to */ collectionIds: Array; /** * The model creation date as an ISO string (example: "2023-02-03T11:19:41.579Z") */ createdAt: string; /** * Whether the model is a custom model and can be used only with POST * /generate/custom/{modelId} endpoint */ custom: boolean; /** * List of all example asset IDs setup by the model owner */ exampleAssetIds: Array; /** * The privacy of the model (default: private) */ privacy: 'private' | 'public' | 'unlisted'; /** * The source of the model */ source: 'civitai' | 'huggingface' | 'other' | 'scenario'; /** * The model status */ status: 'copying' | 'failed' | 'new' | 'trained' | 'training' | 'training-canceled'; /** * The associated tags (example: ["sci-fi", "landscape"]) */ tags: Array; /** * The total number of training images */ trainingImagesNumber: number; /** * The model type (example: "flux.1-lora") */ type: 'custom' | 'elevenlabs-voice' | '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' | 'flux.2-dev-edit-lora' | 'flux.2-dev-lora' | 'flux.2-klein-4b-edit-lora' | 'flux.2-klein-4b-lora' | 'flux.2-klein-9b-edit-lora' | 'flux.2-klein-9b-lora' | 'flux.2-klein-base-4b-edit-lora' | 'flux.2-klein-base-4b-lora' | 'flux.2-klein-base-9b-edit-lora' | 'flux.2-klein-base-9b-lora' | 'flux1.1-pro' | 'gpt-image-1' | 'qwen-image-2512-lora' | 'qwen-image-edit-2509-lora' | 'qwen-image-edit-2511-lora' | 'qwen-image-edit-lora' | 'qwen-image-lora' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora'; /** * The model last update date as an ISO string (example: * "2023-02-03T11:19:41.579Z") */ updatedAt: string; /** * The access restrictions of the model 0: Free plan 25: Creator plan 50: Pro plan * 75: Team plan 100: Enterprise plan */ accessRestrictions?: 0 | 100 | 25 | 50 | 75; /** * The author user ID (example: "user_VFhihHKMRZyDDnZAJwLb2Q") */ authorId?: string; /** * The class of the model */ class?: Model.Class; /** * List of base model IDs compliant with the model (example: ["flux.1-dev", * "flux.1-schnell"]) This attribute is mainly used for Flux LoRA models */ compliantModelIds?: Array; /** * The concepts is required for the type model: composition */ concepts?: Array; /** * When true, credits spent on a generation with this model are not automatically * refunded if the generation fails. Absent or false means failed generations are * refunded as usual. */ disableRefund?: boolean; /** * The epoch of the model. Only available for Flux Lora Trained models. If not set, * uses the final model epoch (latest) */ epoch?: string; /** * The epochs of the model. Only available for Flux Lora Trained models. */ epochs?: Array; /** * The inputs of the model. Only used for custom models. To retrieve this list, get * it by modelId with GET /models/{modelId} */ inputs?: Array; /** * The model keyword, this is a legacy parameter, please use conceptPrompt in * parameters */ modelKeyword?: string; /** * The model name (example: "Cinematic Realism") */ name?: string; /** * Fine-tune the model's inferences with negative prompt embedding */ negativePromptEmbedding?: string; /** * The owner ID (example: "team_VFhihHKMRZyDDnZAJwLb2Q") */ ownerId?: string; /** * The parameters of the model */ parameters?: Model.Parameters; /** * The id of the parent model */ parentModelId?: string; /** * Aggregated performance stats */ performanceStats?: Model.PerformanceStats; /** * Fine-tune the model's inferences with prompt embedding */ promptEmbedding?: string; /** * The model short description (example: "This model generates highly detailed * cinematic scenes.") */ shortDescription?: string; /** * The date when the model will be soft deleted (only for Free plan) */ softDeletionOn?: string; /** * A thumbnail for your model */ thumbnail?: Model.Thumbnail; /** * Array of training image pairs */ trainingImagePairs?: Array; /** * The URLs of the first 3 training images of the model. To retrieve the full set * of images, get it by modelId */ trainingImages?: Array; /** * Additional information about the training progress of the model */ trainingProgress?: Model.TrainingProgress; /** * Additional information about the model's training */ trainingStats?: Model.TrainingStats; /** * The UI configuration for the model */ uiConfig?: Model.UiConfig; /** * (Deprecated) The user ID (example: "user_VFhihHKMRZyDDnZAJwLb2Q") */ userId?: string; } namespace Model { /** * The class of the model */ interface Class { /** * The category slug of the class (example: "art-style") */ category: string; /** * The concept prompt of the class (example: "a sks character design") */ conceptPrompt: string; /** * The model ID of the class. Only available for legacy models. */ modelId: string; /** * The class name (example: "Character Design") */ name: string; /** * The class prompt (example: "a character design") */ prompt: string; /** * The class slug (example: "art-style-character-design") */ slug: string; /** * The class status (only published classes are listed, but unpublished classes can * still appear in existing models) */ status: 'published' | 'unpublished'; /** * Some example images URLs to showcase the class */ thumbnails: Array; } interface Concept { /** * The model ID (example: "model_eyVcnFJcR92BxBkz7N6g5w") */ modelId: string; /** * The scale of the model (example: 1.0) For Flux Kontext Prompt Editing, the scale * is between 0 and 2. */ scale: number; /** * The epoch of the model (example: "000001") Only available for Flux Lora Trained * models */ modelEpoch?: string; } interface Epoch { /** * The epoch hash to identify the epoch */ epoch: string; /** * The assets of the epoch if sample prompts as been supplied during training */ assets?: Array; } namespace Epoch { interface Asset { /** * The AssetId of the image during training (example: * "asset_GTrL3mq4SXWyMxkOHRxlpw") */ assetId: string; /** * The url of the asset */ url: string; } } /** * Defines the input parameters for a model. Use this to understand the available * input parameters for a given `modelId` when calling * `POST /generate/custom/{modelId}`. See {@link * https://docs.scenario.com/get-started/generation/video-generation} for examples. */ interface Input { /** * The name that must be user to call the model through the API */ name: string; /** * The data type of the input */ type: 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array'; /** * The allowed values for the input. For \`string\` or \`number\` types, creates a * single-select dropdown. For \`string_array\` type, creates a multi-select * dropdown. */ allowedValues?: Array; /** * Specifies the background behavior for the input. Only available for \`file\` and * \`file_array\` input types with kind \`image\`. */ backgroundBehavior?: 'opaque' | 'transparent'; /** * Whether the input is a color or not. Only available for \`string\` input type. */ color?: boolean; /** * Whether this input affects the model's cost calculation */ costImpact?: boolean; /** * The default value for the input */ default?: unknown; /** * Help text displayed in the UI to provide additional information about the input */ description?: string; /** * Used to visually group inputs together in the UI. Inputs with the same group * value appear consecutively in the UI. */ group?: string; /** * Hint text displayed in the UI as a tooltip to guide the user */ hint?: string; /** * The list of inputs which form an object within a container array. All inputs are * the same as the current object. This is only available for type inputs_array * inputs. */ inputs?: Array<{ [key: string]: unknown; }>; /** * The asset kind of the input. Only taken into account for \`file\` and * \`file_array\` input types. If model provides multiple kinds, the input will be * not able to create the asset on the flight on API side with dataurl without * data:kind, prefix */ kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'text' | 'video'; /** * The label displayed in the UI for this input */ label?: string; /** * The name of the file input field to use as the mask source */ maskFrom?: string; /** * The maximum allowed value. Only available for \`number\` and \`array\` input * types. */ max?: number; /** * The maximum allowed media duration in seconds. Only applies to \`file\` and * \`file_array\` input types for video and audio assets. Validated against * \`asset.properties.duration\` at job creation time. */ maxDuration?: number; /** * The maximum allowed length for \`string\` inputs. Also applies to each item in * \`string_array\`. */ maxLength?: number; /** * The maximum allowed file size in bytes. Only applies to \`file\` and * \`file_array\` input types. Validated against \`asset.properties.size\` at job * creation time. */ maxSize?: number; /** * The minimum allowed value. Only available for \`number\` and array input types. */ min?: number; /** * The minimum allowed length for string inputs. Also applies to each item in * \`string_array\`. */ minLength?: number; /** * The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only * available for \`model_array\` input type. */ modelTypes?: Array<'custom' | 'elevenlabs-voice' | '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' | 'flux.2-dev-edit-lora' | 'flux.2-dev-lora' | 'flux.2-klein-4b-edit-lora' | 'flux.2-klein-4b-lora' | 'flux.2-klein-9b-edit-lora' | 'flux.2-klein-9b-lora' | 'flux.2-klein-base-4b-edit-lora' | 'flux.2-klein-base-4b-lora' | 'flux.2-klein-base-9b-edit-lora' | 'flux.2-klein-base-9b-lora' | 'flux1.1-pro' | 'gpt-image-1' | 'qwen-image-2512-lora' | 'qwen-image-edit-2509-lora' | 'qwen-image-edit-2511-lora' | 'qwen-image-edit-lora' | 'qwen-image-lora' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora'>; /** * Whether this input represents a parent asset to assign to the produced assets. * Only available for \`file\` and \`file_array\` input types. * * For \`file_array\`, the parent asset is the first item in the array. */ parent?: boolean; /** * Placeholder text for the input. Only available for 'string' input type. */ placeholder?: string; /** * Whether the input is a prompt. When true, displays as a text area with prompt * spark feature. Only available for \`string\` input type. */ prompt?: boolean; /** * Whether the input is used with prompt spark. Only available for \`string\` input * type. */ promptSpark?: boolean; /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ required?: Input.Required; /** * The step increment for numeric inputs. Only available for \`number\` input type. */ step?: number; } namespace Input { /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ interface Required { /** * Whether the input is always required */ always?: boolean; /** * Makes this input required when another input has a specific value: * * - Key: name of the input to check * - Value: operation and allowed values that trigger the requirement */ conditionalValues?: unknown; /** * Makes this input required when another input is defined: * * - Key: name of the input that must be defined * - Value: message to display when this input is required */ ifDefined?: unknown; /** * Makes this input required when another input is not defined: * * - Key: name of the input that must be undefined * - Value: message to display when this input is required */ ifNotDefined?: unknown; } } /** * The parameters of the model */ interface Parameters { /** * Age group of the voice (for professional cloning) * * Only available for ElevenLabs voice training */ age?: string; /** * The batch size Less steps, and will increase the learning rate * * Only available for Flux LoRA training */ batchSize?: number; /** * The prompt to specify images in the same class as provided instance images * * Deprecated legacy training parameter. */ classPrompt?: string; /** * Type of voice cloning: "instant" (fast) or "professional" (higher quality, * requires captcha) * * Only available for ElevenLabs voice training */ cloneType?: string; /** * The prompt with identifier specifying the instance (or subject) of the class * (example: "a daiton dog") * * Default value varies depending on the model type. For Flux LoRA, the default is * an empty string. */ conceptPrompt?: string; /** * Gender of the voice (for professional cloning) * * Only available for ElevenLabs voice training */ gender?: string; /** * Language of the audio samples (ISO 639-1 code) * * Only available for ElevenLabs voice training */ language?: string; /** * Initial learning rate (after the potential warmup period) * * Default value varies depending on the model type. For Flux LoRA, the default is * 0.0001. */ learningRate?: number; /** * Initial learning rate (after the potential warmup period) for the text encoder * * Maximum [Flux LoRA: 0.001] Default [Flux LoRA: 0.00001] Minimum [Flux LoRA: * 0.000001] */ learningRateTextEncoder?: number; /** * Initial learning rate (after the potential warmup period) for the UNet * * Deprecated legacy training parameter. */ learningRateUnet?: number; /** * The scheduler type to use (default: "constant") * * Deprecated legacy training parameter. */ lrScheduler?: 'constant' | 'constant-with-warmup' | 'cosine' | 'cosine-with-restarts' | 'linear' | 'polynomial'; /** * Maximum number of training steps to execute (default: varies depending on the * model type) * * Default value varies depending on the model type: * * - For Flux: number of training images \* 100 * * Maximum value varies depending on the model type: * * - For Flux: [0, 10000] */ maxTrainSteps?: number; /** * The number of epochs to train for * * Only available for Flux LoRA training */ nbEpochs?: number; /** * The number of times to repeat the training * * Only available for Flux LoRA training */ nbRepeats?: number; /** * The number of training steps for the text encoder * * Deprecated legacy training parameter. */ numTextTrainSteps?: number; /** * The number of training steps for the UNet * * Deprecated legacy training parameter. */ numUNetTrainSteps?: number; /** * Optimize the model training task for a specific type of input images. The * available values are: * * - "likeness": optimize training for likeness or portrait (targets specific * transformer blocks) * - "all": train all transformer blocks * - "none": train no specific transformer blocks * * This parameter controls which double and single transformer blocks are trained * during the LoRA training process. * * Only available for Flux LoRA training */ optimizeFor?: 'likeness'; /** * The weight of prior preservation loss * * Deprecated legacy training parameter. */ priorLossWeight?: number; /** * Whether to random crop or center crop images before resizing to the working * resolution * * Deprecated legacy training parameter. */ randomCrop?: boolean; /** * Ratio of random crops * * Deprecated legacy training parameter. */ randomCropRatio?: number; /** * Scale of random crops * * Deprecated legacy training parameter. */ randomCropScale?: number; /** * The dimension of the LoRA update matrices * * Only available for Flux LoRA and Musubi training * * Default value varies depending on the model type: * * - For Flux: 16 * - For Musubi: 64 * * Each trainer enforces its own tighter limit (Flux LoRA: [2; 64], Musubi: [2; * 128]) */ rank?: number; /** * Whether to remove background noise from audio samples before cloning. When * enabled, each sample must be at least 5 seconds long. * * Only available for ElevenLabs voice training */ removeBackgroundNoise?: boolean; /** * The prompts to use for each epoch Only available for Flux LoRA training */ samplePrompts?: Array; /** * The sample prompt images (AssetIds) paired with samplePrompts Only available for * Flux LoRA training Must be the same length as samplePrompts */ sampleSourceImages?: Array; /** * Whether to scale the learning rate * * Note: Legacy parameter, will be ignored * * Deprecated legacy training parameter. */ scaleLr?: boolean; /** * Used to reproduce previous results. Default: randomly generated number. * * Deprecated legacy training parameter. */ seed?: number; /** * Whether to train the text encoder or not * * Example: For 100 steps and a value of 0.2, it means that the text encoder will * be trained for 20 steps and then the UNet for 80 steps * * Note: Legacy parameter, please use `numTextTrainSteps` and `numUNetTrainSteps` * * Deprecated legacy training parameter. */ textEncoderTrainingRatio?: number; /** * Validation frequency. Cannot be greater than maxTrainSteps value * * Deprecated legacy training parameter. */ validationFrequency?: number; /** * Validation prompt * * Deprecated legacy training parameter. */ validationPrompt?: string; /** * Description of the voice characteristics * * Only available for ElevenLabs voice training */ voiceDescription?: string; /** * The Weights And Bias key to use for logging. The maximum length is 40 characters */ wandbKey?: string; } /** * Aggregated performance stats */ interface PerformanceStats { /** * Performance metrics per variant */ variants: Array; /** * Default variant key for quick model comparison */ default?: string; } namespace PerformanceStats { /** * Performance stats for a model variant */ interface Variant { /** * The generation capability (example: "txt2img", "img2video", "txt2audio") */ capability: string; /** * When these stats were last computed (ISO date) */ computedAt: string; /** * Unique variant identifier (example: "txt2img:1K", "img2video:2K", "txt2audio") */ variantKey: string; /** * External quality score from arena.ai leaderboard */ arenaScore?: Variant.ArenaScore; /** * Maximum cost per output asset (CU) */ costPerAssetMaxCU?: number; /** * Minimum cost per output asset (CU) */ costPerAssetMinCU?: number; /** * Median cost per output asset (CU) */ costPerAssetP50CU?: number; /** * Inference latency P50 per output asset (seconds) */ inferenceLatencyP50Sec?: number; /** * Inference latency P75 per output asset (seconds) */ inferenceLatencyP75Sec?: number; /** * The resolution bucket (example: "0.5K", "1K", "2K", "4K") */ resolution?: string; /** * Total latency P50 per output asset, including queue time (seconds) */ totalLatencyP50Sec?: number; /** * Total latency P75 per output asset, including queue time (seconds) */ totalLatencyP75Sec?: number; } namespace Variant { /** * External quality score from arena.ai leaderboard */ interface ArenaScore { /** * Arena category (example: "text_to_image", "image_to_video") */ arenaCategory: string; /** * Model name on arena.ai */ arenaModelName: string; /** * When this score was last fetched (ISO date) */ fetchedAt: string; /** * Rank in the arena category */ rank: number; /** * ELO rating */ rating: number; /** * ELO rating confidence interval lower bound */ ratingLower: number; /** * ELO rating confidence interval upper bound */ ratingUpper: number; /** * Number of human votes */ votes: number; } } } /** * A thumbnail for your model */ interface Thumbnail { /** * The AssetId of the image used as a thumbnail for your model (example: * "asset_GTrL3mq4SXWyMxkOHRxlpw") */ assetId: string; /** * The url of the image used as a thumbnail for your model */ url: string; } interface TrainingImagePair { /** * The instruction for the image pair, source to target */ instruction?: string; /** * The source asset ID (must be a training asset) */ sourceId?: string; /** * The target asset ID (must be a training asset) */ targetId?: string; } interface TrainingImage { /** * The training image ID (example: "asset_GTrL3mq4SXWyMxkOHRxlpw") */ id: string; /** * Automatic captioning of the image */ automaticCaptioning: string; /** * The training image upload date as an ISO string (example: * "2023-02-03T11:19:41.579Z") */ createdAt: string; /** * Description for the image */ description: string; /** * The URL of the image */ downloadUrl: string; /** * The original file name of the image (example: "my-training-image.jpg") */ name: string; } /** * Additional information about the training progress of the model */ interface TrainingProgress { /** * The stage of the request */ stage: 'pending' | 'pending-captcha' | 'queued-for-train' | 'ready-for-captcha' | 'running-train' | 'starting-train'; /** * Timestamp in milliseconds of the last time the training progress was updated */ updatedAt: number; /** * Signed URL of the captcha image to read aloud during PVC voice cloning. Only * present when stage === 'pending-captcha'. Overwritten on each retry. */ captchaImageUrl?: string; /** * Position of the job in the queue (ie. the number of job in the queue before this * one) */ position?: number; /** * The progress of the job */ progress?: number; /** * The remaining time in milliseconds */ remainingTimeMs?: number; /** * Last recoverable failure message during PVC. Present when the model has bounced * back to stage === 'ready-for-captcha' after a step 2 or step 3 failure (e.g. * captcha rejected, time limit exceeded). Surface above the retry button so the * user understands why they're back here. */ retryableError?: string; /** * Number of consecutive PVC step 2 / step 3 failures on this voice model. The * model is marked Failed when this reaches the platform's max retries. */ retryCount?: number; /** * The timestamp in millisecond marking the start of the process */ startedAt?: number; } /** * Additional information about the model's training */ interface TrainingStats { /** * The training end time as an ISO date string */ endedAt?: string; /** * The training queued duration in seconds */ queueDuration?: number; /** * The training start time as an ISO date string */ startedAt?: string; /** * The training duration in seconds */ trainDuration?: number; } /** * The UI configuration for the model */ interface UiConfig { /** * Configuration for the input properties */ inputProperties?: { [key: string]: UiConfig.InputProperties; }; /** * Configuration for the loras component */ lorasComponent?: UiConfig.LorasComponent; /** * Configuration for the presets */ presets?: Array; /** * Configuration for the resolution component */ resolutionComponent?: UiConfig.ResolutionComponent; /** * Configuration for the selects */ selects?: { [key: string]: unknown; }; /** * Configuration for the trigger generate button */ triggerGenerate?: UiConfig.TriggerGenerate; } namespace UiConfig { interface InputProperties { collapsed?: boolean; } /** * Configuration for the loras component */ interface LorasComponent { /** * The label of the component */ label: string; /** * The input name of the model (model_array) */ modelInput: string; /** * The input name of the scale (number_array) */ scaleInput: string; /** * The input model id (example: a composition or a single LoRA modelId) If * specified, the model id will be attached to the output asset as a metadata If * the model-decomposer parser is specified on it, modelInput and scaleInput will * be automatically populated */ modelIdInput?: string; } interface Preset { fields: Array; presets: unknown; } /** * Configuration for the resolution component */ interface ResolutionComponent { /** * The input name of the height */ heightInput: string; /** * The label of the component */ label: string; /** * The resolution presets */ presets: Array; /** * The input name of the width */ widthInput: string; } namespace ResolutionComponent { interface Preset { height: number; label: string; width: number; } } /** * Configuration for the trigger generate button */ interface TriggerGenerate { label: string; /** * The 'name' of the input where the trigger generate button will be displayed * (after the input). Do not specify both position and after. */ after?: string; /** * The position of the trigger generate button. If position specified, the button * will be displayed at the specified position. Do not specify both position and * after. */ position?: 'bottom' | 'top'; } } } } export type ModelDeleteImagesResponse = unknown; export interface ModelDownloadResponse { /** * The job id associated with the download request */ jobId: string; } export interface ModelGetBulkResponse { models: Array; } export declare namespace ModelGetBulkResponse { interface Model { /** * The model ID (example: "model_eyVcnFJcR92BxBkz7N6g5w") */ id: string; /** * The privacy of the model (default: private) */ privacy: 'private' | 'public' | 'unlisted'; /** * The model type (example: "flux.1-lora") */ type: 'custom' | 'elevenlabs-voice' | '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' | 'flux.2-dev-edit-lora' | 'flux.2-dev-lora' | 'flux.2-klein-4b-edit-lora' | 'flux.2-klein-4b-lora' | 'flux.2-klein-9b-edit-lora' | 'flux.2-klein-9b-lora' | 'flux.2-klein-base-4b-edit-lora' | 'flux.2-klein-base-4b-lora' | 'flux.2-klein-base-9b-edit-lora' | 'flux.2-klein-base-9b-lora' | 'flux1.1-pro' | 'gpt-image-1' | 'qwen-image-2512-lora' | 'qwen-image-edit-2509-lora' | 'qwen-image-edit-2511-lora' | 'qwen-image-edit-lora' | 'qwen-image-lora' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora'; /** * The access restrictions of the model 0: Free plan 25: Creator plan 50: Pro plan * 75: Team plan 100: Enterprise plan */ accessRestrictions?: 0 | 100 | 25 | 50 | 75; /** * The author user ID (example: "user_VFhihHKMRZyDDnZAJwLb2Q") */ authorId?: string; /** * List of model capabilities (example: ["txt2img", "img2img", * "txt2img_ip_adapter", ...]) */ capabilities?: Array<'3d23d' | 'audio2audio' | 'audio2txt' | 'audio2video' | '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' | 'video23d' | 'video2audio' | 'video2img' | 'video2video'>; /** * The class of the model */ class?: Model.Class; /** * A list of CollectionId this model belongs to */ collectionIds?: Array; /** * List of base model IDs compliant with the model (example: ["flux.1-dev", * "flux.1-schnell"]) This attribute is mainly used for Flux LoRA models */ compliantModelIds?: Array; /** * The concepts is required for the type model: composition */ concepts?: Array; /** * The model creation date as an ISO string (example: "2023-02-03T11:19:41.579Z") */ createdAt?: string; /** * Whether the model is a custom model and can be used only with POST * /generate/custom/{modelId} endpoint */ custom?: boolean; /** * When true, credits spent on a generation with this model are not automatically * refunded if the generation fails. Absent or false means failed generations are * refunded as usual. */ disableRefund?: boolean; /** * The epoch of the model. Only available for Flux Lora Trained models. If not set, * uses the final model epoch (latest) */ epoch?: string; /** * The epochs of the model. Only available for Flux Lora Trained models. */ epochs?: Array; /** * List of all example asset IDs setup by the model owner */ exampleAssetIds?: Array; /** * The inputs of the model. Only used for custom models. To retrieve this list, get * it by modelId with GET /models/{modelId} */ inputs?: Array; /** * The model keyword, this is a legacy parameter, please use conceptPrompt in * parameters */ modelKeyword?: string; /** * The model name (example: "Cinematic Realism") */ name?: string; /** * Fine-tune the model's inferences with negative prompt embedding */ negativePromptEmbedding?: string; /** * The owner ID (example: "team_VFhihHKMRZyDDnZAJwLb2Q") */ ownerId?: string; /** * The parameters of the model */ parameters?: Model.Parameters; /** * The id of the parent model */ parentModelId?: string; /** * Aggregated performance stats */ performanceStats?: Model.PerformanceStats; /** * Fine-tune the model's inferences with prompt embedding */ promptEmbedding?: string; /** * The model short description (example: "This model generates highly detailed * cinematic scenes.") */ shortDescription?: string; /** * The date when the model will be soft deleted (only for Free plan) */ softDeletionOn?: string; /** * The source of the model */ source?: 'civitai' | 'huggingface' | 'other' | 'scenario'; /** * The model status */ status?: 'copying' | 'failed' | 'new' | 'trained' | 'training' | 'training-canceled'; /** * The associated tags (example: ["sci-fi", "landscape"]) */ tags?: Array; /** * A thumbnail for your model */ thumbnail?: Model.Thumbnail; /** * Array of training image pairs */ trainingImagePairs?: Array; /** * The URLs of the first 3 training images of the model. To retrieve the full set * of images, get it by modelId */ trainingImages?: Array; /** * The total number of training images */ trainingImagesNumber?: number; /** * Additional information about the training progress of the model */ trainingProgress?: Model.TrainingProgress; /** * Additional information about the model's training */ trainingStats?: Model.TrainingStats; /** * The UI configuration for the model */ uiConfig?: Model.UiConfig; /** * The model last update date as an ISO string (example: * "2023-02-03T11:19:41.579Z") */ updatedAt?: string; /** * (Deprecated) The user ID (example: "user_VFhihHKMRZyDDnZAJwLb2Q") */ userId?: string; } namespace Model { /** * The class of the model */ interface Class { /** * The category slug of the class (example: "art-style") */ category: string; /** * The concept prompt of the class (example: "a sks character design") */ conceptPrompt: string; /** * The model ID of the class. Only available for legacy models. */ modelId: string; /** * The class name (example: "Character Design") */ name: string; /** * The class prompt (example: "a character design") */ prompt: string; /** * The class slug (example: "art-style-character-design") */ slug: string; /** * The class status (only published classes are listed, but unpublished classes can * still appear in existing models) */ status: 'published' | 'unpublished'; /** * Some example images URLs to showcase the class */ thumbnails: Array; } interface Concept { /** * The model ID (example: "model_eyVcnFJcR92BxBkz7N6g5w") */ modelId: string; /** * The scale of the model (example: 1.0) For Flux Kontext Prompt Editing, the scale * is between 0 and 2. */ scale: number; /** * The epoch of the model (example: "000001") Only available for Flux Lora Trained * models */ modelEpoch?: string; } interface Epoch { /** * The epoch hash to identify the epoch */ epoch: string; /** * The assets of the epoch if sample prompts as been supplied during training */ assets?: Array; } namespace Epoch { interface Asset { /** * The AssetId of the image during training (example: * "asset_GTrL3mq4SXWyMxkOHRxlpw") */ assetId: string; /** * The url of the asset */ url: string; } } /** * Defines the input parameters for a model. Use this to understand the available * input parameters for a given `modelId` when calling * `POST /generate/custom/{modelId}`. See {@link * https://docs.scenario.com/get-started/generation/video-generation} for examples. */ interface Input { /** * The name that must be user to call the model through the API */ name: string; /** * The data type of the input */ type: 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array'; /** * The allowed values for the input. For \`string\` or \`number\` types, creates a * single-select dropdown. For \`string_array\` type, creates a multi-select * dropdown. */ allowedValues?: Array; /** * Specifies the background behavior for the input. Only available for \`file\` and * \`file_array\` input types with kind \`image\`. */ backgroundBehavior?: 'opaque' | 'transparent'; /** * Whether the input is a color or not. Only available for \`string\` input type. */ color?: boolean; /** * Whether this input affects the model's cost calculation */ costImpact?: boolean; /** * The default value for the input */ default?: unknown; /** * Help text displayed in the UI to provide additional information about the input */ description?: string; /** * Used to visually group inputs together in the UI. Inputs with the same group * value appear consecutively in the UI. */ group?: string; /** * Hint text displayed in the UI as a tooltip to guide the user */ hint?: string; /** * The list of inputs which form an object within a container array. All inputs are * the same as the current object. This is only available for type inputs_array * inputs. */ inputs?: Array<{ [key: string]: unknown; }>; /** * The asset kind of the input. Only taken into account for \`file\` and * \`file_array\` input types. If model provides multiple kinds, the input will be * not able to create the asset on the flight on API side with dataurl without * data:kind, prefix */ kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'text' | 'video'; /** * The label displayed in the UI for this input */ label?: string; /** * The name of the file input field to use as the mask source */ maskFrom?: string; /** * The maximum allowed value. Only available for \`number\` and \`array\` input * types. */ max?: number; /** * The maximum allowed media duration in seconds. Only applies to \`file\` and * \`file_array\` input types for video and audio assets. Validated against * \`asset.properties.duration\` at job creation time. */ maxDuration?: number; /** * The maximum allowed length for \`string\` inputs. Also applies to each item in * \`string_array\`. */ maxLength?: number; /** * The maximum allowed file size in bytes. Only applies to \`file\` and * \`file_array\` input types. Validated against \`asset.properties.size\` at job * creation time. */ maxSize?: number; /** * The minimum allowed value. Only available for \`number\` and array input types. */ min?: number; /** * The minimum allowed length for string inputs. Also applies to each item in * \`string_array\`. */ minLength?: number; /** * The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only * available for \`model_array\` input type. */ modelTypes?: Array<'custom' | 'elevenlabs-voice' | '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' | 'flux.2-dev-edit-lora' | 'flux.2-dev-lora' | 'flux.2-klein-4b-edit-lora' | 'flux.2-klein-4b-lora' | 'flux.2-klein-9b-edit-lora' | 'flux.2-klein-9b-lora' | 'flux.2-klein-base-4b-edit-lora' | 'flux.2-klein-base-4b-lora' | 'flux.2-klein-base-9b-edit-lora' | 'flux.2-klein-base-9b-lora' | 'flux1.1-pro' | 'gpt-image-1' | 'qwen-image-2512-lora' | 'qwen-image-edit-2509-lora' | 'qwen-image-edit-2511-lora' | 'qwen-image-edit-lora' | 'qwen-image-lora' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora'>; /** * Whether this input represents a parent asset to assign to the produced assets. * Only available for \`file\` and \`file_array\` input types. * * For \`file_array\`, the parent asset is the first item in the array. */ parent?: boolean; /** * Placeholder text for the input. Only available for 'string' input type. */ placeholder?: string; /** * Whether the input is a prompt. When true, displays as a text area with prompt * spark feature. Only available for \`string\` input type. */ prompt?: boolean; /** * Whether the input is used with prompt spark. Only available for \`string\` input * type. */ promptSpark?: boolean; /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ required?: Input.Required; /** * The step increment for numeric inputs. Only available for \`number\` input type. */ step?: number; } namespace Input { /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ interface Required { /** * Whether the input is always required */ always?: boolean; /** * Makes this input required when another input has a specific value: * * - Key: name of the input to check * - Value: operation and allowed values that trigger the requirement */ conditionalValues?: unknown; /** * Makes this input required when another input is defined: * * - Key: name of the input that must be defined * - Value: message to display when this input is required */ ifDefined?: unknown; /** * Makes this input required when another input is not defined: * * - Key: name of the input that must be undefined * - Value: message to display when this input is required */ ifNotDefined?: unknown; } } /** * The parameters of the model */ interface Parameters { /** * Age group of the voice (for professional cloning) * * Only available for ElevenLabs voice training */ age?: string; /** * The batch size Less steps, and will increase the learning rate * * Only available for Flux LoRA training */ batchSize?: number; /** * The prompt to specify images in the same class as provided instance images * * Deprecated legacy training parameter. */ classPrompt?: string; /** * Type of voice cloning: "instant" (fast) or "professional" (higher quality, * requires captcha) * * Only available for ElevenLabs voice training */ cloneType?: string; /** * The prompt with identifier specifying the instance (or subject) of the class * (example: "a daiton dog") * * Default value varies depending on the model type. For Flux LoRA, the default is * an empty string. */ conceptPrompt?: string; /** * Gender of the voice (for professional cloning) * * Only available for ElevenLabs voice training */ gender?: string; /** * Language of the audio samples (ISO 639-1 code) * * Only available for ElevenLabs voice training */ language?: string; /** * Initial learning rate (after the potential warmup period) * * Default value varies depending on the model type. For Flux LoRA, the default is * 0.0001. */ learningRate?: number; /** * Initial learning rate (after the potential warmup period) for the text encoder * * Maximum [Flux LoRA: 0.001] Default [Flux LoRA: 0.00001] Minimum [Flux LoRA: * 0.000001] */ learningRateTextEncoder?: number; /** * Initial learning rate (after the potential warmup period) for the UNet * * Deprecated legacy training parameter. */ learningRateUnet?: number; /** * The scheduler type to use (default: "constant") * * Deprecated legacy training parameter. */ lrScheduler?: 'constant' | 'constant-with-warmup' | 'cosine' | 'cosine-with-restarts' | 'linear' | 'polynomial'; /** * Maximum number of training steps to execute (default: varies depending on the * model type) * * Default value varies depending on the model type: * * - For Flux: number of training images \* 100 * * Maximum value varies depending on the model type: * * - For Flux: [0, 10000] */ maxTrainSteps?: number; /** * The number of epochs to train for * * Only available for Flux LoRA training */ nbEpochs?: number; /** * The number of times to repeat the training * * Only available for Flux LoRA training */ nbRepeats?: number; /** * The number of training steps for the text encoder * * Deprecated legacy training parameter. */ numTextTrainSteps?: number; /** * The number of training steps for the UNet * * Deprecated legacy training parameter. */ numUNetTrainSteps?: number; /** * Optimize the model training task for a specific type of input images. The * available values are: * * - "likeness": optimize training for likeness or portrait (targets specific * transformer blocks) * - "all": train all transformer blocks * - "none": train no specific transformer blocks * * This parameter controls which double and single transformer blocks are trained * during the LoRA training process. * * Only available for Flux LoRA training */ optimizeFor?: 'likeness'; /** * The weight of prior preservation loss * * Deprecated legacy training parameter. */ priorLossWeight?: number; /** * Whether to random crop or center crop images before resizing to the working * resolution * * Deprecated legacy training parameter. */ randomCrop?: boolean; /** * Ratio of random crops * * Deprecated legacy training parameter. */ randomCropRatio?: number; /** * Scale of random crops * * Deprecated legacy training parameter. */ randomCropScale?: number; /** * The dimension of the LoRA update matrices * * Only available for Flux LoRA and Musubi training * * Default value varies depending on the model type: * * - For Flux: 16 * - For Musubi: 64 * * Each trainer enforces its own tighter limit (Flux LoRA: [2; 64], Musubi: [2; * 128]) */ rank?: number; /** * Whether to remove background noise from audio samples before cloning. When * enabled, each sample must be at least 5 seconds long. * * Only available for ElevenLabs voice training */ removeBackgroundNoise?: boolean; /** * The prompts to use for each epoch Only available for Flux LoRA training */ samplePrompts?: Array; /** * The sample prompt images (AssetIds) paired with samplePrompts Only available for * Flux LoRA training Must be the same length as samplePrompts */ sampleSourceImages?: Array; /** * Whether to scale the learning rate * * Note: Legacy parameter, will be ignored * * Deprecated legacy training parameter. */ scaleLr?: boolean; /** * Used to reproduce previous results. Default: randomly generated number. * * Deprecated legacy training parameter. */ seed?: number; /** * Whether to train the text encoder or not * * Example: For 100 steps and a value of 0.2, it means that the text encoder will * be trained for 20 steps and then the UNet for 80 steps * * Note: Legacy parameter, please use `numTextTrainSteps` and `numUNetTrainSteps` * * Deprecated legacy training parameter. */ textEncoderTrainingRatio?: number; /** * Validation frequency. Cannot be greater than maxTrainSteps value * * Deprecated legacy training parameter. */ validationFrequency?: number; /** * Validation prompt * * Deprecated legacy training parameter. */ validationPrompt?: string; /** * Description of the voice characteristics * * Only available for ElevenLabs voice training */ voiceDescription?: string; /** * The Weights And Bias key to use for logging. The maximum length is 40 characters */ wandbKey?: string; } /** * Aggregated performance stats */ interface PerformanceStats { /** * Performance metrics per variant */ variants: Array; /** * Default variant key for quick model comparison */ default?: string; } namespace PerformanceStats { /** * Performance stats for a model variant */ interface Variant { /** * The generation capability (example: "txt2img", "img2video", "txt2audio") */ capability: string; /** * When these stats were last computed (ISO date) */ computedAt: string; /** * Unique variant identifier (example: "txt2img:1K", "img2video:2K", "txt2audio") */ variantKey: string; /** * External quality score from arena.ai leaderboard */ arenaScore?: Variant.ArenaScore; /** * Maximum cost per output asset (CU) */ costPerAssetMaxCU?: number; /** * Minimum cost per output asset (CU) */ costPerAssetMinCU?: number; /** * Median cost per output asset (CU) */ costPerAssetP50CU?: number; /** * Inference latency P50 per output asset (seconds) */ inferenceLatencyP50Sec?: number; /** * Inference latency P75 per output asset (seconds) */ inferenceLatencyP75Sec?: number; /** * The resolution bucket (example: "0.5K", "1K", "2K", "4K") */ resolution?: string; /** * Total latency P50 per output asset, including queue time (seconds) */ totalLatencyP50Sec?: number; /** * Total latency P75 per output asset, including queue time (seconds) */ totalLatencyP75Sec?: number; } namespace Variant { /** * External quality score from arena.ai leaderboard */ interface ArenaScore { /** * Arena category (example: "text_to_image", "image_to_video") */ arenaCategory: string; /** * Model name on arena.ai */ arenaModelName: string; /** * When this score was last fetched (ISO date) */ fetchedAt: string; /** * Rank in the arena category */ rank: number; /** * ELO rating */ rating: number; /** * ELO rating confidence interval lower bound */ ratingLower: number; /** * ELO rating confidence interval upper bound */ ratingUpper: number; /** * Number of human votes */ votes: number; } } } /** * A thumbnail for your model */ interface Thumbnail { /** * The AssetId of the image used as a thumbnail for your model (example: * "asset_GTrL3mq4SXWyMxkOHRxlpw") */ assetId: string; /** * The url of the image used as a thumbnail for your model */ url: string; } interface TrainingImagePair { /** * The instruction for the image pair, source to target */ instruction?: string; /** * The source asset ID (must be a training asset) */ sourceId?: string; /** * The target asset ID (must be a training asset) */ targetId?: string; } interface TrainingImage { /** * The training image ID (example: "asset_GTrL3mq4SXWyMxkOHRxlpw") */ id: string; /** * Automatic captioning of the image */ automaticCaptioning: string; /** * The training image upload date as an ISO string (example: * "2023-02-03T11:19:41.579Z") */ createdAt: string; /** * Description for the image */ description: string; /** * The URL of the image */ downloadUrl: string; /** * The original file name of the image (example: "my-training-image.jpg") */ name: string; } /** * Additional information about the training progress of the model */ interface TrainingProgress { /** * The stage of the request */ stage: 'pending' | 'pending-captcha' | 'queued-for-train' | 'ready-for-captcha' | 'running-train' | 'starting-train'; /** * Timestamp in milliseconds of the last time the training progress was updated */ updatedAt: number; /** * Signed URL of the captcha image to read aloud during PVC voice cloning. Only * present when stage === 'pending-captcha'. Overwritten on each retry. */ captchaImageUrl?: string; /** * Position of the job in the queue (ie. the number of job in the queue before this * one) */ position?: number; /** * The progress of the job */ progress?: number; /** * The remaining time in milliseconds */ remainingTimeMs?: number; /** * Last recoverable failure message during PVC. Present when the model has bounced * back to stage === 'ready-for-captcha' after a step 2 or step 3 failure (e.g. * captcha rejected, time limit exceeded). Surface above the retry button so the * user understands why they're back here. */ retryableError?: string; /** * Number of consecutive PVC step 2 / step 3 failures on this voice model. The * model is marked Failed when this reaches the platform's max retries. */ retryCount?: number; /** * The timestamp in millisecond marking the start of the process */ startedAt?: number; } /** * Additional information about the model's training */ interface TrainingStats { /** * The training end time as an ISO date string */ endedAt?: string; /** * The training queued duration in seconds */ queueDuration?: number; /** * The training start time as an ISO date string */ startedAt?: string; /** * The training duration in seconds */ trainDuration?: number; } /** * The UI configuration for the model */ interface UiConfig { /** * Configuration for the input properties */ inputProperties?: { [key: string]: UiConfig.InputProperties; }; /** * Configuration for the loras component */ lorasComponent?: UiConfig.LorasComponent; /** * Configuration for the presets */ presets?: Array; /** * Configuration for the resolution component */ resolutionComponent?: UiConfig.ResolutionComponent; /** * Configuration for the selects */ selects?: { [key: string]: unknown; }; /** * Configuration for the trigger generate button */ triggerGenerate?: UiConfig.TriggerGenerate; } namespace UiConfig { interface InputProperties { collapsed?: boolean; } /** * Configuration for the loras component */ interface LorasComponent { /** * The label of the component */ label: string; /** * The input name of the model (model_array) */ modelInput: string; /** * The input name of the scale (number_array) */ scaleInput: string; /** * The input model id (example: a composition or a single LoRA modelId) If * specified, the model id will be attached to the output asset as a metadata If * the model-decomposer parser is specified on it, modelInput and scaleInput will * be automatically populated */ modelIdInput?: string; } interface Preset { fields: Array; presets: unknown; } /** * Configuration for the resolution component */ interface ResolutionComponent { /** * The input name of the height */ heightInput: string; /** * The label of the component */ label: string; /** * The resolution presets */ presets: Array; /** * The input name of the width */ widthInput: string; } namespace ResolutionComponent { interface Preset { height: number; label: string; width: number; } } /** * Configuration for the trigger generate button */ interface TriggerGenerate { label: string; /** * The 'name' of the input where the trigger generate button will be displayed * (after the input). Do not specify both position and after. */ after?: string; /** * The position of the trigger generate button. If position specified, the button * will be displayed at the specified position. Do not specify both position and * after. */ position?: 'bottom' | 'top'; } } } } export interface ModelTransferResponse { model: ModelTransferResponse.Model; } export declare namespace ModelTransferResponse { interface Model { /** * The model ID (example: "model_eyVcnFJcR92BxBkz7N6g5w") */ id: string; /** * List of model capabilities (example: ["txt2img", "img2img", * "txt2img_ip_adapter", ...]) */ capabilities: Array<'3d23d' | 'audio2audio' | 'audio2txt' | 'audio2video' | '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' | 'video23d' | 'video2audio' | 'video2img' | 'video2video'>; /** * A list of CollectionId this model belongs to */ collectionIds: Array; /** * The model creation date as an ISO string (example: "2023-02-03T11:19:41.579Z") */ createdAt: string; /** * Whether the model is a custom model and can be used only with POST * /generate/custom/{modelId} endpoint */ custom: boolean; /** * List of all example asset IDs setup by the model owner */ exampleAssetIds: Array; /** * The privacy of the model (default: private) */ privacy: 'private' | 'public' | 'unlisted'; /** * The source of the model */ source: 'civitai' | 'huggingface' | 'other' | 'scenario'; /** * The model status */ status: 'copying' | 'failed' | 'new' | 'trained' | 'training' | 'training-canceled'; /** * The associated tags (example: ["sci-fi", "landscape"]) */ tags: Array; /** * The total number of training images */ trainingImagesNumber: number; /** * The model type (example: "flux.1-lora") */ type: 'custom' | 'elevenlabs-voice' | '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' | 'flux.2-dev-edit-lora' | 'flux.2-dev-lora' | 'flux.2-klein-4b-edit-lora' | 'flux.2-klein-4b-lora' | 'flux.2-klein-9b-edit-lora' | 'flux.2-klein-9b-lora' | 'flux.2-klein-base-4b-edit-lora' | 'flux.2-klein-base-4b-lora' | 'flux.2-klein-base-9b-edit-lora' | 'flux.2-klein-base-9b-lora' | 'flux1.1-pro' | 'gpt-image-1' | 'qwen-image-2512-lora' | 'qwen-image-edit-2509-lora' | 'qwen-image-edit-2511-lora' | 'qwen-image-edit-lora' | 'qwen-image-lora' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora'; /** * The model last update date as an ISO string (example: * "2023-02-03T11:19:41.579Z") */ updatedAt: string; /** * The access restrictions of the model 0: Free plan 25: Creator plan 50: Pro plan * 75: Team plan 100: Enterprise plan */ accessRestrictions?: 0 | 100 | 25 | 50 | 75; /** * The author user ID (example: "user_VFhihHKMRZyDDnZAJwLb2Q") */ authorId?: string; /** * The class of the model */ class?: Model.Class; /** * List of base model IDs compliant with the model (example: ["flux.1-dev", * "flux.1-schnell"]) This attribute is mainly used for Flux LoRA models */ compliantModelIds?: Array; /** * The concepts is required for the type model: composition */ concepts?: Array; /** * When true, credits spent on a generation with this model are not automatically * refunded if the generation fails. Absent or false means failed generations are * refunded as usual. */ disableRefund?: boolean; /** * The epoch of the model. Only available for Flux Lora Trained models. If not set, * uses the final model epoch (latest) */ epoch?: string; /** * The epochs of the model. Only available for Flux Lora Trained models. */ epochs?: Array; /** * The inputs of the model. Only used for custom models. To retrieve this list, get * it by modelId with GET /models/{modelId} */ inputs?: Array; /** * The model keyword, this is a legacy parameter, please use conceptPrompt in * parameters */ modelKeyword?: string; /** * The model name (example: "Cinematic Realism") */ name?: string; /** * Fine-tune the model's inferences with negative prompt embedding */ negativePromptEmbedding?: string; /** * The owner ID (example: "team_VFhihHKMRZyDDnZAJwLb2Q") */ ownerId?: string; /** * The parameters of the model */ parameters?: Model.Parameters; /** * The id of the parent model */ parentModelId?: string; /** * Aggregated performance stats */ performanceStats?: Model.PerformanceStats; /** * Fine-tune the model's inferences with prompt embedding */ promptEmbedding?: string; /** * The model short description (example: "This model generates highly detailed * cinematic scenes.") */ shortDescription?: string; /** * The date when the model will be soft deleted (only for Free plan) */ softDeletionOn?: string; /** * A thumbnail for your model */ thumbnail?: Model.Thumbnail; /** * Array of training image pairs */ trainingImagePairs?: Array; /** * The URLs of the first 3 training images of the model. To retrieve the full set * of images, get it by modelId */ trainingImages?: Array; /** * Additional information about the training progress of the model */ trainingProgress?: Model.TrainingProgress; /** * Additional information about the model's training */ trainingStats?: Model.TrainingStats; /** * The UI configuration for the model */ uiConfig?: Model.UiConfig; /** * (Deprecated) The user ID (example: "user_VFhihHKMRZyDDnZAJwLb2Q") */ userId?: string; } namespace Model { /** * The class of the model */ interface Class { /** * The category slug of the class (example: "art-style") */ category: string; /** * The concept prompt of the class (example: "a sks character design") */ conceptPrompt: string; /** * The model ID of the class. Only available for legacy models. */ modelId: string; /** * The class name (example: "Character Design") */ name: string; /** * The class prompt (example: "a character design") */ prompt: string; /** * The class slug (example: "art-style-character-design") */ slug: string; /** * The class status (only published classes are listed, but unpublished classes can * still appear in existing models) */ status: 'published' | 'unpublished'; /** * Some example images URLs to showcase the class */ thumbnails: Array; } interface Concept { /** * The model ID (example: "model_eyVcnFJcR92BxBkz7N6g5w") */ modelId: string; /** * The scale of the model (example: 1.0) For Flux Kontext Prompt Editing, the scale * is between 0 and 2. */ scale: number; /** * The epoch of the model (example: "000001") Only available for Flux Lora Trained * models */ modelEpoch?: string; } interface Epoch { /** * The epoch hash to identify the epoch */ epoch: string; /** * The assets of the epoch if sample prompts as been supplied during training */ assets?: Array; } namespace Epoch { interface Asset { /** * The AssetId of the image during training (example: * "asset_GTrL3mq4SXWyMxkOHRxlpw") */ assetId: string; /** * The url of the asset */ url: string; } } /** * Defines the input parameters for a model. Use this to understand the available * input parameters for a given `modelId` when calling * `POST /generate/custom/{modelId}`. See {@link * https://docs.scenario.com/get-started/generation/video-generation} for examples. */ interface Input { /** * The name that must be user to call the model through the API */ name: string; /** * The data type of the input */ type: 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array'; /** * The allowed values for the input. For \`string\` or \`number\` types, creates a * single-select dropdown. For \`string_array\` type, creates a multi-select * dropdown. */ allowedValues?: Array; /** * Specifies the background behavior for the input. Only available for \`file\` and * \`file_array\` input types with kind \`image\`. */ backgroundBehavior?: 'opaque' | 'transparent'; /** * Whether the input is a color or not. Only available for \`string\` input type. */ color?: boolean; /** * Whether this input affects the model's cost calculation */ costImpact?: boolean; /** * The default value for the input */ default?: unknown; /** * Help text displayed in the UI to provide additional information about the input */ description?: string; /** * Used to visually group inputs together in the UI. Inputs with the same group * value appear consecutively in the UI. */ group?: string; /** * Hint text displayed in the UI as a tooltip to guide the user */ hint?: string; /** * The list of inputs which form an object within a container array. All inputs are * the same as the current object. This is only available for type inputs_array * inputs. */ inputs?: Array<{ [key: string]: unknown; }>; /** * The asset kind of the input. Only taken into account for \`file\` and * \`file_array\` input types. If model provides multiple kinds, the input will be * not able to create the asset on the flight on API side with dataurl without * data:kind, prefix */ kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'text' | 'video'; /** * The label displayed in the UI for this input */ label?: string; /** * The name of the file input field to use as the mask source */ maskFrom?: string; /** * The maximum allowed value. Only available for \`number\` and \`array\` input * types. */ max?: number; /** * The maximum allowed media duration in seconds. Only applies to \`file\` and * \`file_array\` input types for video and audio assets. Validated against * \`asset.properties.duration\` at job creation time. */ maxDuration?: number; /** * The maximum allowed length for \`string\` inputs. Also applies to each item in * \`string_array\`. */ maxLength?: number; /** * The maximum allowed file size in bytes. Only applies to \`file\` and * \`file_array\` input types. Validated against \`asset.properties.size\` at job * creation time. */ maxSize?: number; /** * The minimum allowed value. Only available for \`number\` and array input types. */ min?: number; /** * The minimum allowed length for string inputs. Also applies to each item in * \`string_array\`. */ minLength?: number; /** * The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only * available for \`model_array\` input type. */ modelTypes?: Array<'custom' | 'elevenlabs-voice' | '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' | 'flux.2-dev-edit-lora' | 'flux.2-dev-lora' | 'flux.2-klein-4b-edit-lora' | 'flux.2-klein-4b-lora' | 'flux.2-klein-9b-edit-lora' | 'flux.2-klein-9b-lora' | 'flux.2-klein-base-4b-edit-lora' | 'flux.2-klein-base-4b-lora' | 'flux.2-klein-base-9b-edit-lora' | 'flux.2-klein-base-9b-lora' | 'flux1.1-pro' | 'gpt-image-1' | 'qwen-image-2512-lora' | 'qwen-image-edit-2509-lora' | 'qwen-image-edit-2511-lora' | 'qwen-image-edit-lora' | 'qwen-image-lora' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora'>; /** * Whether this input represents a parent asset to assign to the produced assets. * Only available for \`file\` and \`file_array\` input types. * * For \`file_array\`, the parent asset is the first item in the array. */ parent?: boolean; /** * Placeholder text for the input. Only available for 'string' input type. */ placeholder?: string; /** * Whether the input is a prompt. When true, displays as a text area with prompt * spark feature. Only available for \`string\` input type. */ prompt?: boolean; /** * Whether the input is used with prompt spark. Only available for \`string\` input * type. */ promptSpark?: boolean; /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ required?: Input.Required; /** * The step increment for numeric inputs. Only available for \`number\` input type. */ step?: number; } namespace Input { /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ interface Required { /** * Whether the input is always required */ always?: boolean; /** * Makes this input required when another input has a specific value: * * - Key: name of the input to check * - Value: operation and allowed values that trigger the requirement */ conditionalValues?: unknown; /** * Makes this input required when another input is defined: * * - Key: name of the input that must be defined * - Value: message to display when this input is required */ ifDefined?: unknown; /** * Makes this input required when another input is not defined: * * - Key: name of the input that must be undefined * - Value: message to display when this input is required */ ifNotDefined?: unknown; } } /** * The parameters of the model */ interface Parameters { /** * Age group of the voice (for professional cloning) * * Only available for ElevenLabs voice training */ age?: string; /** * The batch size Less steps, and will increase the learning rate * * Only available for Flux LoRA training */ batchSize?: number; /** * The prompt to specify images in the same class as provided instance images * * Deprecated legacy training parameter. */ classPrompt?: string; /** * Type of voice cloning: "instant" (fast) or "professional" (higher quality, * requires captcha) * * Only available for ElevenLabs voice training */ cloneType?: string; /** * The prompt with identifier specifying the instance (or subject) of the class * (example: "a daiton dog") * * Default value varies depending on the model type. For Flux LoRA, the default is * an empty string. */ conceptPrompt?: string; /** * Gender of the voice (for professional cloning) * * Only available for ElevenLabs voice training */ gender?: string; /** * Language of the audio samples (ISO 639-1 code) * * Only available for ElevenLabs voice training */ language?: string; /** * Initial learning rate (after the potential warmup period) * * Default value varies depending on the model type. For Flux LoRA, the default is * 0.0001. */ learningRate?: number; /** * Initial learning rate (after the potential warmup period) for the text encoder * * Maximum [Flux LoRA: 0.001] Default [Flux LoRA: 0.00001] Minimum [Flux LoRA: * 0.000001] */ learningRateTextEncoder?: number; /** * Initial learning rate (after the potential warmup period) for the UNet * * Deprecated legacy training parameter. */ learningRateUnet?: number; /** * The scheduler type to use (default: "constant") * * Deprecated legacy training parameter. */ lrScheduler?: 'constant' | 'constant-with-warmup' | 'cosine' | 'cosine-with-restarts' | 'linear' | 'polynomial'; /** * Maximum number of training steps to execute (default: varies depending on the * model type) * * Default value varies depending on the model type: * * - For Flux: number of training images \* 100 * * Maximum value varies depending on the model type: * * - For Flux: [0, 10000] */ maxTrainSteps?: number; /** * The number of epochs to train for * * Only available for Flux LoRA training */ nbEpochs?: number; /** * The number of times to repeat the training * * Only available for Flux LoRA training */ nbRepeats?: number; /** * The number of training steps for the text encoder * * Deprecated legacy training parameter. */ numTextTrainSteps?: number; /** * The number of training steps for the UNet * * Deprecated legacy training parameter. */ numUNetTrainSteps?: number; /** * Optimize the model training task for a specific type of input images. The * available values are: * * - "likeness": optimize training for likeness or portrait (targets specific * transformer blocks) * - "all": train all transformer blocks * - "none": train no specific transformer blocks * * This parameter controls which double and single transformer blocks are trained * during the LoRA training process. * * Only available for Flux LoRA training */ optimizeFor?: 'likeness'; /** * The weight of prior preservation loss * * Deprecated legacy training parameter. */ priorLossWeight?: number; /** * Whether to random crop or center crop images before resizing to the working * resolution * * Deprecated legacy training parameter. */ randomCrop?: boolean; /** * Ratio of random crops * * Deprecated legacy training parameter. */ randomCropRatio?: number; /** * Scale of random crops * * Deprecated legacy training parameter. */ randomCropScale?: number; /** * The dimension of the LoRA update matrices * * Only available for Flux LoRA and Musubi training * * Default value varies depending on the model type: * * - For Flux: 16 * - For Musubi: 64 * * Each trainer enforces its own tighter limit (Flux LoRA: [2; 64], Musubi: [2; * 128]) */ rank?: number; /** * Whether to remove background noise from audio samples before cloning. When * enabled, each sample must be at least 5 seconds long. * * Only available for ElevenLabs voice training */ removeBackgroundNoise?: boolean; /** * The prompts to use for each epoch Only available for Flux LoRA training */ samplePrompts?: Array; /** * The sample prompt images (AssetIds) paired with samplePrompts Only available for * Flux LoRA training Must be the same length as samplePrompts */ sampleSourceImages?: Array; /** * Whether to scale the learning rate * * Note: Legacy parameter, will be ignored * * Deprecated legacy training parameter. */ scaleLr?: boolean; /** * Used to reproduce previous results. Default: randomly generated number. * * Deprecated legacy training parameter. */ seed?: number; /** * Whether to train the text encoder or not * * Example: For 100 steps and a value of 0.2, it means that the text encoder will * be trained for 20 steps and then the UNet for 80 steps * * Note: Legacy parameter, please use `numTextTrainSteps` and `numUNetTrainSteps` * * Deprecated legacy training parameter. */ textEncoderTrainingRatio?: number; /** * Validation frequency. Cannot be greater than maxTrainSteps value * * Deprecated legacy training parameter. */ validationFrequency?: number; /** * Validation prompt * * Deprecated legacy training parameter. */ validationPrompt?: string; /** * Description of the voice characteristics * * Only available for ElevenLabs voice training */ voiceDescription?: string; /** * The Weights And Bias key to use for logging. The maximum length is 40 characters */ wandbKey?: string; } /** * Aggregated performance stats */ interface PerformanceStats { /** * Performance metrics per variant */ variants: Array; /** * Default variant key for quick model comparison */ default?: string; } namespace PerformanceStats { /** * Performance stats for a model variant */ interface Variant { /** * The generation capability (example: "txt2img", "img2video", "txt2audio") */ capability: string; /** * When these stats were last computed (ISO date) */ computedAt: string; /** * Unique variant identifier (example: "txt2img:1K", "img2video:2K", "txt2audio") */ variantKey: string; /** * External quality score from arena.ai leaderboard */ arenaScore?: Variant.ArenaScore; /** * Maximum cost per output asset (CU) */ costPerAssetMaxCU?: number; /** * Minimum cost per output asset (CU) */ costPerAssetMinCU?: number; /** * Median cost per output asset (CU) */ costPerAssetP50CU?: number; /** * Inference latency P50 per output asset (seconds) */ inferenceLatencyP50Sec?: number; /** * Inference latency P75 per output asset (seconds) */ inferenceLatencyP75Sec?: number; /** * The resolution bucket (example: "0.5K", "1K", "2K", "4K") */ resolution?: string; /** * Total latency P50 per output asset, including queue time (seconds) */ totalLatencyP50Sec?: number; /** * Total latency P75 per output asset, including queue time (seconds) */ totalLatencyP75Sec?: number; } namespace Variant { /** * External quality score from arena.ai leaderboard */ interface ArenaScore { /** * Arena category (example: "text_to_image", "image_to_video") */ arenaCategory: string; /** * Model name on arena.ai */ arenaModelName: string; /** * When this score was last fetched (ISO date) */ fetchedAt: string; /** * Rank in the arena category */ rank: number; /** * ELO rating */ rating: number; /** * ELO rating confidence interval lower bound */ ratingLower: number; /** * ELO rating confidence interval upper bound */ ratingUpper: number; /** * Number of human votes */ votes: number; } } } /** * A thumbnail for your model */ interface Thumbnail { /** * The AssetId of the image used as a thumbnail for your model (example: * "asset_GTrL3mq4SXWyMxkOHRxlpw") */ assetId: string; /** * The url of the image used as a thumbnail for your model */ url: string; } interface TrainingImagePair { /** * The instruction for the image pair, source to target */ instruction?: string; /** * The source asset ID (must be a training asset) */ sourceId?: string; /** * The target asset ID (must be a training asset) */ targetId?: string; } interface TrainingImage { /** * The training image ID (example: "asset_GTrL3mq4SXWyMxkOHRxlpw") */ id: string; /** * Automatic captioning of the image */ automaticCaptioning: string; /** * The training image upload date as an ISO string (example: * "2023-02-03T11:19:41.579Z") */ createdAt: string; /** * Description for the image */ description: string; /** * The URL of the image */ downloadUrl: string; /** * The original file name of the image (example: "my-training-image.jpg") */ name: string; } /** * Additional information about the training progress of the model */ interface TrainingProgress { /** * The stage of the request */ stage: 'pending' | 'pending-captcha' | 'queued-for-train' | 'ready-for-captcha' | 'running-train' | 'starting-train'; /** * Timestamp in milliseconds of the last time the training progress was updated */ updatedAt: number; /** * Signed URL of the captcha image to read aloud during PVC voice cloning. Only * present when stage === 'pending-captcha'. Overwritten on each retry. */ captchaImageUrl?: string; /** * Position of the job in the queue (ie. the number of job in the queue before this * one) */ position?: number; /** * The progress of the job */ progress?: number; /** * The remaining time in milliseconds */ remainingTimeMs?: number; /** * Last recoverable failure message during PVC. Present when the model has bounced * back to stage === 'ready-for-captcha' after a step 2 or step 3 failure (e.g. * captcha rejected, time limit exceeded). Surface above the retry button so the * user understands why they're back here. */ retryableError?: string; /** * Number of consecutive PVC step 2 / step 3 failures on this voice model. The * model is marked Failed when this reaches the platform's max retries. */ retryCount?: number; /** * The timestamp in millisecond marking the start of the process */ startedAt?: number; } /** * Additional information about the model's training */ interface TrainingStats { /** * The training end time as an ISO date string */ endedAt?: string; /** * The training queued duration in seconds */ queueDuration?: number; /** * The training start time as an ISO date string */ startedAt?: string; /** * The training duration in seconds */ trainDuration?: number; } /** * The UI configuration for the model */ interface UiConfig { /** * Configuration for the input properties */ inputProperties?: { [key: string]: UiConfig.InputProperties; }; /** * Configuration for the loras component */ lorasComponent?: UiConfig.LorasComponent; /** * Configuration for the presets */ presets?: Array; /** * Configuration for the resolution component */ resolutionComponent?: UiConfig.ResolutionComponent; /** * Configuration for the selects */ selects?: { [key: string]: unknown; }; /** * Configuration for the trigger generate button */ triggerGenerate?: UiConfig.TriggerGenerate; } namespace UiConfig { interface InputProperties { collapsed?: boolean; } /** * Configuration for the loras component */ interface LorasComponent { /** * The label of the component */ label: string; /** * The input name of the model (model_array) */ modelInput: string; /** * The input name of the scale (number_array) */ scaleInput: string; /** * The input model id (example: a composition or a single LoRA modelId) If * specified, the model id will be attached to the output asset as a metadata If * the model-decomposer parser is specified on it, modelInput and scaleInput will * be automatically populated */ modelIdInput?: string; } interface Preset { fields: Array; presets: unknown; } /** * Configuration for the resolution component */ interface ResolutionComponent { /** * The input name of the height */ heightInput: string; /** * The label of the component */ label: string; /** * The resolution presets */ presets: Array; /** * The input name of the width */ widthInput: string; } namespace ResolutionComponent { interface Preset { height: number; label: string; width: number; } } /** * Configuration for the trigger generate button */ interface TriggerGenerate { label: string; /** * The 'name' of the input where the trigger generate button will be displayed * (after the input). Do not specify both position and after. */ after?: string; /** * The position of the trigger generate button. If position specified, the button * will be displayed at the specified position. Do not specify both position and * after. */ position?: 'bottom' | 'top'; } } } } export interface ModelUpdateTagsResponse { /** * The list of added tags */ added: Array; /** * The list of deleted tags */ deleted: Array; } export interface ModelCreateParams { /** * Query param: If set to true, returns the original asset without transformation */ originalAssets?: boolean; /** * Query param: The projectId used for ownership resource management. Either to * assert ownership or to set the owner of the resource(s) */ projectId?: string; /** * Body param: The ID of the base model to use as a starting point for the training * (example: "flux.1-dev") * * Value is automatically set based on the model's type. In case of doubt leave it * empty. */ baseModelId?: string; /** * Body param: The slug of the class you want to use (ex: * "characters-npcs-mobs-characters"). Set to null to unset the class */ classSlug?: string; /** * Body param: List of collection IDs to add the model to */ collectionIds?: Array; /** * Body param: The concepts is required for composition models. With one or more * loras * * Only applicable to Flux based models. */ concepts?: Array; /** * Body param: The model's name (ex: "Cinematic Realism"). * * If not set, the model's name will be automatically generated when starting * training based on training data. */ name?: string; /** * Body param: The model's short description (ex: "This model generates highly * detailed cinematic scenes."). * * If not set, the model's short description will be automatically generated when * starting training based on training data. */ shortDescription?: string; /** * Body param: The model's type (ex: "flux.1-lora"). * * The type can only be changed if the model has the "new" status. */ type?: 'custom' | 'elevenlabs-voice' | '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' | 'flux.2-dev-edit-lora' | 'flux.2-dev-lora' | 'flux.2-klein-4b-edit-lora' | 'flux.2-klein-4b-lora' | 'flux.2-klein-9b-edit-lora' | 'flux.2-klein-9b-lora' | 'flux.2-klein-base-4b-edit-lora' | 'flux.2-klein-base-4b-lora' | 'flux.2-klein-base-9b-edit-lora' | 'flux.2-klein-base-9b-lora' | 'flux1.1-pro' | 'gpt-image-1' | 'qwen-image-2512-lora' | 'qwen-image-edit-2509-lora' | 'qwen-image-edit-2511-lora' | 'qwen-image-edit-lora' | 'qwen-image-lora' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora'; } export declare namespace ModelCreateParams { interface Concept { /** * The model ID (example: "model_eyVcnFJcR92BxBkz7N6g5w") */ modelId: string; /** * The scale of the model (example: 1.0) For Flux Kontext Prompt Editing, the scale * is between 0 and 2. */ scale: number; /** * The epoch of the model (example: "000001") Only available for Flux Lora Trained * models */ modelEpoch?: string; } } export interface ModelRetrieveParams { /** * If set to true, returns the original asset without transformation */ originalAssets?: boolean; /** * The projectId used for ownership resource management. Either to assert ownership * or to set the owner of the resource(s) */ projectId?: string; } export interface ModelUpdateParams { /** * Query param: If set to true, returns the original asset without transformation */ originalAssets?: boolean; /** * Query param: The projectId used for ownership resource management. Either to * assert ownership or to set the owner of the resource(s) */ projectId?: string; /** * Body param: The slug of the class you want to use (ex: * "characters-npcs-mobs-characters"). Set to null to unset the class */ classSlug?: string; /** * Body param: The concepts is required for composition models. With one or more * loras * * Only applicable to Flux based models. */ concepts?: Array; /** * Body param: The epoch of the model. Only available for flux.1-lora and * flux.1-kontext-lora based models. * * The epoch can only be set if the model has epochs and is in status "trained". * * The default epoch (if not set) is the final model epoch (latest). * * Set to null to unset the epoch. */ epoch?: string; /** * Body param: The model's name (ex: "Cinematic Realism"). * * If not set, the model's name will be automatically generated when starting * training based on training data. */ name?: string; /** * Body param: Add a negative prompt embedding to every model's generation */ negativePromptEmbedding?: string; /** * Body param: The parameters to use for the model's training */ parameters?: ModelUpdateParams.Parameters; /** * Body param: Add a prompt embedding to every model's generation */ promptEmbedding?: string; /** * Body param: The model's short description (ex: "This model generates highly * detailed cinematic scenes."). * * If not set, the model's short description will be automatically generated when * starting training based on training data. */ shortDescription?: string; /** * Body param: The AssetId of the image you want to use as a thumbnail for the * model (example: "asset_GTrL3mq4SXWyMxkOHRxlpw"). Set to null to unset the * thumbnail */ thumbnail?: string; /** * Body param: The model's type (ex: "flux.1-lora"). * * The type can only be changed if the model has the "new" status. */ type?: 'custom' | 'elevenlabs-voice' | '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' | 'flux.2-dev-edit-lora' | 'flux.2-dev-lora' | 'flux.2-klein-4b-edit-lora' | 'flux.2-klein-4b-lora' | 'flux.2-klein-9b-edit-lora' | 'flux.2-klein-9b-lora' | 'flux.2-klein-base-4b-edit-lora' | 'flux.2-klein-base-4b-lora' | 'flux.2-klein-base-9b-edit-lora' | 'flux.2-klein-base-9b-lora' | 'flux1.1-pro' | 'gpt-image-1' | 'qwen-image-2512-lora' | 'qwen-image-edit-2509-lora' | 'qwen-image-edit-2511-lora' | 'qwen-image-edit-lora' | 'qwen-image-lora' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora'; } export declare namespace ModelUpdateParams { interface Concept { /** * The model ID (example: "model_eyVcnFJcR92BxBkz7N6g5w") */ modelId: string; /** * The scale of the model (example: 1.0) For Flux Kontext Prompt Editing, the scale * is between 0 and 2. */ scale: number; /** * The epoch of the model (example: "000001") Only available for Flux Lora Trained * models */ modelEpoch?: string; } /** * The parameters to use for the model's training */ interface Parameters { /** * Age group of the voice (for professional cloning) * * Only available for ElevenLabs voice training */ age?: string; /** * The batch size Less steps, and will increase the learning rate * * Only available for Flux LoRA training */ batchSize?: number; /** * The prompt to specify images in the same class as provided instance images * * Deprecated legacy training parameter. */ classPrompt?: string; /** * Type of voice cloning: "instant" (fast) or "professional" (higher quality, * requires captcha) * * Only available for ElevenLabs voice training */ cloneType?: string; /** * The prompt with identifier specifying the instance (or subject) of the class * (example: "a daiton dog") * * Default value varies depending on the model type. For Flux LoRA, the default is * an empty string. */ conceptPrompt?: string; /** * Gender of the voice (for professional cloning) * * Only available for ElevenLabs voice training */ gender?: string; /** * Language of the audio samples (ISO 639-1 code) * * Only available for ElevenLabs voice training */ language?: string; /** * Initial learning rate (after the potential warmup period) * * Default value varies depending on the model type. For Flux LoRA, the default is * 0.0001. */ learningRate?: number; /** * Initial learning rate (after the potential warmup period) for the text encoder * * Maximum [Flux LoRA: 0.001] Default [Flux LoRA: 0.00001] Minimum [Flux LoRA: * 0.000001] */ learningRateTextEncoder?: number; /** * Initial learning rate (after the potential warmup period) for the UNet * * Deprecated legacy training parameter. */ learningRateUnet?: number; /** * The scheduler type to use (default: "constant") * * Deprecated legacy training parameter. */ lrScheduler?: 'constant' | 'constant-with-warmup' | 'cosine' | 'cosine-with-restarts' | 'linear' | 'polynomial'; /** * Maximum number of training steps to execute (default: varies depending on the * model type) * * Default value varies depending on the model type: * * - For Flux: number of training images \* 100 * * Maximum value varies depending on the model type: * * - For Flux: [0, 10000] */ maxTrainSteps?: number; /** * The number of epochs to train for * * Only available for Flux LoRA training */ nbEpochs?: number; /** * The number of times to repeat the training * * Only available for Flux LoRA training */ nbRepeats?: number; /** * The number of training steps for the text encoder * * Deprecated legacy training parameter. */ numTextTrainSteps?: number; /** * The number of training steps for the UNet * * Deprecated legacy training parameter. */ numUNetTrainSteps?: number; /** * Optimize the model training task for a specific type of input images. The * available values are: * * - "likeness": optimize training for likeness or portrait (targets specific * transformer blocks) * - "all": train all transformer blocks * - "none": train no specific transformer blocks * * This parameter controls which double and single transformer blocks are trained * during the LoRA training process. * * Only available for Flux LoRA training */ optimizeFor?: 'likeness'; /** * The weight of prior preservation loss * * Deprecated legacy training parameter. */ priorLossWeight?: number; /** * Whether to random crop or center crop images before resizing to the working * resolution * * Deprecated legacy training parameter. */ randomCrop?: boolean; /** * Ratio of random crops * * Deprecated legacy training parameter. */ randomCropRatio?: number; /** * Scale of random crops * * Deprecated legacy training parameter. */ randomCropScale?: number; /** * The dimension of the LoRA update matrices * * Only available for Flux LoRA and Musubi training * * Default value varies depending on the model type: * * - For Flux: 16 * - For Musubi: 64 * * Each trainer enforces its own tighter limit (Flux LoRA: [2; 64], Musubi: [2; * 128]) */ rank?: number; /** * Whether to remove background noise from audio samples before cloning. When * enabled, each sample must be at least 5 seconds long. * * Only available for ElevenLabs voice training */ removeBackgroundNoise?: boolean; /** * The prompts to use for each epoch Only available for Flux LoRA training */ samplePrompts?: Array; /** * The sample prompt images (AssetIds) paired with samplePrompts Only available for * Flux LoRA training Must be the same length as samplePrompts */ sampleSourceImages?: Array; /** * Whether to scale the learning rate * * Note: Legacy parameter, will be ignored * * Deprecated legacy training parameter. */ scaleLr?: boolean; /** * Used to reproduce previous results. Default: randomly generated number. * * Deprecated legacy training parameter. */ seed?: number; /** * Whether to train the text encoder or not * * Example: For 100 steps and a value of 0.2, it means that the text encoder will * be trained for 20 steps and then the UNet for 80 steps * * Note: Legacy parameter, please use `numTextTrainSteps` and `numUNetTrainSteps` * * Deprecated legacy training parameter. */ textEncoderTrainingRatio?: number; /** * Validation frequency. Cannot be greater than maxTrainSteps value * * Deprecated legacy training parameter. */ validationFrequency?: number; /** * Validation prompt * * Deprecated legacy training parameter. */ validationPrompt?: string; /** * Description of the voice characteristics * * Only available for ElevenLabs voice training */ voiceDescription?: string; /** * The Weights And Bias key to use for logging. The maximum length is 40 characters */ wandbKey?: string; } } export interface ModelListParams extends ModelsCursorParams { /** * If set to true, returns the full list of models (including blacklisted models) * (only available for team admins) */ blacklisted?: boolean; /** * When provided, only the models in the Collection will be returned. Only * available when privacy=private/unlisted (note: this is different from * collectionIds which is only for privacy=public) */ collectionId?: string; /** * List of collection ids, comma separated. Only available when privacy=public */ collectionIds?: string; /** * Filter results to only return models created after the specified ISO string date * (exclusive). Requires the sortBy parameter to be "createdAt". Available for both * privacy=public and privacy=private/unlisted */ createdAfter?: string; /** * Filter results to only return models created before the specified ISO string * date (exclusive). Requires the sortBy parameter to be "createdAt". Available for * both privacy=public and privacy=private/unlisted */ createdBefore?: string; /** * If set to true, returns the list of models currently loaded on GPU */ loadedOnly?: boolean; /** * If set to true, returns the original asset without transformation */ originalAssets?: boolean; /** * The number of items to return in the response. The default value is 100, maximum * value is 500, minimum value is 1 */ pageSize?: number; /** * The privacy of the models to return. The default value is `private`, possible * values are `private` and `public` */ privacy?: 'private' | 'public'; /** * The projectId used for ownership resource management. Either to assert ownership * or to set the owner of the resource(s) */ projectId?: string; /** * Sort results by createdAt, updatedAt, or score. When privacy=public, defaults to * score if not specified. When privacy=private/unlisted, supports createdAt and * score (default: createdAt). When sortBy=score for privacy=private/unlisted, both * privacy and status query parameters are required. */ sortBy?: 'createdAt' | 'updatedAt' | 'score'; /** * Sort results in ascending (asc) or descending (desc) order. Only used when * sortBy is specified. Available for both privacy=public and * privacy=private/unlisted. For public models, this parameter is ignored when * sortBy is not specified or set to score. */ sortDirection?: 'asc' | 'desc'; /** * The status of the models to return. Only available when privacy=private/unlisted */ status?: 'new' | 'training' | 'trained' | 'failed' | 'deleted'; /** * List of tags, comma separated. Only available when privacy=public */ tags?: string; /** * List all the models of a specific type. The parameter "type" and "types" cannot * be used together. Can be any of the following values: flux.1, flux.1-lora, * flux.1-kontext-dev, flux.1-krea-dev, flux.1-kontext-lora, flux.1-krea-lora, * flux.1-composition, flux.1-pro, flux1.1-pro, flux.1.1-pro-ultra, * flux.2-dev-lora, flux.2-dev-edit-lora, flux.2-klein-4b-lora, * flux.2-klein-9b-lora, flux.2-klein-base-4b-lora, flux.2-klein-base-9b-lora, * flux.2-klein-4b-edit-lora, flux.2-klein-9b-edit-lora, * flux.2-klein-base-4b-edit-lora, flux.2-klein-base-9b-edit-lora, gpt-image-1, * qwen-image-lora, qwen-image-2512-lora, qwen-image-edit-lora, * qwen-image-edit-2509-lora, qwen-image-edit-2511-lora, zimage-lora, * zimage-turbo-lora, zimage-de-turbo-lora, custom, elevenlabs-voice. Only * available when privacy=public */ type?: 'flux.1' | 'flux.1-lora' | 'flux.1-kontext-dev' | 'flux.1-krea-dev' | 'flux.1-kontext-lora' | 'flux.1-krea-lora' | 'flux.1-composition' | 'flux.1-pro' | 'flux1.1-pro' | 'flux.1.1-pro-ultra' | 'flux.2-dev-lora' | 'flux.2-dev-edit-lora' | 'flux.2-klein-4b-lora' | 'flux.2-klein-9b-lora' | 'flux.2-klein-base-4b-lora' | 'flux.2-klein-base-9b-lora' | 'flux.2-klein-4b-edit-lora' | 'flux.2-klein-9b-edit-lora' | 'flux.2-klein-base-4b-edit-lora' | 'flux.2-klein-base-9b-edit-lora' | 'gpt-image-1' | 'qwen-image-lora' | 'qwen-image-2512-lora' | 'qwen-image-edit-lora' | 'qwen-image-edit-2509-lora' | 'qwen-image-edit-2511-lora' | 'zimage-lora' | 'zimage-turbo-lora' | 'zimage-de-turbo-lora' | 'custom' | 'elevenlabs-voice'; /** * List of types, comma separated. The parameter "type" and "types" cannot be used * together. Can be any of the following values: flux.1, flux.1-lora, * flux.1-kontext-dev, flux.1-krea-dev, flux.1-kontext-lora, flux.1-krea-lora, * flux.1-composition, flux.1-pro, flux1.1-pro, flux.1.1-pro-ultra, * flux.2-dev-lora, flux.2-dev-edit-lora, flux.2-klein-4b-lora, * flux.2-klein-9b-lora, flux.2-klein-base-4b-lora, flux.2-klein-base-9b-lora, * flux.2-klein-4b-edit-lora, flux.2-klein-9b-edit-lora, * flux.2-klein-base-4b-edit-lora, flux.2-klein-base-9b-edit-lora, gpt-image-1, * qwen-image-lora, qwen-image-2512-lora, qwen-image-edit-lora, * qwen-image-edit-2509-lora, qwen-image-edit-2511-lora, zimage-lora, * zimage-turbo-lora, zimage-de-turbo-lora, custom, elevenlabs-voice. Only * available when privacy=public */ types?: Array<'flux.1' | 'flux.1-lora' | 'flux.1-kontext-dev' | 'flux.1-krea-dev' | 'flux.1-kontext-lora' | 'flux.1-krea-lora' | 'flux.1-composition' | 'flux.1-pro' | 'flux1.1-pro' | 'flux.1.1-pro-ultra' | 'flux.2-dev-lora' | 'flux.2-dev-edit-lora' | 'flux.2-klein-4b-lora' | 'flux.2-klein-9b-lora' | 'flux.2-klein-base-4b-lora' | 'flux.2-klein-base-9b-lora' | 'flux.2-klein-4b-edit-lora' | 'flux.2-klein-9b-edit-lora' | 'flux.2-klein-base-4b-edit-lora' | 'flux.2-klein-base-9b-edit-lora' | 'gpt-image-1' | 'qwen-image-lora' | 'qwen-image-2512-lora' | 'qwen-image-edit-lora' | 'qwen-image-edit-2509-lora' | 'qwen-image-edit-2511-lora' | 'zimage-lora' | 'zimage-turbo-lora' | 'zimage-de-turbo-lora' | 'custom' | 'elevenlabs-voice'>; /** * Filter results to only return models updated after the specified ISO string date * (exclusive). Requires the sortBy parameter to be "updatedAt". Only available * when privacy=public */ updatedAfter?: string; /** * Filter results to only return models updated before the specified ISO string * date (exclusive). Requires the sortBy parameter to be "updatedAt". Only * available when privacy=public */ updatedBefore?: string; } export interface ModelDeleteParams { /** * The projectId used for ownership resource management. Either to assert ownership * or to set the owner of the resource(s) */ projectId?: string; } export interface ModelCopyParams { /** * Query param: If set to true, returns the original asset without transformation */ originalAssets?: boolean; /** * Query param: The projectId used for ownership resource management. Either to * assert ownership or to set the owner of the resource(s) */ projectId?: string; /** * Body param: If set to true, the training data will be copied */ copyAsTrained?: boolean; /** * Body param: true by default, the example images will be copied */ copyExamples?: boolean; } export interface ModelDeleteImagesParams { /** * The asset ids of the images to delete */ ids: Array; /** * The projectId used for ownership resource management. Either to assert ownership * or to set the owner of the resource(s) */ projectId?: string; } export interface ModelDownloadParams { /** * Query param: The projectId used for ownership resource management. Either to * assert ownership or to set the owner of the resource(s) */ projectId?: string; /** * Body param: The epoch hash of the model to download Only available for Flux Lora * Trained models with epochs Will only apply to the main model in the download * request If not set, the default (latest or setup at model level) epoch will be * used */ modelEpoch?: string; } export interface ModelGetBulkParams { /** * Query param: If set to true, returns the original asset without transformation */ originalAssets?: boolean; /** * Query param: The projectId used for ownership resource management. Either to * assert ownership or to set the owner of the resource(s) */ projectId?: string; /** * Body param: If true will return all training images; otherwise returns only the * first 3 training images. * * If `trainingImagesPreview` set to true, this parameter is ignored. */ allTrainingImages?: boolean; /** * Body param: If true will return only the base details of the model (id, name, * type) * * if true, all other parameters are ignored */ minimal?: boolean; /** * Body param: The list of model IDs to include in the response */ modelIds?: Array; /** * Body param: If true, will return the settings: `promptEmbedding` and * `negativePromptEmbedding`. */ settings?: boolean; /** * Body param: If true will return the thumbnail, when no thumbnail is set, will * try to fetch the first training image instead. */ thumbnail?: boolean; /** * Body param: If true will return the first 3 training images; otherwise returns * the full training images. * * If `allTrainingImages` set to true, this parameter is ignored. */ trainingImagesPreview?: boolean; } export interface ModelTransferParams { /** * Body param: The id of the project to copy and transfer the model to */ destinationProjectId: string; /** * Query param: The projectId used for ownership resource management. Either to * assert ownership or to set the owner of the resource(s) */ projectId?: string; /** * Body param: The id of the team to copy and transfer the model to */ destinationTeamId?: string; } export interface ModelUpdateTagsParams { /** * Query param: The projectId used for ownership resource management. Either to * assert ownership or to set the owner of the resource(s) */ projectId?: string; /** * Body param: The list of tags to add */ add?: Array; /** * Body param: The list of tags to delete */ delete?: Array; /** * Body param: If true, the function will throw an error if: * * - one of the tags to add already exists * - one of the tags to delete is not found If false, the endpoint will behave as * if it was idempotent */ strict?: boolean; } export declare namespace Models { export { type ModelCreateResponse as ModelCreateResponse, type ModelRetrieveResponse as ModelRetrieveResponse, type ModelUpdateResponse as ModelUpdateResponse, type ModelListResponse as ModelListResponse, type ModelDeleteResponse as ModelDeleteResponse, type ModelCopyResponse as ModelCopyResponse, type ModelDeleteImagesResponse as ModelDeleteImagesResponse, type ModelDownloadResponse as ModelDownloadResponse, type ModelGetBulkResponse as ModelGetBulkResponse, type ModelTransferResponse as ModelTransferResponse, type ModelUpdateTagsResponse as ModelUpdateTagsResponse, type ModelListResponsesModelsCursor as ModelListResponsesModelsCursor, type ModelCreateParams as ModelCreateParams, type ModelRetrieveParams as ModelRetrieveParams, type ModelUpdateParams as ModelUpdateParams, type ModelListParams as ModelListParams, type ModelDeleteParams as ModelDeleteParams, type ModelCopyParams as ModelCopyParams, type ModelDeleteImagesParams as ModelDeleteImagesParams, type ModelDownloadParams as ModelDownloadParams, type ModelGetBulkParams as ModelGetBulkParams, type ModelTransferParams as ModelTransferParams, type ModelUpdateTagsParams as ModelUpdateTagsParams, }; export { Description as Description, type DescriptionRetrieveResponse as DescriptionRetrieveResponse, type DescriptionUpdateResponse as DescriptionUpdateResponse, type DescriptionRetrieveParams as DescriptionRetrieveParams, type DescriptionUpdateParams as DescriptionUpdateParams, }; export { Examples as Examples, type ExampleUpdateResponse as ExampleUpdateResponse, type ExampleListResponse as ExampleListResponse, type ExampleUpdateParams as ExampleUpdateParams, type ExampleListParams as ExampleListParams, }; export { Train as Train, type TrainActionResponse as TrainActionResponse, type TrainTriggerResponse as TrainTriggerResponse, type TrainActionParams as TrainActionParams, type TrainTriggerParams as TrainTriggerParams, }; export { TrainingImages as TrainingImages, type TrainingImageDeleteResponse as TrainingImageDeleteResponse, type TrainingImageAddResponse as TrainingImageAddResponse, type TrainingImageReplaceResponse as TrainingImageReplaceResponse, type TrainingImageReplacePairsResponse as TrainingImageReplacePairsResponse, type TrainingImageDeleteParams as TrainingImageDeleteParams, type TrainingImageAddParams as TrainingImageAddParams, type TrainingImageReplaceParams as TrainingImageReplaceParams, type TrainingImageReplacePairsParams as TrainingImageReplacePairsParams, }; } //# sourceMappingURL=models.d.ts.map