@runware/sdk-js 1.1.4 → 1.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -73,6 +73,7 @@ type IControlNetPreprocess = {
73
73
  lowThresholdCanny?: number;
74
74
  includeHandsAndFaceOpenPose?: boolean;
75
75
  includeCost?: boolean;
76
+ customTaskUUID?: string;
76
77
  };
77
78
  type IControlNet = IControlNetGeneral;
78
79
  type IControlNetWithUUID = Omit<IControlNet, "guideImage"> & {
@@ -106,12 +107,14 @@ interface IRequestImage {
106
107
  controlNet?: IControlNet[];
107
108
  lora?: ILora[];
108
109
  includeCost?: boolean;
110
+ customTaskUUID?: string;
109
111
  useCache?: boolean;
110
112
  onPartialImages?: (images: IImage[], error?: IError) => void;
111
113
  }
112
114
  interface IRequestImageToText {
113
115
  inputImage?: File | string;
114
116
  includeCost?: boolean;
117
+ customTaskUUID?: string;
115
118
  }
116
119
  interface IImageToText {
117
120
  taskType: ETaskType;
@@ -146,6 +149,7 @@ interface IPromptEnhancer {
146
149
  promptVersions?: number;
147
150
  prompt: string;
148
151
  includeCost?: boolean;
152
+ customTaskUUID?: string;
149
153
  }
150
154
  interface IEnhancedPrompt extends IImageToText {
151
155
  }
@@ -155,6 +159,7 @@ interface IUpscaleGan {
155
159
  outputType?: IOutputType;
156
160
  outputFormat?: IOutputFormat;
157
161
  includeCost?: boolean;
162
+ customTaskUUID?: string;
158
163
  }
159
164
  type ReconnectingWebsocketProps = {
160
165
  addEventListener: (type: string, listener: EventListener, options: any) => void;
@@ -273,12 +278,12 @@ declare class RunwareBase {
273
278
  }): {
274
279
  destroy: () => void;
275
280
  };
276
- requestImages({ outputType, outputFormat, uploadEndpoint, checkNsfw, positivePrompt, negativePrompt, seedImage, maskImage, strength, height, width, model, steps, scheduler, seed, CFGScale, clipSkip, usePromptWeighting, numberResults, controlNet, lora, useCache, onPartialImages, includeCost, }: IRequestImage): Promise<IImage[] | undefined>;
277
- controlNetPreProcess: ({ inputImage, preProcessor, height, width, outputType, outputFormat, highThresholdCanny, lowThresholdCanny, includeHandsAndFaceOpenPose, includeCost, }: IControlNetPreprocess) => Promise<IControlNetImage | null>;
278
- requestImageToText: ({ inputImage, includeCost, }: IRequestImageToText) => Promise<IImageToText>;
279
- removeImageBackground: ({ inputImage, outputType, outputFormat, rgba, postProcessMask, returnOnlyMask, alphaMatting, alphaMattingForegroundThreshold, alphaMattingBackgroundThreshold, alphaMattingErodeSize, includeCost, }: IRemoveImageBackground) => Promise<IRemoveImage[]>;
280
- upscaleGan: ({ inputImage, upscaleFactor, outputType, outputFormat, includeCost, }: IUpscaleGan) => Promise<IImage[]>;
281
- enhancePrompt: ({ prompt, promptMaxLength, promptVersions, includeCost, }: IPromptEnhancer) => Promise<IEnhancedPrompt[]>;
281
+ requestImages({ outputType, outputFormat, uploadEndpoint, checkNsfw, positivePrompt, negativePrompt, seedImage, maskImage, strength, height, width, model, steps, scheduler, seed, CFGScale, clipSkip, usePromptWeighting, numberResults, controlNet, lora, useCache, onPartialImages, includeCost, customTaskUUID, }: IRequestImage): Promise<IImage[] | undefined>;
282
+ controlNetPreProcess: ({ inputImage, preProcessor, height, width, outputType, outputFormat, highThresholdCanny, lowThresholdCanny, includeHandsAndFaceOpenPose, includeCost, customTaskUUID, }: IControlNetPreprocess) => Promise<IControlNetImage | null>;
283
+ requestImageToText: ({ inputImage, includeCost, customTaskUUID, }: IRequestImageToText) => Promise<IImageToText>;
284
+ removeImageBackground: ({ inputImage, outputType, outputFormat, rgba, postProcessMask, returnOnlyMask, alphaMatting, alphaMattingForegroundThreshold, alphaMattingBackgroundThreshold, alphaMattingErodeSize, includeCost, customTaskUUID, }: IRemoveImageBackground) => Promise<IRemoveImage[]>;
285
+ upscaleGan: ({ inputImage, upscaleFactor, outputType, outputFormat, includeCost, customTaskUUID, }: IUpscaleGan) => Promise<IImage[]>;
286
+ enhancePrompt: ({ prompt, promptMaxLength, promptVersions, includeCost, customTaskUUID, }: IPromptEnhancer) => Promise<IEnhancedPrompt[]>;
282
287
  ensureConnection(): Promise<unknown>;
283
288
  getSimilarImages({ taskUUID, numberResults, shouldThrowError, lis, }: {
284
289
  taskUUID: string | string[];
package/dist/index.d.ts CHANGED
@@ -73,6 +73,7 @@ type IControlNetPreprocess = {
73
73
  lowThresholdCanny?: number;
74
74
  includeHandsAndFaceOpenPose?: boolean;
75
75
  includeCost?: boolean;
76
+ customTaskUUID?: string;
76
77
  };
77
78
  type IControlNet = IControlNetGeneral;
78
79
  type IControlNetWithUUID = Omit<IControlNet, "guideImage"> & {
@@ -106,12 +107,14 @@ interface IRequestImage {
106
107
  controlNet?: IControlNet[];
107
108
  lora?: ILora[];
108
109
  includeCost?: boolean;
110
+ customTaskUUID?: string;
109
111
  useCache?: boolean;
110
112
  onPartialImages?: (images: IImage[], error?: IError) => void;
111
113
  }
112
114
  interface IRequestImageToText {
113
115
  inputImage?: File | string;
114
116
  includeCost?: boolean;
117
+ customTaskUUID?: string;
115
118
  }
116
119
  interface IImageToText {
117
120
  taskType: ETaskType;
@@ -146,6 +149,7 @@ interface IPromptEnhancer {
146
149
  promptVersions?: number;
147
150
  prompt: string;
148
151
  includeCost?: boolean;
152
+ customTaskUUID?: string;
149
153
  }
150
154
  interface IEnhancedPrompt extends IImageToText {
151
155
  }
@@ -155,6 +159,7 @@ interface IUpscaleGan {
155
159
  outputType?: IOutputType;
156
160
  outputFormat?: IOutputFormat;
157
161
  includeCost?: boolean;
162
+ customTaskUUID?: string;
158
163
  }
159
164
  type ReconnectingWebsocketProps = {
160
165
  addEventListener: (type: string, listener: EventListener, options: any) => void;
@@ -273,12 +278,12 @@ declare class RunwareBase {
273
278
  }): {
274
279
  destroy: () => void;
275
280
  };
276
- requestImages({ outputType, outputFormat, uploadEndpoint, checkNsfw, positivePrompt, negativePrompt, seedImage, maskImage, strength, height, width, model, steps, scheduler, seed, CFGScale, clipSkip, usePromptWeighting, numberResults, controlNet, lora, useCache, onPartialImages, includeCost, }: IRequestImage): Promise<IImage[] | undefined>;
277
- controlNetPreProcess: ({ inputImage, preProcessor, height, width, outputType, outputFormat, highThresholdCanny, lowThresholdCanny, includeHandsAndFaceOpenPose, includeCost, }: IControlNetPreprocess) => Promise<IControlNetImage | null>;
278
- requestImageToText: ({ inputImage, includeCost, }: IRequestImageToText) => Promise<IImageToText>;
279
- removeImageBackground: ({ inputImage, outputType, outputFormat, rgba, postProcessMask, returnOnlyMask, alphaMatting, alphaMattingForegroundThreshold, alphaMattingBackgroundThreshold, alphaMattingErodeSize, includeCost, }: IRemoveImageBackground) => Promise<IRemoveImage[]>;
280
- upscaleGan: ({ inputImage, upscaleFactor, outputType, outputFormat, includeCost, }: IUpscaleGan) => Promise<IImage[]>;
281
- enhancePrompt: ({ prompt, promptMaxLength, promptVersions, includeCost, }: IPromptEnhancer) => Promise<IEnhancedPrompt[]>;
281
+ requestImages({ outputType, outputFormat, uploadEndpoint, checkNsfw, positivePrompt, negativePrompt, seedImage, maskImage, strength, height, width, model, steps, scheduler, seed, CFGScale, clipSkip, usePromptWeighting, numberResults, controlNet, lora, useCache, onPartialImages, includeCost, customTaskUUID, }: IRequestImage): Promise<IImage[] | undefined>;
282
+ controlNetPreProcess: ({ inputImage, preProcessor, height, width, outputType, outputFormat, highThresholdCanny, lowThresholdCanny, includeHandsAndFaceOpenPose, includeCost, customTaskUUID, }: IControlNetPreprocess) => Promise<IControlNetImage | null>;
283
+ requestImageToText: ({ inputImage, includeCost, customTaskUUID, }: IRequestImageToText) => Promise<IImageToText>;
284
+ removeImageBackground: ({ inputImage, outputType, outputFormat, rgba, postProcessMask, returnOnlyMask, alphaMatting, alphaMattingForegroundThreshold, alphaMattingBackgroundThreshold, alphaMattingErodeSize, includeCost, customTaskUUID, }: IRemoveImageBackground) => Promise<IRemoveImage[]>;
285
+ upscaleGan: ({ inputImage, upscaleFactor, outputType, outputFormat, includeCost, customTaskUUID, }: IUpscaleGan) => Promise<IImage[]>;
286
+ enhancePrompt: ({ prompt, promptMaxLength, promptVersions, includeCost, customTaskUUID, }: IPromptEnhancer) => Promise<IEnhancedPrompt[]>;
282
287
  ensureConnection(): Promise<unknown>;
283
288
  getSimilarImages({ taskUUID, numberResults, shouldThrowError, lis, }: {
284
289
  taskUUID: string | string[];
package/dist/index.js CHANGED
@@ -503,13 +503,14 @@ var RunwareBase = class {
503
503
  highThresholdCanny,
504
504
  lowThresholdCanny,
505
505
  includeHandsAndFaceOpenPose,
506
- includeCost
506
+ includeCost,
507
+ customTaskUUID
507
508
  }) => {
508
509
  try {
509
510
  const image = await this.uploadImage(inputImage);
510
511
  if (!(image == null ? void 0 : image.imageUUID))
511
512
  return null;
512
- const taskUUID = getUUID();
513
+ const taskUUID = customTaskUUID || getUUID();
513
514
  this.send(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({
514
515
  inputImage: image.imageUUID,
515
516
  taskType: "imageControlNetPreProcess" /* IMAGE_CONTROL_NET_PRE_PROCESS */,
@@ -554,7 +555,8 @@ var RunwareBase = class {
554
555
  };
555
556
  this.requestImageToText = async ({
556
557
  inputImage,
557
- includeCost
558
+ includeCost,
559
+ customTaskUUID
558
560
  }) => {
559
561
  try {
560
562
  await this.ensureConnection();
@@ -564,7 +566,7 @@ var RunwareBase = class {
564
566
  );
565
567
  if (!(imageUploaded == null ? void 0 : imageUploaded.imageUUID))
566
568
  return null;
567
- const taskUUID = getUUID();
569
+ const taskUUID = customTaskUUID || getUUID();
568
570
  this.send(__spreadValues({
569
571
  taskUUID,
570
572
  taskType: "imageCaption" /* IMAGE_CAPTION */,
@@ -610,7 +612,8 @@ var RunwareBase = class {
610
612
  alphaMattingForegroundThreshold,
611
613
  alphaMattingBackgroundThreshold,
612
614
  alphaMattingErodeSize,
613
- includeCost
615
+ includeCost,
616
+ customTaskUUID
614
617
  }) => {
615
618
  try {
616
619
  await this.ensureConnection();
@@ -620,7 +623,7 @@ var RunwareBase = class {
620
623
  );
621
624
  if (!(imageUploaded == null ? void 0 : imageUploaded.imageUUID))
622
625
  return null;
623
- const taskUUID = getUUID();
626
+ const taskUUID = customTaskUUID || getUUID();
624
627
  this.send(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({
625
628
  taskType: "imageBackgroundRemoval" /* IMAGE_BACKGROUND_REMOVAL */,
626
629
  taskUUID,
@@ -670,7 +673,8 @@ var RunwareBase = class {
670
673
  upscaleFactor,
671
674
  outputType,
672
675
  outputFormat,
673
- includeCost
676
+ includeCost,
677
+ customTaskUUID
674
678
  }) => {
675
679
  try {
676
680
  await this.ensureConnection();
@@ -679,7 +683,7 @@ var RunwareBase = class {
679
683
  imageUploaded = await this.uploadImage(inputImage);
680
684
  if (!(imageUploaded == null ? void 0 : imageUploaded.imageUUID))
681
685
  return null;
682
- const taskUUID = getUUID();
686
+ const taskUUID = customTaskUUID || getUUID();
683
687
  this.send(__spreadValues(__spreadValues(__spreadValues({
684
688
  taskUUID,
685
689
  inputImage: imageUploaded == null ? void 0 : imageUploaded.imageUUID,
@@ -717,12 +721,13 @@ var RunwareBase = class {
717
721
  prompt,
718
722
  promptMaxLength = 380,
719
723
  promptVersions = 1,
720
- includeCost
724
+ includeCost,
725
+ customTaskUUID
721
726
  }) => {
722
727
  try {
723
728
  await this.ensureConnection();
724
729
  return await asyncRetry(async () => {
725
- const taskUUID = getUUID();
730
+ const taskUUID = customTaskUUID || getUUID();
726
731
  this.send(__spreadProps(__spreadValues({
727
732
  prompt,
728
733
  taskUUID,
@@ -955,7 +960,8 @@ var RunwareBase = class {
955
960
  lora,
956
961
  useCache,
957
962
  onPartialImages,
958
- includeCost
963
+ includeCost,
964
+ customTaskUUID
959
965
  }) {
960
966
  let lis = void 0;
961
967
  let requestObject = void 0;
@@ -1032,7 +1038,7 @@ var RunwareBase = class {
1032
1038
  const imagesWithSimilarTask = this._globalImages.filter(
1033
1039
  (img) => taskUUIDs.includes(img.taskUUID)
1034
1040
  );
1035
- const taskUUID = getUUID();
1041
+ const taskUUID = customTaskUUID || getUUID();
1036
1042
  taskUUIDs.push(taskUUID);
1037
1043
  const imageRemaining = numberResults - imagesWithSimilarTask.length;
1038
1044
  const newRequestObject = __spreadProps(__spreadValues({}, requestObject), {
package/dist/index.mjs CHANGED
@@ -482,13 +482,14 @@ var RunwareBase = class {
482
482
  highThresholdCanny,
483
483
  lowThresholdCanny,
484
484
  includeHandsAndFaceOpenPose,
485
- includeCost
485
+ includeCost,
486
+ customTaskUUID
486
487
  }) => {
487
488
  try {
488
489
  const image = await this.uploadImage(inputImage);
489
490
  if (!(image == null ? void 0 : image.imageUUID))
490
491
  return null;
491
- const taskUUID = getUUID();
492
+ const taskUUID = customTaskUUID || getUUID();
492
493
  this.send(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({
493
494
  inputImage: image.imageUUID,
494
495
  taskType: "imageControlNetPreProcess" /* IMAGE_CONTROL_NET_PRE_PROCESS */,
@@ -533,7 +534,8 @@ var RunwareBase = class {
533
534
  };
534
535
  this.requestImageToText = async ({
535
536
  inputImage,
536
- includeCost
537
+ includeCost,
538
+ customTaskUUID
537
539
  }) => {
538
540
  try {
539
541
  await this.ensureConnection();
@@ -543,7 +545,7 @@ var RunwareBase = class {
543
545
  );
544
546
  if (!(imageUploaded == null ? void 0 : imageUploaded.imageUUID))
545
547
  return null;
546
- const taskUUID = getUUID();
548
+ const taskUUID = customTaskUUID || getUUID();
547
549
  this.send(__spreadValues({
548
550
  taskUUID,
549
551
  taskType: "imageCaption" /* IMAGE_CAPTION */,
@@ -589,7 +591,8 @@ var RunwareBase = class {
589
591
  alphaMattingForegroundThreshold,
590
592
  alphaMattingBackgroundThreshold,
591
593
  alphaMattingErodeSize,
592
- includeCost
594
+ includeCost,
595
+ customTaskUUID
593
596
  }) => {
594
597
  try {
595
598
  await this.ensureConnection();
@@ -599,7 +602,7 @@ var RunwareBase = class {
599
602
  );
600
603
  if (!(imageUploaded == null ? void 0 : imageUploaded.imageUUID))
601
604
  return null;
602
- const taskUUID = getUUID();
605
+ const taskUUID = customTaskUUID || getUUID();
603
606
  this.send(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({
604
607
  taskType: "imageBackgroundRemoval" /* IMAGE_BACKGROUND_REMOVAL */,
605
608
  taskUUID,
@@ -649,7 +652,8 @@ var RunwareBase = class {
649
652
  upscaleFactor,
650
653
  outputType,
651
654
  outputFormat,
652
- includeCost
655
+ includeCost,
656
+ customTaskUUID
653
657
  }) => {
654
658
  try {
655
659
  await this.ensureConnection();
@@ -658,7 +662,7 @@ var RunwareBase = class {
658
662
  imageUploaded = await this.uploadImage(inputImage);
659
663
  if (!(imageUploaded == null ? void 0 : imageUploaded.imageUUID))
660
664
  return null;
661
- const taskUUID = getUUID();
665
+ const taskUUID = customTaskUUID || getUUID();
662
666
  this.send(__spreadValues(__spreadValues(__spreadValues({
663
667
  taskUUID,
664
668
  inputImage: imageUploaded == null ? void 0 : imageUploaded.imageUUID,
@@ -696,12 +700,13 @@ var RunwareBase = class {
696
700
  prompt,
697
701
  promptMaxLength = 380,
698
702
  promptVersions = 1,
699
- includeCost
703
+ includeCost,
704
+ customTaskUUID
700
705
  }) => {
701
706
  try {
702
707
  await this.ensureConnection();
703
708
  return await asyncRetry(async () => {
704
- const taskUUID = getUUID();
709
+ const taskUUID = customTaskUUID || getUUID();
705
710
  this.send(__spreadProps(__spreadValues({
706
711
  prompt,
707
712
  taskUUID,
@@ -934,7 +939,8 @@ var RunwareBase = class {
934
939
  lora,
935
940
  useCache,
936
941
  onPartialImages,
937
- includeCost
942
+ includeCost,
943
+ customTaskUUID
938
944
  }) {
939
945
  let lis = void 0;
940
946
  let requestObject = void 0;
@@ -1011,7 +1017,7 @@ var RunwareBase = class {
1011
1017
  const imagesWithSimilarTask = this._globalImages.filter(
1012
1018
  (img) => taskUUIDs.includes(img.taskUUID)
1013
1019
  );
1014
- const taskUUID = getUUID();
1020
+ const taskUUID = customTaskUUID || getUUID();
1015
1021
  taskUUIDs.push(taskUUID);
1016
1022
  const imageRemaining = numberResults - imagesWithSimilarTask.length;
1017
1023
  const newRequestObject = __spreadProps(__spreadValues({}, requestObject), {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runware/sdk-js",
3
- "version": "1.1.4",
3
+ "version": "1.1.5",
4
4
  "description": "The SDK is used to run image inference with the Runware API, powered by the RunWare inference platform. It can be used to generate imaged with text-to-image and image-to-image. It also allows the use of an existing gallery of models or selecting any model or LoRA from the CivitAI gallery. The API also supports upscaling, background removal, inpainting and outpainting, and a series of other ControlNet models.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
package/readme.md CHANGED
@@ -356,6 +356,12 @@ return interface IControlNetImage {
356
356
 
357
357
  ## Changelog
358
358
 
359
+ ### - v1.1.5
360
+
361
+ **Added or Changed**
362
+
363
+ - Added Custom UUID
364
+
359
365
  ### - v1.1.3/4
360
366
 
361
367
  **Added or Changed**