@runware/sdk-js 1.1.48-beta-vectorize → 1.1.48
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/esm/Runware/Runware-base.d.ts +70 -0
- package/dist/esm/Runware/Runware-base.js +1002 -0
- package/dist/esm/Runware/Runware-client.d.ts +5 -0
- package/dist/esm/Runware/Runware-client.js +28 -0
- package/dist/esm/Runware/Runware-server.d.ts +15 -0
- package/dist/esm/Runware/Runware-server.js +145 -0
- package/dist/esm/Runware/Runware.d.ts +4 -0
- package/dist/esm/Runware/Runware.js +13 -0
- package/dist/esm/Runware/async-retry.d.ts +5 -0
- package/dist/esm/Runware/async-retry.js +30 -0
- package/dist/esm/Runware/index.d.ts +4 -0
- package/dist/esm/Runware/index.js +20 -0
- package/dist/esm/Runware/reconnect.d.ts +11 -0
- package/dist/esm/Runware/reconnect.js +175 -0
- package/dist/esm/Runware/types.d.ts +644 -0
- package/dist/esm/Runware/types.js +156 -0
- package/dist/esm/Runware/utils.d.ts +57 -0
- package/dist/esm/Runware/utils.js +262 -0
- package/dist/esm/tests/Runware/enhance-prompt.test.d.ts +1 -0
- package/dist/esm/tests/Runware/enhance-prompt.test.js +58 -0
- package/dist/esm/tests/Runware/remove-image-background.test.d.ts +1 -0
- package/dist/esm/tests/Runware/remove-image-background.test.js +37 -0
- package/dist/esm/tests/Runware/request-image-to-text.test.d.ts +1 -0
- package/dist/esm/tests/Runware/request-image-to-text.test.js +37 -0
- package/dist/esm/tests/Runware/request-images.test.d.ts +1 -0
- package/dist/esm/tests/Runware/request-images.test.js +84 -0
- package/dist/esm/tests/Runware/runware-server.test.d.ts +1 -0
- package/dist/esm/tests/Runware/runware-server.test.js +26 -0
- package/dist/esm/tests/Runware/upload-image.test.d.ts +1 -0
- package/dist/esm/tests/Runware/upload-image.test.js +28 -0
- package/dist/esm/tests/Runware/upscale-gan.test.d.ts +1 -0
- package/dist/esm/tests/Runware/upscale-gan.test.js +41 -0
- package/dist/esm/tests/mockServer.d.ts +12 -0
- package/dist/esm/tests/mockServer.js +38 -0
- package/dist/esm/tests/script.d.ts +8 -0
- package/dist/esm/tests/script.js +570 -0
- package/dist/esm/tests/test-utils.d.ts +40 -0
- package/dist/esm/tests/test-utils.js +45 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -39
- package/dist/index.d.ts +3 -39
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/readme.md +29 -10
package/readme.md
CHANGED
|
@@ -66,15 +66,18 @@ await runware.disconnect();
|
|
|
66
66
|
|
|
67
67
|
### Request Image
|
|
68
68
|
|
|
69
|
+
|
|
69
70
|
[Read Documentation](https://docs.runware.ai/en/image-inference/api-reference)
|
|
70
71
|
|
|
71
72
|
NB: All errors can be caught in the catch block of each request
|
|
72
73
|
|
|
74
|
+
Legacy alias: `requestImages()`
|
|
75
|
+
|
|
73
76
|
```js
|
|
74
77
|
import { Runware } from "@runware/sdk-js";
|
|
75
78
|
|
|
76
79
|
const runware = new Runware({ apiKey: "API_KEY" });
|
|
77
|
-
const images = await runware.
|
|
80
|
+
const images = await runware.imageInference({
|
|
78
81
|
positivePrompt: string;
|
|
79
82
|
negativePrompt?: string;
|
|
80
83
|
width: number;
|
|
@@ -126,7 +129,7 @@ return interface ITextToImage {
|
|
|
126
129
|
const runware = new Runware({ apiKey: "API_KEY" });
|
|
127
130
|
|
|
128
131
|
const [firstImagesRequest, secondImagesRequest] = await Promise.all([
|
|
129
|
-
runware.
|
|
132
|
+
runware.imageInference({
|
|
130
133
|
positivePrompt: string;
|
|
131
134
|
width: number;
|
|
132
135
|
height: number;
|
|
@@ -135,7 +138,7 @@ const [firstImagesRequest, secondImagesRequest] = await Promise.all([
|
|
|
135
138
|
negativePrompt?: string;
|
|
136
139
|
onPartialImages?: (images: IImage[], error: IError) => void;
|
|
137
140
|
}),
|
|
138
|
-
runware.
|
|
141
|
+
runware.imageInference({
|
|
139
142
|
positivePrompt: string;
|
|
140
143
|
width: number;
|
|
141
144
|
height: number;
|
|
@@ -228,10 +231,12 @@ return interface ITextToImage {
|
|
|
228
231
|
|
|
229
232
|
[Read Documentation](https://docs.runware.ai/en/utilities/image-to-text)
|
|
230
233
|
|
|
234
|
+
Legacy alias: `requestImageToText()`
|
|
235
|
+
|
|
231
236
|
```js
|
|
232
237
|
|
|
233
238
|
const runware = new Runware({ apiKey: "API_KEY" });
|
|
234
|
-
const imageToText = await runware.
|
|
239
|
+
const imageToText = await runware.caption({
|
|
235
240
|
inputImage: string | File
|
|
236
241
|
})
|
|
237
242
|
console.log(imageToText)
|
|
@@ -256,10 +261,12 @@ return interface IImageToText {
|
|
|
256
261
|
|
|
257
262
|
[Read Documentation](https://docs.runware.ai/en/image-editing/background-removal)
|
|
258
263
|
|
|
264
|
+
Legacy alias: `removeImageBackground()`
|
|
265
|
+
|
|
259
266
|
```js
|
|
260
267
|
|
|
261
268
|
const runware = new Runware({ apiKey: "API_KEY" });
|
|
262
|
-
const image = await runware.
|
|
269
|
+
const image = await runware.removeBackground({
|
|
263
270
|
inputImage: string | File
|
|
264
271
|
outputType?: IOutputType;
|
|
265
272
|
outputFormat?: IOutputFormat;
|
|
@@ -305,10 +312,12 @@ return interface IImage {
|
|
|
305
312
|
|
|
306
313
|
[Read Documentation](https://docs.runware.ai/en/image-editing/upscaling)
|
|
307
314
|
|
|
315
|
+
Legacy alias: `upscaleGan()`
|
|
316
|
+
|
|
308
317
|
```js
|
|
309
318
|
|
|
310
319
|
const runware = new Runware({ apiKey: "API_KEY" });
|
|
311
|
-
const image = await runware.
|
|
320
|
+
const image = await runware.upscale({
|
|
312
321
|
inputImage: File | string;
|
|
313
322
|
upscaleFactor: number;
|
|
314
323
|
outputType?: IOutputType;
|
|
@@ -345,10 +354,12 @@ return interface IImage {
|
|
|
345
354
|
|
|
346
355
|
[Read Documentation](https://docs.runware.ai/en/utilities/prompt-enhancer)
|
|
347
356
|
|
|
357
|
+
Legacy alias: `enhancePrompt()`
|
|
358
|
+
|
|
348
359
|
```js
|
|
349
360
|
|
|
350
361
|
const runware = new Runware({ apiKey: "API_KEY" });
|
|
351
|
-
const enhancedPrompt = await runware.
|
|
362
|
+
const enhancedPrompt = await runware.promptEnhance({
|
|
352
363
|
prompt: string;
|
|
353
364
|
promptMaxLength?: number;
|
|
354
365
|
promptVersions?: number;
|
|
@@ -376,10 +387,12 @@ return interface IEnhancedPrompt {
|
|
|
376
387
|
|
|
377
388
|
[Read Documentation](https://docs.runware.ai/en/image-editing/controlnet-tools)
|
|
378
389
|
|
|
390
|
+
Legacy alias: `controlNetPreProcess()`
|
|
391
|
+
|
|
379
392
|
```js
|
|
380
393
|
|
|
381
394
|
const runware = new Runware({ apiKey: "API_KEY" });
|
|
382
|
-
const controlNetPreProcessed = await runware.
|
|
395
|
+
const controlNetPreProcessed = await runware.controlNetPreprocess({
|
|
383
396
|
inputImage: string | File;
|
|
384
397
|
preProcessorType: EPreProcessor;
|
|
385
398
|
height?: number;
|
|
@@ -621,7 +634,7 @@ export type TModel = {
|
|
|
621
634
|
|
|
622
635
|
const runware = new Runware({ apiKey: "API_KEY" });
|
|
623
636
|
|
|
624
|
-
const imageMasking = await runware.
|
|
637
|
+
const imageMasking = await runware.imageMasking({
|
|
625
638
|
model: string;
|
|
626
639
|
inputImage: string;
|
|
627
640
|
confidence?: number;
|
|
@@ -671,7 +684,13 @@ export type TImageMaskingResponse = {
|
|
|
671
684
|
|
|
672
685
|
**Added or Changed**
|
|
673
686
|
|
|
674
|
-
-
|
|
687
|
+
- Added method aliases so task types match those of official API. It is recommended to use these new aliases going forward:
|
|
688
|
+
|
|
689
|
+
- imageInference > requestImages
|
|
690
|
+
- controlNetPreprocess > controlNetPreProcess
|
|
691
|
+
- caption > requestImageToText
|
|
692
|
+
- upscale > upscaleGan
|
|
693
|
+
- promptEnhance > ehancePrompt
|
|
675
694
|
|
|
676
695
|
### - v1.1.47
|
|
677
696
|
|