@runware/sdk-js 1.1.48 → 1.1.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.cts +69 -8
  4. package/dist/index.d.ts +69 -8
  5. package/dist/index.js +1 -1
  6. package/dist/index.js.map +1 -1
  7. package/package.json +1 -1
  8. package/readme.md +16 -6
  9. package/dist/esm/Runware/Runware-base.d.ts +0 -70
  10. package/dist/esm/Runware/Runware-base.js +0 -1002
  11. package/dist/esm/Runware/Runware-client.d.ts +0 -5
  12. package/dist/esm/Runware/Runware-client.js +0 -28
  13. package/dist/esm/Runware/Runware-server.d.ts +0 -15
  14. package/dist/esm/Runware/Runware-server.js +0 -145
  15. package/dist/esm/Runware/Runware.d.ts +0 -4
  16. package/dist/esm/Runware/Runware.js +0 -13
  17. package/dist/esm/Runware/async-retry.d.ts +0 -5
  18. package/dist/esm/Runware/async-retry.js +0 -30
  19. package/dist/esm/Runware/index.d.ts +0 -4
  20. package/dist/esm/Runware/index.js +0 -20
  21. package/dist/esm/Runware/reconnect.d.ts +0 -11
  22. package/dist/esm/Runware/reconnect.js +0 -175
  23. package/dist/esm/Runware/types.d.ts +0 -644
  24. package/dist/esm/Runware/types.js +0 -156
  25. package/dist/esm/Runware/utils.d.ts +0 -57
  26. package/dist/esm/Runware/utils.js +0 -262
  27. package/dist/esm/tests/Runware/enhance-prompt.test.d.ts +0 -1
  28. package/dist/esm/tests/Runware/enhance-prompt.test.js +0 -58
  29. package/dist/esm/tests/Runware/remove-image-background.test.d.ts +0 -1
  30. package/dist/esm/tests/Runware/remove-image-background.test.js +0 -37
  31. package/dist/esm/tests/Runware/request-image-to-text.test.d.ts +0 -1
  32. package/dist/esm/tests/Runware/request-image-to-text.test.js +0 -37
  33. package/dist/esm/tests/Runware/request-images.test.d.ts +0 -1
  34. package/dist/esm/tests/Runware/request-images.test.js +0 -84
  35. package/dist/esm/tests/Runware/runware-server.test.d.ts +0 -1
  36. package/dist/esm/tests/Runware/runware-server.test.js +0 -26
  37. package/dist/esm/tests/Runware/upload-image.test.d.ts +0 -1
  38. package/dist/esm/tests/Runware/upload-image.test.js +0 -28
  39. package/dist/esm/tests/Runware/upscale-gan.test.d.ts +0 -1
  40. package/dist/esm/tests/Runware/upscale-gan.test.js +0 -41
  41. package/dist/esm/tests/mockServer.d.ts +0 -12
  42. package/dist/esm/tests/mockServer.js +0 -38
  43. package/dist/esm/tests/script.d.ts +0 -8
  44. package/dist/esm/tests/script.js +0 -570
  45. package/dist/esm/tests/test-utils.d.ts +0 -40
  46. package/dist/esm/tests/test-utils.js +0 -45
package/readme.md CHANGED
@@ -66,7 +66,6 @@ await runware.disconnect();
66
66
 
67
67
  ### Request Image
68
68
 
