/** * Runware SDK Telemetry Logger * * Beautiful colored console output for debugging SDK internals. * Only active when `enableLogging: true` is passed during instantiation. * * Usage: * const runware = new RunwareServer({ apiKey: "...", enableLogging: true }); */ declare enum LogLevel { CONNECTION = "CONNECTION", AUTH = "AUTH", HEARTBEAT = "HEARTBEAT", SEND = "SEND", RECEIVE = "RECEIVE", RETRY = "RETRY", REQUEST = "REQUEST", ERROR = "ERROR", WARN = "WARN", INFO = "INFO" } declare class RunwareLogger { private enabled; constructor(enabled?: boolean); private log; connecting(url: string): void; connected(sessionUUID: string): void; reconnecting(attempt: number): void; reconnectScheduled(delayMs: number): void; disconnected(reason?: string): void; connectionClosed(code?: number): void; connectionError(error?: any): void; ensureConnectionStart(): void; ensureConnectionSuccess(): void; ensureConnectionTimeout(): void; authenticating(hasSession: boolean): void; authenticated(sessionUUID: string): void; authError(error: any): void; heartbeatStarted(intervalMs: number): void; heartbeatPingSent(): void; heartbeatPongReceived(): void; heartbeatPongMissed(count: number, max: number): void; heartbeatStopped(): void; messageSent(taskType: string, taskUUID?: string): void; messageReceived(taskType?: string, taskUUID?: string): void; sendReconnecting(): void; sendFailed(error: string): void; requestStart(taskType: string, taskUUID: string): void; requestComplete(taskType: string, taskUUID: string, durationMs: number): void; requestTimeout(taskUUID: string, timeoutMs: number): void; requestError(taskUUID: string, error: any): void; retryAttempt(attempt: number, maxRetries: number, delayMs: number): void; retrySuccess(attempt: number): void; retryExhausted(maxRetries: number): void; retrySkippedApiError(code: string): void; info(message: string, data?: any): void; warn(message: string, data?: any): void; error(message: string, data?: any): void; } declare function createLogger(enabled: boolean): RunwareLogger; declare enum Environment { PRODUCTION = "PRODUCTION", DEVELOPMENT = "DEVELOPMENT", TEST = "TEST" } declare enum SdkType { CLIENT = "CLIENT", SERVER = "SERVER" } declare enum ETaskType { IMAGE_INFERENCE = "imageInference", IMAGE_UPLOAD = "imageUpload", UPSCALE = "upscale", REMOVE_BACKGROUND = "removeBackground", VIDEO_INFERENCE = "videoInference", CAPTION = "caption", AUDIO_INFERENCE = "audioInference", THREE_D_INFERENCE = "3dInference", GET_RESPONSE = "getResponse", PHOTO_MAKER = "photoMaker", IMAGE_CONTROL_NET_PRE_PROCESS = "imageControlNetPreProcess", IMAGE_MASKING = "imageMasking", PROMPT_ENHANCE = "promptEnhance", AUTHENTICATION = "authentication", MODEL_UPLOAD = "modelUpload", MODEL_SEARCH = "modelSearch", MEDIA_STORAGE = "mediaStorage", VECTORIZE = "vectorize", TEXT_INFERENCE = "textInference", GET_TASK_DETAILS = "getTaskDetails", TRAINING = "training" } type RunwareBaseType = { apiKey: string; url?: string; shouldReconnect?: boolean; globalMaxRetries?: number; timeoutDuration?: number; heartbeatInterval?: number; enableLogging?: boolean; dryRun?: boolean; }; type IOutputType = "base64Data" | "dataURI" | "URL"; type IOutputFormat = "JPG" | "PNG" | "WEBP"; type IVideoOutputFormat = "MP4" | "WEBM" | "MOV"; type IAudioOutputFormat = "MP3"; type IThreeDOutputFormat = "GLB" | "PLY"; interface IAdditionalResponsePayload { includePayload?: boolean; includeGenerationTime?: boolean; } interface IImage { taskType: ETaskType; imageUUID?: string; inputImageUUID?: string; taskUUID: string; status: string; imageURL?: string; imageBase64Data?: string; imageDataURI?: string; NSFWContent?: boolean; cost?: number; seed: number; mediaUUID?: string; mediaURL?: string; } interface ITextToImage extends IImage { positivePrompt?: string; negativePrompt?: string; } interface IVideoToImage { taskUUID: string; taskType: string; status: string; videoUUID?: string; cost?: number; seed?: number; videoURL?: string; } interface TOutputFile { uuid: string; url: string; } interface TOutputFiles { files: TOutputFile[]; } interface IThreeDImage { taskType: ETaskType; taskUUID: string; status: string; NSFWContent?: boolean; cost?: number; seed: number; outputs?: TOutputFiles; } interface IControlNetImage { taskUUID: string; inputImageUUID: string; guideImageUUID: string; guideImageURL?: string; guideImageBase64Data?: string; guideImageDataURI?: string; cost?: number; } interface ILora { model: string | number; weight: number; } declare enum EControlMode { BALANCED = "balanced", PROMPT = "prompt", CONTROL_NET = "controlnet" } type IControlNetGeneral = { model: string; guideImage: string | File; weight?: number; startStep?: number; startStepPercentage?: number; endStep?: number; endStepPercentage?: number; controlMode: EControlMode; }; type IControlNetPreprocess = { inputImage: string | File; preProcessorType: EPreProcessorGroup; height?: number; width?: number; outputType?: IOutputType; outputFormat?: IOutputFormat; highThresholdCanny?: number; lowThresholdCanny?: number; includeHandsAndFaceOpenPose?: boolean; includeCost?: boolean; outputQuality?: number; customTaskUUID?: string; taskUUID?: string; retry?: number; deliveryMethod?: string; skipResponse?: boolean; } & IAdditionalResponsePayload; type IControlNet = IControlNetGeneral; type IControlNetWithUUID = Omit & { guideImage?: string; }; interface IError { error: IErrorResponse; } type TPromptWeighting = "compel" | "sdEmbeds"; interface IRequestImage extends IAdditionalResponsePayload { outputType?: IOutputType; outputFormat?: IOutputFormat; uploadEndpoint?: string; checkNSFW?: boolean; positivePrompt: string; negativePrompt?: string; seedImage?: File | string; maskImage?: File | string; strength?: number; height?: number; width?: number; model: number | string; steps?: number; scheduler?: string; seed?: number; maskMargin?: number; CFGScale?: number; clipSkip?: number; /** * @deprecated The usePromptWeighting should not be used, use promptWeighting instead */ usePromptWeighting?: boolean; promptWeighting?: TPromptWeighting; numberResults?: number; includeCost?: boolean; outputQuality?: number; controlNet?: IControlNet[]; lora?: ILora[]; embeddings?: IEmbedding[]; ipAdapters?: IipAdapter[]; providerSettings?: IProviderSettings; outpaint?: IOutpaint; refiner?: IRefiner; acceleratorOptions?: TAcceleratorOptions; advancedFeatures?: { layerDiffuse: boolean; }; referenceImages?: string[]; customTaskUUID?: string; onPartialImages?: (images: IImage[], error?: IError) => void; retry?: number; [key: string]: any; } type TAcceleratorOptions = { teaCache: boolean; teaCacheDistance: number; } | { deepCache: boolean; deepCacheInterval: number; deepCacheBranchId: number; }; interface IOutpaint { top?: number; bottom?: number; right?: number; left?: number; blur?: number; } interface IEmbedding { model: string; weight: number; } interface IipAdapter { model: string; weight: number; guideImage: string; } interface IBflProviderSettings { promptUpsampling?: boolean; safetyTolerance?: number; raw?: boolean; } type ProviderSettings = { bfl: IBflProviderSettings; }; type IProviderSettings = RequireOnlyOne; interface IRefiner { model: string; startStep?: number; startStepPercentage?: number; } interface IRequestImageToText extends IAdditionalResponsePayload { model?: string; inputImage?: File | string; inputs?: { video?: InputsValue; } & { [key: string]: unknown; }; includeCost?: boolean; customTaskUUID?: string; taskUUID?: string; retry?: number; deliveryMethod?: string; skipResponse?: boolean; } interface IImageToText { taskType: ETaskType; taskUUID: string; status: string; text: string; cost?: number; } interface IRemoveImageBackground extends IRequestImageToText { outputType?: IOutputType; outputFormat?: IOutputFormat | "MP4" | "WEBM" | "MOV"; model: string; inputs?: { video?: InputsValue; image?: InputsValue; }; settings?: { rgba?: number[]; postProcessMask?: boolean; returnOnlyMask?: boolean; alphaMatting?: boolean; alphaMattingForegroundThreshold?: number; alphaMattingBackgroundThreshold?: number; alphaMattingErodeSize?: number; }; includeCost?: boolean; outputQuality?: number; retry?: number; skipResponse?: boolean; deliveryMethod?: string; } type InputsValue = string | Record; interface IRequestVideo extends IRequestImageToText { outputType?: IOutputType; outputFormat?: IVideoOutputFormat; outputQuality?: number; uploadEndpoint?: string; checkNSFW?: boolean; includeCost?: boolean; positivePrompt?: string; negativePrompt?: string; model: string; steps?: number; CFGScale?: number; seed?: number; duration?: number; fps?: number; width?: number; height?: number; numberResults?: number; inputAudios?: string[]; referenceVideos?: string[]; inputs?: { image?: InputsValue; images?: InputsValue[]; audio?: InputsValue; audios?: InputsValue[]; mask?: InputsValue[]; reference?: InputsValue; references?: InputsValue[]; } & { [key: string]: unknown; }; speech?: { voice: string; text: string; } & { [key: string]: unknown; }; skipResponse?: boolean; customTaskUUID?: string; retry?: number; [key: string]: any; } interface IAudio { taskUUID: string; taskType: string; status: string; audioUUID?: string; audioURL?: string; audioBase64Data?: string; audioDataURI?: string; cost?: number; } interface IRequestAudio { model: string; numberResults?: number; outputType?: IOutputType; outputFormat?: IAudioOutputFormat; uploadEndpoint?: string; includeCost?: boolean; positivePrompt?: string; duration?: number; audioSettings?: { sampleRate?: number; bitrate?: number; } & { [key: string]: unknown; }; inputs?: { video?: InputsValue; } & { [key: string]: unknown; }; deliveryMethod?: string; taskUUID?: string; customTaskUUID?: string; skipResponse?: boolean; retry?: number; [key: string]: unknown; } interface IRequestThreeD { model: string; numberResults?: number; outputType?: IOutputType; outputFormat?: IThreeDOutputFormat; uploadEndpoint?: string; includeCost?: boolean; positivePrompt?: string; onPartialResponse?: (results: IThreeDImage[], error?: IError) => void; inputs?: { image?: InputsValue; mask?: InputsValue; } & { [key: string]: unknown; }; deliveryMethod?: string; taskUUID?: string; customTaskUUID?: string; skipResponse?: boolean; retry?: number; [key: string]: unknown; } interface ITextMessage { role: "user" | "assistant"; content: string; } interface IRequestTextInference extends IAdditionalResponsePayload { model: string; messages: ITextMessage[]; maxTokens?: number; temperature?: number; topP?: number; topK?: number; seed?: number; stopSequences?: string[]; systemPrompt?: string; outputFormat?: string; numberResults?: number; includeCost?: boolean; onPartialResponse?: (results: IThreeDImage[], error?: IError) => void; deliveryMethod?: string; taskUUID?: string; customTaskUUID?: string; skipResponse?: boolean; retry?: number; [key: string]: unknown; } interface ITextResponse { text: string; finishReason: string; usage: { promptTokens: number; completionTokens: number; totalTokens: number; thinkingTokens: number; }; thoughtSignature: string; cost: number; taskUUID: string; status: string; } interface IAsyncResults { taskUUID: string; onPartialImages?: (images: IImage[], error?: IError) => void; } interface IRemoveImage { taskType: ETaskType; taskUUID: string; status: string; imageUUID?: string; mediaUUID?: string; mediaURL?: string; videoUUID?: string; inputImageUUID: string; imageURL?: string; imageBase64Data?: string; imageDataURI?: string; cost?: number; } interface IPromptEnhancer extends IAdditionalResponsePayload { promptMaxLength?: number; promptVersions?: number; prompt: string; includeCost?: boolean; customTaskUUID?: string; taskUUID?: string; retry?: number; } interface IEnhancedPrompt extends IImageToText { } interface IUpscaleGan extends IAdditionalResponsePayload { inputImage?: File | string; upscaleFactor?: number; outputType?: IOutputType; outputFormat?: IOutputFormat | "MP4" | "WEBM" | "MOV"; includeCost?: boolean; outputQuality?: number; inputs?: { video?: InputsValue; image?: InputsValue; } & { [key: string]: unknown; }; model?: string; customTaskUUID?: string; taskUUID?: string; retry?: number; skipResponse?: boolean; deliveryMethod?: string; [key: string]: any; } type ReconnectingWebsocketProps = { addEventListener: (type: string, listener: EventListener, options: any) => void; send: (data: any) => void; } & WebSocket; type UploadImageType = { imageURL: string; imageUUID: string; taskUUID: string; taskType: ETaskType; }; type GetWithPromiseCallBackType = ({ resolve, reject, intervalId, }: { resolve: (value: T) => void; reject: (value: T) => void; intervalId: any; }) => boolean | undefined; type GetWithPromiseAsyncCallBackType = ({ resolve, reject, intervalId, }: { resolve: (value: T) => void; reject: (value: T) => void; intervalId: any; }) => any; declare enum EPreProcessorGroup { "canny" = "canny", "depth" = "depth", "mlsd" = "mlsd", "normalbae" = "normalbae", "openpose" = "openpose", "tile" = "tile", "seg" = "seg", "lineart" = "lineart", "lineart_anime" = "lineart_anime", "shuffle" = "shuffle", "scribble" = "scribble", "softedge" = "softedge" } declare enum EPreProcessor { "canny" = "canny", "depth_leres" = "depth_leres", "depth_midas" = "depth_midas", "depth_zoe" = "depth_zoe", "inpaint_global_harmonious" = "inpaint_global_harmonious", "lineart_anime" = "lineart_anime", "lineart_coarse" = "lineart_coarse", "lineart_realistic" = "lineart_realistic", "lineart_standard" = "lineart_standard", "mlsd" = "mlsd", "normal_bae" = "normal_bae", "scribble_hed" = "scribble_hed", "scribble_pidinet" = "scribble_pidinet", "seg_ofade20k" = "seg_ofade20k", "seg_ofcoco" = "seg_ofcoco", "seg_ufade20k" = "seg_ufade20k", "shuffle" = "shuffle", "softedge_hed" = "softedge_hed", "softedge_hedsafe" = "softedge_hedsafe", "softedge_pidinet" = "softedge_pidinet", "softedge_pidisafe" = "softedge_pidisafe", "tile_gaussian" = "tile_gaussian", "openpose" = "openpose", "openpose_face" = "openpose_face", "openpose_faceonly" = "openpose_faceonly", "openpose_full" = "openpose_full", "openpose_hand" = "openpose_hand" } declare enum EOpenPosePreProcessor { "openpose" = "openpose", "openpose_face" = "openpose_face", "openpose_faceonly" = "openpose_faceonly", "openpose_full" = "openpose_full", "openpose_hand" = "openpose_hand" } type RequireAtLeastOne = Pick> & { [K in Keys]-?: Required> & Partial>>; }[Keys]; type RequireOnlyOne = Pick> & { [K in Keys]-?: Required> & Partial, undefined>>; }[Keys]; type ListenerType = { key: string; listener: (msg: any) => void; groupKey?: string; }; interface IAddModelResponse { status: string; message: string; taskUUID: string; air: string; taskType: string; } interface IErrorResponse { code: string; message: string; parameter: string; type: string; documentation: string; taskUUID: string; min?: number; max?: number; default?: string | number; } type TAddModelBaseType = { air: string; name: string; downloadURL: string; uniqueIdentifier: string; version: string; format: EModelFormat; architecture: EModelArchitecture; heroImageURL?: string; tags?: string[]; shortDescription?: string; comment?: string; private: boolean; customTaskUUID?: string; taskUUID?: string; retry?: number; onUploadStream?: (response?: IAddModelResponse, error?: IErrorResponse) => void; }; type TAddModelControlNet = { category: "controlnet"; conditioning: EModelConditioning; } & TAddModelBaseType; type TAddModelCheckPoint = { category: "checkpoint"; defaultCFGScale?: number; defaultStrength: number; defaultSteps?: number; defaultScheduler?: string; type: EModelType; } & TAddModelBaseType; type TAddModelLora = { category: "lora"; defaultWeight: number; positiveTriggerWords?: string; } & TAddModelBaseType; type TAddModel = TAddModelCheckPoint | TAddModelControlNet | TAddModelLora; type TPhotoMaker = { style: EPhotoMakerEnum; inputImages: string[]; outputType?: string; outputFormat?: string; uploadEndpoint?: string; checkNSFW?: boolean; positivePrompt: string; negativePrompt?: string; strength?: number; height: number; width: number; model?: string; steps?: number; scheduler?: string; seed?: number; CFGScale?: number; clipSkip?: number; numberResults: number; includeCost?: boolean; outputQuality?: number; customTaskUUID?: string; taskUUID?: string; retry?: number; onPartialImages?: (images: IImage[], error?: IError) => void; } & IAdditionalResponsePayload; type TPhotoMakerResponse = { taskType: string; taskUUID: string; status: string; imageUUID: string; NSFWContent: boolean; cost: number; seed: number; imageURL: string; positivePrompt: string; negativePrompt?: string; }; declare enum EModelFormat { safetensors = "safetensors", pickletensor = "pickletensor" } declare enum EModelArchitecture { flux1d = "flux1d", flux1s = "flux1s", pony = "pony", sdhyper = "sdhyper", sd1x = "sd1x", sd1xlcm = "sd1xlcm", sd3 = "sd3", sdxl = "sdxl", sdxllcm = "sdxllcm", sdxldistilled = "sdxldistilled", sdxlhyper = "sdxlhyper", sdxllightning = "sdxllightning", sdxlturbo = "sdxlturbo" } declare enum EModelType { base = "base", inpainting = "inpainting", pix2pix = "pix2pix" } declare enum EModelConditioning { canny = "canny", depth = "depth", qrcode = "qrcode", hed = "hed", scrible = "scrible", openpose = "openpose", seg = "segmentation", openmlsd = "openmlsd", softedge = "softedge", normal = "normal bae", shuffle = "shuffle", pix2pix = "pix2pix", inpaint = "inpaint", lineart = "line art", sketch = "sketch", inpaintdepth = "inpaint depth", tile = "tile", outfit = "outfit", blur = "blur", gray = "gray", lowquality = "low quality" } declare enum EPhotoMakerEnum { NoStyle = "No style", Cinematic = "Cinematic", DisneyCharacter = "Disney Character", DigitalArt = "Digital Art", Photographic = "Photographic", FantasyArt = "Fantasy art", Neonpunk = "Neonpunk", Enhance = "Enhance", ComicBook = "Comic book", Lowpoly = "Lowpoly", LineArt = "Line art" } type TModelSearch = { search?: string; tags?: string[]; category?: "checkpoint" | "lora" | "controlnet"; type?: string; architecture?: EModelArchitecture; conditioning?: string; visibility?: "public" | "private" | "all"; limit?: number; offset?: number; customTaskUUID?: string; retry?: number; } & { [key: string]: any; }; type TModel = { air: string; name: string; version: string; category: string; architecture: string; tags: string[]; heroImage: string; private: boolean; comment: string; type?: string; defaultWidth?: number; defaultHeight?: number; defaultSteps?: number; defaultScheduler?: string; defaultCFG?: number; defaultStrength: number; conditioning?: string; positiveTriggerWords?: string; } & { [key: string]: any; }; type TModelSearchResponse = { results: TModel[]; taskUUID: string; taskType: string; totalResults: number; }; type TImageMasking = { model: string; inputImage: string; confidence?: number; maskPadding?: number; maskBlur?: number; outputFormat?: string; outputType?: string; includeCost?: boolean; uploadEndpoint?: string; maxDetections?: number; outputQuality?: number; customTaskUUID?: string; retry?: number; }; type TVectorize = { model: string; outputFormat?: string; outputType?: string; includeCost?: boolean; inputs: { image: string; }; customTaskUUID?: string; retry?: number; }; type TVectorizeResponse = { taskType: string; taskUUID: string; cost: number; imageURL: string; }; type TImageUpload = { image: string; customTaskUUID?: string; retry?: number; }; type TMediaStorage = { media: string; operation?: string; customTaskUUID?: string; retry?: number; }; type TMediaStorageResponse = { taskType: string; taskUUID: string; mediaUUID: string; }; type TImageUploadResponse = { image: string; taskUUID: string; imageUUID: number; imageURL: string; }; type TImageMaskingResponse = { taskType: string; taskUUID: string; maskImageUUID: string; detections: [ { x_min: number; y_min: number; x_max: number; y_max: number; } ]; maskImageURL: string; cost: number; }; type TServerError = { error: { code: string; message: string; parameter: string; type: string; taskType: string; }; }; type MediaUUID = { mediaUUID?: string; audioUUID?: string; imageUUID?: string; videoUUID?: string; outputs?: TOutputFiles; text?: string; }; type TGetTaskDetailsRequest = { taskUUID: string; }; type TGetTaskDetailsResponse = { taskType: string; taskUUID: string; request: any[]; response: { data: any[]; error: { code: string; message: string; taskUUID: string; } | null; }[]; }; interface IImportModel { air: string; name: string; uniqueIdentifier: string; version: string; private?: boolean; heroImageURL?: string; shortDescription?: string; } interface IRequestTraining extends IAdditionalResponsePayload { model: string; importModel: IImportModel; inputs: { dataset: string; }; webhookURL?: string; customTaskUUID?: string; taskUUID?: string; skipResponse?: boolean; includeCost?: boolean; [key: string]: unknown; } type TTrainingResponse = { taskType: string; taskUUID: string; status: string; cost?: number; air?: string; }; declare const SDK_VERSION: string; declare enum LISTEN_TO_MEDIA_KEY { REQUEST_IMAGES = "REQUEST_IMAGES", REQUEST_TEXT = "REQUEST_TEXT", REQUEST_AUDIO = "REQUEST_AUDIO" } declare class RunwareBase { _ws: ReconnectingWebsocketProps | any; _listeners: ListenerType[]; _apiKey: string; _url?: string; _globalMessages: Record; _globalImages: IImage[]; _globalErrors: IError[]; _connectionSessionUUID: string | undefined; _connectionError: TServerError | undefined; _sdkType: SdkType; _shouldReconnect: boolean; _globalMaxRetries: number; _timeoutDuration: number; _heartbeatIntervalId: any; _pongTimeoutId: any; _heartbeatInterval: number; _missedPongCount: number; _maxMissedPongs: number; _dryRun: boolean; ensureConnectionUUID: string | null; _logger: RunwareLogger; constructor({ apiKey, url, shouldReconnect, globalMaxRetries, timeoutDuration, heartbeatInterval, enableLogging, dryRun, }: RunwareBaseType); private getUniqueUUID; /** * Shared polling logic for async results. * @param taskUUID - The task UUID to poll for. * @param numberResults - Number of results expected. * @returns Promise resolving to array of results. */ private pollForAsyncResults; static initialize(props: RunwareBaseType): Promise; protected isWebsocketReadyState: () => boolean; protected isWebsocketHealthyForSend: () => boolean; protected canSendMessage: (taskType?: string) => boolean; protected closeCurrentWebsocket(): void; private getReadyStateLabel; private createConnectionTimeoutError; protected isInvalidAPIKey: () => boolean; protected startHeartbeat(): void; protected stopHeartbeat(): void; protected handlePongMessage(data: any): boolean; protected addListener({ lis, groupKey, taskUUID, }: { lis: (v: any) => any; groupKey?: string; taskUUID: string; }): { destroy: () => void; }; protected connect(): void; protected send: (msg: Record) => Promise; protected serializeWebsocketMessage(msg: Record): string; private destroy; private uploadImage; private listenToResponse; private listenToUpload; private globalListener; requestImages({ outputType, outputFormat, uploadEndpoint, checkNSFW, positivePrompt, negativePrompt, seedImage, maskImage, strength, height, width, model, steps, scheduler, seed, CFGScale, clipSkip, usePromptWeighting, promptWeighting, numberResults, onPartialImages, includeCost, customTaskUUID, taskUUID: _taskUUID, retry, refiner, maskMargin, outputQuality, controlNet, lora, embeddings, ipAdapters, providerSettings, outpaint, acceleratorOptions, advancedFeatures, referenceImages, includeGenerationTime, includePayload, ...rest }: IRequestImage, moreOptions?: Record): Promise; imageInference(params: IRequestImage, moreOptions?: Record): Promise; controlNetPreProcess: (payload: IControlNetPreprocess) => Promise; controlNetPreprocess: (params: IControlNetPreprocess) => Promise; requestImageToText: ({ inputImage, inputs, includeCost, customTaskUUID, taskUUID: _taskUUID, retry, includePayload, includeGenerationTime, deliveryMethod, skipResponse, model, }: IRequestImageToText) => Promise; caption: (params: IRequestImageToText) => Promise; /** * Remove the background from an image or video. * @remark This method now supports the removeBackground type which can handle multiple media types such as image and video. * If you pass an `inputs` object with `inputs.image` or `inputs.video`, the response will contain `mediaUUID` and `mediaURL`. * If you pass `inputImage`, the response will contain `imageUUID` and `imageURL`. * @remark `imageUUID` is no longer guaranteed in the response. Use `mediaUUID` for new implementations. * @since 1.2.0 * @returns {Promise} If called with `inputs.image` or `inputs.video`, returns an object with `mediaUUID` and `mediaURL`. If called with `inputImage`, returns an object with `imageUUID` and `imageURL` (not guaranteed). */ removeImageBackground: (payload: IRemoveImageBackground) => Promise; removeBackground: (payload: IRemoveImageBackground) => Promise; vectorize: (payload: TVectorize) => Promise; getTaskDetails: (payload: TGetTaskDetailsRequest) => Promise; training: (payload: IRequestTraining) => Promise; videoInference: (payload: IRequestVideo) => Promise; audioInference: (payload: IRequestAudio) => Promise; threeDInference: (payload: IRequestThreeD) => Promise; textInference: (payload: IRequestTextInference) => Promise; getResponse: (payload: IAsyncResults) => Promise; /** * Upscale an image or video * @remark This method now supports the upscale type which can handle multiple media types such as image and video. * If you pass an `inputs` object with `inputs.image` or `inputs.video`, the response will contain `mediaUUID` and `mediaURL`. * If you pass `inputImage`, the response will contain `imageUUID` and `imageURL`. * @remark `imageUUID` is no longer guaranteed in the response. Use `mediaUUID` for new implementations. * @since 1.2.0 * @returns {Promise} If called with `inputs.image` or `inputs.video`, returns an object with `mediaUUID` and `mediaURL`. If called with `inputImage`, returns an object with `imageUUID` and `imageURL` (not guaranteed). */ upscaleGan: (payload: IUpscaleGan) => Promise; upscale: (params: IUpscaleGan) => Promise; enhancePrompt: ({ prompt, promptMaxLength, promptVersions, includeCost, customTaskUUID, taskUUID: _taskUUID, retry, includeGenerationTime, includePayload, }: IPromptEnhancer) => Promise; promptEnhance: (params: IPromptEnhancer) => Promise; modelUpload: (payload: TAddModel) => Promise; photoMaker: (payload: TPhotoMaker, moreOptions?: Record) => Promise; modelSearch: (payload: TModelSearch) => Promise; imageMasking: (payload: TImageMasking) => Promise; imageUpload: (payload: TImageUpload) => Promise; mediaStorage: (payload: TMediaStorage) => Promise; protected baseSingleRequest: ({ payload, debugKey, isMultiple, }: { payload: Record; debugKey: string; isMultiple?: boolean | undefined; }) => Promise; protected baseSyncRequest: ({ payload, groupKey, skipResponse, }: { payload: Record; groupKey: LISTEN_TO_MEDIA_KEY; skipResponse?: boolean | undefined; }) => Promise; ensureConnection(): Promise; private getResponseWithSimilarTaskUUID; private getSingleMessage; private getMultipleMessages; private insertAdditionalResponse; private handleIncompleteImages; disconnect: () => Promise; private connected; } declare class RunwareClient extends RunwareBase { constructor(props: RunwareBaseType); } declare class RunwareServer extends RunwareBase { _instantiated: boolean; _listeners: any[]; _reconnectingIntervalId: null | any; private _connecting; constructor(props: RunwareBaseType); protected connect(): Promise; protected send: (msg: Record) => Promise; protected handleClose(): void; protected resetConnection: () => void; } declare let Runware: typeof RunwareClient | typeof RunwareServer; export { EControlMode, EModelArchitecture, EModelConditioning, EModelFormat, EModelType, EOpenPosePreProcessor, EPhotoMakerEnum, EPreProcessor, EPreProcessorGroup, ETaskType, Environment, type GetWithPromiseAsyncCallBackType, type GetWithPromiseCallBackType, type IAddModelResponse, type IAdditionalResponsePayload, type IAsyncResults, type IAudio, type IAudioOutputFormat, type IBflProviderSettings, type IControlNet, type IControlNetGeneral, type IControlNetImage, type IControlNetPreprocess, type IControlNetWithUUID, type IEmbedding, type IEnhancedPrompt, type IError, type IErrorResponse, type IImage, type IImageToText, type IImportModel, type IOutpaint, type IOutputFormat, type IOutputType, type IPromptEnhancer, type IProviderSettings, type IRefiner, type IRemoveImage, type IRemoveImageBackground, type IRequestAudio, type IRequestImage, type IRequestImageToText, type IRequestTextInference, type IRequestThreeD, type IRequestTraining, type IRequestVideo, type ITextMessage, type ITextResponse, type ITextToImage, type IThreeDImage, type IThreeDOutputFormat, type IUpscaleGan, type IVideoOutputFormat, type IVideoToImage, type IipAdapter, type ListenerType, LogLevel, type MediaUUID, type ProviderSettings, type ReconnectingWebsocketProps, type RequireAtLeastOne, type RequireOnlyOne, Runware, type RunwareBaseType, RunwareClient, RunwareLogger, RunwareServer, SDK_VERSION, SdkType, type TAcceleratorOptions, type TAddModel, type TAddModelBaseType, type TAddModelCheckPoint, type TAddModelControlNet, type TAddModelLora, type TGetTaskDetailsRequest, type TGetTaskDetailsResponse, type TImageMasking, type TImageMaskingResponse, type TImageUpload, type TImageUploadResponse, type TMediaStorage, type TMediaStorageResponse, type TModel, type TModelSearch, type TModelSearchResponse, type TPhotoMaker, type TPhotoMakerResponse, type TPromptWeighting, type TServerError, type TTrainingResponse, type TVectorize, type TVectorizeResponse, type UploadImageType, createLogger };