// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../core/resource'; import { APIPromise } from '../../core/api-promise'; import { RequestOptions } from '../../internal/request-options'; import { path } from '../../internal/utils/path'; export class Examples extends APIResource { /** * Add/delete/sort examples of the given `modelId` */ update( modelID: string, params: ExampleUpdateParams, options?: RequestOptions, ): APIPromise { const { originalAssets, projectId, ...body } = params; return this._client.put(path`/models/${modelID}/examples`, { query: { originalAssets, projectId }, body, ...options, }); } /** * List all examples of the given `modelId` */ list( modelID: string, query: ExampleListParams | null | undefined = {}, options?: RequestOptions, ): APIPromise { return this._client.get(path`/models/${modelID}/examples`, { query, ...options }); } } export interface ExampleUpdateResponse { examples: Array; } export namespace ExampleUpdateResponse { export interface Example { /** * Asset generated by the inference */ asset: Example.Asset; /** * Model id of the model used to generate the asset */ modelId: string; /** * Inference id of the inference used to generate the asset */ inferenceId?: string; /** * The inference parameters used to generate the asset */ inferenceParameters?: Example.InferenceParameters; /** * The job associated with the asset */ job?: Example.Job; } export namespace Example { /** * Asset generated by the inference */ export interface Asset { /** * The asset ID (example: "asset_GTrL3mq4SXWyMxkOHRxlpw") */ id: string; /** * The author user ID (example: "dcf121faaa1a0a0bbbd9ca1b73d62aea") */ authorId: string; /** * A list of CollectionId this asset belongs to */ collectionIds: Array; /** * The asset creation date as an ISO string (example: "2023-02-03T11:19:41.579Z") */ createdAt: string; /** * List of edit capabilities */ editCapabilities: Array< | 'DETECTION' | 'GENERATIVE_FILL' | 'PIXELATE' | 'PROMPT_EDITING' | 'REFINE' | 'REFRAME' | 'REMOVE_BACKGROUND' | 'SEGMENTATION' | 'UPSCALE' | 'UPSCALE_360' | 'VECTORIZATION' >; /** * The kind of asset */ kind: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'text' | 'video'; /** * Metadata of the asset with some additional information */ metadata: Asset.Metadata; /** * The mime type of the asset (example: "image/png") */ mimeType: string; /** * The owner (project) ID (example: "proj_23tlk332lkht3kl2" or * "team_dlkhgs23tlk3hlkth32lkht3kl2" for old teams) */ ownerId: string; /** * The privacy of the asset */ privacy: 'private' | 'public' | 'unlisted'; /** * The properties of the asset, content may depend on the kind of asset returned */ properties: Asset.Properties; /** * source of the asset */ source: | '3d23d' | '3d23d:texture' | '3d:texture' | '3d:texture:albedo' | '3d:texture:metallic' | '3d:texture:mtl' | '3d:texture:normal' | '3d:texture:roughness' | 'audio2audio' | 'audio2txt' | 'audio2video' | 'background-removal' | 'canvas' | 'canvas-drawing' | 'canvas-export' | 'detection' | 'generative-fill' | 'image-prompt-editing' | 'img23d' | 'img2img' | 'img2splat' | 'img2txt' | 'img2video' | 'inference-control-net' | 'inference-control-net-img' | 'inference-control-net-inpainting' | 'inference-control-net-inpainting-ip-adapter' | 'inference-control-net-ip-adapter' | 'inference-control-net-reference' | 'inference-control-net-texture' | 'inference-img' | 'inference-img-ip-adapter' | 'inference-img-texture' | 'inference-in-paint' | 'inference-in-paint-ip-adapter' | 'inference-reference' | 'inference-reference-texture' | 'inference-txt' | 'inference-txt-ip-adapter' | 'inference-txt-texture' | 'patch' | 'pixelization' | 'reframe' | 'restyle' | 'segment' | 'segmentation-image' | 'segmentation-mask' | 'skybox-3d' | 'skybox-base-360' | 'skybox-hdri' | 'texture' | 'texture:albedo' | 'texture:ao' | 'texture:edge' | 'texture:height' | 'texture:metallic' | 'texture:normal' | 'texture:smoothness' | 'txt23d' | 'txt2audio' | 'txt2img' | 'txt2txt' | 'txt2video' | 'unknown' | 'uploaded' | 'uploaded-3d' | 'uploaded-audio' | 'uploaded-avatar' | 'uploaded-text' | 'uploaded-video' | 'upscale' | 'upscale-skybox' | 'upscale-texture' | 'upscale-video' | 'vectorization' | 'video23d' | 'video2audio' | 'video2img' | 'video2video' | 'voice-clone'; /** * The actual status */ status: 'error' | 'pending' | 'success'; /** * The associated tags (example: ["sci-fi", "landscape"]) */ tags: Array; /** * The asset last update date as an ISO string (example: * "2023-02-03T11:19:41.579Z") */ updatedAt: string; /** * Signed URL to get the asset content */ url: string; /** * Automatic captioning of the asset */ automaticCaptioning?: string; /** * The description, it will contain in priority: * * - the manual description * - the advanced captioning when the asset is used in training flow * - the automatic captioning */ description?: string; /** * The embedding of the asset when requested. * * Only available when an asset can be embedded (ie: not Detection maps) */ embedding?: Array; /** * The video asset's first frame. * * Contains the assetId and the url of the first frame. */ firstFrame?: Asset.FirstFrame; /** * Whether the asset is hidden. */ isHidden?: boolean; /** * The video asset's last frame. * * Contains the assetId and the url of the last frame. */ lastFrame?: Asset.LastFrame; /** * The NSFW labels */ nsfw?: Array; /** * The original file url. * * Contains the url of the original file. without any conversion. Only available * for some specific video, audio and threeD assets. Is only specified if the given * asset data has been replaced with a new file during the creation of the asset. */ originalFileUrl?: string; /** * The output index of the asset within a job This index is an positive integer * that starts at 0 It is used to differentiate between multiple outputs of the * same job If the job has only one output, this index is 0 */ outputIndex?: number; /** * The asset's preview. * * Contains the assetId and the url of the preview. */ preview?: Asset.Preview; /** * SlopGuard detection result, computed asynchronously after generation. * * `details` (the per-dimension reasons and suggestions) is returned only when the * asset is read with `withSlopGuardDetails=true`. */ slopGuard?: Asset.SlopGuard; /** * The asset's thumbnail. * * Contains the assetId and the url of the thumbnail. */ thumbnail?: Asset.Thumbnail; } export namespace Asset { /** * Metadata of the asset with some additional information */ export interface Metadata { kind: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'text' | 'video'; /** * The type of the asset. Ex: 'inference-txt2img' will represent an asset generated * from a text to image model */ type: | '3d-texture' | '3d-texture-albedo' | '3d-texture-metallic' | '3d-texture-mtl' | '3d-texture-normal' | '3d-texture-roughness' | '3d23d' | '3d23d-texture' | 'audio2audio' | 'audio2txt' | 'audio2video' | 'background-removal' | 'canvas' | 'canvas-drawing' | 'canvas-export' | 'detection' | 'generative-fill' | 'image-prompt-editing' | 'img23d' | 'img2img' | 'img2splat' | 'img2txt' | 'img2video' | 'inference-controlnet' | 'inference-controlnet-img2img' | 'inference-controlnet-inpaint' | 'inference-controlnet-inpaint-ip-adapter' | 'inference-controlnet-ip-adapter' | 'inference-controlnet-reference' | 'inference-controlnet-texture' | 'inference-img2img' | 'inference-img2img-ip-adapter' | 'inference-img2img-texture' | 'inference-inpaint' | 'inference-inpaint-ip-adapter' | 'inference-reference' | 'inference-reference-texture' | 'inference-txt2img' | 'inference-txt2img-ip-adapter' | 'inference-txt2img-texture' | 'patch' | 'pixelization' | 'reframe' | 'restyle' | 'segment' | 'segmentation-image' | 'segmentation-mask' | 'skybox-3d' | 'skybox-base-360' | 'skybox-hdri' | 'texture' | 'texture-albedo' | 'texture-ao' | 'texture-edge' | 'texture-height' | 'texture-metallic' | 'texture-normal' | 'texture-smoothness' | 'txt23d' | 'txt2audio' | 'txt2img' | 'txt2txt' | 'txt2video' | 'unknown' | 'uploaded' | 'uploaded-3d' | 'uploaded-audio' | 'uploaded-avatar' | 'uploaded-text' | 'uploaded-video' | 'upscale' | 'upscale-skybox' | 'upscale-texture' | 'upscale-video' | 'vectorization' | 'video23d' | 'video2audio' | 'video2img' | 'video2video' | 'voice-clone'; /** * How angular is the surface? 0 is like a sphere, 1 is like a mechanical object */ angular?: number; /** * The optional aspect ratio given for the generation, only applicable for some * models */ aspectRatio?: string; backgroundOpacity?: number; /** * The baseModelId that maybe changed at inference time */ baseModelId?: string; /** * A bounding box around the object of interest, in the format [x1, y1, x2, y2]. */ bbox?: Array; betterQuality?: boolean; /** * The control image already processed by canny detector. Must reference an * existing AssetId. */ cannyStructureImage?: string; /** * Activate clustering. */ clustering?: boolean; /** * Ensure upscaled tile have the same color histogram as original tile. */ colorCorrection?: boolean; colorMode?: string; colorPrecision?: number; /** * Flux Kontext LoRA to style the image. For Flux Kontext Prompt Editing. */ concepts?: Array; contours?: Array>>>; /** * End step for control. */ controlEnd?: number; /** * The date when the asset was copied to a project */ copiedAt?: string; cornerThreshold?: number; /** * Allow the generation of "hallucinations" during the upscale process, which adds * additional details and deviates from the original image. Default: optimized for * your preset and style. */ creativity?: number; /** * Amount of decay in creativity over the upscale process. The lowest the value, * the less the creativity will be preserved over the upscale process. */ creativityDecay?: number; /** * If true, use the default parameters */ defaultParameters?: boolean; /** * The depth fidelity if a depth image provided */ depthFidelity?: number; /** * The control image processed by depth estimator. Must reference an existing * AssetId. */ depthImage?: string; /** * Amount of details to remove or add */ detailsLevel?: number; dilate?: number; /** * Contrast factor for Grayscale detector */ factor?: number; filterSpeckle?: number; /** * Determine the scale at which the upscale process works. * * - With a small value, the upscale works at the largest scale, resulting in fewer * added details and more coherent images. Ideal for portraits, for example. * - With a large value, the upscale works at the smallest scale, resulting in more * added details and more hallucinations. Ideal for landscapes, for example. * * (info): A small value is slower and more expensive to run. */ fractality?: number; /** * Apply extra control to the Skybox 360 geometry. The higher the value, the more * the 360 geometry will influence the generated skybox image. * * Use with caution. Default is adapted to the other parameters. */ geometryEnforcement?: number; /** * The guidance used to generate this asset */ guidance?: number; halfMode?: boolean; hdr?: number; height?: number; /** * High threshold for Canny detector */ highThreshold?: number; /** * (deprecated) Horizontal expansion ratio. */ horizontalExpansionRatio?: number; /** * The input image to process. Must reference an existing AssetId or be a data URL. */ image?: string; /** * Strengthen the similarity to the original image during the upscale. Default: * optimized for your preset and style. */ imageFidelity?: number; /** * Preserve the seamless properties of skybox or texture images. Input has to be of * same type (seamless). */ imageType?: 'seamfull' | 'skybox' | 'texture'; /** * The id of the Inference describing how this image was generated */ inferenceId?: string; /** * When set to `high`, allows to better preserve details from the input images in * the output. This is especially useful when using images that contain elements * like faces or logos that require accurate preservation in the generated image. * * You can provide multiple input images that will all be preserved with high * fidelity, but keep in mind that the first image will be preserved with richer * textures and finer details, so if you include elements such as faces, consider * placing them in the first image. * * Only available for the `gpt-image-1` model. */ inputFidelity?: 'high' | 'low'; /** * Location of the input image in the output. */ inputLocation?: 'bottom' | 'left' | 'middle' | 'right' | 'top'; /** * To invert the relief */ invert?: boolean; /** * How polished is the surface? 0 is like a rough surface, 1 is like a mirror */ keypointThreshold?: number; layerDifference?: number; lengthThreshold?: number; /** * The ISO timestamp when the lock on the canvas will expire */ lockExpiresAt?: string; /** * Low threshold for Canny detector */ lowThreshold?: number; /** * The mask used for the asset generation or editing */ mask?: string; maxIterations?: number; /** * Maximum threshold for Grayscale conversion */ maxThreshold?: number; /** * Minimum threshold for Grayscale conversion */ minThreshold?: number; /** * Modality to detect */ modality?: | 'canny' | 'depth' | 'grayscale' | 'lineart_anime' | 'mlsd' | 'normal' | 'pose' | 'scribble' | 'segmentation' | 'sketch'; mode?: string; /** * The modelId used to generate this asset */ modelId?: string; /** * The type of the generator used */ modelType?: | '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'; name?: string; nbMasks?: number; /** * The negative prompt used to generate this asset */ negativePrompt?: string; /** * Controls the influence of the negative prompt. Default 0 means the negative * prompt has no effect. Higher values increase negative prompt influence. Must * be > 0 if negativePrompt is provided. */ negativePromptStrength?: number; /** * The number of denoising steps for each image generation. */ numInferenceSteps?: number; /** * The number of outputs to generate. */ numOutputs?: number; originalAssetId?: string; outputIndex?: number; /** * Overlap percentage for the output image. */ overlapPercentage?: number; /** * Override the embeddings of the model. Only your prompt and negativePrompt will * be used. Use with caution. */ overrideEmbeddings?: boolean; parentId?: string; parentJobId?: string; pathPrecision?: number; /** * List of points (label, x, y) in the image where label = 0 for background and 1 * for object. */ points?: Array>; /** * How polished is the surface? 0 is like a rough surface, 1 is like a mirror */ polished?: number; preset?: string; progressPercent?: number; /** * The prompt that guided the asset generation or editing */ prompt?: string; /** * Increase the fidelity to the prompt during upscale. Default: optimized for your * preset and style. */ promptFidelity?: number; /** * How raised is the surface? 0 is flat like water, 1 is like a very rough rock */ raised?: number; /** * The reference images used for the asset generation or editing */ referenceImages?: Array; /** * Additional refinement steps before scaling. * * If scalingFactor == 1, the refinement process will be applied (1 + * refinementSteps) times. If scalingFactor > 1, the refinement process will be * applied refinementSteps times. */ refinementSteps?: number; /** * Remove background for Grayscale detector */ removeBackground?: boolean; /** * Size proportion of the input image in the output. */ resizeOption?: number; /** * Boolean to output the contours. */ resultContours?: boolean; /** * Boolean to return the source image with the mask applied as alpha channel (RGBA * PNG, transparent background) instead of the binary mask. Mutually exclusive with * `resultMask` — passing both as `true` returns a 400 error. Note: * `backgroundOpacity` is no longer honored — alpha is binary (0/255) only. */ resultImage?: boolean; /** * Boolean to return the binary masks in the response. Mutually exclusive with * `resultImage` — passing both as `true` returns a 400 error. */ resultMask?: boolean; rootParentId?: string; /** * Save a flipbook of the texture. Deactivated when the input texture is larger * than 2048x2048px */ saveFlipbook?: boolean; /** * Scaling factor (when `targetWidth` not specified) */ scalingFactor?: number; /** * The scheduler used to generate this asset */ scheduler?: string; /** * The seed used to generate this asset. Can be a string or a number in some * cases . */ seed?: string; /** * Sharpen tiles. */ sharpen?: boolean; /** * How shiny is the surface? 0 is like a matte surface, 1 is like a diamond */ shiny?: number; size?: number; /** * Activate sketch detection instead of canny. */ sketch?: boolean; sourceProjectId?: string; spliceThreshold?: number; /** * The strength * * Only available for the `flux-kontext` LoRA model. */ strength?: number; /** * Strength for the input image structure preservation */ structureFidelity?: number; /** * The control image for structure. A canny detector will be applied to this image. * Must reference an existing AssetId. */ structureImage?: string; style?: | '3d-cartoon' | '3d-rendered' | 'anime' | 'cartoon' | 'cinematic' | 'claymation' | 'cloud-skydome' | 'comic' | 'cyberpunk' | 'enchanted' | 'fantasy' | 'ink' | 'manga' | 'manga-color' | 'minimalist' | 'neon-tron' | 'oil-painting' | 'pastel' | 'photo' | 'photography' | 'psychedelic' | 'retro-fantasy' | 'scifi-concept-art' | 'space' | 'standard' | 'whimsical'; /** * The higher the value the more it will look like the style image(s) */ styleFidelity?: number; /** * List of style images. Most of the time, only one image is enough. It must be * existing AssetIds. */ styleImages?: Array; /** * Condition the influence of the style image(s). The higher the value, the more * the style images will influence the upscaled image. */ styleImagesFidelity?: number; /** * The target height of the output image. */ targetHeight?: number; /** * Target width for the upscaled image, take priority over scaling factor */ targetWidth?: number; /** * A textual description / keywords describing the object of interest. */ text?: string; /** * The asset to convert in texture maps. Must reference an existing AssetId. */ texture?: string; /** * The thumbnail of the canvas */ thumbnail?: Metadata.Thumbnail; /** * If set to true, during the upscaling process, the model will match tiles of the * source image with tiles of the style image(s). This will result in a more * coherent restyle. Works best with style images that have a similar composition. */ tileStyle?: boolean; trainingImage?: boolean; /** * (deprecated) Vertical expansion ratio. */ verticalExpansionRatio?: number; /** * The width of the rendered image. */ width?: number; } export namespace Metadata { export 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 thumbnail of the canvas */ export interface Thumbnail { /** * The AssetId of the image used as a thumbnail for the canvas (example: * "asset_GTrL3mq4SXWyMxkOHRxlpw") */ assetId: string; /** * The url of the image used as a thumbnail for the canvas */ url: string; } } /** * The properties of the asset, content may depend on the kind of asset returned */ export interface Properties { size: number; /** * Number of animation frames if animations exist */ animationFrameCount?: number; /** * Bitrate of the media in bits per second */ bitrate?: number; /** * Number of bones if skeleton exists */ boneCount?: number; /** * Recommended preview camera mode emitted by the generator (gsplat route); passed * through to mesh-rendering verbatim. */ cameraMode?: 'aerial' | 'interior' | 'turntable'; /** * Recommended preview camera path emitted by the generator (gsplat route); passed * through to mesh-rendering verbatim. */ cameraTrajectory?: Array; /** * Number of channels of the audio */ channels?: number; /** * Number of Unicode code points in the text. Code-point-aware (so a non-BMP emoji * counts as 1) but not full grapheme-cluster aware (a ZWJ sequence still counts as * several). */ charCount?: number; /** * Classification of the audio */ classification?: 'effect' | 'interview' | 'music' | 'other' | 'sound' | 'speech' | 'text' | 'unknown'; /** * Codec name of the media */ codecName?: string; /** * Description of the audio */ description?: string; /** * Bounding box dimensions [width, height, depth] */ dimensions?: Array; /** * Duration of the media in seconds */ duration?: number; /** * Number of faces/triangles in the mesh */ faceCount?: number; /** * Format of the mesh file (e.g. 'glb', etc.) */ format?: string; /** * Frame rate of the video in frames per second */ frameRate?: number; /** * Whether the mesh has animations */ hasAnimations?: boolean; /** * True when `preview` holds the entire content unmodified — consumers can use it * directly without fetching `asset.url`. False or undefined means the content * exceeds the preview budget and consumers must fetch the full body from S3 to * read past the preview. */ hasFullPreview?: boolean; /** * Whether the mesh has normal vectors */ hasNormals?: boolean; /** * Whether the mesh has bones/skeleton */ hasSkeleton?: boolean; /** * Whether the mesh has UV coordinates */ hasUVs?: boolean; height?: number; /** * Number of frames in the video */ nbFrames?: number; /** * Leading slice of the content used for inline UI display and as a search * shortcut. Capped at TEXT_PREVIEW_MAX_BYTES (UTF-8) and always cut on a * code-point boundary so no character is split. Number of characters in the * preview varies by script (around 1024 for ASCII, ~340 for CJK, ~256 for * emoji-heavy text at the default 1 KB budget). */ preview?: string; /** * Sample rate of the media in Hz */ sampleRate?: number; /** * Transcription of the audio */ transcription?: Properties.Transcription; /** * Number of vertices in the mesh */ vertexCount?: number; width?: number; /** * Number of whitespace-separated words in the text */ wordCount?: number; } export namespace Properties { /** * One explicit camera keyframe for the splat route. Several are interpolated over * the requested frames into an orbit/fly-through; a single keyframe renders a * static view. Overrides {@link SplatCameraMode} when provided. */ export interface CameraTrajectory { /** * Camera eye position in the splat's world frame. */ position: Array; /** * Look-at point in the splat's world frame. */ target: Array; /** * Vertical field of view in degrees (defaults to 50 in the renderer). */ fov?: number; } /** * Transcription of the audio */ export interface Transcription { text: string; } } /** * The video asset's first frame. * * Contains the assetId and the url of the first frame. */ export interface FirstFrame { assetId: string; url: string; } /** * The video asset's last frame. * * Contains the assetId and the url of the last frame. */ export interface LastFrame { assetId: string; url: string; } /** * The asset's preview. * * Contains the assetId and the url of the preview. */ export interface Preview { assetId: string; url: string; } /** * SlopGuard detection result, computed asynchronously after generation. * * `details` (the per-dimension reasons and suggestions) is returned only when the * asset is read with `withSlopGuardDetails=true`. */ export interface SlopGuard { /** * ISO-8601 timestamp of when scoring ran */ computedAt: string; /** * Whether scoring succeeded or errored */ status: 'error' | 'scored'; /** * Rubric/model version that produced this result */ version: string; /** * Generic AI-quality sub-score */ aiQualityScore?: number; /** * Ids of briefs that contributed */ appliedBriefIds?: Array; /** * Brief-compliance sub-score (omitted when no brief applied) */ briefComplianceScore?: number; /** * Per-dimension reasons and suggestions, as produced by the detector. * * Returned only when the asset is read with `withSlopGuardDetails=true` by the * project that owns it — the brief-compliance text paraphrases that project's * brief, so a cross-project read of a public asset gets the summary alone. Also * omitted when the archived verdict is unavailable (asset scored by an older * version, or an unreadable archive). */ details?: SlopGuard.Details; /** * Error message when status is 'error' (truncated) */ error?: string; /** * 0–100 composite score (present when status is 'scored') */ overallScore?: number; /** * Sensitivity used for the verdict */ sensitivity?: 'high' | 'low' | 'medium'; /** * pass / warn / fail (present when status is 'scored') */ verdict?: 'fail' | 'pass' | 'warn'; } export namespace SlopGuard { /** * Per-dimension reasons and suggestions, as produced by the detector. * * Returned only when the asset is read with `withSlopGuardDetails=true` by the * project that owns it — the brief-compliance text paraphrases that project's * brief, so a cross-project read of a public asset gets the summary alone. Also * omitted when the archived verdict is unavailable (asset scored by an older * version, or an unreadable archive). */ export interface Details { /** * Always-on generic AI-quality dimension */ aiQuality: Details.AIQuality; /** * Brief-compliance dimension; omitted when no brief applied */ briefCompliance?: Details.BriefCompliance; } export namespace Details { /** * Always-on generic AI-quality dimension */ export interface AIQuality { /** * Why the image scored as it did */ reasons: Array; /** * 0–100; higher is better (more compliant / less AI-looking) */ score: number; /** * Actionable suggestions to improve the score */ suggestions: Array; } /** * Brief-compliance dimension; omitted when no brief applied */ export interface BriefCompliance { /** * Why the image scored as it did */ reasons: Array; /** * 0–100; higher is better (more compliant / less AI-looking) */ score: number; /** * Actionable suggestions to improve the score */ suggestions: Array; } } } /** * The asset's thumbnail. * * Contains the assetId and the url of the thumbnail. */ export interface Thumbnail { assetId: string; url: string; } } /** * The inference parameters used to generate the asset */ export interface InferenceParameters { /** * Full text prompt including the model placeholder. (example: "an illustration of * phoenix in a fantasy world, flying over a mountain, 8k, bokeh effect") */ prompt: string; /** * The type of inference to use. Example: txt2img, img2img, etc. * * Selecting the right type will condition the expected parameters. * * Note: for inpainting with models that support multiple base models, Scenario * determines the best available `baseModel` for a given `modelId`. */ type: | 'controlnet' | 'controlnet_img2img' | 'controlnet_inpaint' | 'controlnet_inpaint_ip_adapter' | 'controlnet_ip_adapter' | 'controlnet_reference' | 'controlnet_texture' | 'img2img' | 'img2img_ip_adapter' | 'img2img_texture' | 'inpaint' | 'inpaint_ip_adapter' | 'outpaint' | 'reference' | 'reference_texture' | 'txt2img' | 'txt2img_ip_adapter' | 'txt2img_texture'; /** * The aspect ratio of the generated images. Only used for the model * flux.1.1-pro-ultra. The aspect ratio is a string formatted as "width:height" * (example: "16:9"). */ aspectRatio?: '16:9' | '1:1' | '21:9' | '2:3' | '3:2' | '3:4' | '4:3' | '4:5' | '5:4' | '9:16' | '9:21'; /** * The base model to use for the inference. Only Flux LoRA models can use this * parameter. Allowed values are available in the model's attribute: * `compliantModelIds` */ baseModelId?: string; concepts?: Array; /** * Specifies how long the ControlNet guidance should be applied during the * inference process. * * Only available for Flux.1-dev based models. * * The value represents the percentage of total inference steps where the * ControlNet guidance is active. For example: * * - 1.0: ControlNet guidance is applied during all inference steps * - 0.5: ControlNet guidance is only applied during the first half of inference * steps * * Default values: * * - 0.5 for Canny modality * - 0.6 for all other modalities */ controlEnd?: number; /** * Signed URL to display the controlnet input image */ controlImage?: string; /** * Asset id of the controlnet input image */ controlImageId?: string; /** * Specifies the starting point of the ControlNet guidance during the inference * process. * * Only available for Flux.1-dev based models. * * The value represents the percentage of total inference steps where the * ControlNet guidance starts. For example: * * - 0.0: ControlNet guidance starts at the beginning of the inference steps * - 0.5: ControlNet guidance starts at the middle of the inference steps */ controlStart?: number; /** * If set to true, the entire input image will likely change during inpainting. * This results in faster inferences, but the output image will be harder to * integrate if the input is just a small part of a larger image. */ disableMerging?: boolean; /** * If false, the process uses the given image to detect the modality. If true * (default), the process will not try to detect the modality of the given image. * * For example: with `pose` modality and `false` value, the process will detect the * pose of people in the given image with `depth` modality and `false` value, the * process will detect the depth of the given image with `scribble` modality and * `true`value, the process will use the given image as a scribble * * ⚠️ For models of the FLUX schnell or dev families, this parameter is ignored. * The modality detection is always disabled. ⚠️ */ disableModalityDetection?: boolean; /** * Controls how closely the generated image follows the prompt. Higher values * result in stronger adherence to the prompt. Default and allowed values depend on * the model type: * * - For Flux dev models, the default is 3.5 and allowed values are within [0, 10] * - For Flux pro models, the default is 3 and allowed values are within [2, 5] */ guidance?: number; /** * The height of the generated images, must be a 8 multiple (within [64, 2048], * default: 512) If model.type is `flux.1.1-pro-ultra`, you can use the aspectRatio * parameter instead */ height?: number; /** * If set, generated assets will be hidden and not returned in the list of images * of the inference or when listing assets (default: false) */ hideResults?: boolean; /** * Signed URL to display the input image */ image?: string; /** * Asset id of the input image */ imageId?: string; /** * Enable or disable the intermediate images generation (default: false) */ intermediateImages?: boolean; /** * Signed URL to display the IpAdapter image */ ipAdapterImage?: string; /** * Asset id of the input IpAdapter image */ ipAdapterImageId?: string; /** * Asset id of the input IpAdapter images */ ipAdapterImageIds?: Array; /** * Signed URL to display the IpAdapter images */ ipAdapterImages?: Array; /** * IpAdapter scale factor (within [0.0, 1.0], default: 0.9). */ ipAdapterScale?: number; /** * IpAdapter scale factors (within [0.0, 1.0], default: 0.9). */ ipAdapterScales?: Array; /** * The type of IP Adapter model to use. Must be one of [`style`, `character`], * default to `style`` */ ipAdapterType?: 'character' | 'style'; /** * Signed URL to display the mask image */ mask?: string; /** * Asset id of the mask image */ maskId?: string; /** * The modality associated with the control image used for the generation: it can * either be an object with a combination of maximum * * For models of the FLUX schnell or dev families: * * - one modality from: `canny`, `tile`, `depth`, `blur`, `pose`, `gray`, * `low-quality` * * Optionally, you can associate a value to these modalities or presets. The value * must be within `]0.0, 1.0]`. * * Examples: * * - `canny` * - `depth:0.5,pose:1.0` * - `canny:0.5,depth:0.5,lines:0.3` * - `landscape` * - `character:0.5` * - `illusion:1` * * Note: if you use a value that is not supported by the model family, this will * result in an error. */ modality?: string; /** * The epoch of the model to use for the inference. Only available for Flux Lora * Trained models. */ modelEpoch?: string; /** * The prompt not to guide the image generation, ignored when guidance < 1 * (example: "((ugly face))") For Flux based model (not Fast-Flux): requires * negativePromptStrength > 0 and active only for inference types txt2img / img2img * / controlnet. */ negativePrompt?: string; /** * Only applicable for flux-dev based models for `txt2img`, `img2img`, and * `controlnet` inference types. * * Controls the influence of the negative prompt. Default 0 means the negative * prompt has no effect. Higher values increase negative prompt influence. Must * be > 0 if negativePrompt is provided. */ negativePromptStrength?: number; /** * The number of denoising steps for each image generation (within [1, 150], * default: 30) */ numInferenceSteps?: number; /** * The number of images to generate (within [1, 128], default: 4) */ numSamples?: number; /** * Whether to use reference adain Only for "reference" inference type */ referenceAdain?: boolean; /** * Whether to use reference query for self attention's context Only for "reference" * inference type */ referenceAttn?: boolean; /** * The scheduler to use to override the default configured for the model. See * detailed documentation for more details. */ scheduler?: | 'DDIMScheduler' | 'DDPMScheduler' | 'DEISMultistepScheduler' | 'DPMSolverMultistepScheduler' | 'DPMSolverSinglestepScheduler' | 'EulerAncestralDiscreteScheduler' | 'EulerDiscreteScheduler' | 'HeunDiscreteScheduler' | 'KDPM2AncestralDiscreteScheduler' | 'KDPM2DiscreteScheduler' | 'LCMScheduler' | 'LMSDiscreteScheduler' | 'PNDMScheduler' | 'TCDScheduler' | 'UniPCMultistepScheduler'; /** * Used to reproduce previous results. Default: randomly generated number. */ seed?: string; /** * Controls the noise intensity introduced to the input image, where a value of 1.0 * completely erases the original image's details. Available for img2img and * inpainting. (within [0.01, 1.0], default: 0.75) */ strength?: number; /** * If style_fidelity=1.0, control more important, else if style_fidelity=0.0, * prompt more important, else balanced Only for "reference" inference type */ styleFidelity?: number; /** * The width of the generated images, must be a 8 multiple (within [64, 2048], * default: 512) If model.type is `flux.1.1-pro-ultra`, you can use the aspectRatio * parameter instead */ width?: number; } export namespace InferenceParameters { export 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 job associated with the asset */ export interface Job { /** * The job creation date as an ISO string (example: "2023-02-03T11:19:41.579Z") */ createdAt: string; /** * The job ID (example: "job_ocZCnG1Df35XRL1QyCZSRxAG8") */ jobId: string; /** * The type of job */ jobType: | 'assets-download' | 'canvas-export' | 'caption' | 'caption-llava' | 'custom' | 'describe-style' | 'detection' | 'embed' | 'flux' | 'flux-model-training' | 'generate-prompt' | 'image-generation' | 'image-prompt-editing' | 'inference' | 'mesh-preview-rendering' | 'model-download' | 'model-import' | 'model-training' | 'musubi-model-training' | 'openai-image-generation' | 'patch-image' | 'pixelate' | 'reframe' | 'remove-background' | 'repaint' | 'restyle' | 'segment' | 'skybox-3d' | 'skybox-base-360' | 'skybox-hdri' | 'skybox-upscale-360' | 'splat' | 'texture' | 'translate' | 'upload' | 'upscale' | 'upscale-skybox' | 'upscale-texture' | 'vectorize' | 'workflow'; /** * Metadata of the job with some additional information */ metadata: Job.Metadata; /** * Progress of the job (between 0 and 1) */ progress: number; /** * The current status of the job */ status: | 'canceled' | 'failure' | 'finalizing' | 'in-progress' | 'pending' | 'queued' | 'success' | 'warming-up'; /** * The history of the different statuses the job went through with the ISO string * date of when the job reached each statuses. */ statusHistory: Array; /** * The job last update date as an ISO string (example: "2023-02-03T11:19:41.579Z") */ updatedAt: string; /** * The author user ID (example: "dcf121faaa1a0a0bbbd9ca1b73d62aea") */ authorId?: string; /** * The billing of the job */ billing?: Job.Billing; /** * The owner ID (example: "team_U3Qmc8PCdWXwAQJ4Dvw4tV6D") */ ownerId?: string; } export namespace Job { /** * Metadata of the job with some additional information */ export interface Metadata { /** * List of produced assets for this job */ assetIds?: Array; /** * Eventual error for the job */ error?: string | null; /** * The flow of the job. Only available for workflow jobs. */ flow?: Array; /** * Actionable hint for the user explaining what went wrong and how to resolve it. */ hint?: string; /** * The inputs for the job */ input?: { [key: string]: unknown }; /** * May contain the output of the job for specific custom models jobs. Only * available for custom models which generate non-assets outputs. Example: LLM text * results. */ output?: { [key: string]: unknown }; /** * For voice-clone jobs: the ID of the model being trained. */ outputModelId?: string; /** * The workflow ID of the job if job is part of a workflow. */ workflowId?: string; /** * The workflow job ID of the job if job is part of a workflow job. */ workflowJobId?: string; } export namespace Metadata { export interface Flow { /** * The id of the node. */ id: string; /** * The status of the node. Only available for WorkflowJob nodes. */ status: 'failure' | 'pending' | 'processing' | 'rejected' | 'skipped' | 'success'; /** * The type of the job for the node. */ type: | 'custom-model' | 'for-each' | 'generate-prompt' | 'list' | 'logic' | 'model' | 'remove-background' | 'transform' | 'user-approval' | 'workflow'; /** * List of produced assets for this node. */ assets?: Array; /** * Fixed number of iterations for a ForEach node. When set, the loop runs exactly * `count` times regardless of array input. When not set, the loop iterates over * the resolved array input. Only available for ForEach nodes. */ count?: number; /** * The nodes that this node depends on. Only available for nodes that have * dependencies. Mainly used for user approval nodes. */ dependsOn?: Array; /** * If true, the outputs of this node will be included in the workflow job's final * output. Only applicable to producing nodes (custom-model, inference, etc.). By * default, only last nodes (nodes not referenced by other nodes) contribute to * outputs. Set this to true to also include intermediate nodes in the final * output. Note: This should only be set to `true` or left undefined. */ includeOutputsInWorkflowJob?: true; /** * The inputs of the node. */ inputs?: Array; /** * Statically-configured items for a List node. The node outputs this array as-is * when executed. Only available for List nodes. The values can be strings, * numbers, or asset IDs. */ items?: Array; /** * Zero-based index of the iteration this node copy belongs to. Set on * dynamically-created copies of loop body nodes. */ iterationIndex?: number; /** * If the flow is part of a WorkflowJob, this is the jobId for the node. jobId is * only available for nodes started. A node "Pending" for a running workflow job is * not started. */ jobId?: string; /** * The logic of the node. Only available for logic nodes. */ logic?: Flow.Logic; /** * The type of the logic for the node. Only available for logic nodes. */ logicType?: 'if-else'; /** * IDs of the body template nodes that belong to this ForEach loop. At runtime * these templates are cloned once per iteration and marked Skipped. Only available * for ForEach nodes. */ loopBodyNodeIds?: Array; /** * ID of the ForEach node that spawned this iteration copy. Set on * dynamically-created copies of loop body nodes. */ loopNodeId?: string; /** * The model id for the node. Mainly used for custom model tasks. */ modelId?: string; /** * The output of the node. Only available for logic nodes. */ output?: unknown; /** * The workflow id for the node. Mainly used for workflow tasks. */ workflowId?: string; } export namespace Flow { export interface Asset { assetId: string; url: string; } /** * This is used to run the flow. */ export 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 configured items for inputs_array type inputs. Each item is an array of * SubNodeInput that need ref/value resolution. Only available for inputs_array * type. */ items?: Array>; /** * 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; /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ ref?: Input.Ref; /** * 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; /** * The value of the input. This is the value of the input that will be used to run * the node. Only available for flows managed by a WorkflowJob. */ value?: unknown; } export namespace Input { /** * A sub-input within an inputs_array item. Same as NodeInput but without the * recursive items field. */ export interface Item { /** * 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; /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ ref?: Item.Ref; /** * 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?: Item.Required; /** * The step increment for numeric inputs. Only available for \`number\` input type. */ step?: number; /** * The value of the input. This is the value of the input that will be used to run * the node. Only available for flows managed by a WorkflowJob. */ value?: unknown; } export namespace Item { /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ export interface Ref { /** * The conditional nodes to reference. If the conditional nodes are successful, the * node will be successful. If the conditional nodes are skipped, the node will be * skipped. Contains an array of node ids used to check the status of the nodes. */ conditional?: Array; /** * This is the desired node output value if ref is an if/else node. */ equal?: string; /** * The name of the input or output to reference. If the type is 'workflow', the * name is the name of the input of the workflow is required If the type is 'node', * the name is not mandatory, except if you want all outputs of the node. To get * all outputs of a node, you can use the name 'all'. */ name?: string; /** * The node id or 'workflow' if the source is a workflow input. */ node?: string; } /** * 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. */ export 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 reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ export interface Ref { /** * The conditional nodes to reference. If the conditional nodes are successful, the * node will be successful. If the conditional nodes are skipped, the node will be * skipped. Contains an array of node ids used to check the status of the nodes. */ conditional?: Array; /** * This is the desired node output value if ref is an if/else node. */ equal?: string; /** * The name of the input or output to reference. If the type is 'workflow', the * name is the name of the input of the workflow is required If the type is 'node', * the name is not mandatory, except if you want all outputs of the node. To get * all outputs of a node, you can use the name 'all'. */ name?: string; /** * The node id or 'workflow' if the source is a workflow input. */ node?: string; } /** * 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. */ export 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 logic of the node. Only available for logic nodes. */ export interface Logic { /** * The cases of the logic. Only available for if/else nodes. */ cases?: Array; /** * The default case of the logic. Contains the id/output of the node to execute if * no case is matched. Only available for if/else nodes. */ default?: string; /** * The transform of the logic. Only available for transform nodes. */ transform?: string; } export namespace Logic { export interface Case { condition: string; value: string; } } } } export interface StatusHistory { date: string; status: | 'canceled' | 'failure' | 'finalizing' | 'in-progress' | 'pending' | 'queued' | 'success' | 'warming-up'; } /** * The billing of the job */ export interface Billing { cuCost: number; cuDiscount: number; /** * Compute Units charged for the ADD-ONS of this job, per action — the fees paid on * top of the generation itself, such as `slop-detection`. * * `cuCost` above is the main action alone, so the job's total is `cuCost` plus the * values here. * * Two caveats when displaying it: * * - These are a remaining refundable balance, not a receipt: a job that failed or * was cancelled has had its add-ons refunded, so they read 0 while `cuCost` * still shows the main action's original charge. * - `ip-detection` is part of the shape but is never populated today: that fee is * charged outside the job and reported once, as * `ipDetection.creativeUnitsCharged`, in the response of the request that ran * it. * * Absent when the job paid for no add-on. */ cuCostDetails?: Billing.CuCostDetails; /** * When true, the credits charged for this job are not automatically refunded if * the generation fails, because the model used does not support refund-on-failure. * Absent or false means a failed generation is refunded as usual. */ disableRefund?: boolean; } export namespace Billing { /** * Compute Units charged for the ADD-ONS of this job, per action — the fees paid on * top of the generation itself, such as `slop-detection`. * * `cuCost` above is the main action alone, so the job's total is `cuCost` plus the * values here. * * Two caveats when displaying it: * * - These are a remaining refundable balance, not a receipt: a job that failed or * was cancelled has had its add-ons refunded, so they read 0 while `cuCost` * still shows the main action's original charge. * - `ip-detection` is part of the shape but is never populated today: that fee is * charged outside the job and reported once, as * `ipDetection.creativeUnitsCharged`, in the response of the request that ran * it. * * Absent when the job paid for no add-on. */ export interface CuCostDetails { 'ip-detection'?: number; 'slop-detection'?: number; } } } } } export interface ExampleListResponse { examples: Array; } export namespace ExampleListResponse { export interface Example { /** * Asset generated by the inference */ asset: Example.Asset; /** * Model id of the model used to generate the asset */ modelId: string; /** * Inference id of the inference used to generate the asset */ inferenceId?: string; /** * The inference parameters used to generate the asset */ inferenceParameters?: Example.InferenceParameters; /** * The job associated with the asset */ job?: Example.Job; } export namespace Example { /** * Asset generated by the inference */ export interface Asset { /** * The asset ID (example: "asset_GTrL3mq4SXWyMxkOHRxlpw") */ id: string; /** * The author user ID (example: "dcf121faaa1a0a0bbbd9ca1b73d62aea") */ authorId: string; /** * A list of CollectionId this asset belongs to */ collectionIds: Array; /** * The asset creation date as an ISO string (example: "2023-02-03T11:19:41.579Z") */ createdAt: string; /** * List of edit capabilities */ editCapabilities: Array< | 'DETECTION' | 'GENERATIVE_FILL' | 'PIXELATE' | 'PROMPT_EDITING' | 'REFINE' | 'REFRAME' | 'REMOVE_BACKGROUND' | 'SEGMENTATION' | 'UPSCALE' | 'UPSCALE_360' | 'VECTORIZATION' >; /** * The kind of asset */ kind: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'text' | 'video'; /** * Metadata of the asset with some additional information */ metadata: Asset.Metadata; /** * The mime type of the asset (example: "image/png") */ mimeType: string; /** * The owner (project) ID (example: "proj_23tlk332lkht3kl2" or * "team_dlkhgs23tlk3hlkth32lkht3kl2" for old teams) */ ownerId: string; /** * The privacy of the asset */ privacy: 'private' | 'public' | 'unlisted'; /** * The properties of the asset, content may depend on the kind of asset returned */ properties: Asset.Properties; /** * source of the asset */ source: | '3d23d' | '3d23d:texture' | '3d:texture' | '3d:texture:albedo' | '3d:texture:metallic' | '3d:texture:mtl' | '3d:texture:normal' | '3d:texture:roughness' | 'audio2audio' | 'audio2txt' | 'audio2video' | 'background-removal' | 'canvas' | 'canvas-drawing' | 'canvas-export' | 'detection' | 'generative-fill' | 'image-prompt-editing' | 'img23d' | 'img2img' | 'img2splat' | 'img2txt' | 'img2video' | 'inference-control-net' | 'inference-control-net-img' | 'inference-control-net-inpainting' | 'inference-control-net-inpainting-ip-adapter' | 'inference-control-net-ip-adapter' | 'inference-control-net-reference' | 'inference-control-net-texture' | 'inference-img' | 'inference-img-ip-adapter' | 'inference-img-texture' | 'inference-in-paint' | 'inference-in-paint-ip-adapter' | 'inference-reference' | 'inference-reference-texture' | 'inference-txt' | 'inference-txt-ip-adapter' | 'inference-txt-texture' | 'patch' | 'pixelization' | 'reframe' | 'restyle' | 'segment' | 'segmentation-image' | 'segmentation-mask' | 'skybox-3d' | 'skybox-base-360' | 'skybox-hdri' | 'texture' | 'texture:albedo' | 'texture:ao' | 'texture:edge' | 'texture:height' | 'texture:metallic' | 'texture:normal' | 'texture:smoothness' | 'txt23d' | 'txt2audio' | 'txt2img' | 'txt2txt' | 'txt2video' | 'unknown' | 'uploaded' | 'uploaded-3d' | 'uploaded-audio' | 'uploaded-avatar' | 'uploaded-text' | 'uploaded-video' | 'upscale' | 'upscale-skybox' | 'upscale-texture' | 'upscale-video' | 'vectorization' | 'video23d' | 'video2audio' | 'video2img' | 'video2video' | 'voice-clone'; /** * The actual status */ status: 'error' | 'pending' | 'success'; /** * The associated tags (example: ["sci-fi", "landscape"]) */ tags: Array; /** * The asset last update date as an ISO string (example: * "2023-02-03T11:19:41.579Z") */ updatedAt: string; /** * Signed URL to get the asset content */ url: string; /** * Automatic captioning of the asset */ automaticCaptioning?: string; /** * The description, it will contain in priority: * * - the manual description * - the advanced captioning when the asset is used in training flow * - the automatic captioning */ description?: string; /** * The embedding of the asset when requested. * * Only available when an asset can be embedded (ie: not Detection maps) */ embedding?: Array; /** * The video asset's first frame. * * Contains the assetId and the url of the first frame. */ firstFrame?: Asset.FirstFrame; /** * Whether the asset is hidden. */ isHidden?: boolean; /** * The video asset's last frame. * * Contains the assetId and the url of the last frame. */ lastFrame?: Asset.LastFrame; /** * The NSFW labels */ nsfw?: Array; /** * The original file url. * * Contains the url of the original file. without any conversion. Only available * for some specific video, audio and threeD assets. Is only specified if the given * asset data has been replaced with a new file during the creation of the asset. */ originalFileUrl?: string; /** * The output index of the asset within a job This index is an positive integer * that starts at 0 It is used to differentiate between multiple outputs of the * same job If the job has only one output, this index is 0 */ outputIndex?: number; /** * The asset's preview. * * Contains the assetId and the url of the preview. */ preview?: Asset.Preview; /** * SlopGuard detection result, computed asynchronously after generation. * * `details` (the per-dimension reasons and suggestions) is returned only when the * asset is read with `withSlopGuardDetails=true`. */ slopGuard?: Asset.SlopGuard; /** * The asset's thumbnail. * * Contains the assetId and the url of the thumbnail. */ thumbnail?: Asset.Thumbnail; } export namespace Asset { /** * Metadata of the asset with some additional information */ export interface Metadata { kind: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'text' | 'video'; /** * The type of the asset. Ex: 'inference-txt2img' will represent an asset generated * from a text to image model */ type: | '3d-texture' | '3d-texture-albedo' | '3d-texture-metallic' | '3d-texture-mtl' | '3d-texture-normal' | '3d-texture-roughness' | '3d23d' | '3d23d-texture' | 'audio2audio' | 'audio2txt' | 'audio2video' | 'background-removal' | 'canvas' | 'canvas-drawing' | 'canvas-export' | 'detection' | 'generative-fill' | 'image-prompt-editing' | 'img23d' | 'img2img' | 'img2splat' | 'img2txt' | 'img2video' | 'inference-controlnet' | 'inference-controlnet-img2img' | 'inference-controlnet-inpaint' | 'inference-controlnet-inpaint-ip-adapter' | 'inference-controlnet-ip-adapter' | 'inference-controlnet-reference' | 'inference-controlnet-texture' | 'inference-img2img' | 'inference-img2img-ip-adapter' | 'inference-img2img-texture' | 'inference-inpaint' | 'inference-inpaint-ip-adapter' | 'inference-reference' | 'inference-reference-texture' | 'inference-txt2img' | 'inference-txt2img-ip-adapter' | 'inference-txt2img-texture' | 'patch' | 'pixelization' | 'reframe' | 'restyle' | 'segment' | 'segmentation-image' | 'segmentation-mask' | 'skybox-3d' | 'skybox-base-360' | 'skybox-hdri' | 'texture' | 'texture-albedo' | 'texture-ao' | 'texture-edge' | 'texture-height' | 'texture-metallic' | 'texture-normal' | 'texture-smoothness' | 'txt23d' | 'txt2audio' | 'txt2img' | 'txt2txt' | 'txt2video' | 'unknown' | 'uploaded' | 'uploaded-3d' | 'uploaded-audio' | 'uploaded-avatar' | 'uploaded-text' | 'uploaded-video' | 'upscale' | 'upscale-skybox' | 'upscale-texture' | 'upscale-video' | 'vectorization' | 'video23d' | 'video2audio' | 'video2img' | 'video2video' | 'voice-clone'; /** * How angular is the surface? 0 is like a sphere, 1 is like a mechanical object */ angular?: number; /** * The optional aspect ratio given for the generation, only applicable for some * models */ aspectRatio?: string; backgroundOpacity?: number; /** * The baseModelId that maybe changed at inference time */ baseModelId?: string; /** * A bounding box around the object of interest, in the format [x1, y1, x2, y2]. */ bbox?: Array; betterQuality?: boolean; /** * The control image already processed by canny detector. Must reference an * existing AssetId. */ cannyStructureImage?: string; /** * Activate clustering. */ clustering?: boolean; /** * Ensure upscaled tile have the same color histogram as original tile. */ colorCorrection?: boolean; colorMode?: string; colorPrecision?: number; /** * Flux Kontext LoRA to style the image. For Flux Kontext Prompt Editing. */ concepts?: Array; contours?: Array>>>; /** * End step for control. */ controlEnd?: number; /** * The date when the asset was copied to a project */ copiedAt?: string; cornerThreshold?: number; /** * Allow the generation of "hallucinations" during the upscale process, which adds * additional details and deviates from the original image. Default: optimized for * your preset and style. */ creativity?: number; /** * Amount of decay in creativity over the upscale process. The lowest the value, * the less the creativity will be preserved over the upscale process. */ creativityDecay?: number; /** * If true, use the default parameters */ defaultParameters?: boolean; /** * The depth fidelity if a depth image provided */ depthFidelity?: number; /** * The control image processed by depth estimator. Must reference an existing * AssetId. */ depthImage?: string; /** * Amount of details to remove or add */ detailsLevel?: number; dilate?: number; /** * Contrast factor for Grayscale detector */ factor?: number; filterSpeckle?: number; /** * Determine the scale at which the upscale process works. * * - With a small value, the upscale works at the largest scale, resulting in fewer * added details and more coherent images. Ideal for portraits, for example. * - With a large value, the upscale works at the smallest scale, resulting in more * added details and more hallucinations. Ideal for landscapes, for example. * * (info): A small value is slower and more expensive to run. */ fractality?: number; /** * Apply extra control to the Skybox 360 geometry. The higher the value, the more * the 360 geometry will influence the generated skybox image. * * Use with caution. Default is adapted to the other parameters. */ geometryEnforcement?: number; /** * The guidance used to generate this asset */ guidance?: number; halfMode?: boolean; hdr?: number; height?: number; /** * High threshold for Canny detector */ highThreshold?: number; /** * (deprecated) Horizontal expansion ratio. */ horizontalExpansionRatio?: number; /** * The input image to process. Must reference an existing AssetId or be a data URL. */ image?: string; /** * Strengthen the similarity to the original image during the upscale. Default: * optimized for your preset and style. */ imageFidelity?: number; /** * Preserve the seamless properties of skybox or texture images. Input has to be of * same type (seamless). */ imageType?: 'seamfull' | 'skybox' | 'texture'; /** * The id of the Inference describing how this image was generated */ inferenceId?: string; /** * When set to `high`, allows to better preserve details from the input images in * the output. This is especially useful when using images that contain elements * like faces or logos that require accurate preservation in the generated image. * * You can provide multiple input images that will all be preserved with high * fidelity, but keep in mind that the first image will be preserved with richer * textures and finer details, so if you include elements such as faces, consider * placing them in the first image. * * Only available for the `gpt-image-1` model. */ inputFidelity?: 'high' | 'low'; /** * Location of the input image in the output. */ inputLocation?: 'bottom' | 'left' | 'middle' | 'right' | 'top'; /** * To invert the relief */ invert?: boolean; /** * How polished is the surface? 0 is like a rough surface, 1 is like a mirror */ keypointThreshold?: number; layerDifference?: number; lengthThreshold?: number; /** * The ISO timestamp when the lock on the canvas will expire */ lockExpiresAt?: string; /** * Low threshold for Canny detector */ lowThreshold?: number; /** * The mask used for the asset generation or editing */ mask?: string; maxIterations?: number; /** * Maximum threshold for Grayscale conversion */ maxThreshold?: number; /** * Minimum threshold for Grayscale conversion */ minThreshold?: number; /** * Modality to detect */ modality?: | 'canny' | 'depth' | 'grayscale' | 'lineart_anime' | 'mlsd' | 'normal' | 'pose' | 'scribble' | 'segmentation' | 'sketch'; mode?: string; /** * The modelId used to generate this asset */ modelId?: string; /** * The type of the generator used */ modelType?: | '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'; name?: string; nbMasks?: number; /** * The negative prompt used to generate this asset */ negativePrompt?: string; /** * Controls the influence of the negative prompt. Default 0 means the negative * prompt has no effect. Higher values increase negative prompt influence. Must * be > 0 if negativePrompt is provided. */ negativePromptStrength?: number; /** * The number of denoising steps for each image generation. */ numInferenceSteps?: number; /** * The number of outputs to generate. */ numOutputs?: number; originalAssetId?: string; outputIndex?: number; /** * Overlap percentage for the output image. */ overlapPercentage?: number; /** * Override the embeddings of the model. Only your prompt and negativePrompt will * be used. Use with caution. */ overrideEmbeddings?: boolean; parentId?: string; parentJobId?: string; pathPrecision?: number; /** * List of points (label, x, y) in the image where label = 0 for background and 1 * for object. */ points?: Array>; /** * How polished is the surface? 0 is like a rough surface, 1 is like a mirror */ polished?: number; preset?: string; progressPercent?: number; /** * The prompt that guided the asset generation or editing */ prompt?: string; /** * Increase the fidelity to the prompt during upscale. Default: optimized for your * preset and style. */ promptFidelity?: number; /** * How raised is the surface? 0 is flat like water, 1 is like a very rough rock */ raised?: number; /** * The reference images used for the asset generation or editing */ referenceImages?: Array; /** * Additional refinement steps before scaling. * * If scalingFactor == 1, the refinement process will be applied (1 + * refinementSteps) times. If scalingFactor > 1, the refinement process will be * applied refinementSteps times. */ refinementSteps?: number; /** * Remove background for Grayscale detector */ removeBackground?: boolean; /** * Size proportion of the input image in the output. */ resizeOption?: number; /** * Boolean to output the contours. */ resultContours?: boolean; /** * Boolean to return the source image with the mask applied as alpha channel (RGBA * PNG, transparent background) instead of the binary mask. Mutually exclusive with * `resultMask` — passing both as `true` returns a 400 error. Note: * `backgroundOpacity` is no longer honored — alpha is binary (0/255) only. */ resultImage?: boolean; /** * Boolean to return the binary masks in the response. Mutually exclusive with * `resultImage` — passing both as `true` returns a 400 error. */ resultMask?: boolean; rootParentId?: string; /** * Save a flipbook of the texture. Deactivated when the input texture is larger * than 2048x2048px */ saveFlipbook?: boolean; /** * Scaling factor (when `targetWidth` not specified) */ scalingFactor?: number; /** * The scheduler used to generate this asset */ scheduler?: string; /** * The seed used to generate this asset. Can be a string or a number in some * cases . */ seed?: string; /** * Sharpen tiles. */ sharpen?: boolean; /** * How shiny is the surface? 0 is like a matte surface, 1 is like a diamond */ shiny?: number; size?: number; /** * Activate sketch detection instead of canny. */ sketch?: boolean; sourceProjectId?: string; spliceThreshold?: number; /** * The strength * * Only available for the `flux-kontext` LoRA model. */ strength?: number; /** * Strength for the input image structure preservation */ structureFidelity?: number; /** * The control image for structure. A canny detector will be applied to this image. * Must reference an existing AssetId. */ structureImage?: string; style?: | '3d-cartoon' | '3d-rendered' | 'anime' | 'cartoon' | 'cinematic' | 'claymation' | 'cloud-skydome' | 'comic' | 'cyberpunk' | 'enchanted' | 'fantasy' | 'ink' | 'manga' | 'manga-color' | 'minimalist' | 'neon-tron' | 'oil-painting' | 'pastel' | 'photo' | 'photography' | 'psychedelic' | 'retro-fantasy' | 'scifi-concept-art' | 'space' | 'standard' | 'whimsical'; /** * The higher the value the more it will look like the style image(s) */ styleFidelity?: number; /** * List of style images. Most of the time, only one image is enough. It must be * existing AssetIds. */ styleImages?: Array; /** * Condition the influence of the style image(s). The higher the value, the more * the style images will influence the upscaled image. */ styleImagesFidelity?: number; /** * The target height of the output image. */ targetHeight?: number; /** * Target width for the upscaled image, take priority over scaling factor */ targetWidth?: number; /** * A textual description / keywords describing the object of interest. */ text?: string; /** * The asset to convert in texture maps. Must reference an existing AssetId. */ texture?: string; /** * The thumbnail of the canvas */ thumbnail?: Metadata.Thumbnail; /** * If set to true, during the upscaling process, the model will match tiles of the * source image with tiles of the style image(s). This will result in a more * coherent restyle. Works best with style images that have a similar composition. */ tileStyle?: boolean; trainingImage?: boolean; /** * (deprecated) Vertical expansion ratio. */ verticalExpansionRatio?: number; /** * The width of the rendered image. */ width?: number; } export namespace Metadata { export 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 thumbnail of the canvas */ export interface Thumbnail { /** * The AssetId of the image used as a thumbnail for the canvas (example: * "asset_GTrL3mq4SXWyMxkOHRxlpw") */ assetId: string; /** * The url of the image used as a thumbnail for the canvas */ url: string; } } /** * The properties of the asset, content may depend on the kind of asset returned */ export interface Properties { size: number; /** * Number of animation frames if animations exist */ animationFrameCount?: number; /** * Bitrate of the media in bits per second */ bitrate?: number; /** * Number of bones if skeleton exists */ boneCount?: number; /** * Recommended preview camera mode emitted by the generator (gsplat route); passed * through to mesh-rendering verbatim. */ cameraMode?: 'aerial' | 'interior' | 'turntable'; /** * Recommended preview camera path emitted by the generator (gsplat route); passed * through to mesh-rendering verbatim. */ cameraTrajectory?: Array; /** * Number of channels of the audio */ channels?: number; /** * Number of Unicode code points in the text. Code-point-aware (so a non-BMP emoji * counts as 1) but not full grapheme-cluster aware (a ZWJ sequence still counts as * several). */ charCount?: number; /** * Classification of the audio */ classification?: 'effect' | 'interview' | 'music' | 'other' | 'sound' | 'speech' | 'text' | 'unknown'; /** * Codec name of the media */ codecName?: string; /** * Description of the audio */ description?: string; /** * Bounding box dimensions [width, height, depth] */ dimensions?: Array; /** * Duration of the media in seconds */ duration?: number; /** * Number of faces/triangles in the mesh */ faceCount?: number; /** * Format of the mesh file (e.g. 'glb', etc.) */ format?: string; /** * Frame rate of the video in frames per second */ frameRate?: number; /** * Whether the mesh has animations */ hasAnimations?: boolean; /** * True when `preview` holds the entire content unmodified — consumers can use it * directly without fetching `asset.url`. False or undefined means the content * exceeds the preview budget and consumers must fetch the full body from S3 to * read past the preview. */ hasFullPreview?: boolean; /** * Whether the mesh has normal vectors */ hasNormals?: boolean; /** * Whether the mesh has bones/skeleton */ hasSkeleton?: boolean; /** * Whether the mesh has UV coordinates */ hasUVs?: boolean; height?: number; /** * Number of frames in the video */ nbFrames?: number; /** * Leading slice of the content used for inline UI display and as a search * shortcut. Capped at TEXT_PREVIEW_MAX_BYTES (UTF-8) and always cut on a * code-point boundary so no character is split. Number of characters in the * preview varies by script (around 1024 for ASCII, ~340 for CJK, ~256 for * emoji-heavy text at the default 1 KB budget). */ preview?: string; /** * Sample rate of the media in Hz */ sampleRate?: number; /** * Transcription of the audio */ transcription?: Properties.Transcription; /** * Number of vertices in the mesh */ vertexCount?: number; width?: number; /** * Number of whitespace-separated words in the text */ wordCount?: number; } export namespace Properties { /** * One explicit camera keyframe for the splat route. Several are interpolated over * the requested frames into an orbit/fly-through; a single keyframe renders a * static view. Overrides {@link SplatCameraMode} when provided. */ export interface CameraTrajectory { /** * Camera eye position in the splat's world frame. */ position: Array; /** * Look-at point in the splat's world frame. */ target: Array; /** * Vertical field of view in degrees (defaults to 50 in the renderer). */ fov?: number; } /** * Transcription of the audio */ export interface Transcription { text: string; } } /** * The video asset's first frame. * * Contains the assetId and the url of the first frame. */ export interface FirstFrame { assetId: string; url: string; } /** * The video asset's last frame. * * Contains the assetId and the url of the last frame. */ export interface LastFrame { assetId: string; url: string; } /** * The asset's preview. * * Contains the assetId and the url of the preview. */ export interface Preview { assetId: string; url: string; } /** * SlopGuard detection result, computed asynchronously after generation. * * `details` (the per-dimension reasons and suggestions) is returned only when the * asset is read with `withSlopGuardDetails=true`. */ export interface SlopGuard { /** * ISO-8601 timestamp of when scoring ran */ computedAt: string; /** * Whether scoring succeeded or errored */ status: 'error' | 'scored'; /** * Rubric/model version that produced this result */ version: string; /** * Generic AI-quality sub-score */ aiQualityScore?: number; /** * Ids of briefs that contributed */ appliedBriefIds?: Array; /** * Brief-compliance sub-score (omitted when no brief applied) */ briefComplianceScore?: number; /** * Per-dimension reasons and suggestions, as produced by the detector. * * Returned only when the asset is read with `withSlopGuardDetails=true` by the * project that owns it — the brief-compliance text paraphrases that project's * brief, so a cross-project read of a public asset gets the summary alone. Also * omitted when the archived verdict is unavailable (asset scored by an older * version, or an unreadable archive). */ details?: SlopGuard.Details; /** * Error message when status is 'error' (truncated) */ error?: string; /** * 0–100 composite score (present when status is 'scored') */ overallScore?: number; /** * Sensitivity used for the verdict */ sensitivity?: 'high' | 'low' | 'medium'; /** * pass / warn / fail (present when status is 'scored') */ verdict?: 'fail' | 'pass' | 'warn'; } export namespace SlopGuard { /** * Per-dimension reasons and suggestions, as produced by the detector. * * Returned only when the asset is read with `withSlopGuardDetails=true` by the * project that owns it — the brief-compliance text paraphrases that project's * brief, so a cross-project read of a public asset gets the summary alone. Also * omitted when the archived verdict is unavailable (asset scored by an older * version, or an unreadable archive). */ export interface Details { /** * Always-on generic AI-quality dimension */ aiQuality: Details.AIQuality; /** * Brief-compliance dimension; omitted when no brief applied */ briefCompliance?: Details.BriefCompliance; } export namespace Details { /** * Always-on generic AI-quality dimension */ export interface AIQuality { /** * Why the image scored as it did */ reasons: Array; /** * 0–100; higher is better (more compliant / less AI-looking) */ score: number; /** * Actionable suggestions to improve the score */ suggestions: Array; } /** * Brief-compliance dimension; omitted when no brief applied */ export interface BriefCompliance { /** * Why the image scored as it did */ reasons: Array; /** * 0–100; higher is better (more compliant / less AI-looking) */ score: number; /** * Actionable suggestions to improve the score */ suggestions: Array; } } } /** * The asset's thumbnail. * * Contains the assetId and the url of the thumbnail. */ export interface Thumbnail { assetId: string; url: string; } } /** * The inference parameters used to generate the asset */ export interface InferenceParameters { /** * Full text prompt including the model placeholder. (example: "an illustration of * phoenix in a fantasy world, flying over a mountain, 8k, bokeh effect") */ prompt: string; /** * The type of inference to use. Example: txt2img, img2img, etc. * * Selecting the right type will condition the expected parameters. * * Note: for inpainting with models that support multiple base models, Scenario * determines the best available `baseModel` for a given `modelId`. */ type: | 'controlnet' | 'controlnet_img2img' | 'controlnet_inpaint' | 'controlnet_inpaint_ip_adapter' | 'controlnet_ip_adapter' | 'controlnet_reference' | 'controlnet_texture' | 'img2img' | 'img2img_ip_adapter' | 'img2img_texture' | 'inpaint' | 'inpaint_ip_adapter' | 'outpaint' | 'reference' | 'reference_texture' | 'txt2img' | 'txt2img_ip_adapter' | 'txt2img_texture'; /** * The aspect ratio of the generated images. Only used for the model * flux.1.1-pro-ultra. The aspect ratio is a string formatted as "width:height" * (example: "16:9"). */ aspectRatio?: '16:9' | '1:1' | '21:9' | '2:3' | '3:2' | '3:4' | '4:3' | '4:5' | '5:4' | '9:16' | '9:21'; /** * The base model to use for the inference. Only Flux LoRA models can use this * parameter. Allowed values are available in the model's attribute: * `compliantModelIds` */ baseModelId?: string; concepts?: Array; /** * Specifies how long the ControlNet guidance should be applied during the * inference process. * * Only available for Flux.1-dev based models. * * The value represents the percentage of total inference steps where the * ControlNet guidance is active. For example: * * - 1.0: ControlNet guidance is applied during all inference steps * - 0.5: ControlNet guidance is only applied during the first half of inference * steps * * Default values: * * - 0.5 for Canny modality * - 0.6 for all other modalities */ controlEnd?: number; /** * Signed URL to display the controlnet input image */ controlImage?: string; /** * Asset id of the controlnet input image */ controlImageId?: string; /** * Specifies the starting point of the ControlNet guidance during the inference * process. * * Only available for Flux.1-dev based models. * * The value represents the percentage of total inference steps where the * ControlNet guidance starts. For example: * * - 0.0: ControlNet guidance starts at the beginning of the inference steps * - 0.5: ControlNet guidance starts at the middle of the inference steps */ controlStart?: number; /** * If set to true, the entire input image will likely change during inpainting. * This results in faster inferences, but the output image will be harder to * integrate if the input is just a small part of a larger image. */ disableMerging?: boolean; /** * If false, the process uses the given image to detect the modality. If true * (default), the process will not try to detect the modality of the given image. * * For example: with `pose` modality and `false` value, the process will detect the * pose of people in the given image with `depth` modality and `false` value, the * process will detect the depth of the given image with `scribble` modality and * `true`value, the process will use the given image as a scribble * * ⚠️ For models of the FLUX schnell or dev families, this parameter is ignored. * The modality detection is always disabled. ⚠️ */ disableModalityDetection?: boolean; /** * Controls how closely the generated image follows the prompt. Higher values * result in stronger adherence to the prompt. Default and allowed values depend on * the model type: * * - For Flux dev models, the default is 3.5 and allowed values are within [0, 10] * - For Flux pro models, the default is 3 and allowed values are within [2, 5] */ guidance?: number; /** * The height of the generated images, must be a 8 multiple (within [64, 2048], * default: 512) If model.type is `flux.1.1-pro-ultra`, you can use the aspectRatio * parameter instead */ height?: number; /** * If set, generated assets will be hidden and not returned in the list of images * of the inference or when listing assets (default: false) */ hideResults?: boolean; /** * Signed URL to display the input image */ image?: string; /** * Asset id of the input image */ imageId?: string; /** * Enable or disable the intermediate images generation (default: false) */ intermediateImages?: boolean; /** * Signed URL to display the IpAdapter image */ ipAdapterImage?: string; /** * Asset id of the input IpAdapter image */ ipAdapterImageId?: string; /** * Asset id of the input IpAdapter images */ ipAdapterImageIds?: Array; /** * Signed URL to display the IpAdapter images */ ipAdapterImages?: Array; /** * IpAdapter scale factor (within [0.0, 1.0], default: 0.9). */ ipAdapterScale?: number; /** * IpAdapter scale factors (within [0.0, 1.0], default: 0.9). */ ipAdapterScales?: Array; /** * The type of IP Adapter model to use. Must be one of [`style`, `character`], * default to `style`` */ ipAdapterType?: 'character' | 'style'; /** * Signed URL to display the mask image */ mask?: string; /** * Asset id of the mask image */ maskId?: string; /** * The modality associated with the control image used for the generation: it can * either be an object with a combination of maximum * * For models of the FLUX schnell or dev families: * * - one modality from: `canny`, `tile`, `depth`, `blur`, `pose`, `gray`, * `low-quality` * * Optionally, you can associate a value to these modalities or presets. The value * must be within `]0.0, 1.0]`. * * Examples: * * - `canny` * - `depth:0.5,pose:1.0` * - `canny:0.5,depth:0.5,lines:0.3` * - `landscape` * - `character:0.5` * - `illusion:1` * * Note: if you use a value that is not supported by the model family, this will * result in an error. */ modality?: string; /** * The epoch of the model to use for the inference. Only available for Flux Lora * Trained models. */ modelEpoch?: string; /** * The prompt not to guide the image generation, ignored when guidance < 1 * (example: "((ugly face))") For Flux based model (not Fast-Flux): requires * negativePromptStrength > 0 and active only for inference types txt2img / img2img * / controlnet. */ negativePrompt?: string; /** * Only applicable for flux-dev based models for `txt2img`, `img2img`, and * `controlnet` inference types. * * Controls the influence of the negative prompt. Default 0 means the negative * prompt has no effect. Higher values increase negative prompt influence. Must * be > 0 if negativePrompt is provided. */ negativePromptStrength?: number; /** * The number of denoising steps for each image generation (within [1, 150], * default: 30) */ numInferenceSteps?: number; /** * The number of images to generate (within [1, 128], default: 4) */ numSamples?: number; /** * Whether to use reference adain Only for "reference" inference type */ referenceAdain?: boolean; /** * Whether to use reference query for self attention's context Only for "reference" * inference type */ referenceAttn?: boolean; /** * The scheduler to use to override the default configured for the model. See * detailed documentation for more details. */ scheduler?: | 'DDIMScheduler' | 'DDPMScheduler' | 'DEISMultistepScheduler' | 'DPMSolverMultistepScheduler' | 'DPMSolverSinglestepScheduler' | 'EulerAncestralDiscreteScheduler' | 'EulerDiscreteScheduler' | 'HeunDiscreteScheduler' | 'KDPM2AncestralDiscreteScheduler' | 'KDPM2DiscreteScheduler' | 'LCMScheduler' | 'LMSDiscreteScheduler' | 'PNDMScheduler' | 'TCDScheduler' | 'UniPCMultistepScheduler'; /** * Used to reproduce previous results. Default: randomly generated number. */ seed?: string; /** * Controls the noise intensity introduced to the input image, where a value of 1.0 * completely erases the original image's details. Available for img2img and * inpainting. (within [0.01, 1.0], default: 0.75) */ strength?: number; /** * If style_fidelity=1.0, control more important, else if style_fidelity=0.0, * prompt more important, else balanced Only for "reference" inference type */ styleFidelity?: number; /** * The width of the generated images, must be a 8 multiple (within [64, 2048], * default: 512) If model.type is `flux.1.1-pro-ultra`, you can use the aspectRatio * parameter instead */ width?: number; } export namespace InferenceParameters { export 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 job associated with the asset */ export interface Job { /** * The job creation date as an ISO string (example: "2023-02-03T11:19:41.579Z") */ createdAt: string; /** * The job ID (example: "job_ocZCnG1Df35XRL1QyCZSRxAG8") */ jobId: string; /** * The type of job */ jobType: | 'assets-download' | 'canvas-export' | 'caption' | 'caption-llava' | 'custom' | 'describe-style' | 'detection' | 'embed' | 'flux' | 'flux-model-training' | 'generate-prompt' | 'image-generation' | 'image-prompt-editing' | 'inference' | 'mesh-preview-rendering' | 'model-download' | 'model-import' | 'model-training' | 'musubi-model-training' | 'openai-image-generation' | 'patch-image' | 'pixelate' | 'reframe' | 'remove-background' | 'repaint' | 'restyle' | 'segment' | 'skybox-3d' | 'skybox-base-360' | 'skybox-hdri' | 'skybox-upscale-360' | 'splat' | 'texture' | 'translate' | 'upload' | 'upscale' | 'upscale-skybox' | 'upscale-texture' | 'vectorize' | 'workflow'; /** * Metadata of the job with some additional information */ metadata: Job.Metadata; /** * Progress of the job (between 0 and 1) */ progress: number; /** * The current status of the job */ status: | 'canceled' | 'failure' | 'finalizing' | 'in-progress' | 'pending' | 'queued' | 'success' | 'warming-up'; /** * The history of the different statuses the job went through with the ISO string * date of when the job reached each statuses. */ statusHistory: Array; /** * The job last update date as an ISO string (example: "2023-02-03T11:19:41.579Z") */ updatedAt: string; /** * The author user ID (example: "dcf121faaa1a0a0bbbd9ca1b73d62aea") */ authorId?: string; /** * The billing of the job */ billing?: Job.Billing; /** * The owner ID (example: "team_U3Qmc8PCdWXwAQJ4Dvw4tV6D") */ ownerId?: string; } export namespace Job { /** * Metadata of the job with some additional information */ export interface Metadata { /** * List of produced assets for this job */ assetIds?: Array; /** * Eventual error for the job */ error?: string | null; /** * The flow of the job. Only available for workflow jobs. */ flow?: Array; /** * Actionable hint for the user explaining what went wrong and how to resolve it. */ hint?: string; /** * The inputs for the job */ input?: { [key: string]: unknown }; /** * May contain the output of the job for specific custom models jobs. Only * available for custom models which generate non-assets outputs. Example: LLM text * results. */ output?: { [key: string]: unknown }; /** * For voice-clone jobs: the ID of the model being trained. */ outputModelId?: string; /** * The workflow ID of the job if job is part of a workflow. */ workflowId?: string; /** * The workflow job ID of the job if job is part of a workflow job. */ workflowJobId?: string; } export namespace Metadata { export interface Flow { /** * The id of the node. */ id: string; /** * The status of the node. Only available for WorkflowJob nodes. */ status: 'failure' | 'pending' | 'processing' | 'rejected' | 'skipped' | 'success'; /** * The type of the job for the node. */ type: | 'custom-model' | 'for-each' | 'generate-prompt' | 'list' | 'logic' | 'model' | 'remove-background' | 'transform' | 'user-approval' | 'workflow'; /** * List of produced assets for this node. */ assets?: Array; /** * Fixed number of iterations for a ForEach node. When set, the loop runs exactly * `count` times regardless of array input. When not set, the loop iterates over * the resolved array input. Only available for ForEach nodes. */ count?: number; /** * The nodes that this node depends on. Only available for nodes that have * dependencies. Mainly used for user approval nodes. */ dependsOn?: Array; /** * If true, the outputs of this node will be included in the workflow job's final * output. Only applicable to producing nodes (custom-model, inference, etc.). By * default, only last nodes (nodes not referenced by other nodes) contribute to * outputs. Set this to true to also include intermediate nodes in the final * output. Note: This should only be set to `true` or left undefined. */ includeOutputsInWorkflowJob?: true; /** * The inputs of the node. */ inputs?: Array; /** * Statically-configured items for a List node. The node outputs this array as-is * when executed. Only available for List nodes. The values can be strings, * numbers, or asset IDs. */ items?: Array; /** * Zero-based index of the iteration this node copy belongs to. Set on * dynamically-created copies of loop body nodes. */ iterationIndex?: number; /** * If the flow is part of a WorkflowJob, this is the jobId for the node. jobId is * only available for nodes started. A node "Pending" for a running workflow job is * not started. */ jobId?: string; /** * The logic of the node. Only available for logic nodes. */ logic?: Flow.Logic; /** * The type of the logic for the node. Only available for logic nodes. */ logicType?: 'if-else'; /** * IDs of the body template nodes that belong to this ForEach loop. At runtime * these templates are cloned once per iteration and marked Skipped. Only available * for ForEach nodes. */ loopBodyNodeIds?: Array; /** * ID of the ForEach node that spawned this iteration copy. Set on * dynamically-created copies of loop body nodes. */ loopNodeId?: string; /** * The model id for the node. Mainly used for custom model tasks. */ modelId?: string; /** * The output of the node. Only available for logic nodes. */ output?: unknown; /** * The workflow id for the node. Mainly used for workflow tasks. */ workflowId?: string; } export namespace Flow { export interface Asset { assetId: string; url: string; } /** * This is used to run the flow. */ export 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 configured items for inputs_array type inputs. Each item is an array of * SubNodeInput that need ref/value resolution. Only available for inputs_array * type. */ items?: Array>; /** * 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; /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ ref?: Input.Ref; /** * 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; /** * The value of the input. This is the value of the input that will be used to run * the node. Only available for flows managed by a WorkflowJob. */ value?: unknown; } export namespace Input { /** * A sub-input within an inputs_array item. Same as NodeInput but without the * recursive items field. */ export interface Item { /** * 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; /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ ref?: Item.Ref; /** * 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?: Item.Required; /** * The step increment for numeric inputs. Only available for \`number\` input type. */ step?: number; /** * The value of the input. This is the value of the input that will be used to run * the node. Only available for flows managed by a WorkflowJob. */ value?: unknown; } export namespace Item { /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ export interface Ref { /** * The conditional nodes to reference. If the conditional nodes are successful, the * node will be successful. If the conditional nodes are skipped, the node will be * skipped. Contains an array of node ids used to check the status of the nodes. */ conditional?: Array; /** * This is the desired node output value if ref is an if/else node. */ equal?: string; /** * The name of the input or output to reference. If the type is 'workflow', the * name is the name of the input of the workflow is required If the type is 'node', * the name is not mandatory, except if you want all outputs of the node. To get * all outputs of a node, you can use the name 'all'. */ name?: string; /** * The node id or 'workflow' if the source is a workflow input. */ node?: string; } /** * 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. */ export 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 reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ export interface Ref { /** * The conditional nodes to reference. If the conditional nodes are successful, the * node will be successful. If the conditional nodes are skipped, the node will be * skipped. Contains an array of node ids used to check the status of the nodes. */ conditional?: Array; /** * This is the desired node output value if ref is an if/else node. */ equal?: string; /** * The name of the input or output to reference. If the type is 'workflow', the * name is the name of the input of the workflow is required If the type is 'node', * the name is not mandatory, except if you want all outputs of the node. To get * all outputs of a node, you can use the name 'all'. */ name?: string; /** * The node id or 'workflow' if the source is a workflow input. */ node?: string; } /** * 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. */ export 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 logic of the node. Only available for logic nodes. */ export interface Logic { /** * The cases of the logic. Only available for if/else nodes. */ cases?: Array; /** * The default case of the logic. Contains the id/output of the node to execute if * no case is matched. Only available for if/else nodes. */ default?: string; /** * The transform of the logic. Only available for transform nodes. */ transform?: string; } export namespace Logic { export interface Case { condition: string; value: string; } } } } export interface StatusHistory { date: string; status: | 'canceled' | 'failure' | 'finalizing' | 'in-progress' | 'pending' | 'queued' | 'success' | 'warming-up'; } /** * The billing of the job */ export interface Billing { cuCost: number; cuDiscount: number; /** * Compute Units charged for the ADD-ONS of this job, per action — the fees paid on * top of the generation itself, such as `slop-detection`. * * `cuCost` above is the main action alone, so the job's total is `cuCost` plus the * values here. * * Two caveats when displaying it: * * - These are a remaining refundable balance, not a receipt: a job that failed or * was cancelled has had its add-ons refunded, so they read 0 while `cuCost` * still shows the main action's original charge. * - `ip-detection` is part of the shape but is never populated today: that fee is * charged outside the job and reported once, as * `ipDetection.creativeUnitsCharged`, in the response of the request that ran * it. * * Absent when the job paid for no add-on. */ cuCostDetails?: Billing.CuCostDetails; /** * When true, the credits charged for this job are not automatically refunded if * the generation fails, because the model used does not support refund-on-failure. * Absent or false means a failed generation is refunded as usual. */ disableRefund?: boolean; } export namespace Billing { /** * Compute Units charged for the ADD-ONS of this job, per action — the fees paid on * top of the generation itself, such as `slop-detection`. * * `cuCost` above is the main action alone, so the job's total is `cuCost` plus the * values here. * * Two caveats when displaying it: * * - These are a remaining refundable balance, not a receipt: a job that failed or * was cancelled has had its add-ons refunded, so they read 0 while `cuCost` * still shows the main action's original charge. * - `ip-detection` is part of the shape but is never populated today: that fee is * charged outside the job and reported once, as * `ipDetection.creativeUnitsCharged`, in the response of the request that ran * it. * * Absent when the job paid for no add-on. */ export interface CuCostDetails { 'ip-detection'?: number; 'slop-detection'?: number; } } } } } export interface ExampleUpdateParams { /** * Body param: The list of asset ids to use as examples of the model. Maximum of * 150 asset ids. */ assetIds: Array; /** * 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; } export interface ExampleListParams { /** * 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 declare namespace Examples { export { type ExampleUpdateResponse as ExampleUpdateResponse, type ExampleListResponse as ExampleListResponse, type ExampleUpdateParams as ExampleUpdateParams, type ExampleListParams as ExampleListParams, }; }