69
-
70
69
  [Read Documentation](https://docs.runware.ai/en/image-inference/api-reference)
71
70
 
72
71
  NB: All errors can be caught in the catch block of each request
@@ -680,17 +679,28 @@ export type TImageMaskingResponse = {
680
679
 
681
680
  ## Changelog
682
681
 
682
+ ### - v1.1.50
683
+
684
+ - Added mediaStorage taskType
685
+ - Add compatibility with taskUUID
686
+
687
+ ### - v1.1.49
688
+
689
+ - Add support for vectorize taskType
690
+
691
+ **Added or Changed**
692
+
683
693
  ### - v1.1.48
684
694
 
685
695
  **Added or Changed**
686
696
 
687
697
  - Added method aliases so task types match those of official API. It is recommended to use these new aliases going forward:
688
698
 
689
- - imageInference > requestImages
690
- - controlNetPreprocess > controlNetPreProcess
691
- - caption > requestImageToText
692
- - upscale > upscaleGan
693
- - promptEnhance > ehancePrompt
699
+ - imageInference > requestImages
700
+ - controlNetPreprocess > controlNetPreProcess
701
+ - caption > requestImageToText
702
+ - upscale > upscaleGan
703
+ - promptEnhance > ehancePrompt
694
704
 
695
705
  ### - v1.1.47
696
706
 
@@ -1,70 +0,0 @@
1
- import { IEnhancedPrompt, IError, IImage, IImageToText, IPromptEnhancer, IRemoveImageBackground, IRequestImage, IRequestImageToText, IUpscaleGan, ListenerType, ReconnectingWebsocketProps, RunwareBaseType, SdkType, IControlNetPreprocess, IControlNetImage, IRemoveImage, ITextToImage, TAddModel, TPhotoMaker, TPhotoMakerResponse, TModelSearch, TImageMaskingResponse, TImageMasking, TModelSearchResponse, TServerError, TImageUpload, TImageUploadResponse, IRequestVideo, IAsyncResults, IVideoToImage, IRequestRemoveBackground, IMedia } from "./types";
2
- export declare class RunwareBase {
3
- _ws: ReconnectingWebsocketProps | any;
4
- _listeners: ListenerType[];
5
- _apiKey: string;
6
- _url?: string;
7
- _globalMessages: Record<string, any>;
8
- _globalImages: IImage[];
9
- _globalError: IError | undefined;
10
- _connectionSessionUUID: string | undefined;
11
- _connectionError: TServerError | undefined;
12
- _sdkType: SdkType;
13
- _shouldReconnect: boolean;
14
- _globalMaxRetries: number;
15
- _timeoutDuration: number;
16
- ensureConnectionUUID: string | null;
17
- constructor({ apiKey, url, shouldReconnect, globalMaxRetries, timeoutDuration, }: RunwareBaseType);
18
- /**
19
- * Shared polling logic for async results.
20
- * @param taskUUID - The task UUID to poll for.
21
- * @param numberResults - Number of results expected.
22
- * @param resultKey - Key to identify results (default is "mediaUUID" - "videoUUID" is legacy).
23
- * @returns Promise resolving to array of results.
24
- */
25
- private pollForAsyncResults;
26
- static initialize(props: RunwareBaseType): Promise<RunwareBase>;
27
- protected isWebsocketReadyState: () => boolean;
28
- protected isInvalidAPIKey: () => boolean;
29
- protected addListener({ lis, groupKey, taskUUID, }: {
30
- lis: (v: any) => any;
31
- groupKey?: string;
32
- taskUUID: string;
33
- }): {
34
- destroy: () => void;
35
- };
36
- protected connect(): void;
37
- protected send: (msg: Object) => void;
38
- private destroy;
39
- private uploadImage;
40
- private listenToImages;
41
- private listenToUpload;
42
- private globalListener;
43
- requestImages({ outputType, outputFormat, uploadEndpoint, checkNSFW, positivePrompt, negativePrompt, seedImage, maskImage, strength, height, width, model, steps, scheduler, seed, CFGScale, clipSkip, usePromptWeighting, promptWeighting, numberResults, onPartialImages, includeCost, customTaskUUID, retry, refiner, maskMargin, outputQuality, controlNet, lora, embeddings, ipAdapters, providerSettings, outpaint, acceleratorOptions, advancedFeatures, referenceImages, includeGenerationTime, includePayload, ...rest }: IRequestImage, moreOptions?: Record<string, any>): Promise<ITextToImage[] | undefined>;
44
- controlNetPreProcess: ({ inputImage, preProcessorType, height, width, outputType, outputFormat, highThresholdCanny, lowThresholdCanny, includeHandsAndFaceOpenPose, includeCost, outputQuality, customTaskUUID, retry, includeGenerationTime, includePayload, }: IControlNetPreprocess) => Promise<IControlNetImage | null>;
45
- requestImageToText: ({ inputImage, includeCost, customTaskUUID, retry, includePayload, includeGenerationTime, }: IRequestImageToText) => Promise<IImageToText>;
46
- removeImageBackground: (payload: IRemoveImageBackground) => Promise<IRemoveImage>;
47
- removeBackground: (payload: IRequestRemoveBackground) => Promise<IMedia[] | IMedia>;
48
- videoInference: (payload: IRequestVideo) => Promise<IVideoToImage[] | IVideoToImage>;
49
- getResponse: (payload: IAsyncResults) => Promise<IMedia[]>;
50
- upscaleGan: ({ inputImage, upscaleFactor, outputType, outputFormat, includeCost, outputQuality, customTaskUUID, retry, includeGenerationTime, includePayload, }: IUpscaleGan) => Promise<IImage>;
51
- enhancePrompt: ({ prompt, promptMaxLength, promptVersions, includeCost, customTaskUUID, retry, includeGenerationTime, includePayload, }: IPromptEnhancer) => Promise<IEnhancedPrompt[]>;
52
- modelUpload: (payload: TAddModel) => Promise<any>;
53
- photoMaker: (payload: TPhotoMaker, moreOptions?: Record<string, any>) => Promise<TPhotoMakerResponse[] | undefined>;
54
- modelSearch: (payload: TModelSearch) => Promise<TModelSearchResponse>;
55
- imageMasking: (payload: TImageMasking) => Promise<TImageMaskingResponse>;
56
- imageUpload: (payload: TImageUpload) => Promise<TImageUploadResponse>;
57
- protected baseSingleRequest: <T>({ payload, debugKey, isMultiple, }: {
58
- payload: Record<string, any>;
59
- debugKey: string;
60
- isMultiple?: boolean | undefined;
61
- }) => Promise<T>;
62
- ensureConnection(): Promise<unknown>;
63
- private getSimilarImages;
64
- private getSingleMessage;
65
- private getMultipleMessages;
66
- private insertAdditionalResponse;
67
- private handleIncompleteImages;
68
- disconnect: () => Promise<void>;
69
- private connected;
70
- }